From 1cd8d672179bb3c3a36abfe97e54432a820acba4 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Thu, 10 Apr 2025 07:53:59 -0400 Subject: [PATCH 01/26] initial setup --- java/panama-bindings/.gitignore | 1 + java/panama-bindings/generate-bindings.sh | 20 ++++++++++++++++++++ java/panama-bindings/headers.h | 22 ++++++++++++++++++++++ java/panama-bindings/license-header.txt | 15 +++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 java/panama-bindings/.gitignore create mode 100755 java/panama-bindings/generate-bindings.sh create mode 100644 java/panama-bindings/headers.h create mode 100644 java/panama-bindings/license-header.txt diff --git a/java/panama-bindings/.gitignore b/java/panama-bindings/.gitignore new file mode 100644 index 0000000000..a1277a61cf --- /dev/null +++ b/java/panama-bindings/.gitignore @@ -0,0 +1 @@ +bindings/ diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh new file mode 100755 index 0000000000..786adc4640 --- /dev/null +++ b/java/panama-bindings/generate-bindings.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +REPODIR=$(cd $(dirname $0); cd ../../ ; pwd) +CURDIR=$(cd $(dirname $0); pwd) +CUDA_HOME=$(which nvcc | cut -d/ -f-4) + +jextract \ + --include-dir ${REPODIR}/cpp/build/_deps/dlpack-src/include/ \ + --include-dir ${CUDA_HOME}/include \ + --include-dir ${REPODIR}/cpp/include \ + --output ${CURDIR}/bindings \ + --target-package com.nvidia.cuvs.internal.panama \ + --header-class-name PanamaBindings \ + ${CURDIR}/headers.h + +# Insert license headers in the generated files +for file in ${CURDIR}/bindings/com/nvidia/cuvs/internal/panama/*; do + sed -i '1s/^/\n\/\/ NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY\n/' $file + cat ${CURDIR}/license-header.txt $file > temp && mv temp $file +done diff --git a/java/panama-bindings/headers.h b/java/panama-bindings/headers.h new file mode 100644 index 0000000000..34bbe66237 --- /dev/null +++ b/java/panama-bindings/headers.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Please add the required header files needed to communicate via panama FFM API. + +#include +#include +#include +#include diff --git a/java/panama-bindings/license-header.txt b/java/panama-bindings/license-header.txt new file mode 100644 index 0000000000..2001ad3d3a --- /dev/null +++ b/java/panama-bindings/license-header.txt @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ From 48f878f76c97f181dc76bb651874d709a139ef4d Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Thu, 10 Apr 2025 12:56:49 -0400 Subject: [PATCH 02/26] refactor script and fix comment --- java/panama-bindings/generate-bindings.sh | 9 ++++++--- java/panama-bindings/headers.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index 786adc4640..b6b8d9a1ed 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -3,18 +3,21 @@ REPODIR=$(cd $(dirname $0); cd ../../ ; pwd) CURDIR=$(cd $(dirname $0); pwd) CUDA_HOME=$(which nvcc | cut -d/ -f-4) +OUTPUT_FOLDER="${CURDIR}/bindings" +TARGET_PACKAGE="com.nvidia.cuvs.internal.panama" +TARGET_PACKAGE_PATH="${OUTPUT_FOLDER}/${TARGET_PACKAGE//./\/}" jextract \ --include-dir ${REPODIR}/cpp/build/_deps/dlpack-src/include/ \ --include-dir ${CUDA_HOME}/include \ --include-dir ${REPODIR}/cpp/include \ - --output ${CURDIR}/bindings \ - --target-package com.nvidia.cuvs.internal.panama \ + --output ${OUTPUT_FOLDER} \ + --target-package ${TARGET_PACKAGE} \ --header-class-name PanamaBindings \ ${CURDIR}/headers.h # Insert license headers in the generated files -for file in ${CURDIR}/bindings/com/nvidia/cuvs/internal/panama/*; do +for file in ${TARGET_PACKAGE_PATH}/*; do sed -i '1s/^/\n\/\/ NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY\n/' $file cat ${CURDIR}/license-header.txt $file > temp && mv temp $file done diff --git a/java/panama-bindings/headers.h b/java/panama-bindings/headers.h index 34bbe66237..152bf9090c 100644 --- a/java/panama-bindings/headers.h +++ b/java/panama-bindings/headers.h @@ -14,7 +14,7 @@ * limitations under the License. */ -// Please add the required header files needed to communicate via panama FFM API. +// Please add the required header files needed to communicate via panama FFM API below. #include #include From 9a8c6069277047ca6cb4268daabf89b381d9683f Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Thu, 10 Apr 2025 13:58:41 -0400 Subject: [PATCH 03/26] update script - add logic to detect and update panama java files --- java/panama-bindings/generate-bindings.sh | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index b6b8d9a1ed..1edc930db4 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -1,11 +1,13 @@ #!/bin/bash +echo "Starting ..." REPODIR=$(cd $(dirname $0); cd ../../ ; pwd) CURDIR=$(cd $(dirname $0); pwd) CUDA_HOME=$(which nvcc | cut -d/ -f-4) OUTPUT_FOLDER="${CURDIR}/bindings" TARGET_PACKAGE="com.nvidia.cuvs.internal.panama" TARGET_PACKAGE_PATH="${OUTPUT_FOLDER}/${TARGET_PACKAGE//./\/}" +PANAMA_JAVA_FILES_PATH="${REPODIR}/java/cuvs-java/src/main/java22/${TARGET_PACKAGE//./\/}" jextract \ --include-dir ${REPODIR}/cpp/build/_deps/dlpack-src/include/ \ @@ -21,3 +23,29 @@ for file in ${TARGET_PACKAGE_PATH}/*; do sed -i '1s/^/\n\/\/ NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY\n/' $file cat ${CURDIR}/license-header.txt $file > temp && mv temp $file done + +# Update the panama classes in the panama java folder (if existing or not present) +for GENERATED_PANAMA_JAVA_FILE in ${TARGET_PACKAGE_PATH}/*; do + CURR_FILENAME=$(basename $GENERATED_PANAMA_JAVA_FILE) + EXISTING_PANAMA_JAVA_FILE="${PANAMA_JAVA_FILES_PATH}/${CURR_FILENAME}" + echo $GENERATED_PANAMA_JAVA_FILE + echo $EXISTING_PANAMA_JAVA_FILE + if ! test -f $EXISTING_PANAMA_JAVA_FILE; + then + echo "File ${CURR_FILENAME} does not exist. Moving this file in the target folder." + mv ${TARGET_PACKAGE_PATH}/${CURR_FILENAME} $PANAMA_JAVA_FILES_PATH + else + if ! cmp --silent -- "$EXISTING_PANAMA_JAVA_FILE" "$GENERATED_PANAMA_JAVA_FILE"; + then + echo "File ${CURR_FILENAME} exists in target folder but seems to be changed. Updating ..." + truncate -s 0 $EXISTING_PANAMA_JAVA_FILE + cat $GENERATED_PANAMA_JAVA_FILE > $EXISTING_PANAMA_JAVA_FILE + else + echo "File ${CURR_FILENAME} exists and is the same. Ignoring." + fi + fi +done + +# Cleanup +rm -rf $OUTPUT_FOLDER +echo "Done" From 83d1ae2bdc17d0c6fb2572bbf6b6fcc51288f052 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Thu, 10 Apr 2025 15:12:12 -0400 Subject: [PATCH 04/26] update comment/messages in the script --- java/panama-bindings/generate-bindings.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index 1edc930db4..62bac62752 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -24,24 +24,22 @@ for file in ${TARGET_PACKAGE_PATH}/*; do cat ${CURDIR}/license-header.txt $file > temp && mv temp $file done -# Update the panama classes in the panama java folder (if existing or not present) +# Update/Add the panama binding classes in the panama java folder (if existing or not present) for GENERATED_PANAMA_JAVA_FILE in ${TARGET_PACKAGE_PATH}/*; do CURR_FILENAME=$(basename $GENERATED_PANAMA_JAVA_FILE) EXISTING_PANAMA_JAVA_FILE="${PANAMA_JAVA_FILES_PATH}/${CURR_FILENAME}" - echo $GENERATED_PANAMA_JAVA_FILE - echo $EXISTING_PANAMA_JAVA_FILE if ! test -f $EXISTING_PANAMA_JAVA_FILE; then - echo "File ${CURR_FILENAME} does not exist. Moving this file in the target folder." + echo "[NEW] File ${CURR_FILENAME} does not exist. Moving this file in the target folder." mv ${TARGET_PACKAGE_PATH}/${CURR_FILENAME} $PANAMA_JAVA_FILES_PATH else if ! cmp --silent -- "$EXISTING_PANAMA_JAVA_FILE" "$GENERATED_PANAMA_JAVA_FILE"; then - echo "File ${CURR_FILENAME} exists in target folder but seems to be changed. Updating ..." + echo "[UPDATE] File ${CURR_FILENAME} exists in target folder but seems to be changed. Updating." truncate -s 0 $EXISTING_PANAMA_JAVA_FILE cat $GENERATED_PANAMA_JAVA_FILE > $EXISTING_PANAMA_JAVA_FILE else - echo "File ${CURR_FILENAME} exists and is the same. Ignoring." + echo "[IGNORE] File ${CURR_FILENAME} exists and is the same. Ignoring." fi fi done From 4dcda3c66a0c15e7cac6e4093dfbb5cea390b081 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Thu, 10 Apr 2025 21:26:39 -0400 Subject: [PATCH 05/26] plug in the bindings script into the java build script --- java/build.sh | 3 +++ java/panama-bindings/generate-bindings.sh | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/java/build.sh b/java/build.sh index 34c7ae83e6..6198f51701 100755 --- a/java/build.sh +++ b/java/build.sh @@ -6,6 +6,9 @@ if [ -z "$CMAKE_PREFIX_PATH" ]; then export CMAKE_PREFIX_PATH=`pwd`/../cpp/build fi +# Generate Panama FFM API bindings and update (if any of them changed) +/bin/bash panama-bindings/generate-bindings.sh + cd internal && cmake . && cmake --build . \ && cd .. \ && mvn install:install-file -DgroupId=$GROUP_ID -DartifactId=cuvs-java-internal -Dversion=$VERSION -Dpackaging=so -Dfile=$SO_FILE_PATH/libcuvs_java.so \ diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index 62bac62752..c94ffa6f8b 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -1,6 +1,6 @@ #!/bin/bash -echo "Starting ..." +echo "Starting Panama FFM API bindings generation ..." REPODIR=$(cd $(dirname $0); cd ../../ ; pwd) CURDIR=$(cd $(dirname $0); pwd) CUDA_HOME=$(which nvcc | cut -d/ -f-4) @@ -15,7 +15,7 @@ jextract \ --include-dir ${REPODIR}/cpp/include \ --output ${OUTPUT_FOLDER} \ --target-package ${TARGET_PACKAGE} \ - --header-class-name PanamaBindings \ + --header-class-name PanamaFFMAPI \ ${CURDIR}/headers.h # Insert license headers in the generated files @@ -30,20 +30,20 @@ for GENERATED_PANAMA_JAVA_FILE in ${TARGET_PACKAGE_PATH}/*; do EXISTING_PANAMA_JAVA_FILE="${PANAMA_JAVA_FILES_PATH}/${CURR_FILENAME}" if ! test -f $EXISTING_PANAMA_JAVA_FILE; then - echo "[NEW] File ${CURR_FILENAME} does not exist. Moving this file in the target folder." + echo "[NEW] ${CURR_FILENAME}" mv ${TARGET_PACKAGE_PATH}/${CURR_FILENAME} $PANAMA_JAVA_FILES_PATH else if ! cmp --silent -- "$EXISTING_PANAMA_JAVA_FILE" "$GENERATED_PANAMA_JAVA_FILE"; then - echo "[UPDATE] File ${CURR_FILENAME} exists in target folder but seems to be changed. Updating." + echo "[UPDATE] ${CURR_FILENAME}" truncate -s 0 $EXISTING_PANAMA_JAVA_FILE cat $GENERATED_PANAMA_JAVA_FILE > $EXISTING_PANAMA_JAVA_FILE else - echo "[IGNORE] File ${CURR_FILENAME} exists and is the same. Ignoring." + echo "[IGNORE] ${CURR_FILENAME} (already exists and not changed)" fi fi done # Cleanup rm -rf $OUTPUT_FOLDER -echo "Done" +echo "Panama FFM API bindings generation done" From 5a388c7a3d461776f6cfcf8b80a62e216230185a Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Thu, 10 Apr 2025 22:42:06 -0400 Subject: [PATCH 06/26] update comment --- java/panama-bindings/headers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/panama-bindings/headers.h b/java/panama-bindings/headers.h index 152bf9090c..ee1d46ddc0 100644 --- a/java/panama-bindings/headers.h +++ b/java/panama-bindings/headers.h @@ -14,7 +14,7 @@ * limitations under the License. */ -// Please add the required header files needed to communicate via panama FFM API below. +// Please add the required header files below for which panama FFM API bindings are needed #include #include From 07e16d0bcc7e2f197676afcef0560d6cdcc57579 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Thu, 10 Apr 2025 23:17:35 -0400 Subject: [PATCH 07/26] update script to remove last blank line from generated bindings --- java/panama-bindings/generate-bindings.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index c94ffa6f8b..d7aec6bfb2 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -36,8 +36,9 @@ for GENERATED_PANAMA_JAVA_FILE in ${TARGET_PACKAGE_PATH}/*; do if ! cmp --silent -- "$EXISTING_PANAMA_JAVA_FILE" "$GENERATED_PANAMA_JAVA_FILE"; then echo "[UPDATE] ${CURR_FILENAME}" - truncate -s 0 $EXISTING_PANAMA_JAVA_FILE - cat $GENERATED_PANAMA_JAVA_FILE > $EXISTING_PANAMA_JAVA_FILE + truncate -s 0 $EXISTING_PANAMA_JAVA_FILE # remove current source from the file + cat $GENERATED_PANAMA_JAVA_FILE > $EXISTING_PANAMA_JAVA_FILE # put updated source + sed -i '${/^$/d}' $EXISTING_PANAMA_JAVA_FILE # remove last blank line else echo "[IGNORE] ${CURR_FILENAME} (already exists and not changed)" fi From fcef00b082ffacdc1235becc063e8e673765be0e Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Fri, 11 Apr 2025 00:06:42 -0400 Subject: [PATCH 08/26] update script - renaming and conditional delete --- java/panama-bindings/generate-bindings.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index d7aec6bfb2..9ef3aaf3b7 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -6,7 +6,7 @@ CURDIR=$(cd $(dirname $0); pwd) CUDA_HOME=$(which nvcc | cut -d/ -f-4) OUTPUT_FOLDER="${CURDIR}/bindings" TARGET_PACKAGE="com.nvidia.cuvs.internal.panama" -TARGET_PACKAGE_PATH="${OUTPUT_FOLDER}/${TARGET_PACKAGE//./\/}" +GENERATED_PANAMA_BINDINGS_PATH="${OUTPUT_FOLDER}/${TARGET_PACKAGE//./\/}" PANAMA_JAVA_FILES_PATH="${REPODIR}/java/cuvs-java/src/main/java22/${TARGET_PACKAGE//./\/}" jextract \ @@ -19,19 +19,19 @@ jextract \ ${CURDIR}/headers.h # Insert license headers in the generated files -for file in ${TARGET_PACKAGE_PATH}/*; do - sed -i '1s/^/\n\/\/ NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY\n/' $file - cat ${CURDIR}/license-header.txt $file > temp && mv temp $file +for BINDING_FILE in ${GENERATED_PANAMA_BINDINGS_PATH}/*; do + sed -i '1s/^/\n\/\/ NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY\n/' $BINDING_FILE + cat ${CURDIR}/license-header.txt $BINDING_FILE > temp && mv temp $BINDING_FILE done # Update/Add the panama binding classes in the panama java folder (if existing or not present) -for GENERATED_PANAMA_JAVA_FILE in ${TARGET_PACKAGE_PATH}/*; do +for GENERATED_PANAMA_JAVA_FILE in ${GENERATED_PANAMA_BINDINGS_PATH}/*; do CURR_FILENAME=$(basename $GENERATED_PANAMA_JAVA_FILE) EXISTING_PANAMA_JAVA_FILE="${PANAMA_JAVA_FILES_PATH}/${CURR_FILENAME}" if ! test -f $EXISTING_PANAMA_JAVA_FILE; then echo "[NEW] ${CURR_FILENAME}" - mv ${TARGET_PACKAGE_PATH}/${CURR_FILENAME} $PANAMA_JAVA_FILES_PATH + mv ${GENERATED_PANAMA_BINDINGS_PATH}/${CURR_FILENAME} $PANAMA_JAVA_FILES_PATH else if ! cmp --silent -- "$EXISTING_PANAMA_JAVA_FILE" "$GENERATED_PANAMA_JAVA_FILE"; then @@ -46,5 +46,8 @@ for GENERATED_PANAMA_JAVA_FILE in ${TARGET_PACKAGE_PATH}/*; do done # Cleanup -rm -rf $OUTPUT_FOLDER +if test -d $OUTPUT_FOLDER; then + rm -rf $OUTPUT_FOLDER +fi + echo "Panama FFM API bindings generation done" From 4327f6319a236108163c4c3de1c3980fa4027bc3 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Fri, 11 Apr 2025 16:34:55 -0400 Subject: [PATCH 09/26] update script - handle exceptions --- java/build.sh | 8 ++++++++ java/panama-bindings/generate-bindings.sh | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/java/build.sh b/java/build.sh index 6198f51701..022746d797 100755 --- a/java/build.sh +++ b/java/build.sh @@ -9,6 +9,14 @@ fi # Generate Panama FFM API bindings and update (if any of them changed) /bin/bash panama-bindings/generate-bindings.sh +BINDINGS_GENERATION_RETURN_VALUE=$? +if [ $BINDINGS_GENERATION_RETURN_VALUE != 0 ] +then + echo "Bindings generation did not complete normally (returned value ${BINDINGS_GENERATION_RETURN_VALUE})" + echo "Forcing this build process to abort" + exit 1 +fi + cd internal && cmake . && cmake --build . \ && cd .. \ && mvn install:install-file -DgroupId=$GROUP_ID -DartifactId=cuvs-java-internal -Dversion=$VERSION -Dpackaging=so -Dfile=$SO_FILE_PATH/libcuvs_java.so \ diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index 9ef3aaf3b7..b0182937f7 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -9,6 +9,7 @@ TARGET_PACKAGE="com.nvidia.cuvs.internal.panama" GENERATED_PANAMA_BINDINGS_PATH="${OUTPUT_FOLDER}/${TARGET_PACKAGE//./\/}" PANAMA_JAVA_FILES_PATH="${REPODIR}/java/cuvs-java/src/main/java22/${TARGET_PACKAGE//./\/}" +# Use Jextract utility to generate panama bindings jextract \ --include-dir ${REPODIR}/cpp/build/_deps/dlpack-src/include/ \ --include-dir ${CUDA_HOME}/include \ @@ -18,6 +19,16 @@ jextract \ --header-class-name PanamaFFMAPI \ ${CURDIR}/headers.h +# Did Jextract complete normally? If not, stop and return +JEXTRACT_RETURN_VALUE=$? +if [ $JEXTRACT_RETURN_VALUE == 0 ] +then + echo "Jextract SUCCESS" +else + echo "Jextract encountered issues (returned value ${JEXTRACT_RETURN_VALUE})" + exit $JEXTRACT_RETURN_VALUE +fi + # Insert license headers in the generated files for BINDING_FILE in ${GENERATED_PANAMA_BINDINGS_PATH}/*; do sed -i '1s/^/\n\/\/ NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY\n/' $BINDING_FILE From b23aa36046b2df075a616eea533d79ae2fa72b40 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Fri, 11 Apr 2025 16:42:45 -0400 Subject: [PATCH 10/26] update script - trim last blank line for all generated files --- java/panama-bindings/generate-bindings.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index b0182937f7..dd8a9e0902 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -39,6 +39,8 @@ done for GENERATED_PANAMA_JAVA_FILE in ${GENERATED_PANAMA_BINDINGS_PATH}/*; do CURR_FILENAME=$(basename $GENERATED_PANAMA_JAVA_FILE) EXISTING_PANAMA_JAVA_FILE="${PANAMA_JAVA_FILES_PATH}/${CURR_FILENAME}" + sed -i '${/^$/d}' $GENERATED_PANAMA_JAVA_FILE # remove last blank line + if ! test -f $EXISTING_PANAMA_JAVA_FILE; then echo "[NEW] ${CURR_FILENAME}" @@ -49,7 +51,6 @@ for GENERATED_PANAMA_JAVA_FILE in ${GENERATED_PANAMA_BINDINGS_PATH}/*; do echo "[UPDATE] ${CURR_FILENAME}" truncate -s 0 $EXISTING_PANAMA_JAVA_FILE # remove current source from the file cat $GENERATED_PANAMA_JAVA_FILE > $EXISTING_PANAMA_JAVA_FILE # put updated source - sed -i '${/^$/d}' $EXISTING_PANAMA_JAVA_FILE # remove last blank line else echo "[IGNORE] ${CURR_FILENAME} (already exists and not changed)" fi From 271dee56b053be1c73b61fd53dd8614232e37938 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Fri, 11 Apr 2025 16:47:57 -0400 Subject: [PATCH 11/26] remove manually generated bindings with the new ones --- .../cuvs/internal/panama/BruteForceH.java | 1912 -- .../nvidia/cuvs/internal/panama/CUuuid.java | 44 + .../cuvs/internal/panama/CUuuid_st.java | 176 + .../nvidia/cuvs/internal/panama/CagraH.java | 2298 -- .../internal/panama/CuVSBruteForceIndex.java | 183 - .../panama/CuVSCagraCompressionParams.java | 352 - .../cuvs/internal/panama/CuVSCagraIndex.java | 183 - .../internal/panama/CuVSCagraIndexParams.java | 354 - .../panama/CuVSCagraSearchParams.java | 644 - .../internal/panama/CuVSHnswExtendParams.java | 142 - .../cuvs/internal/panama/CuVSHnswIndex.java | 183 - .../internal/panama/CuVSHnswIndexParams.java | 224 - .../internal/panama/CuVSHnswSearchParams.java | 183 - .../cuvs/internal/panama/DLDataType.java | 28 +- .../nvidia/cuvs/internal/panama/DLDevice.java | 25 +- .../cuvs/internal/panama/DLManagedTensor.java | 30 +- .../panama/DLManagedTensorVersioned.java | 381 - .../nvidia/cuvs/internal/panama/DLTensor.java | 33 +- .../cuvs/internal/panama/DistanceH.java | 274 - .../nvidia/cuvs/internal/panama/DlpackH.java | 1898 -- .../nvidia/cuvs/internal/panama/Fsidt.java | 175 - .../nvidia/cuvs/internal/panama/HnswH.java | 2350 -- .../nvidia/cuvs/internal/panama/IvfFlatH.java | 2845 --- .../nvidia/cuvs/internal/panama/IvfPqH.java | 3182 --- .../cuvs/internal/panama/PanamaFFMAPI.java | 13904 ++++++++++++ .../cuvs/internal/panama/PanamaFFMAPI_1.java | 17672 ++++++++++++++++ .../nvidia/cuvs/internal/panama/__fsid_t.java | 176 + .../nvidia/cuvs/internal/panama/char1.java | 143 + .../panama/{DLPackVersion.java => char2.java} | 91 +- .../nvidia/cuvs/internal/panama/char3.java | 235 + .../nvidia/cuvs/internal/panama/char4.java | 281 + .../panama/cudaAccessPolicyWindow.java | 328 + .../panama/cudaArrayMemoryRequirements.java | 268 + .../panama/cudaArraySparseProperties.java | 586 + .../internal/panama/cudaAsyncCallback.java | 85 + .../panama/cudaAsyncNotificationInfo.java | 446 + .../panama/cudaAsyncNotificationInfo_t.java | 49 + .../panama/cudaChannelFormatDesc.java | 327 + .../panama/cudaChildGraphNodeParams.java | 143 + .../panama/cudaConditionalNodeParams.java | 281 + .../cuvs/internal/panama/cudaDeviceProp.java | 5207 +++++ .../panama/cudaEventRecordNodeParams.java | 143 + .../panama/cudaEventWaitNodeParams.java | 143 + .../cuvs/internal/panama/cudaExtent.java | 235 + .../panama/cudaExternalMemoryBufferDesc.java | 236 + .../panama/cudaExternalMemoryHandleDesc.java | 697 + .../cudaExternalMemoryMipmappedArrayDesc.java | 328 + .../cudaExternalSemaphoreHandleDesc.java | 651 + ...cudaExternalSemaphoreSignalNodeParams.java | 236 + ...daExternalSemaphoreSignalNodeParamsV2.java | 236 + .../cudaExternalSemaphoreSignalParams.java | 1033 + .../cudaExternalSemaphoreSignalParams_v1.java | 870 + .../cudaExternalSemaphoreWaitNodeParams.java | 236 + ...cudaExternalSemaphoreWaitNodeParamsV2.java | 236 + .../cudaExternalSemaphoreWaitParams.java | 1090 + .../cudaExternalSemaphoreWaitParams_v1.java | 927 + .../internal/panama/cudaFuncAttributes.java | 913 + .../internal/panama/cudaGraphEdgeData.java | 47 + .../internal/panama/cudaGraphEdgeData_st.java | 314 + .../panama/cudaGraphExecUpdateResultInfo.java | 46 + .../cudaGraphExecUpdateResultInfo_st.java | 236 + .../panama/cudaGraphInstantiateParams.java | 47 + .../panama/cudaGraphInstantiateParams_st.java | 282 + .../panama/cudaGraphKernelNodeUpdate.java | 706 + .../internal/panama/cudaGraphNodeParams.java | 903 + .../cuvs/internal/panama/cudaHostFn_t.java | 83 + .../internal/panama/cudaHostNodeParams.java | 189 + .../internal/panama/cudaHostNodeParamsV2.java | 189 + .../panama/cudaIpcEventHandle_st.java | 176 + .../internal/panama/cudaIpcEventHandle_t.java | 44 + .../internal/panama/cudaIpcMemHandle_st.java | 176 + .../internal/panama/cudaIpcMemHandle_t.java | 44 + .../internal/panama/cudaKernelNodeParams.java | 374 + .../panama/cudaKernelNodeParamsV2.java | 374 + .../internal/panama/cudaLaunchAttribute.java | 46 + .../panama/cudaLaunchAttributeValue.java | 1574 ++ .../panama/cudaLaunchAttribute_st.java | 268 + .../internal/panama/cudaLaunchConfig_st.java | 374 + .../internal/panama/cudaLaunchConfig_t.java | 49 + .../panama/cudaLaunchMemSyncDomainMap.java | 45 + .../panama/cudaLaunchMemSyncDomainMap_st.java | 189 + .../internal/panama/cudaLaunchParams.java | 373 + .../internal/panama/cudaMemAccessDesc.java | 189 + .../panama/cudaMemAllocNodeParams.java | 327 + .../panama/cudaMemAllocNodeParamsV2.java | 327 + .../panama/cudaMemFabricHandle_st.java | 176 + .../panama/cudaMemFabricHandle_t.java | 44 + .../panama/cudaMemFreeNodeParams.java | 143 + .../cuvs/internal/panama/cudaMemLocation.java | 189 + .../internal/panama/cudaMemPoolProps.java | 452 + .../panama/cudaMemPoolPtrExportData.java | 176 + .../internal/panama/cudaMemcpy3DParms.java | 466 + .../panama/cudaMemcpy3DPeerParms.java | 513 + .../internal/panama/cudaMemcpyNodeParams.java | 268 + .../internal/panama/cudaMemsetParams.java | 373 + .../internal/panama/cudaMemsetParamsV2.java | 373 + .../cuvs/internal/panama/cudaPitchedPtr.java | 281 + .../panama/cudaPointerAttributes.java | 281 + .../nvidia/cuvs/internal/panama/cudaPos.java | 235 + .../internal/panama/cudaResourceDesc.java | 1336 ++ .../internal/panama/cudaResourceViewDesc.java | 466 + .../internal/panama/cudaStreamCallback_t.java | 85 + .../cuvs/internal/panama/cudaTextureDesc.java | 761 + .../cuvs/internal/panama/cudaUUID_t.java | 44 + .../internal/panama/cuvsBruteForceIndex.java | 190 + .../panama/cuvsCagraCompressionParams.java | 373 + .../panama/cuvsCagraExtendParams.java | 143 + .../cuvs/internal/panama/cuvsCagraIndex.java | 190 + .../internal/panama/cuvsCagraIndexParams.java | 421 + .../panama/cuvsCagraSearchParams.java | 697 + .../{CuVSFilter.java => cuvsFilter.java} | 28 +- .../internal/panama/cuvsHnswExtendParams.java | 143 + .../cuvs/internal/panama/cuvsHnswIndex.java | 190 + .../internal/panama/cuvsHnswIndexParams.java | 235 + .../internal/panama/cuvsHnswSearchParams.java | 189 + .../cuvs/internal/panama/cuvsIvfPqIndex.java | 190 + .../internal/panama/cuvsIvfPqIndexParams.java | 653 + .../cuvs/internal/panama/cuvsIvfPqParams.java | 236 + .../panama/cuvsIvfPqSearchParams.java | 282 + .../com/nvidia/cuvs/internal/panama/dim3.java | 235 + .../nvidia/cuvs/internal/panama/double1.java | 143 + .../nvidia/cuvs/internal/panama/double2.java | 189 + .../nvidia/cuvs/internal/panama/double3.java | 235 + .../nvidia/cuvs/internal/panama/double4.java | 281 + .../nvidia/cuvs/internal/panama/float1.java | 143 + .../nvidia/cuvs/internal/panama/float2.java | 189 + .../nvidia/cuvs/internal/panama/float3.java | 235 + .../nvidia/cuvs/internal/panama/float4.java | 281 + .../com/nvidia/cuvs/internal/panama/int1.java | 143 + .../com/nvidia/cuvs/internal/panama/int2.java | 189 + .../com/nvidia/cuvs/internal/panama/int3.java | 235 + .../com/nvidia/cuvs/internal/panama/int4.java | 281 + .../nvidia/cuvs/internal/panama/long1.java | 143 + .../nvidia/cuvs/internal/panama/long2.java | 189 + .../nvidia/cuvs/internal/panama/long3.java | 235 + .../nvidia/cuvs/internal/panama/long4.java | 281 + .../cuvs/internal/panama/longlong1.java | 143 + .../cuvs/internal/panama/longlong2.java | 189 + .../cuvs/internal/panama/longlong3.java | 235 + .../cuvs/internal/panama/longlong4.java | 281 + .../{MaxAlignT.java => max_align_t.java} | 25 +- .../nvidia/cuvs/internal/panama/short1.java | 143 + .../nvidia/cuvs/internal/panama/short2.java | 189 + .../nvidia/cuvs/internal/panama/short3.java | 235 + .../nvidia/cuvs/internal/panama/short4.java | 281 + .../nvidia/cuvs/internal/panama/uchar1.java | 143 + .../nvidia/cuvs/internal/panama/uchar2.java | 189 + .../nvidia/cuvs/internal/panama/uchar3.java | 235 + .../nvidia/cuvs/internal/panama/uchar4.java | 281 + .../nvidia/cuvs/internal/panama/uint1.java | 143 + .../nvidia/cuvs/internal/panama/uint2.java | 189 + .../nvidia/cuvs/internal/panama/uint3.java | 235 + .../nvidia/cuvs/internal/panama/uint4.java | 281 + .../nvidia/cuvs/internal/panama/ulong1.java | 143 + .../nvidia/cuvs/internal/panama/ulong2.java | 189 + .../nvidia/cuvs/internal/panama/ulong3.java | 235 + .../nvidia/cuvs/internal/panama/ulong4.java | 281 + .../cuvs/internal/panama/ulonglong1.java | 143 + .../cuvs/internal/panama/ulonglong2.java | 189 + .../cuvs/internal/panama/ulonglong3.java | 235 + .../cuvs/internal/panama/ulonglong4.java | 281 + .../nvidia/cuvs/internal/panama/ushort1.java | 143 + .../nvidia/cuvs/internal/panama/ushort2.java | 189 + .../nvidia/cuvs/internal/panama/ushort3.java | 235 + .../nvidia/cuvs/internal/panama/ushort4.java | 281 + 165 files changed, 77046 insertions(+), 17886 deletions(-) delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/BruteForceH.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CagraH.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSBruteForceIndex.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraCompressionParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraIndex.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraIndexParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraSearchParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswExtendParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswIndex.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswIndexParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswSearchParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensorVersioned.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DistanceH.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DlpackH.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/Fsidt.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/HnswH.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/IvfFlatH.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/IvfPqH.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI_1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/__fsid_t.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char1.java rename java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/{DLPackVersion.java => char2.java} (65%) create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char4.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAccessPolicyWindow.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArrayMemoryRequirements.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArraySparseProperties.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncCallback.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo_t.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChannelFormatDesc.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChildGraphNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaConditionalNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaDeviceProp.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventRecordNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventWaitNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExtent.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryBufferDesc.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryHandleDesc.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryMipmappedArrayDesc.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreHandleDesc.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParamsV2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams_v1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParamsV2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams_v1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaFuncAttributes.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData_st.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo_st.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams_st.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphKernelNodeUpdate.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostFn_t.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParamsV2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_st.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_t.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_st.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_t.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParamsV2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttributeValue.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute_st.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_st.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_t.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap_st.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAccessDesc.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParamsV2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_st.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_t.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFreeNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemLocation.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolProps.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolPtrExportData.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DParms.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DPeerParms.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpyNodeParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParamsV2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPitchedPtr.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPointerAttributes.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPos.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceDesc.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceViewDesc.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaStreamCallback_t.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaTextureDesc.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaUUID_t.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsBruteForceIndex.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraCompressionParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraExtendParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndex.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndexParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraSearchParams.java rename java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/{CuVSFilter.java => cuvsFilter.java} (90%) create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswExtendParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndex.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndexParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswSearchParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndex.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndexParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqSearchParams.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/dim3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double4.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float4.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int4.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long4.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong4.java rename java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/{MaxAlignT.java => max_align_t.java} (90%) create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short4.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar4.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint4.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong4.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong4.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort1.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort2.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort3.java create mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort4.java diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/BruteForceH.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/BruteForceH.java deleted file mode 100644 index 0e34eb2cff..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/BruteForceH.java +++ /dev/null @@ -1,1912 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.ValueLayout.JAVA_BYTE; - -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.PaddingLayout; -import java.lang.foreign.SequenceLayout; -import java.lang.foreign.StructLayout; -import java.lang.foreign.SymbolLookup; -import java.lang.foreign.ValueLayout; -import java.lang.foreign.ValueLayout.OfByte; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.lang.foreign.ValueLayout.OfShort; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.util.Arrays; -import java.util.stream.Collectors; - -public class BruteForceH { - - BruteForceH() { - // Should not be called directly - } - - static final Arena LIBRARY_ARENA = Arena.ofAuto(); - static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); - - static void traceDowncall(String name, Object... args) { - String traceArgs = Arrays.stream(args).map(Object::toString).collect(Collectors.joining(", ")); - System.out.printf("%s(%s)\n", name, traceArgs); - } - - static MemorySegment findOrThrow(String symbol) { - return SYMBOL_LOOKUP.find(symbol).orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); - } - - static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { - try { - return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); - } catch (ReflectiveOperationException ex) { - throw new AssertionError(ex); - } - } - - static MemoryLayout align(MemoryLayout layout, long align) { - return switch (layout) { - case PaddingLayout p -> p; - case ValueLayout v -> v.withByteAlignment(align); - case GroupLayout g -> { - MemoryLayout[] alignedMembers = g.memberLayouts().stream().map(m -> align(m, align)).toArray(MemoryLayout[]::new); - yield g instanceof StructLayout ? MemoryLayout.structLayout(alignedMembers) - : MemoryLayout.unionLayout(alignedMembers); - } - case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); - }; - } - - static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup().or(Linker.nativeLinker().defaultLookup()); - - public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; - public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; - public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; - public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; - public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; - public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; - public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; - public static final AddressLayout C_POINTER = ValueLayout.ADDRESS - .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); - public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; - private static final int DLPACK_VERSION = (int) 80L; - - /** - * {@snippet lang = c : * #define DLPACK_VERSION 80 - * } - */ - public static int DLPACK_VERSION() { - return DLPACK_VERSION; - } - - private static final int DLPACK_ABI_VERSION = (int) 1L; - - /** - * {@snippet lang = c : * #define DLPACK_ABI_VERSION 1 - * } - */ - public static int DLPACK_ABI_VERSION() { - return DLPACK_ABI_VERSION; - } - - private static final int _STDINT_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _STDINT_H 1 - * } - */ - public static int _STDINT_H() { - return _STDINT_H; - } - - private static final int _FEATURES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _FEATURES_H 1 - * } - */ - public static int _FEATURES_H() { - return _FEATURES_H; - } - - private static final int _DEFAULT_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _DEFAULT_SOURCE 1 - * } - */ - public static int _DEFAULT_SOURCE() { - return _DEFAULT_SOURCE; - } - - private static final int __GLIBC_USE_ISOC2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_ISOC2X 0 - * } - */ - public static int __GLIBC_USE_ISOC2X() { - return __GLIBC_USE_ISOC2X; - } - - private static final int __USE_ISOC11 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC11 1 - * } - */ - public static int __USE_ISOC11() { - return __USE_ISOC11; - } - - private static final int __USE_ISOC99 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC99 1 - * } - */ - public static int __USE_ISOC99() { - return __USE_ISOC99; - } - - private static final int __USE_ISOC95 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC95 1 - * } - */ - public static int __USE_ISOC95() { - return __USE_ISOC95; - } - - private static final int __USE_POSIX_IMPLICITLY = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX_IMPLICITLY 1 - * } - */ - public static int __USE_POSIX_IMPLICITLY() { - return __USE_POSIX_IMPLICITLY; - } - - private static final int _POSIX_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _POSIX_SOURCE 1 - * } - */ - public static int _POSIX_SOURCE() { - return _POSIX_SOURCE; - } - - private static final int __USE_POSIX = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX 1 - * } - */ - public static int __USE_POSIX() { - return __USE_POSIX; - } - - private static final int __USE_POSIX2 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX2 1 - * } - */ - public static int __USE_POSIX2() { - return __USE_POSIX2; - } - - private static final int __USE_POSIX199309 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX199309 1 - * } - */ - public static int __USE_POSIX199309() { - return __USE_POSIX199309; - } - - private static final int __USE_POSIX199506 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX199506 1 - * } - */ - public static int __USE_POSIX199506() { - return __USE_POSIX199506; - } - - private static final int __USE_XOPEN2K = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_XOPEN2K 1 - * } - */ - public static int __USE_XOPEN2K() { - return __USE_XOPEN2K; - } - - private static final int __USE_XOPEN2K8 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_XOPEN2K8 1 - * } - */ - public static int __USE_XOPEN2K8() { - return __USE_XOPEN2K8; - } - - private static final int _ATFILE_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _ATFILE_SOURCE 1 - * } - */ - public static int _ATFILE_SOURCE() { - return _ATFILE_SOURCE; - } - - private static final int __WORDSIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - - private static final int __WORDSIZE_TIME64_COMPAT32 = (int) 1L; - - /** - * {@snippet lang = c : * #define __WORDSIZE_TIME64_COMPAT32 1 - * } - */ - public static int __WORDSIZE_TIME64_COMPAT32() { - return __WORDSIZE_TIME64_COMPAT32; - } - - private static final int __SYSCALL_WORDSIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __SYSCALL_WORDSIZE 64 - * } - */ - public static int __SYSCALL_WORDSIZE() { - return __SYSCALL_WORDSIZE; - } - - private static final int __USE_MISC = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_MISC 1 - * } - */ - public static int __USE_MISC() { - return __USE_MISC; - } - - private static final int __USE_ATFILE = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ATFILE 1 - * } - */ - public static int __USE_ATFILE() { - return __USE_ATFILE; - } - - private static final int __USE_FORTIFY_LEVEL = (int) 0L; - - /** - * {@snippet lang = c : * #define __USE_FORTIFY_LEVEL 0 - * } - */ - public static int __USE_FORTIFY_LEVEL() { - return __USE_FORTIFY_LEVEL; - } - - private static final int __GLIBC_USE_DEPRECATED_GETS = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_DEPRECATED_GETS 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_GETS() { - return __GLIBC_USE_DEPRECATED_GETS; - } - - private static final int __GLIBC_USE_DEPRECATED_SCANF = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_DEPRECATED_SCANF 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_SCANF() { - return __GLIBC_USE_DEPRECATED_SCANF; - } - - private static final int _STDC_PREDEF_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _STDC_PREDEF_H 1 - * } - */ - public static int _STDC_PREDEF_H() { - return _STDC_PREDEF_H; - } - - private static final int __STDC_IEC_559__ = (int) 1L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_559__ 1 - * } - */ - public static int __STDC_IEC_559__() { - return __STDC_IEC_559__; - } - - private static final int __STDC_IEC_559_COMPLEX__ = (int) 1L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_559_COMPLEX__ 1 - * } - */ - public static int __STDC_IEC_559_COMPLEX__() { - return __STDC_IEC_559_COMPLEX__; - } - - private static final int __GNU_LIBRARY__ = (int) 6L; - - /** - * {@snippet lang = c : * #define __GNU_LIBRARY__ 6 - * } - */ - public static int __GNU_LIBRARY__() { - return __GNU_LIBRARY__; - } - - private static final int __GLIBC__ = (int) 2L; - - /** - * {@snippet lang = c : * #define __GLIBC__ 2 - * } - */ - public static int __GLIBC__() { - return __GLIBC__; - } - - private static final int __GLIBC_MINOR__ = (int) 35L; - - /** - * {@snippet lang = c : * #define __GLIBC_MINOR__ 35 - * } - */ - public static int __GLIBC_MINOR__() { - return __GLIBC_MINOR__; - } - - private static final int _SYS_CDEFS_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _SYS_CDEFS_H 1 - * } - */ - public static int _SYS_CDEFS_H() { - return _SYS_CDEFS_H; - } - - private static final int __glibc_c99_flexarr_available = (int) 1L; - - /** - * {@snippet lang = c : * #define __glibc_c99_flexarr_available 1 - * } - */ - public static int __glibc_c99_flexarr_available() { - return __glibc_c99_flexarr_available; - } - - private static final int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = (int) 0L; - - /** - * {@snippet lang = c : * #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 - * } - */ - public static int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI() { - return __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI; - } - - private static final int __HAVE_GENERIC_SELECTION = (int) 1L; - - /** - * {@snippet lang = c : * #define __HAVE_GENERIC_SELECTION 1 - * } - */ - public static int __HAVE_GENERIC_SELECTION() { - return __HAVE_GENERIC_SELECTION; - } - - private static final int __GLIBC_USE_LIB_EXT2 = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_LIB_EXT2 0 - * } - */ - public static int __GLIBC_USE_LIB_EXT2() { - return __GLIBC_USE_LIB_EXT2; - } - - private static final int __GLIBC_USE_IEC_60559_BFP_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_BFP_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT() { - return __GLIBC_USE_IEC_60559_BFP_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_BFP_EXT_C2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT_C2X() { - return __GLIBC_USE_IEC_60559_BFP_EXT_C2X; - } - - private static final int __GLIBC_USE_IEC_60559_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_EXT() { - return __GLIBC_USE_IEC_60559_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X; - } - - private static final int __GLIBC_USE_IEC_60559_TYPES_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_TYPES_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_TYPES_EXT() { - return __GLIBC_USE_IEC_60559_TYPES_EXT; - } - - private static final int _BITS_TYPES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TYPES_H 1 - * } - */ - public static int _BITS_TYPES_H() { - return _BITS_TYPES_H; - } - - private static final int _BITS_TYPESIZES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TYPESIZES_H 1 - * } - */ - public static int _BITS_TYPESIZES_H() { - return _BITS_TYPESIZES_H; - } - - private static final int __OFF_T_MATCHES_OFF64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __OFF_T_MATCHES_OFF64_T 1 - * } - */ - public static int __OFF_T_MATCHES_OFF64_T() { - return __OFF_T_MATCHES_OFF64_T; - } - - private static final int __INO_T_MATCHES_INO64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __INO_T_MATCHES_INO64_T 1 - * } - */ - public static int __INO_T_MATCHES_INO64_T() { - return __INO_T_MATCHES_INO64_T; - } - - private static final int __RLIM_T_MATCHES_RLIM64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __RLIM_T_MATCHES_RLIM64_T 1 - * } - */ - public static int __RLIM_T_MATCHES_RLIM64_T() { - return __RLIM_T_MATCHES_RLIM64_T; - } - - private static final int __STATFS_MATCHES_STATFS64 = (int) 1L; - - /** - * {@snippet lang = c : * #define __STATFS_MATCHES_STATFS64 1 - * } - */ - public static int __STATFS_MATCHES_STATFS64() { - return __STATFS_MATCHES_STATFS64; - } - - private static final int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = (int) 1L; - - /** - * {@snippet lang = c : * #define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 - * } - */ - public static int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64() { - return __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64; - } - - private static final int __FD_SETSIZE = (int) 1024L; - - /** - * {@snippet lang = c : * #define __FD_SETSIZE 1024 - * } - */ - public static int __FD_SETSIZE() { - return __FD_SETSIZE; - } - - private static final int _BITS_TIME64_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TIME64_H 1 - * } - */ - public static int _BITS_TIME64_H() { - return _BITS_TIME64_H; - } - - private static final int _BITS_WCHAR_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_WCHAR_H 1 - * } - */ - public static int _BITS_WCHAR_H() { - return _BITS_WCHAR_H; - } - - private static final int _BITS_STDINT_INTN_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_STDINT_INTN_H 1 - * } - */ - public static int _BITS_STDINT_INTN_H() { - return _BITS_STDINT_INTN_H; - } - - private static final int _BITS_STDINT_UINTN_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_STDINT_UINTN_H 1 - * } - */ - public static int _BITS_STDINT_UINTN_H() { - return _BITS_STDINT_UINTN_H; - } - - /** - * {@snippet lang = c : * typedef unsigned char __u_char - * } - */ - public static final OfByte __u_char = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned short __u_short - * } - */ - public static final OfShort __u_short = BruteForceH.C_SHORT; - /** - * {@snippet lang = c : * typedef unsigned int __u_int - * } - */ - public static final OfInt __u_int = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __u_long - * } - */ - public static final OfLong __u_long = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef signed char __int8_t - * } - */ - public static final OfByte __int8_t = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned char __uint8_t - * } - */ - public static final OfByte __uint8_t = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef short __int16_t - * } - */ - public static final OfShort __int16_t = BruteForceH.C_SHORT; - /** - * {@snippet lang = c : * typedef unsigned short __uint16_t - * } - */ - public static final OfShort __uint16_t = BruteForceH.C_SHORT; - /** - * {@snippet lang = c : * typedef int __int32_t - * } - */ - public static final OfInt __int32_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned int __uint32_t - * } - */ - public static final OfInt __uint32_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef long __int64_t - * } - */ - public static final OfLong __int64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __uint64_t - * } - */ - public static final OfLong __uint64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef __int8_t __int_least8_t - * } - */ - public static final OfByte __int_least8_t = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint8_t __uint_least8_t - * } - */ - public static final OfByte __uint_least8_t = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int16_t __int_least16_t - * } - */ - public static final OfShort __int_least16_t = BruteForceH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint16_t __uint_least16_t - * } - */ - public static final OfShort __uint_least16_t = BruteForceH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int32_t __int_least32_t - * } - */ - public static final OfInt __int_least32_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef __uint32_t __uint_least32_t - * } - */ - public static final OfInt __uint_least32_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef __int64_t __int_least64_t - * } - */ - public static final OfLong __int_least64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint64_t __uint_least64_t - * } - */ - public static final OfLong __uint_least64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long __quad_t - * } - */ - public static final OfLong __quad_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __u_quad_t - * } - */ - public static final OfLong __u_quad_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long __intmax_t - * } - */ - public static final OfLong __intmax_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __uintmax_t - * } - */ - public static final OfLong __uintmax_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __dev_t - * } - */ - public static final OfLong __dev_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __uid_t - * } - */ - public static final OfInt __uid_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned int __gid_t - * } - */ - public static final OfInt __gid_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __ino_t - * } - */ - public static final OfLong __ino_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __ino64_t - * } - */ - public static final OfLong __ino64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __mode_t - * } - */ - public static final OfInt __mode_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __nlink_t - * } - */ - public static final OfLong __nlink_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long __off_t - * } - */ - public static final OfLong __off_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long __off64_t - * } - */ - public static final OfLong __off64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef int __pid_t - * } - */ - public static final OfInt __pid_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef long __clock_t - * } - */ - public static final OfLong __clock_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __rlim_t - * } - */ - public static final OfLong __rlim_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __rlim64_t - * } - */ - public static final OfLong __rlim64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __id_t - * } - */ - public static final OfInt __id_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef long __time_t - * } - */ - public static final OfLong __time_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __useconds_t - * } - */ - public static final OfInt __useconds_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef long __suseconds_t - * } - */ - public static final OfLong __suseconds_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long __suseconds64_t - * } - */ - public static final OfLong __suseconds64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef int __daddr_t - * } - */ - public static final OfInt __daddr_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef int __key_t - * } - */ - public static final OfInt __key_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef int __clockid_t - * } - */ - public static final OfInt __clockid_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef void *__timer_t - * } - */ - public static final AddressLayout __timer_t = BruteForceH.C_POINTER; - /** - * {@snippet lang = c : * typedef long __blksize_t - * } - */ - public static final OfLong __blksize_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long __blkcnt_t - * } - */ - public static final OfLong __blkcnt_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long __blkcnt64_t - * } - */ - public static final OfLong __blkcnt64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsblkcnt_t - * } - */ - public static final OfLong __fsblkcnt_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsblkcnt64_t - * } - */ - public static final OfLong __fsblkcnt64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsfilcnt_t - * } - */ - public static final OfLong __fsfilcnt_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsfilcnt64_t - * } - */ - public static final OfLong __fsfilcnt64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long __fsword_t - * } - */ - public static final OfLong __fsword_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long __ssize_t - * } - */ - public static final OfLong __ssize_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long __syscall_slong_t - * } - */ - public static final OfLong __syscall_slong_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __syscall_ulong_t - * } - */ - public static final OfLong __syscall_ulong_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef __off64_t __loff_t - * } - */ - public static final OfLong __loff_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef char *__caddr_t - * } - */ - public static final AddressLayout __caddr_t = BruteForceH.C_POINTER; - /** - * {@snippet lang = c : * typedef long __intptr_t - * } - */ - public static final OfLong __intptr_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __socklen_t - * } - */ - public static final OfInt __socklen_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef int __sig_atomic_t - * } - */ - public static final OfInt __sig_atomic_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef __int8_t int8_t - * } - */ - public static final OfByte int8_t = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int16_t int16_t - * } - */ - public static final OfShort int16_t = BruteForceH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int32_t int32_t - * } - */ - public static final OfInt int32_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef __int64_t int64_t - * } - */ - public static final OfLong int64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint8_t uint8_t - * } - */ - public static final OfByte uint8_t = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint16_t uint16_t - * } - */ - public static final OfShort uint16_t = BruteForceH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint32_t uint32_t - * } - */ - public static final OfInt uint32_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef __uint64_t uint64_t - * } - */ - public static final OfLong uint64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef __int_least8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int_least16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = BruteForceH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int_least32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef __int_least64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint_least8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint_least16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = BruteForceH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint_least32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = BruteForceH.C_INT; - /** - * {@snippet lang = c : * typedef __uint_least64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef signed char int_fast8_t - * } - */ - public static final OfByte int_fast8_t = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef long int_fast16_t - * } - */ - public static final OfLong int_fast16_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long int_fast32_t - * } - */ - public static final OfLong int_fast32_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long int_fast64_t - * } - */ - public static final OfLong int_fast64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned char uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = BruteForceH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast16_t - * } - */ - public static final OfLong uint_fast16_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast32_t - * } - */ - public static final OfLong uint_fast32_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long intptr_t - * } - */ - public static final OfLong intptr_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uintptr_t - * } - */ - public static final OfLong uintptr_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef __intmax_t intmax_t - * } - */ - public static final OfLong intmax_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef __uintmax_t uintmax_t - * } - */ - public static final OfLong uintmax_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long size_t - * } - */ - public static final OfLong size_t = BruteForceH.C_LONG; - /** - * {@snippet lang = c : * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = BruteForceH.C_INT; - private static final int kDLCPU = (int) 1L; - - /** - * {@snippet lang = c : * enum .kDLCPU = 1 - * } - */ - public static int kDLCPU() { - return kDLCPU; - } - - private static final int kDLCUDA = (int) 2L; - - /** - * {@snippet lang = c : * enum .kDLCUDA = 2 - * } - */ - public static int kDLCUDA() { - return kDLCUDA; - } - - private static final int kDLCUDAHost = (int) 3L; - - /** - * {@snippet lang = c : * enum .kDLCUDAHost = 3 - * } - */ - public static int kDLCUDAHost() { - return kDLCUDAHost; - } - - private static final int kDLOpenCL = (int) 4L; - - /** - * {@snippet lang = c : * enum .kDLOpenCL = 4 - * } - */ - public static int kDLOpenCL() { - return kDLOpenCL; - } - - private static final int kDLVulkan = (int) 7L; - - /** - * {@snippet lang = c : * enum .kDLVulkan = 7 - * } - */ - public static int kDLVulkan() { - return kDLVulkan; - } - - private static final int kDLMetal = (int) 8L; - - /** - * {@snippet lang = c : * enum .kDLMetal = 8 - * } - */ - public static int kDLMetal() { - return kDLMetal; - } - - private static final int kDLVPI = (int) 9L; - - /** - * {@snippet lang = c : * enum .kDLVPI = 9 - * } - */ - public static int kDLVPI() { - return kDLVPI; - } - - private static final int kDLROCM = (int) 10L; - - /** - * {@snippet lang = c : * enum .kDLROCM = 10 - * } - */ - public static int kDLROCM() { - return kDLROCM; - } - - private static final int kDLROCMHost = (int) 11L; - - /** - * {@snippet lang = c : * enum .kDLROCMHost = 11 - * } - */ - public static int kDLROCMHost() { - return kDLROCMHost; - } - - private static final int kDLExtDev = (int) 12L; - - /** - * {@snippet lang = c : * enum .kDLExtDev = 12 - * } - */ - public static int kDLExtDev() { - return kDLExtDev; - } - - private static final int kDLCUDAManaged = (int) 13L; - - /** - * {@snippet lang = c : * enum .kDLCUDAManaged = 13 - * } - */ - public static int kDLCUDAManaged() { - return kDLCUDAManaged; - } - - private static final int kDLOneAPI = (int) 14L; - - /** - * {@snippet lang = c : * enum .kDLOneAPI = 14 - * } - */ - public static int kDLOneAPI() { - return kDLOneAPI; - } - - private static final int kDLWebGPU = (int) 15L; - - /** - * {@snippet lang = c : * enum .kDLWebGPU = 15 - * } - */ - public static int kDLWebGPU() { - return kDLWebGPU; - } - - private static final int kDLHexagon = (int) 16L; - - /** - * {@snippet lang = c : * enum .kDLHexagon = 16 - * } - */ - public static int kDLHexagon() { - return kDLHexagon; - } - - private static final int kDLInt = (int) 0L; - - /** - * {@snippet lang = c : * enum .kDLInt = 0 - * } - */ - public static int kDLInt() { - return kDLInt; - } - - private static final int kDLUInt = (int) 1L; - - /** - * {@snippet lang = c : * enum .kDLUInt = 1 - * } - */ - public static int kDLUInt() { - return kDLUInt; - } - - private static final int kDLFloat = (int) 2L; - - /** - * {@snippet lang = c : * enum .kDLFloat = 2 - * } - */ - public static int kDLFloat() { - return kDLFloat; - } - - private static final int kDLOpaqueHandle = (int) 3L; - - /** - * {@snippet lang = c : * enum .kDLOpaqueHandle = 3 - * } - */ - public static int kDLOpaqueHandle() { - return kDLOpaqueHandle; - } - - private static final int kDLBfloat = (int) 4L; - - /** - * {@snippet lang = c : * enum .kDLBfloat = 4 - * } - */ - public static int kDLBfloat() { - return kDLBfloat; - } - - private static final int kDLComplex = (int) 5L; - - /** - * {@snippet lang = c : * enum .kDLComplex = 5 - * } - */ - public static int kDLComplex() { - return kDLComplex; - } - - private static final int kDLBool = (int) 6L; - - /** - * {@snippet lang = c : * enum .kDLBool = 6 - * } - */ - public static int kDLBool() { - return kDLBool; - } - - /** - * {@snippet lang = c : * typedef cuvsBruteForceIndex *cuvsBruteForceIndex_t - * } - */ - public static final AddressLayout cuvsBruteForceIndex_t = BruteForceH.C_POINTER; - private static final long _POSIX_C_SOURCE = 200809L; - - /** - * {@snippet lang = c : * #define _POSIX_C_SOURCE 200809 - * } - */ - public static long _POSIX_C_SOURCE() { - return _POSIX_C_SOURCE; - } - - private static final int __TIMESIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __TIMESIZE 64 - * } - */ - public static int __TIMESIZE() { - return __TIMESIZE; - } - - private static final long __STDC_IEC_60559_BFP__ = 201404L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_60559_BFP__ 201404 - * } - */ - public static long __STDC_IEC_60559_BFP__() { - return __STDC_IEC_60559_BFP__; - } - - private static final long __STDC_IEC_60559_COMPLEX__ = 201404L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_60559_COMPLEX__ 201404 - * } - */ - public static long __STDC_IEC_60559_COMPLEX__() { - return __STDC_IEC_60559_COMPLEX__; - } - - private static final long __STDC_ISO_10646__ = 201706L; - - /** - * {@snippet lang = c : * #define __STDC_ISO_10646__ 201706 - * } - */ - public static long __STDC_ISO_10646__() { - return __STDC_ISO_10646__; - } - - private static final int __WCHAR_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define __WCHAR_MAX 2147483647 - * } - */ - public static int __WCHAR_MAX() { - return __WCHAR_MAX; - } - - private static final int __WCHAR_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define __WCHAR_MIN -2147483648 - * } - */ - public static int __WCHAR_MIN() { - return __WCHAR_MIN; - } - - private static final int INT8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT8_MIN -128 - * } - */ - public static int INT8_MIN() { - return INT8_MIN; - } - - private static final int INT16_MIN = (int) -32768L; - - /** - * {@snippet lang = c : * #define INT16_MIN -32768 - * } - */ - public static int INT16_MIN() { - return INT16_MIN; - } - - private static final int INT32_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define INT32_MIN -2147483648 - * } - */ - public static int INT32_MIN() { - return INT32_MIN; - } - - private static final long INT64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT64_MIN -9223372036854775808 - * } - */ - public static long INT64_MIN() { - return INT64_MIN; - } - - private static final int INT8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT8_MAX 127 - * } - */ - public static int INT8_MAX() { - return INT8_MAX; - } - - private static final int INT16_MAX = (int) 32767L; - - /** - * {@snippet lang = c : * #define INT16_MAX 32767 - * } - */ - public static int INT16_MAX() { - return INT16_MAX; - } - - private static final int INT32_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define INT32_MAX 2147483647 - * } - */ - public static int INT32_MAX() { - return INT32_MAX; - } - - private static final long INT64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT64_MAX 9223372036854775807 - * } - */ - public static long INT64_MAX() { - return INT64_MAX; - } - - private static final int UINT8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT8_MAX 255 - * } - */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - - private static final int UINT16_MAX = (int) 65535L; - - /** - * {@snippet lang = c : * #define UINT16_MAX 65535 - * } - */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - - private static final int UINT32_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define UINT32_MAX 4294967295 - * } - */ - public static int UINT32_MAX() { - return UINT32_MAX; - } - - private static final long UINT64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT64_MAX -1 - * } - */ - public static long UINT64_MAX() { - return UINT64_MAX; - } - - private static final int INT_LEAST8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT_LEAST8_MIN -128 - * } - */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; - } - - private static final int INT_LEAST16_MIN = (int) -32768L; - - /** - * {@snippet lang = c : * #define INT_LEAST16_MIN -32768 - * } - */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; - } - - private static final int INT_LEAST32_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define INT_LEAST32_MIN -2147483648 - * } - */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; - } - - private static final long INT_LEAST64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_LEAST64_MIN -9223372036854775808 - * } - */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; - } - - private static final int INT_LEAST8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT_LEAST8_MAX 127 - * } - */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; - } - - private static final int INT_LEAST16_MAX = (int) 32767L; - - /** - * {@snippet lang = c : * #define INT_LEAST16_MAX 32767 - * } - */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; - } - - private static final int INT_LEAST32_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define INT_LEAST32_MAX 2147483647 - * } - */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; - } - - private static final long INT_LEAST64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_LEAST64_MAX 9223372036854775807 - * } - */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; - } - - private static final int UINT_LEAST8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT_LEAST8_MAX 255 - * } - */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; - } - - private static final int UINT_LEAST16_MAX = (int) 65535L; - - /** - * {@snippet lang = c : * #define UINT_LEAST16_MAX 65535 - * } - */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; - } - - private static final int UINT_LEAST32_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define UINT_LEAST32_MAX 4294967295 - * } - */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; - } - - private static final long UINT_LEAST64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_LEAST64_MAX -1 - * } - */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; - } - - private static final int INT_FAST8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT_FAST8_MIN -128 - * } - */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; - } - - private static final long INT_FAST16_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST16_MIN -9223372036854775808 - * } - */ - public static long INT_FAST16_MIN() { - return INT_FAST16_MIN; - } - - private static final long INT_FAST32_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST32_MIN -9223372036854775808 - * } - */ - public static long INT_FAST32_MIN() { - return INT_FAST32_MIN; - } - - private static final long INT_FAST64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST64_MIN -9223372036854775808 - * } - */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; - } - - private static final int INT_FAST8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT_FAST8_MAX 127 - * } - */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; - } - - private static final long INT_FAST16_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST16_MAX 9223372036854775807 - * } - */ - public static long INT_FAST16_MAX() { - return INT_FAST16_MAX; - } - - private static final long INT_FAST32_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST32_MAX 9223372036854775807 - * } - */ - public static long INT_FAST32_MAX() { - return INT_FAST32_MAX; - } - - private static final long INT_FAST64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST64_MAX 9223372036854775807 - * } - */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; - } - - private static final int UINT_FAST8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT_FAST8_MAX 255 - * } - */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; - } - - private static final long UINT_FAST16_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST16_MAX -1 - * } - */ - public static long UINT_FAST16_MAX() { - return UINT_FAST16_MAX; - } - - private static final long UINT_FAST32_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST32_MAX -1 - * } - */ - public static long UINT_FAST32_MAX() { - return UINT_FAST32_MAX; - } - - private static final long UINT_FAST64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST64_MAX -1 - * } - */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; - } - - private static final long INTPTR_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INTPTR_MIN -9223372036854775808 - * } - */ - public static long INTPTR_MIN() { - return INTPTR_MIN; - } - - private static final long INTPTR_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INTPTR_MAX 9223372036854775807 - * } - */ - public static long INTPTR_MAX() { - return INTPTR_MAX; - } - - private static final long UINTPTR_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINTPTR_MAX -1 - * } - */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; - } - - private static final long INTMAX_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INTMAX_MIN -9223372036854775808 - * } - */ - public static long INTMAX_MIN() { - return INTMAX_MIN; - } - - private static final long INTMAX_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INTMAX_MAX 9223372036854775807 - * } - */ - public static long INTMAX_MAX() { - return INTMAX_MAX; - } - - private static final long UINTMAX_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINTMAX_MAX -1 - * } - */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; - } - - private static final long PTRDIFF_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define PTRDIFF_MIN -9223372036854775808 - * } - */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; - } - - private static final long PTRDIFF_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define PTRDIFF_MAX 9223372036854775807 - * } - */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; - } - - private static final int SIG_ATOMIC_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define SIG_ATOMIC_MIN -2147483648 - * } - */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; - } - - private static final int SIG_ATOMIC_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define SIG_ATOMIC_MAX 2147483647 - * } - */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; - } - - private static final long SIZE_MAX = -1L; - - /** - * {@snippet lang = c : * #define SIZE_MAX -1 - * } - */ - public static long SIZE_MAX() { - return SIZE_MAX; - } - - private static final int WCHAR_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define WCHAR_MIN -2147483648 - * } - */ - public static int WCHAR_MIN() { - return WCHAR_MIN; - } - - private static final int WCHAR_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define WCHAR_MAX 2147483647 - * } - */ - public static int WCHAR_MAX() { - return WCHAR_MAX; - } - - private static final int WINT_MIN = (int) 0L; - - /** - * {@snippet lang = c : * #define WINT_MIN 0 - * } - */ - public static int WINT_MIN() { - return WINT_MIN; - } - - private static final int WINT_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define WINT_MAX 4294967295 - * } - */ - public static int WINT_MAX() { - return WINT_MAX; - } - - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); - - /** - * {@snippet lang = c : * #define NULL (void*) 0 - * } - */ - public static MemorySegment NULL() { - return NULL; - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid.java new file mode 100644 index 0000000000..2c65af5646 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct CUuuid_st { + * char bytes[16]; + * } CUuuid + * } + */ +public class CUuuid extends CUuuid_st { + + CUuuid() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid_st.java new file mode 100644 index 0000000000..163b87ea3d --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid_st.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct CUuuid_st { + * char bytes[16]; + * } + * } + */ +public class CUuuid_st { + + CUuuid_st() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(16, PanamaFFMAPI.C_CHAR).withName("bytes") + ).withName("CUuuid_st"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout bytes$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("bytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * char bytes[16] + * } + */ + public static final SequenceLayout bytes$layout() { + return bytes$LAYOUT; + } + + private static final long bytes$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char bytes[16] + * } + */ + public static final long bytes$offset() { + return bytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char bytes[16] + * } + */ + public static MemorySegment bytes(MemorySegment struct) { + return struct.asSlice(bytes$OFFSET, bytes$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char bytes[16] + * } + */ + public static void bytes(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, bytes$OFFSET, bytes$LAYOUT.byteSize()); + } + + private static long[] bytes$DIMS = { 16 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char bytes[16] + * } + */ + public static long[] bytes$dimensions() { + return bytes$DIMS; + } + private static final VarHandle bytes$ELEM_HANDLE = bytes$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char bytes[16] + * } + */ + public static byte bytes(MemorySegment struct, long index0) { + return (byte)bytes$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char bytes[16] + * } + */ + public static void bytes(MemorySegment struct, long index0, byte fieldValue) { + bytes$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CagraH.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CagraH.java deleted file mode 100644 index 82ecbdc34a..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CagraH.java +++ /dev/null @@ -1,2298 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.ValueLayout.JAVA_BYTE; - -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.PaddingLayout; -import java.lang.foreign.SequenceLayout; -import java.lang.foreign.StructLayout; -import java.lang.foreign.SymbolLookup; -import java.lang.foreign.ValueLayout; -import java.lang.foreign.ValueLayout.OfByte; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.lang.foreign.ValueLayout.OfShort; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.util.Arrays; -import java.util.stream.Collectors; - -public class CagraH { - - CagraH() { - // Should not be called directly - } - - static final Arena LIBRARY_ARENA = Arena.ofAuto(); - static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); - - static void traceDowncall(String name, Object... args) { - String traceArgs = Arrays.stream(args).map(Object::toString).collect(Collectors.joining(", ")); - System.out.printf("%s(%s)\n", name, traceArgs); - } - - static MemorySegment findOrThrow(String symbol) { - return SYMBOL_LOOKUP.find(symbol).orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); - } - - static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { - try { - return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); - } catch (ReflectiveOperationException ex) { - throw new AssertionError(ex); - } - } - - static MemoryLayout align(MemoryLayout layout, long align) { - return switch (layout) { - case PaddingLayout p -> p; - case ValueLayout v -> v.withByteAlignment(align); - case GroupLayout g -> { - MemoryLayout[] alignedMembers = g.memberLayouts().stream().map(m -> align(m, align)).toArray(MemoryLayout[]::new); - yield g instanceof StructLayout ? MemoryLayout.structLayout(alignedMembers) - : MemoryLayout.unionLayout(alignedMembers); - } - case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); - }; - } - - static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup().or(Linker.nativeLinker().defaultLookup()); - - public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; - public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; - public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; - public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; - public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; - public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; - public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; - public static final AddressLayout C_POINTER = ValueLayout.ADDRESS - .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); - public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; - private static final int DLPACK_VERSION = (int) 80L; - - /** - * {@snippet lang = c : * #define DLPACK_VERSION 80 - * } - */ - public static int DLPACK_VERSION() { - return DLPACK_VERSION; - } - - private static final int DLPACK_ABI_VERSION = (int) 1L; - - /** - * {@snippet lang = c : * #define DLPACK_ABI_VERSION 1 - * } - */ - public static int DLPACK_ABI_VERSION() { - return DLPACK_ABI_VERSION; - } - - private static final int _STDINT_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _STDINT_H 1 - * } - */ - public static int _STDINT_H() { - return _STDINT_H; - } - - private static final int _FEATURES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _FEATURES_H 1 - * } - */ - public static int _FEATURES_H() { - return _FEATURES_H; - } - - private static final int _DEFAULT_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _DEFAULT_SOURCE 1 - * } - */ - public static int _DEFAULT_SOURCE() { - return _DEFAULT_SOURCE; - } - - private static final int __GLIBC_USE_ISOC2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_ISOC2X 0 - * } - */ - public static int __GLIBC_USE_ISOC2X() { - return __GLIBC_USE_ISOC2X; - } - - private static final int __USE_ISOC11 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC11 1 - * } - */ - public static int __USE_ISOC11() { - return __USE_ISOC11; - } - - private static final int __USE_ISOC99 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC99 1 - * } - */ - public static int __USE_ISOC99() { - return __USE_ISOC99; - } - - private static final int __USE_ISOC95 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC95 1 - * } - */ - public static int __USE_ISOC95() { - return __USE_ISOC95; - } - - private static final int __USE_POSIX_IMPLICITLY = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX_IMPLICITLY 1 - * } - */ - public static int __USE_POSIX_IMPLICITLY() { - return __USE_POSIX_IMPLICITLY; - } - - private static final int _POSIX_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _POSIX_SOURCE 1 - * } - */ - public static int _POSIX_SOURCE() { - return _POSIX_SOURCE; - } - - private static final int __USE_POSIX = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX 1 - * } - */ - public static int __USE_POSIX() { - return __USE_POSIX; - } - - private static final int __USE_POSIX2 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX2 1 - * } - */ - public static int __USE_POSIX2() { - return __USE_POSIX2; - } - - private static final int __USE_POSIX199309 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX199309 1 - * } - */ - public static int __USE_POSIX199309() { - return __USE_POSIX199309; - } - - private static final int __USE_POSIX199506 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX199506 1 - * } - */ - public static int __USE_POSIX199506() { - return __USE_POSIX199506; - } - - private static final int __USE_XOPEN2K = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_XOPEN2K 1 - * } - */ - public static int __USE_XOPEN2K() { - return __USE_XOPEN2K; - } - - private static final int __USE_XOPEN2K8 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_XOPEN2K8 1 - * } - */ - public static int __USE_XOPEN2K8() { - return __USE_XOPEN2K8; - } - - private static final int _ATFILE_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _ATFILE_SOURCE 1 - * } - */ - public static int _ATFILE_SOURCE() { - return _ATFILE_SOURCE; - } - - private static final int __WORDSIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - - private static final int __WORDSIZE_TIME64_COMPAT32 = (int) 1L; - - /** - * {@snippet lang = c : * #define __WORDSIZE_TIME64_COMPAT32 1 - * } - */ - public static int __WORDSIZE_TIME64_COMPAT32() { - return __WORDSIZE_TIME64_COMPAT32; - } - - private static final int __SYSCALL_WORDSIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __SYSCALL_WORDSIZE 64 - * } - */ - public static int __SYSCALL_WORDSIZE() { - return __SYSCALL_WORDSIZE; - } - - private static final int __USE_MISC = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_MISC 1 - * } - */ - public static int __USE_MISC() { - return __USE_MISC; - } - - private static final int __USE_ATFILE = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ATFILE 1 - * } - */ - public static int __USE_ATFILE() { - return __USE_ATFILE; - } - - private static final int __USE_FORTIFY_LEVEL = (int) 0L; - - /** - * {@snippet lang = c : * #define __USE_FORTIFY_LEVEL 0 - * } - */ - public static int __USE_FORTIFY_LEVEL() { - return __USE_FORTIFY_LEVEL; - } - - private static final int __GLIBC_USE_DEPRECATED_GETS = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_DEPRECATED_GETS 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_GETS() { - return __GLIBC_USE_DEPRECATED_GETS; - } - - private static final int __GLIBC_USE_DEPRECATED_SCANF = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_DEPRECATED_SCANF 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_SCANF() { - return __GLIBC_USE_DEPRECATED_SCANF; - } - - private static final int _STDC_PREDEF_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _STDC_PREDEF_H 1 - * } - */ - public static int _STDC_PREDEF_H() { - return _STDC_PREDEF_H; - } - - private static final int __STDC_IEC_559__ = (int) 1L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_559__ 1 - * } - */ - public static int __STDC_IEC_559__() { - return __STDC_IEC_559__; - } - - private static final int __STDC_IEC_559_COMPLEX__ = (int) 1L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_559_COMPLEX__ 1 - * } - */ - public static int __STDC_IEC_559_COMPLEX__() { - return __STDC_IEC_559_COMPLEX__; - } - - private static final int __GNU_LIBRARY__ = (int) 6L; - - /** - * {@snippet lang = c : * #define __GNU_LIBRARY__ 6 - * } - */ - public static int __GNU_LIBRARY__() { - return __GNU_LIBRARY__; - } - - private static final int __GLIBC__ = (int) 2L; - - /** - * {@snippet lang = c : * #define __GLIBC__ 2 - * } - */ - public static int __GLIBC__() { - return __GLIBC__; - } - - private static final int __GLIBC_MINOR__ = (int) 35L; - - /** - * {@snippet lang = c : * #define __GLIBC_MINOR__ 35 - * } - */ - public static int __GLIBC_MINOR__() { - return __GLIBC_MINOR__; - } - - private static final int _SYS_CDEFS_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _SYS_CDEFS_H 1 - * } - */ - public static int _SYS_CDEFS_H() { - return _SYS_CDEFS_H; - } - - private static final int __glibc_c99_flexarr_available = (int) 1L; - - /** - * {@snippet lang = c : * #define __glibc_c99_flexarr_available 1 - * } - */ - public static int __glibc_c99_flexarr_available() { - return __glibc_c99_flexarr_available; - } - - private static final int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = (int) 0L; - - /** - * {@snippet lang = c : * #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 - * } - */ - public static int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI() { - return __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI; - } - - private static final int __HAVE_GENERIC_SELECTION = (int) 1L; - - /** - * {@snippet lang = c : * #define __HAVE_GENERIC_SELECTION 1 - * } - */ - public static int __HAVE_GENERIC_SELECTION() { - return __HAVE_GENERIC_SELECTION; - } - - private static final int __GLIBC_USE_LIB_EXT2 = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_LIB_EXT2 0 - * } - */ - public static int __GLIBC_USE_LIB_EXT2() { - return __GLIBC_USE_LIB_EXT2; - } - - private static final int __GLIBC_USE_IEC_60559_BFP_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_BFP_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT() { - return __GLIBC_USE_IEC_60559_BFP_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_BFP_EXT_C2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT_C2X() { - return __GLIBC_USE_IEC_60559_BFP_EXT_C2X; - } - - private static final int __GLIBC_USE_IEC_60559_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_EXT() { - return __GLIBC_USE_IEC_60559_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X; - } - - private static final int __GLIBC_USE_IEC_60559_TYPES_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_TYPES_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_TYPES_EXT() { - return __GLIBC_USE_IEC_60559_TYPES_EXT; - } - - private static final int _BITS_TYPES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TYPES_H 1 - * } - */ - public static int _BITS_TYPES_H() { - return _BITS_TYPES_H; - } - - private static final int _BITS_TYPESIZES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TYPESIZES_H 1 - * } - */ - public static int _BITS_TYPESIZES_H() { - return _BITS_TYPESIZES_H; - } - - private static final int __OFF_T_MATCHES_OFF64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __OFF_T_MATCHES_OFF64_T 1 - * } - */ - public static int __OFF_T_MATCHES_OFF64_T() { - return __OFF_T_MATCHES_OFF64_T; - } - - private static final int __INO_T_MATCHES_INO64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __INO_T_MATCHES_INO64_T 1 - * } - */ - public static int __INO_T_MATCHES_INO64_T() { - return __INO_T_MATCHES_INO64_T; - } - - private static final int __RLIM_T_MATCHES_RLIM64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __RLIM_T_MATCHES_RLIM64_T 1 - * } - */ - public static int __RLIM_T_MATCHES_RLIM64_T() { - return __RLIM_T_MATCHES_RLIM64_T; - } - - private static final int __STATFS_MATCHES_STATFS64 = (int) 1L; - - /** - * {@snippet lang = c : * #define __STATFS_MATCHES_STATFS64 1 - * } - */ - public static int __STATFS_MATCHES_STATFS64() { - return __STATFS_MATCHES_STATFS64; - } - - private static final int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = (int) 1L; - - /** - * {@snippet lang = c : * #define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 - * } - */ - public static int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64() { - return __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64; - } - - private static final int __FD_SETSIZE = (int) 1024L; - - /** - * {@snippet lang = c : * #define __FD_SETSIZE 1024 - * } - */ - public static int __FD_SETSIZE() { - return __FD_SETSIZE; - } - - private static final int _BITS_TIME64_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TIME64_H 1 - * } - */ - public static int _BITS_TIME64_H() { - return _BITS_TIME64_H; - } - - private static final int _BITS_WCHAR_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_WCHAR_H 1 - * } - */ - public static int _BITS_WCHAR_H() { - return _BITS_WCHAR_H; - } - - private static final int _BITS_STDINT_INTN_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_STDINT_INTN_H 1 - * } - */ - public static int _BITS_STDINT_INTN_H() { - return _BITS_STDINT_INTN_H; - } - - private static final int _BITS_STDINT_UINTN_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_STDINT_UINTN_H 1 - * } - */ - public static int _BITS_STDINT_UINTN_H() { - return _BITS_STDINT_UINTN_H; - } - - private static final int true_ = (int) 1L; - - /** - * {@snippet lang = c : * #define true 1 - * } - */ - public static int true_() { - return true_; - } - - private static final int false_ = (int) 0L; - - /** - * {@snippet lang = c : * #define false 0 - * } - */ - public static int false_() { - return false_; - } - - private static final int __bool_true_false_are_defined = (int) 1L; - - /** - * {@snippet lang = c : * #define __bool_true_false_are_defined 1 - * } - */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } - - private static final int L2Expanded = (int) 0L; - - /** - * {@snippet lang = c : * enum .L2Expanded = 0 - * } - */ - public static int L2Expanded() { - return L2Expanded; - } - - private static final int L2SqrtExpanded = (int) 1L; - - /** - * {@snippet lang = c : * enum .L2SqrtExpanded = 1 - * } - */ - public static int L2SqrtExpanded() { - return L2SqrtExpanded; - } - - private static final int CosineExpanded = (int) 2L; - - /** - * {@snippet lang = c : * enum .CosineExpanded = 2 - * } - */ - public static int CosineExpanded() { - return CosineExpanded; - } - - private static final int L1 = (int) 3L; - - /** - * {@snippet lang = c : * enum .L1 = 3 - * } - */ - public static int L1() { - return L1; - } - - private static final int L2Unexpanded = (int) 4L; - - /** - * {@snippet lang = c : * enum .L2Unexpanded = 4 - * } - */ - public static int L2Unexpanded() { - return L2Unexpanded; - } - - private static final int L2SqrtUnexpanded = (int) 5L; - - /** - * {@snippet lang = c : * enum .L2SqrtUnexpanded = 5 - * } - */ - public static int L2SqrtUnexpanded() { - return L2SqrtUnexpanded; - } - - private static final int InnerProduct = (int) 6L; - - /** - * {@snippet lang = c : * enum .InnerProduct = 6 - * } - */ - public static int InnerProduct() { - return InnerProduct; - } - - private static final int Linf = (int) 7L; - - /** - * {@snippet lang = c : * enum .Linf = 7 - * } - */ - public static int Linf() { - return Linf; - } - - private static final int Canberra = (int) 8L; - - /** - * {@snippet lang = c : * enum .Canberra = 8 - * } - */ - public static int Canberra() { - return Canberra; - } - - private static final int LpUnexpanded = (int) 9L; - - /** - * {@snippet lang = c : * enum .LpUnexpanded = 9 - * } - */ - public static int LpUnexpanded() { - return LpUnexpanded; - } - - private static final int CorrelationExpanded = (int) 10L; - - /** - * {@snippet lang = c : * enum .CorrelationExpanded = 10 - * } - */ - public static int CorrelationExpanded() { - return CorrelationExpanded; - } - - private static final int JaccardExpanded = (int) 11L; - - /** - * {@snippet lang = c : * enum .JaccardExpanded = 11 - * } - */ - public static int JaccardExpanded() { - return JaccardExpanded; - } - - private static final int HellingerExpanded = (int) 12L; - - /** - * {@snippet lang = c : * enum .HellingerExpanded = 12 - * } - */ - public static int HellingerExpanded() { - return HellingerExpanded; - } - - private static final int Haversine = (int) 13L; - - /** - * {@snippet lang = c : * enum .Haversine = 13 - * } - */ - public static int Haversine() { - return Haversine; - } - - private static final int BrayCurtis = (int) 14L; - - /** - * {@snippet lang = c : * enum .BrayCurtis = 14 - * } - */ - public static int BrayCurtis() { - return BrayCurtis; - } - - private static final int JensenShannon = (int) 15L; - - /** - * {@snippet lang = c : * enum .JensenShannon = 15 - * } - */ - public static int JensenShannon() { - return JensenShannon; - } - - private static final int HammingUnexpanded = (int) 16L; - - /** - * {@snippet lang = c : * enum .HammingUnexpanded = 16 - * } - */ - public static int HammingUnexpanded() { - return HammingUnexpanded; - } - - private static final int KLDivergence = (int) 17L; - - /** - * {@snippet lang = c : * enum .KLDivergence = 17 - * } - */ - public static int KLDivergence() { - return KLDivergence; - } - - private static final int RusselRaoExpanded = (int) 18L; - - /** - * {@snippet lang = c : * enum .RusselRaoExpanded = 18 - * } - */ - public static int RusselRaoExpanded() { - return RusselRaoExpanded; - } - - private static final int DiceExpanded = (int) 19L; - - /** - * {@snippet lang = c : * enum .DiceExpanded = 19 - * } - */ - public static int DiceExpanded() { - return DiceExpanded; - } - - private static final int Precomputed = (int) 100L; - - /** - * {@snippet lang = c : * enum .Precomputed = 100 - * } - */ - public static int Precomputed() { - return Precomputed; - } - - /** - * {@snippet lang = c : * typedef unsigned char __u_char - * } - */ - public static final OfByte __u_char = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned short __u_short - * } - */ - public static final OfShort __u_short = CagraH.C_SHORT; - /** - * {@snippet lang = c : * typedef unsigned int __u_int - * } - */ - public static final OfInt __u_int = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __u_long - * } - */ - public static final OfLong __u_long = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef signed char __int8_t - * } - */ - public static final OfByte __int8_t = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned char __uint8_t - * } - */ - public static final OfByte __uint8_t = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef short __int16_t - * } - */ - public static final OfShort __int16_t = CagraH.C_SHORT; - /** - * {@snippet lang = c : * typedef unsigned short __uint16_t - * } - */ - public static final OfShort __uint16_t = CagraH.C_SHORT; - /** - * {@snippet lang = c : * typedef int __int32_t - * } - */ - public static final OfInt __int32_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned int __uint32_t - * } - */ - public static final OfInt __uint32_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef long __int64_t - * } - */ - public static final OfLong __int64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __uint64_t - * } - */ - public static final OfLong __uint64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef __int8_t __int_least8_t - * } - */ - public static final OfByte __int_least8_t = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint8_t __uint_least8_t - * } - */ - public static final OfByte __uint_least8_t = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int16_t __int_least16_t - * } - */ - public static final OfShort __int_least16_t = CagraH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint16_t __uint_least16_t - * } - */ - public static final OfShort __uint_least16_t = CagraH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int32_t __int_least32_t - * } - */ - public static final OfInt __int_least32_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef __uint32_t __uint_least32_t - * } - */ - public static final OfInt __uint_least32_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef __int64_t __int_least64_t - * } - */ - public static final OfLong __int_least64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint64_t __uint_least64_t - * } - */ - public static final OfLong __uint_least64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long __quad_t - * } - */ - public static final OfLong __quad_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __u_quad_t - * } - */ - public static final OfLong __u_quad_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long __intmax_t - * } - */ - public static final OfLong __intmax_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __uintmax_t - * } - */ - public static final OfLong __uintmax_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __dev_t - * } - */ - public static final OfLong __dev_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __uid_t - * } - */ - public static final OfInt __uid_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned int __gid_t - * } - */ - public static final OfInt __gid_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __ino_t - * } - */ - public static final OfLong __ino_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __ino64_t - * } - */ - public static final OfLong __ino64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __mode_t - * } - */ - public static final OfInt __mode_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __nlink_t - * } - */ - public static final OfLong __nlink_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long __off_t - * } - */ - public static final OfLong __off_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long __off64_t - * } - */ - public static final OfLong __off64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef int __pid_t - * } - */ - public static final OfInt __pid_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef long __clock_t - * } - */ - public static final OfLong __clock_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __rlim_t - * } - */ - public static final OfLong __rlim_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __rlim64_t - * } - */ - public static final OfLong __rlim64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __id_t - * } - */ - public static final OfInt __id_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef long __time_t - * } - */ - public static final OfLong __time_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __useconds_t - * } - */ - public static final OfInt __useconds_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef long __suseconds_t - * } - */ - public static final OfLong __suseconds_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long __suseconds64_t - * } - */ - public static final OfLong __suseconds64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef int __daddr_t - * } - */ - public static final OfInt __daddr_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef int __key_t - * } - */ - public static final OfInt __key_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef int __clockid_t - * } - */ - public static final OfInt __clockid_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef void *__timer_t - * } - */ - public static final AddressLayout __timer_t = CagraH.C_POINTER; - /** - * {@snippet lang = c : * typedef long __blksize_t - * } - */ - public static final OfLong __blksize_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long __blkcnt_t - * } - */ - public static final OfLong __blkcnt_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long __blkcnt64_t - * } - */ - public static final OfLong __blkcnt64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsblkcnt_t - * } - */ - public static final OfLong __fsblkcnt_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsblkcnt64_t - * } - */ - public static final OfLong __fsblkcnt64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsfilcnt_t - * } - */ - public static final OfLong __fsfilcnt_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsfilcnt64_t - * } - */ - public static final OfLong __fsfilcnt64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long __fsword_t - * } - */ - public static final OfLong __fsword_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long __ssize_t - * } - */ - public static final OfLong __ssize_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long __syscall_slong_t - * } - */ - public static final OfLong __syscall_slong_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __syscall_ulong_t - * } - */ - public static final OfLong __syscall_ulong_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef __off64_t __loff_t - * } - */ - public static final OfLong __loff_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef char *__caddr_t - * } - */ - public static final AddressLayout __caddr_t = CagraH.C_POINTER; - /** - * {@snippet lang = c : * typedef long __intptr_t - * } - */ - public static final OfLong __intptr_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __socklen_t - * } - */ - public static final OfInt __socklen_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef int __sig_atomic_t - * } - */ - public static final OfInt __sig_atomic_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef __int8_t int8_t - * } - */ - public static final OfByte int8_t = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int16_t int16_t - * } - */ - public static final OfShort int16_t = CagraH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int32_t int32_t - * } - */ - public static final OfInt int32_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef __int64_t int64_t - * } - */ - public static final OfLong int64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint8_t uint8_t - * } - */ - public static final OfByte uint8_t = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint16_t uint16_t - * } - */ - public static final OfShort uint16_t = CagraH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint32_t uint32_t - * } - */ - public static final OfInt uint32_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef __uint64_t uint64_t - * } - */ - public static final OfLong uint64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef __int_least8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int_least16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = CagraH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int_least32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef __int_least64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint_least8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint_least16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = CagraH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint_least32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = CagraH.C_INT; - /** - * {@snippet lang = c : * typedef __uint_least64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef signed char int_fast8_t - * } - */ - public static final OfByte int_fast8_t = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef long int_fast16_t - * } - */ - public static final OfLong int_fast16_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long int_fast32_t - * } - */ - public static final OfLong int_fast32_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long int_fast64_t - * } - */ - public static final OfLong int_fast64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned char uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = CagraH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast16_t - * } - */ - public static final OfLong uint_fast16_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast32_t - * } - */ - public static final OfLong uint_fast32_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long intptr_t - * } - */ - public static final OfLong intptr_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uintptr_t - * } - */ - public static final OfLong uintptr_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef __intmax_t intmax_t - * } - */ - public static final OfLong intmax_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef __uintmax_t uintmax_t - * } - */ - public static final OfLong uintmax_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long size_t - * } - */ - public static final OfLong size_t = CagraH.C_LONG; - /** - * {@snippet lang = c : * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = CagraH.C_INT; - private static final int kDLCPU = (int) 1L; - - /** - * {@snippet lang = c : * enum .kDLCPU = 1 - * } - */ - public static int kDLCPU() { - return kDLCPU; - } - - private static final int kDLCUDA = (int) 2L; - - /** - * {@snippet lang = c : * enum .kDLCUDA = 2 - * } - */ - public static int kDLCUDA() { - return kDLCUDA; - } - - private static final int kDLCUDAHost = (int) 3L; - - /** - * {@snippet lang = c : * enum .kDLCUDAHost = 3 - * } - */ - public static int kDLCUDAHost() { - return kDLCUDAHost; - } - - private static final int kDLOpenCL = (int) 4L; - - /** - * {@snippet lang = c : * enum .kDLOpenCL = 4 - * } - */ - public static int kDLOpenCL() { - return kDLOpenCL; - } - - private static final int kDLVulkan = (int) 7L; - - /** - * {@snippet lang = c : * enum .kDLVulkan = 7 - * } - */ - public static int kDLVulkan() { - return kDLVulkan; - } - - private static final int kDLMetal = (int) 8L; - - /** - * {@snippet lang = c : * enum .kDLMetal = 8 - * } - */ - public static int kDLMetal() { - return kDLMetal; - } - - private static final int kDLVPI = (int) 9L; - - /** - * {@snippet lang = c : * enum .kDLVPI = 9 - * } - */ - public static int kDLVPI() { - return kDLVPI; - } - - private static final int kDLROCM = (int) 10L; - - /** - * {@snippet lang = c : * enum .kDLROCM = 10 - * } - */ - public static int kDLROCM() { - return kDLROCM; - } - - private static final int kDLROCMHost = (int) 11L; - - /** - * {@snippet lang = c : * enum .kDLROCMHost = 11 - * } - */ - public static int kDLROCMHost() { - return kDLROCMHost; - } - - private static final int kDLExtDev = (int) 12L; - - /** - * {@snippet lang = c : * enum .kDLExtDev = 12 - * } - */ - public static int kDLExtDev() { - return kDLExtDev; - } - - private static final int kDLCUDAManaged = (int) 13L; - - /** - * {@snippet lang = c : * enum .kDLCUDAManaged = 13 - * } - */ - public static int kDLCUDAManaged() { - return kDLCUDAManaged; - } - - private static final int kDLOneAPI = (int) 14L; - - /** - * {@snippet lang = c : * enum .kDLOneAPI = 14 - * } - */ - public static int kDLOneAPI() { - return kDLOneAPI; - } - - private static final int kDLWebGPU = (int) 15L; - - /** - * {@snippet lang = c : * enum .kDLWebGPU = 15 - * } - */ - public static int kDLWebGPU() { - return kDLWebGPU; - } - - private static final int kDLHexagon = (int) 16L; - - /** - * {@snippet lang = c : * enum .kDLHexagon = 16 - * } - */ - public static int kDLHexagon() { - return kDLHexagon; - } - - private static final int kDLInt = (int) 0L; - - /** - * {@snippet lang = c : * enum .kDLInt = 0 - * } - */ - public static int kDLInt() { - return kDLInt; - } - - private static final int kDLUInt = (int) 1L; - - /** - * {@snippet lang = c : * enum .kDLUInt = 1 - * } - */ - public static int kDLUInt() { - return kDLUInt; - } - - private static final int kDLFloat = (int) 2L; - - /** - * {@snippet lang = c : * enum .kDLFloat = 2 - * } - */ - public static int kDLFloat() { - return kDLFloat; - } - - private static final int kDLOpaqueHandle = (int) 3L; - - /** - * {@snippet lang = c : * enum .kDLOpaqueHandle = 3 - * } - */ - public static int kDLOpaqueHandle() { - return kDLOpaqueHandle; - } - - private static final int kDLBfloat = (int) 4L; - - /** - * {@snippet lang = c : * enum .kDLBfloat = 4 - * } - */ - public static int kDLBfloat() { - return kDLBfloat; - } - - private static final int kDLComplex = (int) 5L; - - /** - * {@snippet lang = c : * enum .kDLComplex = 5 - * } - */ - public static int kDLComplex() { - return kDLComplex; - } - - private static final int kDLBool = (int) 6L; - - /** - * {@snippet lang = c : * enum .kDLBool = 6 - * } - */ - public static int kDLBool() { - return kDLBool; - } - - private static final int AUTO_SELECT = (int) 0L; - - /** - * {@snippet lang = c : * enum cuvsCagraGraphBuildAlgo.AUTO_SELECT = 0 - * } - */ - public static int AUTO_SELECT() { - return AUTO_SELECT; - } - - private static final int IVF_PQ = (int) 1L; - - /** - * {@snippet lang = c : * enum cuvsCagraGraphBuildAlgo.IVF_PQ = 1 - * } - */ - public static int IVF_PQ() { - return IVF_PQ; - } - - private static final int NN_DESCENT = (int) 2L; - - /** - * {@snippet lang = c : * enum cuvsCagraGraphBuildAlgo.NN_DESCENT = 2 - * } - */ - public static int NN_DESCENT() { - return NN_DESCENT; - } - - /** - * {@snippet lang = c : - * typedef struct cuvsCagraCompressionParams { - * uint32_t pq_bits; - * uint32_t pq_dim; - * uint32_t vq_n_centers; - * uint32_t kmeans_n_iters; - * double vq_kmeans_trainset_fraction; - * double pq_kmeans_trainset_fraction; - * } *cuvsCagraCompressionParams_t - * } - */ - public static final AddressLayout cuvsCagraCompressionParams_t = CagraH.C_POINTER; - /** - * {@snippet lang = c : - * typedef struct cuvsCagraIndexParams { - * cuvsDistanceType metric; - * long intermediate_graph_degree; - * long graph_degree; - * enum cuvsCagraGraphBuildAlgo build_algo; - * long nn_descent_niter; - * cuvsCagraCompressionParams_t compression; - * } *cuvsCagraIndexParams_t - * } - */ - public static final AddressLayout cuvsCagraIndexParams_t = CagraH.C_POINTER; - private static final int SINGLE_CTA = (int) 0L; - - /** - * {@snippet lang = c : * enum cuvsCagraSearchAlgo.SINGLE_CTA = 0 - * } - */ - public static int SINGLE_CTA() { - return SINGLE_CTA; - } - - private static final int MULTI_CTA = (int) 1L; - - /** - * {@snippet lang = c : * enum cuvsCagraSearchAlgo.MULTI_CTA = 1 - * } - */ - public static int MULTI_CTA() { - return MULTI_CTA; - } - - private static final int MULTI_KERNEL = (int) 2L; - - /** - * {@snippet lang = c : * enum cuvsCagraSearchAlgo.MULTI_KERNEL = 2 - * } - */ - public static int MULTI_KERNEL() { - return MULTI_KERNEL; - } - - private static final int AUTO = (int) 3L; - - /** - * {@snippet lang = c : * enum cuvsCagraSearchAlgo.AUTO = 3 - * } - */ - public static int AUTO() { - return AUTO; - } - - private static final int HASH = (int) 0L; - - /** - * {@snippet lang = c : * enum cuvsCagraHashMode.HASH = 0 - * } - */ - public static int HASH() { - return HASH; - } - - private static final int SMALL = (int) 1L; - - /** - * {@snippet lang = c : * enum cuvsCagraHashMode.SMALL = 1 - * } - */ - public static int SMALL() { - return SMALL; - } - - private static final int AUTO_HASH = (int) 2L; - - /** - * {@snippet lang = c : * enum cuvsCagraHashMode.AUTO_HASH = 2 - * } - */ - public static int AUTO_HASH() { - return AUTO_HASH; - } - - /** - * {@snippet lang = c : - * typedef struct cuvsCagraSearchParams { - * long max_queries; - * long itopk_size; - * long max_iterations; - * enum cuvsCagraSearchAlgo algo; - * long team_size; - * long search_width; - * long min_iterations; - * long thread_block_size; - * enum cuvsCagraHashMode hashmap_mode; - * long hashmap_min_bitlen; - * float hashmap_max_fill_rate; - * uint32_t num_random_samplings; - * uint64_t rand_xor_mask; - * } *cuvsCagraSearchParams_t - * } - */ - public static final AddressLayout cuvsCagraSearchParams_t = CagraH.C_POINTER; - /** - * {@snippet lang = c : * typedef cuvsCagraIndex *cuvsCagraIndex_t - * } - */ - public static final AddressLayout cuvsCagraIndex_t = CagraH.C_POINTER; - private static final long _POSIX_C_SOURCE = 200809L; - - /** - * {@snippet lang = c : * #define _POSIX_C_SOURCE 200809 - * } - */ - public static long _POSIX_C_SOURCE() { - return _POSIX_C_SOURCE; - } - - private static final int __TIMESIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __TIMESIZE 64 - * } - */ - public static int __TIMESIZE() { - return __TIMESIZE; - } - - private static final long __STDC_IEC_60559_BFP__ = 201404L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_60559_BFP__ 201404 - * } - */ - public static long __STDC_IEC_60559_BFP__() { - return __STDC_IEC_60559_BFP__; - } - - private static final long __STDC_IEC_60559_COMPLEX__ = 201404L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_60559_COMPLEX__ 201404 - * } - */ - public static long __STDC_IEC_60559_COMPLEX__() { - return __STDC_IEC_60559_COMPLEX__; - } - - private static final long __STDC_ISO_10646__ = 201706L; - - /** - * {@snippet lang = c : * #define __STDC_ISO_10646__ 201706 - * } - */ - public static long __STDC_ISO_10646__() { - return __STDC_ISO_10646__; - } - - private static final int __WCHAR_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define __WCHAR_MAX 2147483647 - * } - */ - public static int __WCHAR_MAX() { - return __WCHAR_MAX; - } - - private static final int __WCHAR_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define __WCHAR_MIN -2147483648 - * } - */ - public static int __WCHAR_MIN() { - return __WCHAR_MIN; - } - - private static final int INT8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT8_MIN -128 - * } - */ - public static int INT8_MIN() { - return INT8_MIN; - } - - private static final int INT16_MIN = (int) -32768L; - - /** - * {@snippet lang = c : * #define INT16_MIN -32768 - * } - */ - public static int INT16_MIN() { - return INT16_MIN; - } - - private static final int INT32_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define INT32_MIN -2147483648 - * } - */ - public static int INT32_MIN() { - return INT32_MIN; - } - - private static final long INT64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT64_MIN -9223372036854775808 - * } - */ - public static long INT64_MIN() { - return INT64_MIN; - } - - private static final int INT8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT8_MAX 127 - * } - */ - public static int INT8_MAX() { - return INT8_MAX; - } - - private static final int INT16_MAX = (int) 32767L; - - /** - * {@snippet lang = c : * #define INT16_MAX 32767 - * } - */ - public static int INT16_MAX() { - return INT16_MAX; - } - - private static final int INT32_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define INT32_MAX 2147483647 - * } - */ - public static int INT32_MAX() { - return INT32_MAX; - } - - private static final long INT64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT64_MAX 9223372036854775807 - * } - */ - public static long INT64_MAX() { - return INT64_MAX; - } - - private static final int UINT8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT8_MAX 255 - * } - */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - - private static final int UINT16_MAX = (int) 65535L; - - /** - * {@snippet lang = c : * #define UINT16_MAX 65535 - * } - */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - - private static final int UINT32_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define UINT32_MAX 4294967295 - * } - */ - public static int UINT32_MAX() { - return UINT32_MAX; - } - - private static final long UINT64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT64_MAX -1 - * } - */ - public static long UINT64_MAX() { - return UINT64_MAX; - } - - private static final int INT_LEAST8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT_LEAST8_MIN -128 - * } - */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; - } - - private static final int INT_LEAST16_MIN = (int) -32768L; - - /** - * {@snippet lang = c : * #define INT_LEAST16_MIN -32768 - * } - */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; - } - - private static final int INT_LEAST32_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define INT_LEAST32_MIN -2147483648 - * } - */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; - } - - private static final long INT_LEAST64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_LEAST64_MIN -9223372036854775808 - * } - */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; - } - - private static final int INT_LEAST8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT_LEAST8_MAX 127 - * } - */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; - } - - private static final int INT_LEAST16_MAX = (int) 32767L; - - /** - * {@snippet lang = c : * #define INT_LEAST16_MAX 32767 - * } - */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; - } - - private static final int INT_LEAST32_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define INT_LEAST32_MAX 2147483647 - * } - */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; - } - - private static final long INT_LEAST64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_LEAST64_MAX 9223372036854775807 - * } - */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; - } - - private static final int UINT_LEAST8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT_LEAST8_MAX 255 - * } - */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; - } - - private static final int UINT_LEAST16_MAX = (int) 65535L; - - /** - * {@snippet lang = c : * #define UINT_LEAST16_MAX 65535 - * } - */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; - } - - private static final int UINT_LEAST32_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define UINT_LEAST32_MAX 4294967295 - * } - */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; - } - - private static final long UINT_LEAST64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_LEAST64_MAX -1 - * } - */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; - } - - private static final int INT_FAST8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT_FAST8_MIN -128 - * } - */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; - } - - private static final long INT_FAST16_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST16_MIN -9223372036854775808 - * } - */ - public static long INT_FAST16_MIN() { - return INT_FAST16_MIN; - } - - private static final long INT_FAST32_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST32_MIN -9223372036854775808 - * } - */ - public static long INT_FAST32_MIN() { - return INT_FAST32_MIN; - } - - private static final long INT_FAST64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST64_MIN -9223372036854775808 - * } - */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; - } - - private static final int INT_FAST8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT_FAST8_MAX 127 - * } - */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; - } - - private static final long INT_FAST16_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST16_MAX 9223372036854775807 - * } - */ - public static long INT_FAST16_MAX() { - return INT_FAST16_MAX; - } - - private static final long INT_FAST32_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST32_MAX 9223372036854775807 - * } - */ - public static long INT_FAST32_MAX() { - return INT_FAST32_MAX; - } - - private static final long INT_FAST64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST64_MAX 9223372036854775807 - * } - */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; - } - - private static final int UINT_FAST8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT_FAST8_MAX 255 - * } - */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; - } - - private static final long UINT_FAST16_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST16_MAX -1 - * } - */ - public static long UINT_FAST16_MAX() { - return UINT_FAST16_MAX; - } - - private static final long UINT_FAST32_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST32_MAX -1 - * } - */ - public static long UINT_FAST32_MAX() { - return UINT_FAST32_MAX; - } - - private static final long UINT_FAST64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST64_MAX -1 - * } - */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; - } - - private static final long INTPTR_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INTPTR_MIN -9223372036854775808 - * } - */ - public static long INTPTR_MIN() { - return INTPTR_MIN; - } - - private static final long INTPTR_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INTPTR_MAX 9223372036854775807 - * } - */ - public static long INTPTR_MAX() { - return INTPTR_MAX; - } - - private static final long UINTPTR_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINTPTR_MAX -1 - * } - */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; - } - - private static final long INTMAX_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INTMAX_MIN -9223372036854775808 - * } - */ - public static long INTMAX_MIN() { - return INTMAX_MIN; - } - - private static final long INTMAX_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INTMAX_MAX 9223372036854775807 - * } - */ - public static long INTMAX_MAX() { - return INTMAX_MAX; - } - - private static final long UINTMAX_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINTMAX_MAX -1 - * } - */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; - } - - private static final long PTRDIFF_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define PTRDIFF_MIN -9223372036854775808 - * } - */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; - } - - private static final long PTRDIFF_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define PTRDIFF_MAX 9223372036854775807 - * } - */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; - } - - private static final int SIG_ATOMIC_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define SIG_ATOMIC_MIN -2147483648 - * } - */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; - } - - private static final int SIG_ATOMIC_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define SIG_ATOMIC_MAX 2147483647 - * } - */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; - } - - private static final long SIZE_MAX = -1L; - - /** - * {@snippet lang = c : * #define SIZE_MAX -1 - * } - */ - public static long SIZE_MAX() { - return SIZE_MAX; - } - - private static final int WCHAR_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define WCHAR_MIN -2147483648 - * } - */ - public static int WCHAR_MIN() { - return WCHAR_MIN; - } - - private static final int WCHAR_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define WCHAR_MAX 2147483647 - * } - */ - public static int WCHAR_MAX() { - return WCHAR_MAX; - } - - private static final int WINT_MIN = (int) 0L; - - /** - * {@snippet lang = c : * #define WINT_MIN 0 - * } - */ - public static int WINT_MIN() { - return WINT_MIN; - } - - private static final int WINT_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define WINT_MAX 4294967295 - * } - */ - public static int WINT_MAX() { - return WINT_MAX; - } - - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); - - /** - * {@snippet lang = c : * #define NULL (void*) 0 - * } - */ - public static MemorySegment NULL() { - return NULL; - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSBruteForceIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSBruteForceIndex.java deleted file mode 100644 index 0a1ac29e22..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSBruteForceIndex.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; - -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfLong; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct { - * uintptr_t addr; - * DLDataType dtype; - * } - * } - */ -public class CuVSBruteForceIndex { - - CuVSBruteForceIndex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(BruteForceH.C_LONG.withName("addr"), - DLDataType.layout().withName("dtype"), MemoryLayout.paddingLayout(4)).withName("$anon$22:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong addr$LAYOUT = (OfLong) $LAYOUT.select(groupElement("addr")); - - /** - * Layout for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static final OfLong addr$layout() { - return addr$LAYOUT; - } - - private static final long addr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static final long addr$offset() { - return addr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static long addr(MemorySegment struct) { - return struct.get(addr$LAYOUT, addr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static void addr(MemorySegment struct, long fieldValue) { - struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); - } - - private static final GroupLayout dtype$LAYOUT = (GroupLayout) $LAYOUT.select(groupElement("dtype")); - - /** - * Layout for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static final GroupLayout dtype$layout() { - return dtype$LAYOUT; - } - - private static final long dtype$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static final long dtype$offset() { - return dtype$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static MemorySegment dtype(MemorySegment struct) { - return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static void dtype(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraCompressionParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraCompressionParams.java deleted file mode 100644 index 923287fe40..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraCompressionParams.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; - -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfDouble; -import java.lang.foreign.ValueLayout.OfInt; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct cuvsCagraCompressionParams { - * uint32_t pq_bits; - * uint32_t pq_dim; - * uint32_t vq_n_centers; - * uint32_t kmeans_n_iters; - * double vq_kmeans_trainset_fraction; - * double pq_kmeans_trainset_fraction; - * } - * } - */ -public class CuVSCagraCompressionParams { - - CuVSCagraCompressionParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(CagraH.C_INT.withName("pq_bits"), - CagraH.C_INT.withName("pq_dim"), CagraH.C_INT.withName("vq_n_centers"), - CagraH.C_INT.withName("kmeans_n_iters"), CagraH.C_DOUBLE.withName("vq_kmeans_trainset_fraction"), - CagraH.C_DOUBLE.withName("pq_kmeans_trainset_fraction")).withName("cuvsCagraCompressionParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt pq_bits$LAYOUT = (OfInt) $LAYOUT.select(groupElement("pq_bits")); - - /** - * Layout for field: - * {@snippet lang = c : * uint32_t pq_bits - * } - */ - public static final OfInt pq_bits$layout() { - return pq_bits$LAYOUT; - } - - private static final long pq_bits$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * uint32_t pq_bits - * } - */ - public static final long pq_bits$offset() { - return pq_bits$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * uint32_t pq_bits - * } - */ - public static int pq_bits(MemorySegment struct) { - return struct.get(pq_bits$LAYOUT, pq_bits$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * uint32_t pq_bits - * } - */ - public static void pq_bits(MemorySegment struct, int fieldValue) { - struct.set(pq_bits$LAYOUT, pq_bits$OFFSET, fieldValue); - } - - private static final OfInt pq_dim$LAYOUT = (OfInt) $LAYOUT.select(groupElement("pq_dim")); - - /** - * Layout for field: - * {@snippet lang = c : * uint32_t pq_dim - * } - */ - public static final OfInt pq_dim$layout() { - return pq_dim$LAYOUT; - } - - private static final long pq_dim$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang = c : * uint32_t pq_dim - * } - */ - public static final long pq_dim$offset() { - return pq_dim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * uint32_t pq_dim - * } - */ - public static int pq_dim(MemorySegment struct) { - return struct.get(pq_dim$LAYOUT, pq_dim$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * uint32_t pq_dim - * } - */ - public static void pq_dim(MemorySegment struct, int fieldValue) { - struct.set(pq_dim$LAYOUT, pq_dim$OFFSET, fieldValue); - } - - private static final OfInt vq_n_centers$LAYOUT = (OfInt) $LAYOUT.select(groupElement("vq_n_centers")); - - /** - * Layout for field: - * {@snippet lang = c : * uint32_t vq_n_centers - * } - */ - public static final OfInt vq_n_centers$layout() { - return vq_n_centers$LAYOUT; - } - - private static final long vq_n_centers$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang = c : * uint32_t vq_n_centers - * } - */ - public static final long vq_n_centers$offset() { - return vq_n_centers$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * uint32_t vq_n_centers - * } - */ - public static int vq_n_centers(MemorySegment struct) { - return struct.get(vq_n_centers$LAYOUT, vq_n_centers$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * uint32_t vq_n_centers - * } - */ - public static void vq_n_centers(MemorySegment struct, int fieldValue) { - struct.set(vq_n_centers$LAYOUT, vq_n_centers$OFFSET, fieldValue); - } - - private static final OfInt kmeans_n_iters$LAYOUT = (OfInt) $LAYOUT.select(groupElement("kmeans_n_iters")); - - /** - * Layout for field: - * {@snippet lang = c : * uint32_t kmeans_n_iters - * } - */ - public static final OfInt kmeans_n_iters$layout() { - return kmeans_n_iters$LAYOUT; - } - - private static final long kmeans_n_iters$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang = c : * uint32_t kmeans_n_iters - * } - */ - public static final long kmeans_n_iters$offset() { - return kmeans_n_iters$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * uint32_t kmeans_n_iters - * } - */ - public static int kmeans_n_iters(MemorySegment struct) { - return struct.get(kmeans_n_iters$LAYOUT, kmeans_n_iters$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * uint32_t kmeans_n_iters - * } - */ - public static void kmeans_n_iters(MemorySegment struct, int fieldValue) { - struct.set(kmeans_n_iters$LAYOUT, kmeans_n_iters$OFFSET, fieldValue); - } - - private static final OfDouble vq_kmeans_trainset_fraction$LAYOUT = (OfDouble) $LAYOUT - .select(groupElement("vq_kmeans_trainset_fraction")); - - /** - * Layout for field: - * {@snippet lang = c : * double vq_kmeans_trainset_fraction - * } - */ - public static final OfDouble vq_kmeans_trainset_fraction$layout() { - return vq_kmeans_trainset_fraction$LAYOUT; - } - - private static final long vq_kmeans_trainset_fraction$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang = c : * double vq_kmeans_trainset_fraction - * } - */ - public static final long vq_kmeans_trainset_fraction$offset() { - return vq_kmeans_trainset_fraction$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * double vq_kmeans_trainset_fraction - * } - */ - public static double vq_kmeans_trainset_fraction(MemorySegment struct) { - return struct.get(vq_kmeans_trainset_fraction$LAYOUT, vq_kmeans_trainset_fraction$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * double vq_kmeans_trainset_fraction - * } - */ - public static void vq_kmeans_trainset_fraction(MemorySegment struct, double fieldValue) { - struct.set(vq_kmeans_trainset_fraction$LAYOUT, vq_kmeans_trainset_fraction$OFFSET, fieldValue); - } - - private static final OfDouble pq_kmeans_trainset_fraction$LAYOUT = (OfDouble) $LAYOUT - .select(groupElement("pq_kmeans_trainset_fraction")); - - /** - * Layout for field: - * {@snippet lang = c : * double pq_kmeans_trainset_fraction - * } - */ - public static final OfDouble pq_kmeans_trainset_fraction$layout() { - return pq_kmeans_trainset_fraction$LAYOUT; - } - - private static final long pq_kmeans_trainset_fraction$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang = c : * double pq_kmeans_trainset_fraction - * } - */ - public static final long pq_kmeans_trainset_fraction$offset() { - return pq_kmeans_trainset_fraction$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * double pq_kmeans_trainset_fraction - * } - */ - public static double pq_kmeans_trainset_fraction(MemorySegment struct) { - return struct.get(pq_kmeans_trainset_fraction$LAYOUT, pq_kmeans_trainset_fraction$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * double pq_kmeans_trainset_fraction - * } - */ - public static void pq_kmeans_trainset_fraction(MemorySegment struct, double fieldValue) { - struct.set(pq_kmeans_trainset_fraction$LAYOUT, pq_kmeans_trainset_fraction$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraIndex.java deleted file mode 100644 index 7ea435ba0f..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraIndex.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; - -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfLong; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct { - * uintptr_t addr; - * DLDataType dtype; - * } - * } - */ -public class CuVSCagraIndex { - - CuVSCagraIndex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(CagraH.C_LONG.withName("addr"), - DLDataType.layout().withName("dtype"), MemoryLayout.paddingLayout(4)).withName("$anon$175:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong addr$LAYOUT = (OfLong) $LAYOUT.select(groupElement("addr")); - - /** - * Layout for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static final OfLong addr$layout() { - return addr$LAYOUT; - } - - private static final long addr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static final long addr$offset() { - return addr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static long addr(MemorySegment struct) { - return struct.get(addr$LAYOUT, addr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static void addr(MemorySegment struct, long fieldValue) { - struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); - } - - private static final GroupLayout dtype$LAYOUT = (GroupLayout) $LAYOUT.select(groupElement("dtype")); - - /** - * Layout for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static final GroupLayout dtype$layout() { - return dtype$LAYOUT; - } - - private static final long dtype$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static final long dtype$offset() { - return dtype$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static MemorySegment dtype(MemorySegment struct) { - return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static void dtype(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraIndexParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraIndexParams.java deleted file mode 100644 index ffe88effaf..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraIndexParams.java +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; - -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct cuvsCagraIndexParams { - * cuvsDistanceType metric; - * long intermediate_graph_degree; - * long graph_degree; - * enum cuvsCagraGraphBuildAlgo build_algo; - * long nn_descent_niter; - * cuvsCagraCompressionParams_t compression; - * } - * } - */ -public class CuVSCagraIndexParams { - - CuVSCagraIndexParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout - .structLayout(CagraH.C_INT.withName("metric"), MemoryLayout.paddingLayout(4), - CagraH.C_LONG.withName("intermediate_graph_degree"), CagraH.C_LONG.withName("graph_degree"), - CagraH.C_INT.withName("build_algo"), MemoryLayout.paddingLayout(4), - CagraH.C_LONG.withName("nn_descent_niter"), CagraH.C_POINTER.withName("compression")) - .withName("cuvsCagraIndexParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt metric$LAYOUT = (OfInt) $LAYOUT.select(groupElement("metric")); - - /** - * Layout for field: - * {@snippet lang = c : * cuvsDistanceType metric - * } - */ - public static final OfInt metric$layout() { - return metric$LAYOUT; - } - - private static final long metric$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * cuvsDistanceType metric - * } - */ - public static final long metric$offset() { - return metric$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * cuvsDistanceType metric - * } - */ - public static int metric(MemorySegment struct) { - return struct.get(metric$LAYOUT, metric$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * cuvsDistanceType metric - * } - */ - public static void metric(MemorySegment struct, int fieldValue) { - struct.set(metric$LAYOUT, metric$OFFSET, fieldValue); - } - - private static final OfLong intermediate_graph_degree$LAYOUT = (OfLong) $LAYOUT - .select(groupElement("intermediate_graph_degree")); - - /** - * Layout for field: - * {@snippet lang = c : * long intermediate_graph_degree - * } - */ - public static final OfLong intermediate_graph_degree$layout() { - return intermediate_graph_degree$LAYOUT; - } - - private static final long intermediate_graph_degree$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang = c : * long intermediate_graph_degree - * } - */ - public static final long intermediate_graph_degree$offset() { - return intermediate_graph_degree$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long intermediate_graph_degree - * } - */ - public static long intermediate_graph_degree(MemorySegment struct) { - return struct.get(intermediate_graph_degree$LAYOUT, intermediate_graph_degree$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long intermediate_graph_degree - * } - */ - public static void intermediate_graph_degree(MemorySegment struct, long fieldValue) { - struct.set(intermediate_graph_degree$LAYOUT, intermediate_graph_degree$OFFSET, fieldValue); - } - - private static final OfLong graph_degree$LAYOUT = (OfLong) $LAYOUT.select(groupElement("graph_degree")); - - /** - * Layout for field: - * {@snippet lang = c : * long graph_degree - * } - */ - public static final OfLong graph_degree$layout() { - return graph_degree$LAYOUT; - } - - private static final long graph_degree$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang = c : * long graph_degree - * } - */ - public static final long graph_degree$offset() { - return graph_degree$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long graph_degree - * } - */ - public static long graph_degree(MemorySegment struct) { - return struct.get(graph_degree$LAYOUT, graph_degree$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long graph_degree - * } - */ - public static void graph_degree(MemorySegment struct, long fieldValue) { - struct.set(graph_degree$LAYOUT, graph_degree$OFFSET, fieldValue); - } - - private static final OfInt build_algo$LAYOUT = (OfInt) $LAYOUT.select(groupElement("build_algo")); - - /** - * Layout for field: - * {@snippet lang = c : * enum cuvsCagraGraphBuildAlgo build_algo - * } - */ - public static final OfInt build_algo$layout() { - return build_algo$LAYOUT; - } - - private static final long build_algo$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang = c : * enum cuvsCagraGraphBuildAlgo build_algo - * } - */ - public static final long build_algo$offset() { - return build_algo$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * enum cuvsCagraGraphBuildAlgo build_algo - * } - */ - public static int build_algo(MemorySegment struct) { - return struct.get(build_algo$LAYOUT, build_algo$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * enum cuvsCagraGraphBuildAlgo build_algo - * } - */ - public static void build_algo(MemorySegment struct, int fieldValue) { - struct.set(build_algo$LAYOUT, build_algo$OFFSET, fieldValue); - } - - private static final OfLong nn_descent_niter$LAYOUT = (OfLong) $LAYOUT.select(groupElement("nn_descent_niter")); - - /** - * Layout for field: - * {@snippet lang = c : * long nn_descent_niter - * } - */ - public static final OfLong nn_descent_niter$layout() { - return nn_descent_niter$LAYOUT; - } - - private static final long nn_descent_niter$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang = c : * long nn_descent_niter - * } - */ - public static final long nn_descent_niter$offset() { - return nn_descent_niter$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long nn_descent_niter - * } - */ - public static long nn_descent_niter(MemorySegment struct) { - return struct.get(nn_descent_niter$LAYOUT, nn_descent_niter$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long nn_descent_niter - * } - */ - public static void nn_descent_niter(MemorySegment struct, long fieldValue) { - struct.set(nn_descent_niter$LAYOUT, nn_descent_niter$OFFSET, fieldValue); - } - - private static final AddressLayout compression$LAYOUT = (AddressLayout) $LAYOUT.select(groupElement("compression")); - - /** - * Layout for field: - * {@snippet lang = c : * cuvsCagraCompressionParams_t compression - * } - */ - public static final AddressLayout compression$layout() { - return compression$LAYOUT; - } - - private static final long compression$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang = c : * cuvsCagraCompressionParams_t compression - * } - */ - public static final long compression$offset() { - return compression$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * cuvsCagraCompressionParams_t compression - * } - */ - public static MemorySegment compression(MemorySegment struct) { - return struct.get(compression$LAYOUT, compression$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * cuvsCagraCompressionParams_t compression - * } - */ - public static void compression(MemorySegment struct, MemorySegment fieldValue) { - struct.set(compression$LAYOUT, compression$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraSearchParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraSearchParams.java deleted file mode 100644 index 2a1efbfd7f..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSCagraSearchParams.java +++ /dev/null @@ -1,644 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; - -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfFloat; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct cuvsCagraSearchParams { - * long max_queries; - * long itopk_size; - * long max_iterations; - * enum cuvsCagraSearchAlgo algo; - * long team_size; - * long search_width; - * long min_iterations; - * long thread_block_size; - * enum cuvsCagraHashMode hashmap_mode; - * long hashmap_min_bitlen; - * float hashmap_max_fill_rate; - * uint32_t num_random_samplings; - * uint64_t rand_xor_mask; - * } - * } - */ -public class CuVSCagraSearchParams { - - CuVSCagraSearchParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout - .structLayout(CagraH.C_LONG.withName("max_queries"), CagraH.C_LONG.withName("itopk_size"), - CagraH.C_LONG.withName("max_iterations"), CagraH.C_INT.withName("algo"), MemoryLayout.paddingLayout(4), - CagraH.C_LONG.withName("team_size"), CagraH.C_LONG.withName("search_width"), - CagraH.C_LONG.withName("min_iterations"), CagraH.C_LONG.withName("thread_block_size"), - CagraH.C_INT.withName("hashmap_mode"), MemoryLayout.paddingLayout(4), - CagraH.C_LONG.withName("hashmap_min_bitlen"), CagraH.C_FLOAT.withName("hashmap_max_fill_rate"), - CagraH.C_INT.withName("num_random_samplings"), CagraH.C_LONG.withName("rand_xor_mask")) - .withName("cuvsCagraSearchParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong max_queries$LAYOUT = (OfLong) $LAYOUT.select(groupElement("max_queries")); - - /** - * Layout for field: - * {@snippet lang = c : * long max_queries - * } - */ - public static final OfLong max_queries$layout() { - return max_queries$LAYOUT; - } - - private static final long max_queries$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * long max_queries - * } - */ - public static final long max_queries$offset() { - return max_queries$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long max_queries - * } - */ - public static long max_queries(MemorySegment struct) { - return struct.get(max_queries$LAYOUT, max_queries$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long max_queries - * } - */ - public static void max_queries(MemorySegment struct, long fieldValue) { - struct.set(max_queries$LAYOUT, max_queries$OFFSET, fieldValue); - } - - private static final OfLong itopk_size$LAYOUT = (OfLong) $LAYOUT.select(groupElement("itopk_size")); - - /** - * Layout for field: - * {@snippet lang = c : * long itopk_size - * } - */ - public static final OfLong itopk_size$layout() { - return itopk_size$LAYOUT; - } - - private static final long itopk_size$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang = c : * long itopk_size - * } - */ - public static final long itopk_size$offset() { - return itopk_size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long itopk_size - * } - */ - public static long itopk_size(MemorySegment struct) { - return struct.get(itopk_size$LAYOUT, itopk_size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long itopk_size - * } - */ - public static void itopk_size(MemorySegment struct, long fieldValue) { - struct.set(itopk_size$LAYOUT, itopk_size$OFFSET, fieldValue); - } - - private static final OfLong max_iterations$LAYOUT = (OfLong) $LAYOUT.select(groupElement("max_iterations")); - - /** - * Layout for field: - * {@snippet lang = c : * long max_iterations - * } - */ - public static final OfLong max_iterations$layout() { - return max_iterations$LAYOUT; - } - - private static final long max_iterations$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang = c : * long max_iterations - * } - */ - public static final long max_iterations$offset() { - return max_iterations$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long max_iterations - * } - */ - public static long max_iterations(MemorySegment struct) { - return struct.get(max_iterations$LAYOUT, max_iterations$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long max_iterations - * } - */ - public static void max_iterations(MemorySegment struct, long fieldValue) { - struct.set(max_iterations$LAYOUT, max_iterations$OFFSET, fieldValue); - } - - private static final OfInt algo$LAYOUT = (OfInt) $LAYOUT.select(groupElement("algo")); - - /** - * Layout for field: - * {@snippet lang = c : * enum cuvsCagraSearchAlgo algo - * } - */ - public static final OfInt algo$layout() { - return algo$LAYOUT; - } - - private static final long algo$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang = c : * enum cuvsCagraSearchAlgo algo - * } - */ - public static final long algo$offset() { - return algo$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * enum cuvsCagraSearchAlgo algo - * } - */ - public static int algo(MemorySegment struct) { - return struct.get(algo$LAYOUT, algo$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * enum cuvsCagraSearchAlgo algo - * } - */ - public static void algo(MemorySegment struct, int fieldValue) { - struct.set(algo$LAYOUT, algo$OFFSET, fieldValue); - } - - private static final OfLong team_size$LAYOUT = (OfLong) $LAYOUT.select(groupElement("team_size")); - - /** - * Layout for field: - * {@snippet lang = c : * long team_size - * } - */ - public static final OfLong team_size$layout() { - return team_size$LAYOUT; - } - - private static final long team_size$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang = c : * long team_size - * } - */ - public static final long team_size$offset() { - return team_size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long team_size - * } - */ - public static long team_size(MemorySegment struct) { - return struct.get(team_size$LAYOUT, team_size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long team_size - * } - */ - public static void team_size(MemorySegment struct, long fieldValue) { - struct.set(team_size$LAYOUT, team_size$OFFSET, fieldValue); - } - - private static final OfLong search_width$LAYOUT = (OfLong) $LAYOUT.select(groupElement("search_width")); - - /** - * Layout for field: - * {@snippet lang = c : * long search_width - * } - */ - public static final OfLong search_width$layout() { - return search_width$LAYOUT; - } - - private static final long search_width$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang = c : * long search_width - * } - */ - public static final long search_width$offset() { - return search_width$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long search_width - * } - */ - public static long search_width(MemorySegment struct) { - return struct.get(search_width$LAYOUT, search_width$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long search_width - * } - */ - public static void search_width(MemorySegment struct, long fieldValue) { - struct.set(search_width$LAYOUT, search_width$OFFSET, fieldValue); - } - - private static final OfLong min_iterations$LAYOUT = (OfLong) $LAYOUT.select(groupElement("min_iterations")); - - /** - * Layout for field: - * {@snippet lang = c : * long min_iterations - * } - */ - public static final OfLong min_iterations$layout() { - return min_iterations$LAYOUT; - } - - private static final long min_iterations$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang = c : * long min_iterations - * } - */ - public static final long min_iterations$offset() { - return min_iterations$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long min_iterations - * } - */ - public static long min_iterations(MemorySegment struct) { - return struct.get(min_iterations$LAYOUT, min_iterations$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long min_iterations - * } - */ - public static void min_iterations(MemorySegment struct, long fieldValue) { - struct.set(min_iterations$LAYOUT, min_iterations$OFFSET, fieldValue); - } - - private static final OfLong thread_block_size$LAYOUT = (OfLong) $LAYOUT.select(groupElement("thread_block_size")); - - /** - * Layout for field: - * {@snippet lang = c : * long thread_block_size - * } - */ - public static final OfLong thread_block_size$layout() { - return thread_block_size$LAYOUT; - } - - private static final long thread_block_size$OFFSET = 56; - - /** - * Offset for field: - * {@snippet lang = c : * long thread_block_size - * } - */ - public static final long thread_block_size$offset() { - return thread_block_size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long thread_block_size - * } - */ - public static long thread_block_size(MemorySegment struct) { - return struct.get(thread_block_size$LAYOUT, thread_block_size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long thread_block_size - * } - */ - public static void thread_block_size(MemorySegment struct, long fieldValue) { - struct.set(thread_block_size$LAYOUT, thread_block_size$OFFSET, fieldValue); - } - - private static final OfInt hashmap_mode$LAYOUT = (OfInt) $LAYOUT.select(groupElement("hashmap_mode")); - - /** - * Layout for field: - * {@snippet lang = c : * enum cuvsCagraHashMode hashmap_mode - * } - */ - public static final OfInt hashmap_mode$layout() { - return hashmap_mode$LAYOUT; - } - - private static final long hashmap_mode$OFFSET = 64; - - /** - * Offset for field: - * {@snippet lang = c : * enum cuvsCagraHashMode hashmap_mode - * } - */ - public static final long hashmap_mode$offset() { - return hashmap_mode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * enum cuvsCagraHashMode hashmap_mode - * } - */ - public static int hashmap_mode(MemorySegment struct) { - return struct.get(hashmap_mode$LAYOUT, hashmap_mode$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * enum cuvsCagraHashMode hashmap_mode - * } - */ - public static void hashmap_mode(MemorySegment struct, int fieldValue) { - struct.set(hashmap_mode$LAYOUT, hashmap_mode$OFFSET, fieldValue); - } - - private static final OfLong hashmap_min_bitlen$LAYOUT = (OfLong) $LAYOUT.select(groupElement("hashmap_min_bitlen")); - - /** - * Layout for field: - * {@snippet lang = c : * long hashmap_min_bitlen - * } - */ - public static final OfLong hashmap_min_bitlen$layout() { - return hashmap_min_bitlen$LAYOUT; - } - - private static final long hashmap_min_bitlen$OFFSET = 72; - - /** - * Offset for field: - * {@snippet lang = c : * long hashmap_min_bitlen - * } - */ - public static final long hashmap_min_bitlen$offset() { - return hashmap_min_bitlen$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long hashmap_min_bitlen - * } - */ - public static long hashmap_min_bitlen(MemorySegment struct) { - return struct.get(hashmap_min_bitlen$LAYOUT, hashmap_min_bitlen$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long hashmap_min_bitlen - * } - */ - public static void hashmap_min_bitlen(MemorySegment struct, long fieldValue) { - struct.set(hashmap_min_bitlen$LAYOUT, hashmap_min_bitlen$OFFSET, fieldValue); - } - - private static final OfFloat hashmap_max_fill_rate$LAYOUT = (OfFloat) $LAYOUT - .select(groupElement("hashmap_max_fill_rate")); - - /** - * Layout for field: - * {@snippet lang = c : * float hashmap_max_fill_rate - * } - */ - public static final OfFloat hashmap_max_fill_rate$layout() { - return hashmap_max_fill_rate$LAYOUT; - } - - private static final long hashmap_max_fill_rate$OFFSET = 80; - - /** - * Offset for field: - * {@snippet lang = c : * float hashmap_max_fill_rate - * } - */ - public static final long hashmap_max_fill_rate$offset() { - return hashmap_max_fill_rate$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * float hashmap_max_fill_rate - * } - */ - public static float hashmap_max_fill_rate(MemorySegment struct) { - return struct.get(hashmap_max_fill_rate$LAYOUT, hashmap_max_fill_rate$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * float hashmap_max_fill_rate - * } - */ - public static void hashmap_max_fill_rate(MemorySegment struct, float fieldValue) { - struct.set(hashmap_max_fill_rate$LAYOUT, hashmap_max_fill_rate$OFFSET, fieldValue); - } - - private static final OfInt num_random_samplings$LAYOUT = (OfInt) $LAYOUT.select(groupElement("num_random_samplings")); - - /** - * Layout for field: - * {@snippet lang = c : * uint32_t num_random_samplings - * } - */ - public static final OfInt num_random_samplings$layout() { - return num_random_samplings$LAYOUT; - } - - private static final long num_random_samplings$OFFSET = 84; - - /** - * Offset for field: - * {@snippet lang = c : * uint32_t num_random_samplings - * } - */ - public static final long num_random_samplings$offset() { - return num_random_samplings$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * uint32_t num_random_samplings - * } - */ - public static int num_random_samplings(MemorySegment struct) { - return struct.get(num_random_samplings$LAYOUT, num_random_samplings$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * uint32_t num_random_samplings - * } - */ - public static void num_random_samplings(MemorySegment struct, int fieldValue) { - struct.set(num_random_samplings$LAYOUT, num_random_samplings$OFFSET, fieldValue); - } - - private static final OfLong rand_xor_mask$LAYOUT = (OfLong) $LAYOUT.select(groupElement("rand_xor_mask")); - - /** - * Layout for field: - * {@snippet lang = c : * uint64_t rand_xor_mask - * } - */ - public static final OfLong rand_xor_mask$layout() { - return rand_xor_mask$LAYOUT; - } - - private static final long rand_xor_mask$OFFSET = 88; - - /** - * Offset for field: - * {@snippet lang = c : * uint64_t rand_xor_mask - * } - */ - public static final long rand_xor_mask$offset() { - return rand_xor_mask$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * uint64_t rand_xor_mask - * } - */ - public static long rand_xor_mask(MemorySegment struct) { - return struct.get(rand_xor_mask$LAYOUT, rand_xor_mask$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * uint64_t rand_xor_mask - * } - */ - public static void rand_xor_mask(MemorySegment struct, long fieldValue) { - struct.set(rand_xor_mask$LAYOUT, rand_xor_mask$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswExtendParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswExtendParams.java deleted file mode 100644 index 83358e2338..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswExtendParams.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; - -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfInt; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct cuvsHnswExtendParams { - * int num_threads; - * } - * } - */ -public class CuVSHnswExtendParams { - - CuVSHnswExtendParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(HnswH.C_INT.withName("num_threads")) - .withName("cuvsHnswExtendParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt num_threads$LAYOUT = (OfInt) $LAYOUT.select(groupElement("num_threads")); - - /** - * Layout for field: - * {@snippet lang = c : * int num_threads - * } - */ - public static final OfInt num_threads$layout() { - return num_threads$LAYOUT; - } - - private static final long num_threads$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * int num_threads - * } - */ - public static final long num_threads$offset() { - return num_threads$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * int num_threads - * } - */ - public static int num_threads(MemorySegment struct) { - return struct.get(num_threads$LAYOUT, num_threads$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * int num_threads - * } - */ - public static void num_threads(MemorySegment struct, int fieldValue) { - struct.set(num_threads$LAYOUT, num_threads$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswIndex.java deleted file mode 100644 index aa12e4400b..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswIndex.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; - -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfLong; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct { - * uintptr_t addr; - * DLDataType dtype; - * } - * } - */ -public class CuVSHnswIndex { - - CuVSHnswIndex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(HnswH.C_LONG.withName("addr"), - DLDataType.layout().withName("dtype"), MemoryLayout.paddingLayout(4)).withName("$anon$66:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong addr$LAYOUT = (OfLong) $LAYOUT.select(groupElement("addr")); - - /** - * Layout for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static final OfLong addr$layout() { - return addr$LAYOUT; - } - - private static final long addr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static final long addr$offset() { - return addr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static long addr(MemorySegment struct) { - return struct.get(addr$LAYOUT, addr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * uintptr_t addr - * } - */ - public static void addr(MemorySegment struct, long fieldValue) { - struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); - } - - private static final GroupLayout dtype$LAYOUT = (GroupLayout) $LAYOUT.select(groupElement("dtype")); - - /** - * Layout for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static final GroupLayout dtype$layout() { - return dtype$LAYOUT; - } - - private static final long dtype$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static final long dtype$offset() { - return dtype$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static MemorySegment dtype(MemorySegment struct) { - return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang = c : * DLDataType dtype - * } - */ - public static void dtype(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswIndexParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswIndexParams.java deleted file mode 100644 index d6b06872f6..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswIndexParams.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; - -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfInt; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct cuvsHnswIndexParams { - * cuvsHnswHierarchy hierarchy; - * int ef_construction; - * int num_threads; - * } - * } - */ -public class CuVSHnswIndexParams { - - CuVSHnswIndexParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(HnswH.C_INT.withName("hierarchy"), - HnswH.C_INT.withName("ef_construction"), HnswH.C_INT.withName("num_threads")).withName("cuvsHnswIndexParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt hierarchy$LAYOUT = (OfInt) $LAYOUT.select(groupElement("hierarchy")); - - /** - * Layout for field: - * {@snippet lang = c : * cuvsHnswHierarchy hierarchy - * } - */ - public static final OfInt hierarchy$layout() { - return hierarchy$LAYOUT; - } - - private static final long hierarchy$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * cuvsHnswHierarchy hierarchy - * } - */ - public static final long hierarchy$offset() { - return hierarchy$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * cuvsHnswHierarchy hierarchy - * } - */ - public static int hierarchy(MemorySegment struct) { - return struct.get(hierarchy$LAYOUT, hierarchy$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * cuvsHnswHierarchy hierarchy - * } - */ - public static void hierarchy(MemorySegment struct, int fieldValue) { - struct.set(hierarchy$LAYOUT, hierarchy$OFFSET, fieldValue); - } - - private static final OfInt ef_construction$LAYOUT = (OfInt) $LAYOUT.select(groupElement("ef_construction")); - - /** - * Layout for field: - * {@snippet lang = c : * int ef_construction - * } - */ - public static final OfInt ef_construction$layout() { - return ef_construction$LAYOUT; - } - - private static final long ef_construction$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang = c : * int ef_construction - * } - */ - public static final long ef_construction$offset() { - return ef_construction$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * int ef_construction - * } - */ - public static int ef_construction(MemorySegment struct) { - return struct.get(ef_construction$LAYOUT, ef_construction$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * int ef_construction - * } - */ - public static void ef_construction(MemorySegment struct, int fieldValue) { - struct.set(ef_construction$LAYOUT, ef_construction$OFFSET, fieldValue); - } - - private static final OfInt num_threads$LAYOUT = (OfInt) $LAYOUT.select(groupElement("num_threads")); - - /** - * Layout for field: - * {@snippet lang = c : * int num_threads - * } - */ - public static final OfInt num_threads$layout() { - return num_threads$LAYOUT; - } - - private static final long num_threads$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang = c : * int num_threads - * } - */ - public static final long num_threads$offset() { - return num_threads$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * int num_threads - * } - */ - public static int num_threads(MemorySegment struct) { - return struct.get(num_threads$LAYOUT, num_threads$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * int num_threads - * } - */ - public static void num_threads(MemorySegment struct, int fieldValue) { - struct.set(num_threads$LAYOUT, num_threads$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswSearchParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswSearchParams.java deleted file mode 100644 index ff8329a57c..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSHnswSearchParams.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; - -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfInt; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct cuvsHnswSearchParams { - * int32_t ef; - * int32_t num_threads; - * } - * } - */ -public class CuVSHnswSearchParams { - - CuVSHnswSearchParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout - .structLayout(HnswH.C_INT.withName("ef"), HnswH.C_INT.withName("num_threads")).withName("cuvsHnswSearchParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt ef$LAYOUT = (OfInt) $LAYOUT.select(groupElement("ef")); - - /** - * Layout for field: - * {@snippet lang = c : * int32_t ef - * } - */ - public static final OfInt ef$layout() { - return ef$LAYOUT; - } - - private static final long ef$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * int32_t ef - * } - */ - public static final long ef$offset() { - return ef$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * int32_t ef - * } - */ - public static int ef(MemorySegment struct) { - return struct.get(ef$LAYOUT, ef$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * int32_t ef - * } - */ - public static void ef(MemorySegment struct, int fieldValue) { - struct.set(ef$LAYOUT, ef$OFFSET, fieldValue); - } - - private static final OfInt num_threads$LAYOUT = (OfInt) $LAYOUT.select(groupElement("num_threads")); - - /** - * Layout for field: - * {@snippet lang = c : * int32_t num_threads - * } - */ - public static final OfInt num_threads$layout() { - return num_threads$LAYOUT; - } - - private static final long num_threads$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang = c : * int32_t num_threads - * } - */ - public static final long num_threads$offset() { - return num_threads$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * int32_t num_threads - * } - */ - public static int num_threads(MemorySegment struct) { - return struct.get(num_threads$LAYOUT, num_threads$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * int32_t num_threads - * } - */ - public static void num_threads(MemorySegment struct, int fieldValue) { - struct.set(num_threads$LAYOUT, num_threads$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDataType.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDataType.java index aaa2f4d2dd..7f5ec97847 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDataType.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDataType.java @@ -14,18 +14,20 @@ * limitations under the License. */ +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + package com.nvidia.cuvs.internal.panama; -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfByte; -import java.lang.foreign.ValueLayout.OfShort; -import java.util.function.Consumer; +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; /** * {@snippet lang=c : @@ -43,10 +45,10 @@ public class DLDataType { } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - DlpackH.C_CHAR.withName("code"), - DlpackH.C_CHAR.withName("bits"), - DlpackH.C_SHORT.withName("lanes") - ).withName("$anon$174:9"); + PanamaFFMAPI.C_CHAR.withName("code"), + PanamaFFMAPI.C_CHAR.withName("bits"), + PanamaFFMAPI.C_SHORT.withName("lanes") + ).withName("$anon$145:9"); /** * The layout of this struct diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDevice.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDevice.java index ceadb6a698..e51f370618 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDevice.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDevice.java @@ -14,17 +14,20 @@ * limitations under the License. */ +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + package com.nvidia.cuvs.internal.panama; -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfInt; -import java.util.function.Consumer; +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; /** * {@snippet lang=c : @@ -41,9 +44,9 @@ public class DLDevice { } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - DlpackH.C_INT.withName("device_type"), - DlpackH.C_INT.withName("device_id") - ).withName("$anon$126:9"); + PanamaFFMAPI.C_INT.withName("device_type"), + PanamaFFMAPI.C_INT.withName("device_id") + ).withName("$anon$97:9"); /** * The layout of this struct diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensor.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensor.java index c28dd71c37..170349b81b 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensor.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensor.java @@ -14,20 +14,20 @@ * limitations under the License. */ +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + package com.nvidia.cuvs.internal.panama; -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.invoke.MethodHandle; -import java.util.function.Consumer; +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; /** * {@snippet lang=c : @@ -46,8 +46,8 @@ public class DLManagedTensor { private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( DLTensor.layout().withName("dl_tensor"), - DlpackH.C_POINTER.withName("manager_ctx"), - DlpackH.C_POINTER.withName("deleter") + PanamaFFMAPI.C_POINTER.withName("manager_ctx"), + PanamaFFMAPI.C_POINTER.withName("deleter") ).withName("DLManagedTensor"); /** @@ -164,7 +164,7 @@ public interface Function { } private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( - DlpackH.C_POINTER + PanamaFFMAPI.C_POINTER ); /** @@ -174,7 +174,7 @@ public static FunctionDescriptor descriptor() { return $DESC; } - private static final MethodHandle UP$MH = DlpackH.upcallHandle(deleter.Function.class, "apply", $DESC); + private static final MethodHandle UP$MH = PanamaFFMAPI.upcallHandle(deleter.Function.class, "apply", $DESC); /** * Allocates a new upcall stub, whose implementation is defined by {@code fi}. diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensorVersioned.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensorVersioned.java deleted file mode 100644 index f631140e23..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensorVersioned.java +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; - -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfLong; -import java.lang.invoke.MethodHandle; -import java.util.function.Consumer; - -/** - * {@snippet lang=c : - * struct DLManagedTensorVersioned { - * DLPackVersion version; - * void *manager_ctx; - * void (*deleter)(struct DLManagedTensorVersioned *); - * uint64_t flags; - * DLTensor dl_tensor; - * } - * } - */ -public class DLManagedTensorVersioned { - - DLManagedTensorVersioned() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - DLPackVersion.layout().withName("version"), - DlpackH.C_POINTER.withName("manager_ctx"), - DlpackH.C_POINTER.withName("deleter"), - DlpackH.C_LONG.withName("flags"), - DLTensor.layout().withName("dl_tensor") - ).withName("DLManagedTensorVersioned"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final GroupLayout version$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("version")); - - /** - * Layout for field: - * {@snippet lang=c : - * DLPackVersion version - * } - */ - public static final GroupLayout version$layout() { - return version$LAYOUT; - } - - private static final long version$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * DLPackVersion version - * } - */ - public static final long version$offset() { - return version$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DLPackVersion version - * } - */ - public static MemorySegment version(MemorySegment struct) { - return struct.asSlice(version$OFFSET, version$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DLPackVersion version - * } - */ - public static void version(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, version$OFFSET, version$LAYOUT.byteSize()); - } - - private static final AddressLayout manager_ctx$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("manager_ctx")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *manager_ctx - * } - */ - public static final AddressLayout manager_ctx$layout() { - return manager_ctx$LAYOUT; - } - - private static final long manager_ctx$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * void *manager_ctx - * } - */ - public static final long manager_ctx$offset() { - return manager_ctx$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *manager_ctx - * } - */ - public static MemorySegment manager_ctx(MemorySegment struct) { - return struct.get(manager_ctx$LAYOUT, manager_ctx$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *manager_ctx - * } - */ - public static void manager_ctx(MemorySegment struct, MemorySegment fieldValue) { - struct.set(manager_ctx$LAYOUT, manager_ctx$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * void (*deleter)(struct DLManagedTensorVersioned *) - * } - */ - public static class deleter { - - deleter() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - void apply(MemorySegment _x0); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( - DlpackH.C_POINTER - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = DlpackH.upcallHandle(deleter.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(deleter.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static void invoke(MemorySegment funcPtr,MemorySegment _x0) { - try { - DOWN$MH.invokeExact(funcPtr, _x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static final AddressLayout deleter$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("deleter")); - - /** - * Layout for field: - * {@snippet lang=c : - * void (*deleter)(struct DLManagedTensorVersioned *) - * } - */ - public static final AddressLayout deleter$layout() { - return deleter$LAYOUT; - } - - private static final long deleter$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * void (*deleter)(struct DLManagedTensorVersioned *) - * } - */ - public static final long deleter$offset() { - return deleter$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void (*deleter)(struct DLManagedTensorVersioned *) - * } - */ - public static MemorySegment deleter(MemorySegment struct) { - return struct.get(deleter$LAYOUT, deleter$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void (*deleter)(struct DLManagedTensorVersioned *) - * } - */ - public static void deleter(MemorySegment struct, MemorySegment fieldValue) { - struct.set(deleter$LAYOUT, deleter$OFFSET, fieldValue); - } - - private static final OfLong flags$LAYOUT = (OfLong)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint64_t flags - * } - */ - public static final OfLong flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * uint64_t flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint64_t flags - * } - */ - public static long flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint64_t flags - * } - */ - public static void flags(MemorySegment struct, long fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - private static final GroupLayout dl_tensor$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dl_tensor")); - - /** - * Layout for field: - * {@snippet lang=c : - * DLTensor dl_tensor - * } - */ - public static final GroupLayout dl_tensor$layout() { - return dl_tensor$LAYOUT; - } - - private static final long dl_tensor$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * DLTensor dl_tensor - * } - */ - public static final long dl_tensor$offset() { - return dl_tensor$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DLTensor dl_tensor - * } - */ - public static MemorySegment dl_tensor(MemorySegment struct) { - return struct.asSlice(dl_tensor$OFFSET, dl_tensor$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DLTensor dl_tensor - * } - */ - public static void dl_tensor(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dl_tensor$OFFSET, dl_tensor$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLTensor.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLTensor.java index 21d928905e..248c1046d0 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLTensor.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLTensor.java @@ -14,19 +14,20 @@ * limitations under the License. */ +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + package com.nvidia.cuvs.internal.panama; -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.util.function.Consumer; +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; /** * {@snippet lang=c : @@ -48,14 +49,14 @@ public class DLTensor { } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - DlpackH.C_POINTER.withName("data"), + PanamaFFMAPI.C_POINTER.withName("data"), DLDevice.layout().withName("device"), - DlpackH.C_INT.withName("ndim"), + PanamaFFMAPI.C_INT.withName("ndim"), DLDataType.layout().withName("dtype"), - DlpackH.C_POINTER.withName("shape"), - DlpackH.C_POINTER.withName("strides"), - DlpackH.C_LONG.withName("byte_offset") - ).withName("$anon$192:9"); + PanamaFFMAPI.C_POINTER.withName("shape"), + PanamaFFMAPI.C_POINTER.withName("strides"), + PanamaFFMAPI.C_LONG.withName("byte_offset") + ).withName("$anon$163:9"); /** * The layout of this struct diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DistanceH.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DistanceH.java deleted file mode 100644 index b98f95ae23..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DistanceH.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -public class DistanceH { - - DistanceH() { - // Should not be called directly - } - - static final Arena LIBRARY_ARENA = Arena.ofAuto(); - static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); - - static void traceDowncall(String name, Object... args) { - String traceArgs = Arrays.stream(args) - .map(Object::toString) - .collect(Collectors.joining(", ")); - System.out.printf("%s(%s)\n", name, traceArgs); - } - - static MemorySegment findOrThrow(String symbol) { - return SYMBOL_LOOKUP.find(symbol) - .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); - } - - static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { - try { - return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); - } catch (ReflectiveOperationException ex) { - throw new AssertionError(ex); - } - } - - static MemoryLayout align(MemoryLayout layout, long align) { - return switch (layout) { - case PaddingLayout p -> p; - case ValueLayout v -> v.withByteAlignment(align); - case GroupLayout g -> { - MemoryLayout[] alignedMembers = g.memberLayouts().stream() - .map(m -> align(m, align)).toArray(MemoryLayout[]::new); - yield g instanceof StructLayout ? - MemoryLayout.structLayout(alignedMembers) : MemoryLayout.unionLayout(alignedMembers); - } - case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); - }; - } - - static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup() - .or(Linker.nativeLinker().defaultLookup()); - - public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; - public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; - public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; - public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; - public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; - public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; - public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; - public static final AddressLayout C_POINTER = ValueLayout.ADDRESS - .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); - public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; - private static final int L2Expanded = (int)0L; - /** - * {@snippet lang=c : - * enum .L2Expanded = 0 - * } - */ - public static int L2Expanded() { - return L2Expanded; - } - private static final int L2SqrtExpanded = (int)1L; - /** - * {@snippet lang=c : - * enum .L2SqrtExpanded = 1 - * } - */ - public static int L2SqrtExpanded() { - return L2SqrtExpanded; - } - private static final int CosineExpanded = (int)2L; - /** - * {@snippet lang=c : - * enum .CosineExpanded = 2 - * } - */ - public static int CosineExpanded() { - return CosineExpanded; - } - private static final int L1 = (int)3L; - /** - * {@snippet lang=c : - * enum .L1 = 3 - * } - */ - public static int L1() { - return L1; - } - private static final int L2Unexpanded = (int)4L; - /** - * {@snippet lang=c : - * enum .L2Unexpanded = 4 - * } - */ - public static int L2Unexpanded() { - return L2Unexpanded; - } - private static final int L2SqrtUnexpanded = (int)5L; - /** - * {@snippet lang=c : - * enum .L2SqrtUnexpanded = 5 - * } - */ - public static int L2SqrtUnexpanded() { - return L2SqrtUnexpanded; - } - private static final int InnerProduct = (int)6L; - /** - * {@snippet lang=c : - * enum .InnerProduct = 6 - * } - */ - public static int InnerProduct() { - return InnerProduct; - } - private static final int Linf = (int)7L; - /** - * {@snippet lang=c : - * enum .Linf = 7 - * } - */ - public static int Linf() { - return Linf; - } - private static final int Canberra = (int)8L; - /** - * {@snippet lang=c : - * enum .Canberra = 8 - * } - */ - public static int Canberra() { - return Canberra; - } - private static final int LpUnexpanded = (int)9L; - /** - * {@snippet lang=c : - * enum .LpUnexpanded = 9 - * } - */ - public static int LpUnexpanded() { - return LpUnexpanded; - } - private static final int CorrelationExpanded = (int)10L; - /** - * {@snippet lang=c : - * enum .CorrelationExpanded = 10 - * } - */ - public static int CorrelationExpanded() { - return CorrelationExpanded; - } - private static final int JaccardExpanded = (int)11L; - /** - * {@snippet lang=c : - * enum .JaccardExpanded = 11 - * } - */ - public static int JaccardExpanded() { - return JaccardExpanded; - } - private static final int HellingerExpanded = (int)12L; - /** - * {@snippet lang=c : - * enum .HellingerExpanded = 12 - * } - */ - public static int HellingerExpanded() { - return HellingerExpanded; - } - private static final int Haversine = (int)13L; - /** - * {@snippet lang=c : - * enum .Haversine = 13 - * } - */ - public static int Haversine() { - return Haversine; - } - private static final int BrayCurtis = (int)14L; - /** - * {@snippet lang=c : - * enum .BrayCurtis = 14 - * } - */ - public static int BrayCurtis() { - return BrayCurtis; - } - private static final int JensenShannon = (int)15L; - /** - * {@snippet lang=c : - * enum .JensenShannon = 15 - * } - */ - public static int JensenShannon() { - return JensenShannon; - } - private static final int HammingUnexpanded = (int)16L; - /** - * {@snippet lang=c : - * enum .HammingUnexpanded = 16 - * } - */ - public static int HammingUnexpanded() { - return HammingUnexpanded; - } - private static final int KLDivergence = (int)17L; - /** - * {@snippet lang=c : - * enum .KLDivergence = 17 - * } - */ - public static int KLDivergence() { - return KLDivergence; - } - private static final int RusselRaoExpanded = (int)18L; - /** - * {@snippet lang=c : - * enum .RusselRaoExpanded = 18 - * } - */ - public static int RusselRaoExpanded() { - return RusselRaoExpanded; - } - private static final int DiceExpanded = (int)19L; - /** - * {@snippet lang=c : - * enum .DiceExpanded = 19 - * } - */ - public static int DiceExpanded() { - return DiceExpanded; - } - private static final int Precomputed = (int)100L; - /** - * {@snippet lang=c : - * enum .Precomputed = 100 - * } - */ - public static int Precomputed() { - return Precomputed; - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DlpackH.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DlpackH.java deleted file mode 100644 index 6ef78336f7..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DlpackH.java +++ /dev/null @@ -1,1898 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.ValueLayout.JAVA_BYTE; - -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.PaddingLayout; -import java.lang.foreign.SequenceLayout; -import java.lang.foreign.StructLayout; -import java.lang.foreign.SymbolLookup; -import java.lang.foreign.ValueLayout; -import java.lang.foreign.ValueLayout.OfByte; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.lang.foreign.ValueLayout.OfShort; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.util.Arrays; -import java.util.stream.Collectors; - -public class DlpackH { - - DlpackH() { - // Should not be called directly - } - - static final Arena LIBRARY_ARENA = Arena.ofAuto(); - static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); - - static void traceDowncall(String name, Object... args) { - String traceArgs = Arrays.stream(args) - .map(Object::toString) - .collect(Collectors.joining(", ")); - System.out.printf("%s(%s)\n", name, traceArgs); - } - - static MemorySegment findOrThrow(String symbol) { - return SYMBOL_LOOKUP.find(symbol) - .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); - } - - static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { - try { - return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); - } catch (ReflectiveOperationException ex) { - throw new AssertionError(ex); - } - } - - static MemoryLayout align(MemoryLayout layout, long align) { - return switch (layout) { - case PaddingLayout p -> p; - case ValueLayout v -> v.withByteAlignment(align); - case GroupLayout g -> { - MemoryLayout[] alignedMembers = g.memberLayouts().stream() - .map(m -> align(m, align)).toArray(MemoryLayout[]::new); - yield g instanceof StructLayout ? - MemoryLayout.structLayout(alignedMembers) : MemoryLayout.unionLayout(alignedMembers); - } - case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); - }; - } - - static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup() - .or(Linker.nativeLinker().defaultLookup()); - - public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; - public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; - public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; - public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; - public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; - public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; - public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; - public static final AddressLayout C_POINTER = ValueLayout.ADDRESS - .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); - public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; - private static final int DLPACK_MAJOR_VERSION = (int)1L; - /** - * {@snippet lang=c : - * #define DLPACK_MAJOR_VERSION 1 - * } - */ - public static int DLPACK_MAJOR_VERSION() { - return DLPACK_MAJOR_VERSION; - } - private static final int DLPACK_MINOR_VERSION = (int)0L; - /** - * {@snippet lang=c : - * #define DLPACK_MINOR_VERSION 0 - * } - */ - public static int DLPACK_MINOR_VERSION() { - return DLPACK_MINOR_VERSION; - } - private static final int _STDINT_H = (int)1L; - /** - * {@snippet lang=c : - * #define _STDINT_H 1 - * } - */ - public static int _STDINT_H() { - return _STDINT_H; - } - private static final int _FEATURES_H = (int)1L; - /** - * {@snippet lang=c : - * #define _FEATURES_H 1 - * } - */ - public static int _FEATURES_H() { - return _FEATURES_H; - } - private static final int _DEFAULT_SOURCE = (int)1L; - /** - * {@snippet lang=c : - * #define _DEFAULT_SOURCE 1 - * } - */ - public static int _DEFAULT_SOURCE() { - return _DEFAULT_SOURCE; - } - private static final int __GLIBC_USE_ISOC2X = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_ISOC2X 0 - * } - */ - public static int __GLIBC_USE_ISOC2X() { - return __GLIBC_USE_ISOC2X; - } - private static final int __USE_ISOC11 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_ISOC11 1 - * } - */ - public static int __USE_ISOC11() { - return __USE_ISOC11; - } - private static final int __USE_ISOC99 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_ISOC99 1 - * } - */ - public static int __USE_ISOC99() { - return __USE_ISOC99; - } - private static final int __USE_ISOC95 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_ISOC95 1 - * } - */ - public static int __USE_ISOC95() { - return __USE_ISOC95; - } - private static final int __USE_POSIX_IMPLICITLY = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_POSIX_IMPLICITLY 1 - * } - */ - public static int __USE_POSIX_IMPLICITLY() { - return __USE_POSIX_IMPLICITLY; - } - private static final int _POSIX_SOURCE = (int)1L; - /** - * {@snippet lang=c : - * #define _POSIX_SOURCE 1 - * } - */ - public static int _POSIX_SOURCE() { - return _POSIX_SOURCE; - } - private static final int __USE_POSIX = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_POSIX 1 - * } - */ - public static int __USE_POSIX() { - return __USE_POSIX; - } - private static final int __USE_POSIX2 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_POSIX2 1 - * } - */ - public static int __USE_POSIX2() { - return __USE_POSIX2; - } - private static final int __USE_POSIX199309 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_POSIX199309 1 - * } - */ - public static int __USE_POSIX199309() { - return __USE_POSIX199309; - } - private static final int __USE_POSIX199506 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_POSIX199506 1 - * } - */ - public static int __USE_POSIX199506() { - return __USE_POSIX199506; - } - private static final int __USE_XOPEN2K = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_XOPEN2K 1 - * } - */ - public static int __USE_XOPEN2K() { - return __USE_XOPEN2K; - } - private static final int __USE_XOPEN2K8 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_XOPEN2K8 1 - * } - */ - public static int __USE_XOPEN2K8() { - return __USE_XOPEN2K8; - } - private static final int _ATFILE_SOURCE = (int)1L; - /** - * {@snippet lang=c : - * #define _ATFILE_SOURCE 1 - * } - */ - public static int _ATFILE_SOURCE() { - return _ATFILE_SOURCE; - } - private static final int __WORDSIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - private static final int __WORDSIZE_TIME64_COMPAT32 = (int)1L; - /** - * {@snippet lang=c : - * #define __WORDSIZE_TIME64_COMPAT32 1 - * } - */ - public static int __WORDSIZE_TIME64_COMPAT32() { - return __WORDSIZE_TIME64_COMPAT32; - } - private static final int __SYSCALL_WORDSIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __SYSCALL_WORDSIZE 64 - * } - */ - public static int __SYSCALL_WORDSIZE() { - return __SYSCALL_WORDSIZE; - } - private static final int __USE_MISC = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_MISC 1 - * } - */ - public static int __USE_MISC() { - return __USE_MISC; - } - private static final int __USE_ATFILE = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_ATFILE 1 - * } - */ - public static int __USE_ATFILE() { - return __USE_ATFILE; - } - private static final int __USE_FORTIFY_LEVEL = (int)0L; - /** - * {@snippet lang=c : - * #define __USE_FORTIFY_LEVEL 0 - * } - */ - public static int __USE_FORTIFY_LEVEL() { - return __USE_FORTIFY_LEVEL; - } - private static final int __GLIBC_USE_DEPRECATED_GETS = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_DEPRECATED_GETS 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_GETS() { - return __GLIBC_USE_DEPRECATED_GETS; - } - private static final int __GLIBC_USE_DEPRECATED_SCANF = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_DEPRECATED_SCANF 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_SCANF() { - return __GLIBC_USE_DEPRECATED_SCANF; - } - private static final int _STDC_PREDEF_H = (int)1L; - /** - * {@snippet lang=c : - * #define _STDC_PREDEF_H 1 - * } - */ - public static int _STDC_PREDEF_H() { - return _STDC_PREDEF_H; - } - private static final int __STDC_IEC_559__ = (int)1L; - /** - * {@snippet lang=c : - * #define __STDC_IEC_559__ 1 - * } - */ - public static int __STDC_IEC_559__() { - return __STDC_IEC_559__; - } - private static final int __STDC_IEC_559_COMPLEX__ = (int)1L; - /** - * {@snippet lang=c : - * #define __STDC_IEC_559_COMPLEX__ 1 - * } - */ - public static int __STDC_IEC_559_COMPLEX__() { - return __STDC_IEC_559_COMPLEX__; - } - private static final int __GNU_LIBRARY__ = (int)6L; - /** - * {@snippet lang=c : - * #define __GNU_LIBRARY__ 6 - * } - */ - public static int __GNU_LIBRARY__() { - return __GNU_LIBRARY__; - } - private static final int __GLIBC__ = (int)2L; - /** - * {@snippet lang=c : - * #define __GLIBC__ 2 - * } - */ - public static int __GLIBC__() { - return __GLIBC__; - } - private static final int __GLIBC_MINOR__ = (int)35L; - /** - * {@snippet lang=c : - * #define __GLIBC_MINOR__ 35 - * } - */ - public static int __GLIBC_MINOR__() { - return __GLIBC_MINOR__; - } - private static final int _SYS_CDEFS_H = (int)1L; - /** - * {@snippet lang=c : - * #define _SYS_CDEFS_H 1 - * } - */ - public static int _SYS_CDEFS_H() { - return _SYS_CDEFS_H; - } - private static final int __glibc_c99_flexarr_available = (int)1L; - /** - * {@snippet lang=c : - * #define __glibc_c99_flexarr_available 1 - * } - */ - public static int __glibc_c99_flexarr_available() { - return __glibc_c99_flexarr_available; - } - private static final int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = (int)0L; - /** - * {@snippet lang=c : - * #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 - * } - */ - public static int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI() { - return __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI; - } - private static final int __HAVE_GENERIC_SELECTION = (int)1L; - /** - * {@snippet lang=c : - * #define __HAVE_GENERIC_SELECTION 1 - * } - */ - public static int __HAVE_GENERIC_SELECTION() { - return __HAVE_GENERIC_SELECTION; - } - private static final int __GLIBC_USE_LIB_EXT2 = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_LIB_EXT2 0 - * } - */ - public static int __GLIBC_USE_LIB_EXT2() { - return __GLIBC_USE_LIB_EXT2; - } - private static final int __GLIBC_USE_IEC_60559_BFP_EXT = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_BFP_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT() { - return __GLIBC_USE_IEC_60559_BFP_EXT; - } - private static final int __GLIBC_USE_IEC_60559_BFP_EXT_C2X = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT_C2X() { - return __GLIBC_USE_IEC_60559_BFP_EXT_C2X; - } - private static final int __GLIBC_USE_IEC_60559_EXT = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_EXT() { - return __GLIBC_USE_IEC_60559_EXT; - } - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT; - } - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X; - } - private static final int __GLIBC_USE_IEC_60559_TYPES_EXT = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_TYPES_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_TYPES_EXT() { - return __GLIBC_USE_IEC_60559_TYPES_EXT; - } - private static final int _BITS_TYPES_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_TYPES_H 1 - * } - */ - public static int _BITS_TYPES_H() { - return _BITS_TYPES_H; - } - private static final int _BITS_TYPESIZES_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_TYPESIZES_H 1 - * } - */ - public static int _BITS_TYPESIZES_H() { - return _BITS_TYPESIZES_H; - } - private static final int __OFF_T_MATCHES_OFF64_T = (int)1L; - /** - * {@snippet lang=c : - * #define __OFF_T_MATCHES_OFF64_T 1 - * } - */ - public static int __OFF_T_MATCHES_OFF64_T() { - return __OFF_T_MATCHES_OFF64_T; - } - private static final int __INO_T_MATCHES_INO64_T = (int)1L; - /** - * {@snippet lang=c : - * #define __INO_T_MATCHES_INO64_T 1 - * } - */ - public static int __INO_T_MATCHES_INO64_T() { - return __INO_T_MATCHES_INO64_T; - } - private static final int __RLIM_T_MATCHES_RLIM64_T = (int)1L; - /** - * {@snippet lang=c : - * #define __RLIM_T_MATCHES_RLIM64_T 1 - * } - */ - public static int __RLIM_T_MATCHES_RLIM64_T() { - return __RLIM_T_MATCHES_RLIM64_T; - } - private static final int __STATFS_MATCHES_STATFS64 = (int)1L; - /** - * {@snippet lang=c : - * #define __STATFS_MATCHES_STATFS64 1 - * } - */ - public static int __STATFS_MATCHES_STATFS64() { - return __STATFS_MATCHES_STATFS64; - } - private static final int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = (int)1L; - /** - * {@snippet lang=c : - * #define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 - * } - */ - public static int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64() { - return __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64; - } - private static final int __FD_SETSIZE = (int)1024L; - /** - * {@snippet lang=c : - * #define __FD_SETSIZE 1024 - * } - */ - public static int __FD_SETSIZE() { - return __FD_SETSIZE; - } - private static final int _BITS_TIME64_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_TIME64_H 1 - * } - */ - public static int _BITS_TIME64_H() { - return _BITS_TIME64_H; - } - private static final int _BITS_WCHAR_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_WCHAR_H 1 - * } - */ - public static int _BITS_WCHAR_H() { - return _BITS_WCHAR_H; - } - private static final int _BITS_STDINT_INTN_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_STDINT_INTN_H 1 - * } - */ - public static int _BITS_STDINT_INTN_H() { - return _BITS_STDINT_INTN_H; - } - private static final int _BITS_STDINT_UINTN_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_STDINT_UINTN_H 1 - * } - */ - public static int _BITS_STDINT_UINTN_H() { - return _BITS_STDINT_UINTN_H; - } - /** - * {@snippet lang=c : - * typedef unsigned char __u_char - * } - */ - public static final OfByte __u_char = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short __u_short - * } - */ - public static final OfShort __u_short = DlpackH.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int __u_int - * } - */ - public static final OfInt __u_int = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long __u_long - * } - */ - public static final OfLong __u_long = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef signed char __int8_t - * } - */ - public static final OfByte __int8_t = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned char __uint8_t - * } - */ - public static final OfByte __uint8_t = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef short __int16_t - * } - */ - public static final OfShort __int16_t = DlpackH.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned short __uint16_t - * } - */ - public static final OfShort __uint16_t = DlpackH.C_SHORT; - /** - * {@snippet lang=c : - * typedef int __int32_t - * } - */ - public static final OfInt __int32_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned int __uint32_t - * } - */ - public static final OfInt __uint32_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef long __int64_t - * } - */ - public static final OfLong __int64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __uint64_t - * } - */ - public static final OfLong __uint64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef __int8_t __int_least8_t - * } - */ - public static final OfByte __int_least8_t = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef __uint8_t __uint_least8_t - * } - */ - public static final OfByte __uint_least8_t = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef __int16_t __int_least16_t - * } - */ - public static final OfShort __int_least16_t = DlpackH.C_SHORT; - /** - * {@snippet lang=c : - * typedef __uint16_t __uint_least16_t - * } - */ - public static final OfShort __uint_least16_t = DlpackH.C_SHORT; - /** - * {@snippet lang=c : - * typedef __int32_t __int_least32_t - * } - */ - public static final OfInt __int_least32_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t __uint_least32_t - * } - */ - public static final OfInt __uint_least32_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef __int64_t __int_least64_t - * } - */ - public static final OfLong __int_least64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef __uint64_t __uint_least64_t - * } - */ - public static final OfLong __uint_least64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long __quad_t - * } - */ - public static final OfLong __quad_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __u_quad_t - * } - */ - public static final OfLong __u_quad_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long __intmax_t - * } - */ - public static final OfLong __intmax_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __uintmax_t - * } - */ - public static final OfLong __uintmax_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __dev_t - * } - */ - public static final OfLong __dev_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __uid_t - * } - */ - public static final OfInt __uid_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned int __gid_t - * } - */ - public static final OfInt __gid_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long __ino_t - * } - */ - public static final OfLong __ino_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __ino64_t - * } - */ - public static final OfLong __ino64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __mode_t - * } - */ - public static final OfInt __mode_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long __nlink_t - * } - */ - public static final OfLong __nlink_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long __off_t - * } - */ - public static final OfLong __off_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long __off64_t - * } - */ - public static final OfLong __off64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef int __pid_t - * } - */ - public static final OfInt __pid_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef long __clock_t - * } - */ - public static final OfLong __clock_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __rlim_t - * } - */ - public static final OfLong __rlim_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __rlim64_t - * } - */ - public static final OfLong __rlim64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __id_t - * } - */ - public static final OfInt __id_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef long __time_t - * } - */ - public static final OfLong __time_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __useconds_t - * } - */ - public static final OfInt __useconds_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef long __suseconds_t - * } - */ - public static final OfLong __suseconds_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long __suseconds64_t - * } - */ - public static final OfLong __suseconds64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef int __daddr_t - * } - */ - public static final OfInt __daddr_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef int __key_t - * } - */ - public static final OfInt __key_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef int __clockid_t - * } - */ - public static final OfInt __clockid_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef void *__timer_t - * } - */ - public static final AddressLayout __timer_t = DlpackH.C_POINTER; - /** - * {@snippet lang=c : - * typedef long __blksize_t - * } - */ - public static final OfLong __blksize_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long __blkcnt_t - * } - */ - public static final OfLong __blkcnt_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long __blkcnt64_t - * } - */ - public static final OfLong __blkcnt64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __fsblkcnt_t - * } - */ - public static final OfLong __fsblkcnt_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __fsblkcnt64_t - * } - */ - public static final OfLong __fsblkcnt64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __fsfilcnt_t - * } - */ - public static final OfLong __fsfilcnt_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __fsfilcnt64_t - * } - */ - public static final OfLong __fsfilcnt64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long __fsword_t - * } - */ - public static final OfLong __fsword_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long __ssize_t - * } - */ - public static final OfLong __ssize_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long __syscall_slong_t - * } - */ - public static final OfLong __syscall_slong_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __syscall_ulong_t - * } - */ - public static final OfLong __syscall_ulong_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef __off64_t __loff_t - * } - */ - public static final OfLong __loff_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef char *__caddr_t - * } - */ - public static final AddressLayout __caddr_t = DlpackH.C_POINTER; - /** - * {@snippet lang=c : - * typedef long __intptr_t - * } - */ - public static final OfLong __intptr_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __socklen_t - * } - */ - public static final OfInt __socklen_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef int __sig_atomic_t - * } - */ - public static final OfInt __sig_atomic_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef __int8_t int8_t - * } - */ - public static final OfByte int8_t = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef __int16_t int16_t - * } - */ - public static final OfShort int16_t = DlpackH.C_SHORT; - /** - * {@snippet lang=c : - * typedef __int32_t int32_t - * } - */ - public static final OfInt int32_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef __int64_t int64_t - * } - */ - public static final OfLong int64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef __uint8_t uint8_t - * } - */ - public static final OfByte uint8_t = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef __uint16_t uint16_t - * } - */ - public static final OfShort uint16_t = DlpackH.C_SHORT; - /** - * {@snippet lang=c : - * typedef __uint32_t uint32_t - * } - */ - public static final OfInt uint32_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef __uint64_t uint64_t - * } - */ - public static final OfLong uint64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef __int_least8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef __int_least16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = DlpackH.C_SHORT; - /** - * {@snippet lang=c : - * typedef __int_least32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef __int_least64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef __uint_least8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef __uint_least16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = DlpackH.C_SHORT; - /** - * {@snippet lang=c : - * typedef __uint_least32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = DlpackH.C_INT; - /** - * {@snippet lang=c : - * typedef __uint_least64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef signed char int_fast8_t - * } - */ - public static final OfByte int_fast8_t = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef long int_fast16_t - * } - */ - public static final OfLong int_fast16_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long int_fast32_t - * } - */ - public static final OfLong int_fast32_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long int_fast64_t - * } - */ - public static final OfLong int_fast64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned char uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = DlpackH.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned long uint_fast16_t - * } - */ - public static final OfLong uint_fast16_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uint_fast32_t - * } - */ - public static final OfLong uint_fast32_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long intptr_t - * } - */ - public static final OfLong intptr_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uintptr_t - * } - */ - public static final OfLong uintptr_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef __intmax_t intmax_t - * } - */ - public static final OfLong intmax_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef __uintmax_t uintmax_t - * } - */ - public static final OfLong uintmax_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long size_t - * } - */ - public static final OfLong size_t = DlpackH.C_LONG; - /** - * {@snippet lang=c : - * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = DlpackH.C_INT; - private static final int kDLCPU = (int)1L; - /** - * {@snippet lang=c : - * enum .kDLCPU = 1 - * } - */ - public static int kDLCPU() { - return kDLCPU; - } - private static final int kDLCUDA = (int)2L; - /** - * {@snippet lang=c : - * enum .kDLCUDA = 2 - * } - */ - public static int kDLCUDA() { - return kDLCUDA; - } - private static final int kDLCUDAHost = (int)3L; - /** - * {@snippet lang=c : - * enum .kDLCUDAHost = 3 - * } - */ - public static int kDLCUDAHost() { - return kDLCUDAHost; - } - private static final int kDLOpenCL = (int)4L; - /** - * {@snippet lang=c : - * enum .kDLOpenCL = 4 - * } - */ - public static int kDLOpenCL() { - return kDLOpenCL; - } - private static final int kDLVulkan = (int)7L; - /** - * {@snippet lang=c : - * enum .kDLVulkan = 7 - * } - */ - public static int kDLVulkan() { - return kDLVulkan; - } - private static final int kDLMetal = (int)8L; - /** - * {@snippet lang=c : - * enum .kDLMetal = 8 - * } - */ - public static int kDLMetal() { - return kDLMetal; - } - private static final int kDLVPI = (int)9L; - /** - * {@snippet lang=c : - * enum .kDLVPI = 9 - * } - */ - public static int kDLVPI() { - return kDLVPI; - } - private static final int kDLROCM = (int)10L; - /** - * {@snippet lang=c : - * enum .kDLROCM = 10 - * } - */ - public static int kDLROCM() { - return kDLROCM; - } - private static final int kDLROCMHost = (int)11L; - /** - * {@snippet lang=c : - * enum .kDLROCMHost = 11 - * } - */ - public static int kDLROCMHost() { - return kDLROCMHost; - } - private static final int kDLExtDev = (int)12L; - /** - * {@snippet lang=c : - * enum .kDLExtDev = 12 - * } - */ - public static int kDLExtDev() { - return kDLExtDev; - } - private static final int kDLCUDAManaged = (int)13L; - /** - * {@snippet lang=c : - * enum .kDLCUDAManaged = 13 - * } - */ - public static int kDLCUDAManaged() { - return kDLCUDAManaged; - } - private static final int kDLOneAPI = (int)14L; - /** - * {@snippet lang=c : - * enum .kDLOneAPI = 14 - * } - */ - public static int kDLOneAPI() { - return kDLOneAPI; - } - private static final int kDLWebGPU = (int)15L; - /** - * {@snippet lang=c : - * enum .kDLWebGPU = 15 - * } - */ - public static int kDLWebGPU() { - return kDLWebGPU; - } - private static final int kDLHexagon = (int)16L; - /** - * {@snippet lang=c : - * enum .kDLHexagon = 16 - * } - */ - public static int kDLHexagon() { - return kDLHexagon; - } - private static final int kDLMAIA = (int)17L; - /** - * {@snippet lang=c : - * enum .kDLMAIA = 17 - * } - */ - public static int kDLMAIA() { - return kDLMAIA; - } - private static final int kDLInt = (int)0L; - /** - * {@snippet lang=c : - * enum .kDLInt = 0 - * } - */ - public static int kDLInt() { - return kDLInt; - } - private static final int kDLUInt = (int)1L; - /** - * {@snippet lang=c : - * enum .kDLUInt = 1 - * } - */ - public static int kDLUInt() { - return kDLUInt; - } - private static final int kDLFloat = (int)2L; - /** - * {@snippet lang=c : - * enum .kDLFloat = 2 - * } - */ - public static int kDLFloat() { - return kDLFloat; - } - private static final int kDLOpaqueHandle = (int)3L; - /** - * {@snippet lang=c : - * enum .kDLOpaqueHandle = 3 - * } - */ - public static int kDLOpaqueHandle() { - return kDLOpaqueHandle; - } - private static final int kDLBfloat = (int)4L; - /** - * {@snippet lang=c : - * enum .kDLBfloat = 4 - * } - */ - public static int kDLBfloat() { - return kDLBfloat; - } - private static final int kDLComplex = (int)5L; - /** - * {@snippet lang=c : - * enum .kDLComplex = 5 - * } - */ - public static int kDLComplex() { - return kDLComplex; - } - private static final int kDLBool = (int)6L; - /** - * {@snippet lang=c : - * enum .kDLBool = 6 - * } - */ - public static int kDLBool() { - return kDLBool; - } - private static final long _POSIX_C_SOURCE = 200809L; - /** - * {@snippet lang=c : - * #define _POSIX_C_SOURCE 200809 - * } - */ - public static long _POSIX_C_SOURCE() { - return _POSIX_C_SOURCE; - } - private static final int __TIMESIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __TIMESIZE 64 - * } - */ - public static int __TIMESIZE() { - return __TIMESIZE; - } - private static final long __STDC_IEC_60559_BFP__ = 201404L; - /** - * {@snippet lang=c : - * #define __STDC_IEC_60559_BFP__ 201404 - * } - */ - public static long __STDC_IEC_60559_BFP__() { - return __STDC_IEC_60559_BFP__; - } - private static final long __STDC_IEC_60559_COMPLEX__ = 201404L; - /** - * {@snippet lang=c : - * #define __STDC_IEC_60559_COMPLEX__ 201404 - * } - */ - public static long __STDC_IEC_60559_COMPLEX__() { - return __STDC_IEC_60559_COMPLEX__; - } - private static final long __STDC_ISO_10646__ = 201706L; - /** - * {@snippet lang=c : - * #define __STDC_ISO_10646__ 201706 - * } - */ - public static long __STDC_ISO_10646__() { - return __STDC_ISO_10646__; - } - private static final int __WCHAR_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define __WCHAR_MAX 2147483647 - * } - */ - public static int __WCHAR_MAX() { - return __WCHAR_MAX; - } - private static final int __WCHAR_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define __WCHAR_MIN -2147483648 - * } - */ - public static int __WCHAR_MIN() { - return __WCHAR_MIN; - } - private static final int INT8_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define INT8_MIN -128 - * } - */ - public static int INT8_MIN() { - return INT8_MIN; - } - private static final int INT16_MIN = (int)-32768L; - /** - * {@snippet lang=c : - * #define INT16_MIN -32768 - * } - */ - public static int INT16_MIN() { - return INT16_MIN; - } - private static final int INT32_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define INT32_MIN -2147483648 - * } - */ - public static int INT32_MIN() { - return INT32_MIN; - } - private static final long INT64_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT64_MIN -9223372036854775808 - * } - */ - public static long INT64_MIN() { - return INT64_MIN; - } - private static final int INT8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT8_MAX 127 - * } - */ - public static int INT8_MAX() { - return INT8_MAX; - } - private static final int INT16_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define INT16_MAX 32767 - * } - */ - public static int INT16_MAX() { - return INT16_MAX; - } - private static final int INT32_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define INT32_MAX 2147483647 - * } - */ - public static int INT32_MAX() { - return INT32_MAX; - } - private static final long INT64_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT64_MAX 9223372036854775807 - * } - */ - public static long INT64_MAX() { - return INT64_MAX; - } - private static final int UINT8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT8_MAX 255 - * } - */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - private static final int UINT16_MAX = (int)65535L; - /** - * {@snippet lang=c : - * #define UINT16_MAX 65535 - * } - */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - private static final int UINT32_MAX = (int)4294967295L; - /** - * {@snippet lang=c : - * #define UINT32_MAX 4294967295 - * } - */ - public static int UINT32_MAX() { - return UINT32_MAX; - } - private static final long UINT64_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT64_MAX -1 - * } - */ - public static long UINT64_MAX() { - return UINT64_MAX; - } - private static final int INT_LEAST8_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define INT_LEAST8_MIN -128 - * } - */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; - } - private static final int INT_LEAST16_MIN = (int)-32768L; - /** - * {@snippet lang=c : - * #define INT_LEAST16_MIN -32768 - * } - */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; - } - private static final int INT_LEAST32_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define INT_LEAST32_MIN -2147483648 - * } - */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; - } - private static final long INT_LEAST64_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT_LEAST64_MIN -9223372036854775808 - * } - */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; - } - private static final int INT_LEAST8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT_LEAST8_MAX 127 - * } - */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; - } - private static final int INT_LEAST16_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define INT_LEAST16_MAX 32767 - * } - */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; - } - private static final int INT_LEAST32_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define INT_LEAST32_MAX 2147483647 - * } - */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; - } - private static final long INT_LEAST64_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT_LEAST64_MAX 9223372036854775807 - * } - */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; - } - private static final int UINT_LEAST8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT_LEAST8_MAX 255 - * } - */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; - } - private static final int UINT_LEAST16_MAX = (int)65535L; - /** - * {@snippet lang=c : - * #define UINT_LEAST16_MAX 65535 - * } - */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; - } - private static final int UINT_LEAST32_MAX = (int)4294967295L; - /** - * {@snippet lang=c : - * #define UINT_LEAST32_MAX 4294967295 - * } - */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; - } - private static final long UINT_LEAST64_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT_LEAST64_MAX -1 - * } - */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; - } - private static final int INT_FAST8_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define INT_FAST8_MIN -128 - * } - */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; - } - private static final long INT_FAST16_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT_FAST16_MIN -9223372036854775808 - * } - */ - public static long INT_FAST16_MIN() { - return INT_FAST16_MIN; - } - private static final long INT_FAST32_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT_FAST32_MIN -9223372036854775808 - * } - */ - public static long INT_FAST32_MIN() { - return INT_FAST32_MIN; - } - private static final long INT_FAST64_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT_FAST64_MIN -9223372036854775808 - * } - */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; - } - private static final int INT_FAST8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT_FAST8_MAX 127 - * } - */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; - } - private static final long INT_FAST16_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT_FAST16_MAX 9223372036854775807 - * } - */ - public static long INT_FAST16_MAX() { - return INT_FAST16_MAX; - } - private static final long INT_FAST32_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT_FAST32_MAX 9223372036854775807 - * } - */ - public static long INT_FAST32_MAX() { - return INT_FAST32_MAX; - } - private static final long INT_FAST64_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT_FAST64_MAX 9223372036854775807 - * } - */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; - } - private static final int UINT_FAST8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT_FAST8_MAX 255 - * } - */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; - } - private static final long UINT_FAST16_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT_FAST16_MAX -1 - * } - */ - public static long UINT_FAST16_MAX() { - return UINT_FAST16_MAX; - } - private static final long UINT_FAST32_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT_FAST32_MAX -1 - * } - */ - public static long UINT_FAST32_MAX() { - return UINT_FAST32_MAX; - } - private static final long UINT_FAST64_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT_FAST64_MAX -1 - * } - */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; - } - private static final long INTPTR_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INTPTR_MIN -9223372036854775808 - * } - */ - public static long INTPTR_MIN() { - return INTPTR_MIN; - } - private static final long INTPTR_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INTPTR_MAX 9223372036854775807 - * } - */ - public static long INTPTR_MAX() { - return INTPTR_MAX; - } - private static final long UINTPTR_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINTPTR_MAX -1 - * } - */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; - } - private static final long INTMAX_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INTMAX_MIN -9223372036854775808 - * } - */ - public static long INTMAX_MIN() { - return INTMAX_MIN; - } - private static final long INTMAX_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INTMAX_MAX 9223372036854775807 - * } - */ - public static long INTMAX_MAX() { - return INTMAX_MAX; - } - private static final long UINTMAX_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINTMAX_MAX -1 - * } - */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; - } - private static final long PTRDIFF_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define PTRDIFF_MIN -9223372036854775808 - * } - */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; - } - private static final long PTRDIFF_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define PTRDIFF_MAX 9223372036854775807 - * } - */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; - } - private static final int SIG_ATOMIC_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define SIG_ATOMIC_MIN -2147483648 - * } - */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; - } - private static final int SIG_ATOMIC_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define SIG_ATOMIC_MAX 2147483647 - * } - */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; - } - private static final long SIZE_MAX = -1L; - /** - * {@snippet lang=c : - * #define SIZE_MAX -1 - * } - */ - public static long SIZE_MAX() { - return SIZE_MAX; - } - private static final int WCHAR_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define WCHAR_MIN -2147483648 - * } - */ - public static int WCHAR_MIN() { - return WCHAR_MIN; - } - private static final int WCHAR_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define WCHAR_MAX 2147483647 - * } - */ - public static int WCHAR_MAX() { - return WCHAR_MAX; - } - private static final int WINT_MIN = (int)0L; - /** - * {@snippet lang=c : - * #define WINT_MIN 0 - * } - */ - public static int WINT_MIN() { - return WINT_MIN; - } - private static final int WINT_MAX = (int)4294967295L; - /** - * {@snippet lang=c : - * #define WINT_MAX 4294967295 - * } - */ - public static int WINT_MAX() { - return WINT_MAX; - } - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); - /** - * {@snippet lang=c : - * #define NULL (void*) 0 - * } - */ - public static MemorySegment NULL() { - return NULL; - } - private static final long DLPACK_FLAG_BITMASK_READ_ONLY = 1L; - /** - * {@snippet lang=c : - * #define DLPACK_FLAG_BITMASK_READ_ONLY 1 - * } - */ - public static long DLPACK_FLAG_BITMASK_READ_ONLY() { - return DLPACK_FLAG_BITMASK_READ_ONLY; - } - private static final long DLPACK_FLAG_BITMASK_IS_COPIED = 2L; - /** - * {@snippet lang=c : - * #define DLPACK_FLAG_BITMASK_IS_COPIED 2 - * } - */ - public static long DLPACK_FLAG_BITMASK_IS_COPIED() { - return DLPACK_FLAG_BITMASK_IS_COPIED; - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/Fsidt.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/Fsidt.java deleted file mode 100644 index fb5f82ed18..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/Fsidt.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; -import static java.lang.foreign.MemoryLayout.PathElement.sequenceElement; - -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.SequenceLayout; -import java.lang.invoke.VarHandle; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct { - * int __val[2]; - * } - * } - */ -public class Fsidt { - - Fsidt() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout - .structLayout(MemoryLayout.sequenceLayout(2, CagraH.C_INT).withName("__val")).withName("$anon$155:12"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout __val$LAYOUT = (SequenceLayout) $LAYOUT.select(groupElement("__val")); - - /** - * Layout for field: - * {@snippet lang = c : * int __val[2] - * } - */ - public static final SequenceLayout __val$layout() { - return __val$LAYOUT; - } - - private static final long __val$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * int __val[2] - * } - */ - public static final long __val$offset() { - return __val$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * int __val[2] - * } - */ - public static MemorySegment __val(MemorySegment struct) { - return struct.asSlice(__val$OFFSET, __val$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang = c : * int __val[2] - * } - */ - public static void __val(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __val$OFFSET, __val$LAYOUT.byteSize()); - } - - private static long[] __val$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang = c : * int __val[2] - * } - */ - public static long[] __val$dimensions() { - return __val$DIMS; - } - - private static final VarHandle __val$ELEM_HANDLE = __val$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang = c : * int __val[2] - * } - */ - public static int __val(MemorySegment struct, long index0) { - return (int) __val$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang = c : * int __val[2] - * } - */ - public static void __val(MemorySegment struct, long index0, int fieldValue) { - __val$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/HnswH.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/HnswH.java deleted file mode 100644 index b6945030b4..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/HnswH.java +++ /dev/null @@ -1,2350 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.ValueLayout.JAVA_BYTE; - -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.PaddingLayout; -import java.lang.foreign.SequenceLayout; -import java.lang.foreign.StructLayout; -import java.lang.foreign.SymbolLookup; -import java.lang.foreign.ValueLayout; -import java.lang.foreign.ValueLayout.OfByte; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.lang.foreign.ValueLayout.OfShort; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.util.Arrays; -import java.util.stream.Collectors; - -public class HnswH { - - HnswH() { - // Should not be called directly - } - - static final Arena LIBRARY_ARENA = Arena.ofAuto(); - static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); - - static void traceDowncall(String name, Object... args) { - String traceArgs = Arrays.stream(args).map(Object::toString).collect(Collectors.joining(", ")); - System.out.printf("%s(%s)\n", name, traceArgs); - } - - static MemorySegment findOrThrow(String symbol) { - return SYMBOL_LOOKUP.find(symbol).orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); - } - - static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { - try { - return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); - } catch (ReflectiveOperationException ex) { - throw new AssertionError(ex); - } - } - - static MemoryLayout align(MemoryLayout layout, long align) { - return switch (layout) { - case PaddingLayout p -> p; - case ValueLayout v -> v.withByteAlignment(align); - case GroupLayout g -> { - MemoryLayout[] alignedMembers = g.memberLayouts().stream().map(m -> align(m, align)).toArray(MemoryLayout[]::new); - yield g instanceof StructLayout ? MemoryLayout.structLayout(alignedMembers) - : MemoryLayout.unionLayout(alignedMembers); - } - case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); - }; - } - - static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup().or(Linker.nativeLinker().defaultLookup()); - - public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; - public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; - public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; - public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; - public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; - public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; - public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; - public static final AddressLayout C_POINTER = ValueLayout.ADDRESS - .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); - public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; - private static final int DLPACK_VERSION = (int) 80L; - - /** - * {@snippet lang = c : * #define DLPACK_VERSION 80 - * } - */ - public static int DLPACK_VERSION() { - return DLPACK_VERSION; - } - - private static final int DLPACK_ABI_VERSION = (int) 1L; - - /** - * {@snippet lang = c : * #define DLPACK_ABI_VERSION 1 - * } - */ - public static int DLPACK_ABI_VERSION() { - return DLPACK_ABI_VERSION; - } - - private static final int _STDINT_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _STDINT_H 1 - * } - */ - public static int _STDINT_H() { - return _STDINT_H; - } - - private static final int _FEATURES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _FEATURES_H 1 - * } - */ - public static int _FEATURES_H() { - return _FEATURES_H; - } - - private static final int _DEFAULT_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _DEFAULT_SOURCE 1 - * } - */ - public static int _DEFAULT_SOURCE() { - return _DEFAULT_SOURCE; - } - - private static final int __GLIBC_USE_ISOC2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_ISOC2X 0 - * } - */ - public static int __GLIBC_USE_ISOC2X() { - return __GLIBC_USE_ISOC2X; - } - - private static final int __USE_ISOC11 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC11 1 - * } - */ - public static int __USE_ISOC11() { - return __USE_ISOC11; - } - - private static final int __USE_ISOC99 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC99 1 - * } - */ - public static int __USE_ISOC99() { - return __USE_ISOC99; - } - - private static final int __USE_ISOC95 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC95 1 - * } - */ - public static int __USE_ISOC95() { - return __USE_ISOC95; - } - - private static final int __USE_POSIX_IMPLICITLY = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX_IMPLICITLY 1 - * } - */ - public static int __USE_POSIX_IMPLICITLY() { - return __USE_POSIX_IMPLICITLY; - } - - private static final int _POSIX_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _POSIX_SOURCE 1 - * } - */ - public static int _POSIX_SOURCE() { - return _POSIX_SOURCE; - } - - private static final int __USE_POSIX = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX 1 - * } - */ - public static int __USE_POSIX() { - return __USE_POSIX; - } - - private static final int __USE_POSIX2 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX2 1 - * } - */ - public static int __USE_POSIX2() { - return __USE_POSIX2; - } - - private static final int __USE_POSIX199309 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX199309 1 - * } - */ - public static int __USE_POSIX199309() { - return __USE_POSIX199309; - } - - private static final int __USE_POSIX199506 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX199506 1 - * } - */ - public static int __USE_POSIX199506() { - return __USE_POSIX199506; - } - - private static final int __USE_XOPEN2K = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_XOPEN2K 1 - * } - */ - public static int __USE_XOPEN2K() { - return __USE_XOPEN2K; - } - - private static final int __USE_XOPEN2K8 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_XOPEN2K8 1 - * } - */ - public static int __USE_XOPEN2K8() { - return __USE_XOPEN2K8; - } - - private static final int _ATFILE_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _ATFILE_SOURCE 1 - * } - */ - public static int _ATFILE_SOURCE() { - return _ATFILE_SOURCE; - } - - private static final int __WORDSIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - - private static final int __WORDSIZE_TIME64_COMPAT32 = (int) 1L; - - /** - * {@snippet lang = c : * #define __WORDSIZE_TIME64_COMPAT32 1 - * } - */ - public static int __WORDSIZE_TIME64_COMPAT32() { - return __WORDSIZE_TIME64_COMPAT32; - } - - private static final int __SYSCALL_WORDSIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __SYSCALL_WORDSIZE 64 - * } - */ - public static int __SYSCALL_WORDSIZE() { - return __SYSCALL_WORDSIZE; - } - - private static final int __USE_MISC = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_MISC 1 - * } - */ - public static int __USE_MISC() { - return __USE_MISC; - } - - private static final int __USE_ATFILE = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ATFILE 1 - * } - */ - public static int __USE_ATFILE() { - return __USE_ATFILE; - } - - private static final int __USE_FORTIFY_LEVEL = (int) 0L; - - /** - * {@snippet lang = c : * #define __USE_FORTIFY_LEVEL 0 - * } - */ - public static int __USE_FORTIFY_LEVEL() { - return __USE_FORTIFY_LEVEL; - } - - private static final int __GLIBC_USE_DEPRECATED_GETS = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_DEPRECATED_GETS 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_GETS() { - return __GLIBC_USE_DEPRECATED_GETS; - } - - private static final int __GLIBC_USE_DEPRECATED_SCANF = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_DEPRECATED_SCANF 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_SCANF() { - return __GLIBC_USE_DEPRECATED_SCANF; - } - - private static final int _STDC_PREDEF_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _STDC_PREDEF_H 1 - * } - */ - public static int _STDC_PREDEF_H() { - return _STDC_PREDEF_H; - } - - private static final int __STDC_IEC_559__ = (int) 1L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_559__ 1 - * } - */ - public static int __STDC_IEC_559__() { - return __STDC_IEC_559__; - } - - private static final int __STDC_IEC_559_COMPLEX__ = (int) 1L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_559_COMPLEX__ 1 - * } - */ - public static int __STDC_IEC_559_COMPLEX__() { - return __STDC_IEC_559_COMPLEX__; - } - - private static final int __GNU_LIBRARY__ = (int) 6L; - - /** - * {@snippet lang = c : * #define __GNU_LIBRARY__ 6 - * } - */ - public static int __GNU_LIBRARY__() { - return __GNU_LIBRARY__; - } - - private static final int __GLIBC__ = (int) 2L; - - /** - * {@snippet lang = c : * #define __GLIBC__ 2 - * } - */ - public static int __GLIBC__() { - return __GLIBC__; - } - - private static final int __GLIBC_MINOR__ = (int) 35L; - - /** - * {@snippet lang = c : * #define __GLIBC_MINOR__ 35 - * } - */ - public static int __GLIBC_MINOR__() { - return __GLIBC_MINOR__; - } - - private static final int _SYS_CDEFS_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _SYS_CDEFS_H 1 - * } - */ - public static int _SYS_CDEFS_H() { - return _SYS_CDEFS_H; - } - - private static final int __glibc_c99_flexarr_available = (int) 1L; - - /** - * {@snippet lang = c : * #define __glibc_c99_flexarr_available 1 - * } - */ - public static int __glibc_c99_flexarr_available() { - return __glibc_c99_flexarr_available; - } - - private static final int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = (int) 0L; - - /** - * {@snippet lang = c : * #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 - * } - */ - public static int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI() { - return __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI; - } - - private static final int __HAVE_GENERIC_SELECTION = (int) 1L; - - /** - * {@snippet lang = c : * #define __HAVE_GENERIC_SELECTION 1 - * } - */ - public static int __HAVE_GENERIC_SELECTION() { - return __HAVE_GENERIC_SELECTION; - } - - private static final int __GLIBC_USE_LIB_EXT2 = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_LIB_EXT2 0 - * } - */ - public static int __GLIBC_USE_LIB_EXT2() { - return __GLIBC_USE_LIB_EXT2; - } - - private static final int __GLIBC_USE_IEC_60559_BFP_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_BFP_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT() { - return __GLIBC_USE_IEC_60559_BFP_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_BFP_EXT_C2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT_C2X() { - return __GLIBC_USE_IEC_60559_BFP_EXT_C2X; - } - - private static final int __GLIBC_USE_IEC_60559_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_EXT() { - return __GLIBC_USE_IEC_60559_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X; - } - - private static final int __GLIBC_USE_IEC_60559_TYPES_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_TYPES_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_TYPES_EXT() { - return __GLIBC_USE_IEC_60559_TYPES_EXT; - } - - private static final int _BITS_TYPES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TYPES_H 1 - * } - */ - public static int _BITS_TYPES_H() { - return _BITS_TYPES_H; - } - - private static final int _BITS_TYPESIZES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TYPESIZES_H 1 - * } - */ - public static int _BITS_TYPESIZES_H() { - return _BITS_TYPESIZES_H; - } - - private static final int __OFF_T_MATCHES_OFF64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __OFF_T_MATCHES_OFF64_T 1 - * } - */ - public static int __OFF_T_MATCHES_OFF64_T() { - return __OFF_T_MATCHES_OFF64_T; - } - - private static final int __INO_T_MATCHES_INO64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __INO_T_MATCHES_INO64_T 1 - * } - */ - public static int __INO_T_MATCHES_INO64_T() { - return __INO_T_MATCHES_INO64_T; - } - - private static final int __RLIM_T_MATCHES_RLIM64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __RLIM_T_MATCHES_RLIM64_T 1 - * } - */ - public static int __RLIM_T_MATCHES_RLIM64_T() { - return __RLIM_T_MATCHES_RLIM64_T; - } - - private static final int __STATFS_MATCHES_STATFS64 = (int) 1L; - - /** - * {@snippet lang = c : * #define __STATFS_MATCHES_STATFS64 1 - * } - */ - public static int __STATFS_MATCHES_STATFS64() { - return __STATFS_MATCHES_STATFS64; - } - - private static final int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = (int) 1L; - - /** - * {@snippet lang = c : * #define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 - * } - */ - public static int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64() { - return __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64; - } - - private static final int __FD_SETSIZE = (int) 1024L; - - /** - * {@snippet lang = c : * #define __FD_SETSIZE 1024 - * } - */ - public static int __FD_SETSIZE() { - return __FD_SETSIZE; - } - - private static final int _BITS_TIME64_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TIME64_H 1 - * } - */ - public static int _BITS_TIME64_H() { - return _BITS_TIME64_H; - } - - private static final int _BITS_WCHAR_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_WCHAR_H 1 - * } - */ - public static int _BITS_WCHAR_H() { - return _BITS_WCHAR_H; - } - - private static final int _BITS_STDINT_INTN_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_STDINT_INTN_H 1 - * } - */ - public static int _BITS_STDINT_INTN_H() { - return _BITS_STDINT_INTN_H; - } - - private static final int _BITS_STDINT_UINTN_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_STDINT_UINTN_H 1 - * } - */ - public static int _BITS_STDINT_UINTN_H() { - return _BITS_STDINT_UINTN_H; - } - - private static final int true_ = (int) 1L; - - /** - * {@snippet lang = c : * #define true 1 - * } - */ - public static int true_() { - return true_; - } - - private static final int false_ = (int) 0L; - - /** - * {@snippet lang = c : * #define false 0 - * } - */ - public static int false_() { - return false_; - } - - private static final int __bool_true_false_are_defined = (int) 1L; - - /** - * {@snippet lang = c : * #define __bool_true_false_are_defined 1 - * } - */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } - - private static final int L2Expanded = (int) 0L; - - /** - * {@snippet lang = c : * enum .L2Expanded = 0 - * } - */ - public static int L2Expanded() { - return L2Expanded; - } - - private static final int L2SqrtExpanded = (int) 1L; - - /** - * {@snippet lang = c : * enum .L2SqrtExpanded = 1 - * } - */ - public static int L2SqrtExpanded() { - return L2SqrtExpanded; - } - - private static final int CosineExpanded = (int) 2L; - - /** - * {@snippet lang = c : * enum .CosineExpanded = 2 - * } - */ - public static int CosineExpanded() { - return CosineExpanded; - } - - private static final int L1 = (int) 3L; - - /** - * {@snippet lang = c : * enum .L1 = 3 - * } - */ - public static int L1() { - return L1; - } - - private static final int L2Unexpanded = (int) 4L; - - /** - * {@snippet lang = c : * enum .L2Unexpanded = 4 - * } - */ - public static int L2Unexpanded() { - return L2Unexpanded; - } - - private static final int L2SqrtUnexpanded = (int) 5L; - - /** - * {@snippet lang = c : * enum .L2SqrtUnexpanded = 5 - * } - */ - public static int L2SqrtUnexpanded() { - return L2SqrtUnexpanded; - } - - private static final int InnerProduct = (int) 6L; - - /** - * {@snippet lang = c : * enum .InnerProduct = 6 - * } - */ - public static int InnerProduct() { - return InnerProduct; - } - - private static final int Linf = (int) 7L; - - /** - * {@snippet lang = c : * enum .Linf = 7 - * } - */ - public static int Linf() { - return Linf; - } - - private static final int Canberra = (int) 8L; - - /** - * {@snippet lang = c : * enum .Canberra = 8 - * } - */ - public static int Canberra() { - return Canberra; - } - - private static final int LpUnexpanded = (int) 9L; - - /** - * {@snippet lang = c : * enum .LpUnexpanded = 9 - * } - */ - public static int LpUnexpanded() { - return LpUnexpanded; - } - - private static final int CorrelationExpanded = (int) 10L; - - /** - * {@snippet lang = c : * enum .CorrelationExpanded = 10 - * } - */ - public static int CorrelationExpanded() { - return CorrelationExpanded; - } - - private static final int JaccardExpanded = (int) 11L; - - /** - * {@snippet lang = c : * enum .JaccardExpanded = 11 - * } - */ - public static int JaccardExpanded() { - return JaccardExpanded; - } - - private static final int HellingerExpanded = (int) 12L; - - /** - * {@snippet lang = c : * enum .HellingerExpanded = 12 - * } - */ - public static int HellingerExpanded() { - return HellingerExpanded; - } - - private static final int Haversine = (int) 13L; - - /** - * {@snippet lang = c : * enum .Haversine = 13 - * } - */ - public static int Haversine() { - return Haversine; - } - - private static final int BrayCurtis = (int) 14L; - - /** - * {@snippet lang = c : * enum .BrayCurtis = 14 - * } - */ - public static int BrayCurtis() { - return BrayCurtis; - } - - private static final int JensenShannon = (int) 15L; - - /** - * {@snippet lang = c : * enum .JensenShannon = 15 - * } - */ - public static int JensenShannon() { - return JensenShannon; - } - - private static final int HammingUnexpanded = (int) 16L; - - /** - * {@snippet lang = c : * enum .HammingUnexpanded = 16 - * } - */ - public static int HammingUnexpanded() { - return HammingUnexpanded; - } - - private static final int KLDivergence = (int) 17L; - - /** - * {@snippet lang = c : * enum .KLDivergence = 17 - * } - */ - public static int KLDivergence() { - return KLDivergence; - } - - private static final int RusselRaoExpanded = (int) 18L; - - /** - * {@snippet lang = c : * enum .RusselRaoExpanded = 18 - * } - */ - public static int RusselRaoExpanded() { - return RusselRaoExpanded; - } - - private static final int DiceExpanded = (int) 19L; - - /** - * {@snippet lang = c : * enum .DiceExpanded = 19 - * } - */ - public static int DiceExpanded() { - return DiceExpanded; - } - - private static final int Precomputed = (int) 100L; - - /** - * {@snippet lang = c : * enum .Precomputed = 100 - * } - */ - public static int Precomputed() { - return Precomputed; - } - - /** - * {@snippet lang = c : * typedef unsigned char __u_char - * } - */ - public static final OfByte __u_char = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned short __u_short - * } - */ - public static final OfShort __u_short = HnswH.C_SHORT; - /** - * {@snippet lang = c : * typedef unsigned int __u_int - * } - */ - public static final OfInt __u_int = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __u_long - * } - */ - public static final OfLong __u_long = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef signed char __int8_t - * } - */ - public static final OfByte __int8_t = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned char __uint8_t - * } - */ - public static final OfByte __uint8_t = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef short __int16_t - * } - */ - public static final OfShort __int16_t = HnswH.C_SHORT; - /** - * {@snippet lang = c : * typedef unsigned short __uint16_t - * } - */ - public static final OfShort __uint16_t = HnswH.C_SHORT; - /** - * {@snippet lang = c : * typedef int __int32_t - * } - */ - public static final OfInt __int32_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned int __uint32_t - * } - */ - public static final OfInt __uint32_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef long __int64_t - * } - */ - public static final OfLong __int64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __uint64_t - * } - */ - public static final OfLong __uint64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef __int8_t __int_least8_t - * } - */ - public static final OfByte __int_least8_t = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint8_t __uint_least8_t - * } - */ - public static final OfByte __uint_least8_t = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int16_t __int_least16_t - * } - */ - public static final OfShort __int_least16_t = HnswH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint16_t __uint_least16_t - * } - */ - public static final OfShort __uint_least16_t = HnswH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int32_t __int_least32_t - * } - */ - public static final OfInt __int_least32_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef __uint32_t __uint_least32_t - * } - */ - public static final OfInt __uint_least32_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef __int64_t __int_least64_t - * } - */ - public static final OfLong __int_least64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint64_t __uint_least64_t - * } - */ - public static final OfLong __uint_least64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long __quad_t - * } - */ - public static final OfLong __quad_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __u_quad_t - * } - */ - public static final OfLong __u_quad_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long __intmax_t - * } - */ - public static final OfLong __intmax_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __uintmax_t - * } - */ - public static final OfLong __uintmax_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __dev_t - * } - */ - public static final OfLong __dev_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __uid_t - * } - */ - public static final OfInt __uid_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned int __gid_t - * } - */ - public static final OfInt __gid_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __ino_t - * } - */ - public static final OfLong __ino_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __ino64_t - * } - */ - public static final OfLong __ino64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __mode_t - * } - */ - public static final OfInt __mode_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __nlink_t - * } - */ - public static final OfLong __nlink_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long __off_t - * } - */ - public static final OfLong __off_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long __off64_t - * } - */ - public static final OfLong __off64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef int __pid_t - * } - */ - public static final OfInt __pid_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef long __clock_t - * } - */ - public static final OfLong __clock_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __rlim_t - * } - */ - public static final OfLong __rlim_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __rlim64_t - * } - */ - public static final OfLong __rlim64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __id_t - * } - */ - public static final OfInt __id_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef long __time_t - * } - */ - public static final OfLong __time_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __useconds_t - * } - */ - public static final OfInt __useconds_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef long __suseconds_t - * } - */ - public static final OfLong __suseconds_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long __suseconds64_t - * } - */ - public static final OfLong __suseconds64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef int __daddr_t - * } - */ - public static final OfInt __daddr_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef int __key_t - * } - */ - public static final OfInt __key_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef int __clockid_t - * } - */ - public static final OfInt __clockid_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef void *__timer_t - * } - */ - public static final AddressLayout __timer_t = HnswH.C_POINTER; - /** - * {@snippet lang = c : * typedef long __blksize_t - * } - */ - public static final OfLong __blksize_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long __blkcnt_t - * } - */ - public static final OfLong __blkcnt_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long __blkcnt64_t - * } - */ - public static final OfLong __blkcnt64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsblkcnt_t - * } - */ - public static final OfLong __fsblkcnt_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsblkcnt64_t - * } - */ - public static final OfLong __fsblkcnt64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsfilcnt_t - * } - */ - public static final OfLong __fsfilcnt_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsfilcnt64_t - * } - */ - public static final OfLong __fsfilcnt64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long __fsword_t - * } - */ - public static final OfLong __fsword_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long __ssize_t - * } - */ - public static final OfLong __ssize_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long __syscall_slong_t - * } - */ - public static final OfLong __syscall_slong_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __syscall_ulong_t - * } - */ - public static final OfLong __syscall_ulong_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef __off64_t __loff_t - * } - */ - public static final OfLong __loff_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef char *__caddr_t - * } - */ - public static final AddressLayout __caddr_t = HnswH.C_POINTER; - /** - * {@snippet lang = c : * typedef long __intptr_t - * } - */ - public static final OfLong __intptr_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __socklen_t - * } - */ - public static final OfInt __socklen_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef int __sig_atomic_t - * } - */ - public static final OfInt __sig_atomic_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef __int8_t int8_t - * } - */ - public static final OfByte int8_t = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int16_t int16_t - * } - */ - public static final OfShort int16_t = HnswH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int32_t int32_t - * } - */ - public static final OfInt int32_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef __int64_t int64_t - * } - */ - public static final OfLong int64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint8_t uint8_t - * } - */ - public static final OfByte uint8_t = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint16_t uint16_t - * } - */ - public static final OfShort uint16_t = HnswH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint32_t uint32_t - * } - */ - public static final OfInt uint32_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef __uint64_t uint64_t - * } - */ - public static final OfLong uint64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef __int_least8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int_least16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = HnswH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int_least32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef __int_least64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint_least8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint_least16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = HnswH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint_least32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = HnswH.C_INT; - /** - * {@snippet lang = c : * typedef __uint_least64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef signed char int_fast8_t - * } - */ - public static final OfByte int_fast8_t = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef long int_fast16_t - * } - */ - public static final OfLong int_fast16_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long int_fast32_t - * } - */ - public static final OfLong int_fast32_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long int_fast64_t - * } - */ - public static final OfLong int_fast64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned char uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = HnswH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast16_t - * } - */ - public static final OfLong uint_fast16_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast32_t - * } - */ - public static final OfLong uint_fast32_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long intptr_t - * } - */ - public static final OfLong intptr_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uintptr_t - * } - */ - public static final OfLong uintptr_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef __intmax_t intmax_t - * } - */ - public static final OfLong intmax_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef __uintmax_t uintmax_t - * } - */ - public static final OfLong uintmax_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long size_t - * } - */ - public static final OfLong size_t = HnswH.C_LONG; - /** - * {@snippet lang = c : * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = HnswH.C_INT; - private static final int kDLCPU = (int) 1L; - - /** - * {@snippet lang = c : * enum .kDLCPU = 1 - * } - */ - public static int kDLCPU() { - return kDLCPU; - } - - private static final int kDLCUDA = (int) 2L; - - /** - * {@snippet lang = c : * enum .kDLCUDA = 2 - * } - */ - public static int kDLCUDA() { - return kDLCUDA; - } - - private static final int kDLCUDAHost = (int) 3L; - - /** - * {@snippet lang = c : * enum .kDLCUDAHost = 3 - * } - */ - public static int kDLCUDAHost() { - return kDLCUDAHost; - } - - private static final int kDLOpenCL = (int) 4L; - - /** - * {@snippet lang = c : * enum .kDLOpenCL = 4 - * } - */ - public static int kDLOpenCL() { - return kDLOpenCL; - } - - private static final int kDLVulkan = (int) 7L; - - /** - * {@snippet lang = c : * enum .kDLVulkan = 7 - * } - */ - public static int kDLVulkan() { - return kDLVulkan; - } - - private static final int kDLMetal = (int) 8L; - - /** - * {@snippet lang = c : * enum .kDLMetal = 8 - * } - */ - public static int kDLMetal() { - return kDLMetal; - } - - private static final int kDLVPI = (int) 9L; - - /** - * {@snippet lang = c : * enum .kDLVPI = 9 - * } - */ - public static int kDLVPI() { - return kDLVPI; - } - - private static final int kDLROCM = (int) 10L; - - /** - * {@snippet lang = c : * enum .kDLROCM = 10 - * } - */ - public static int kDLROCM() { - return kDLROCM; - } - - private static final int kDLROCMHost = (int) 11L; - - /** - * {@snippet lang = c : * enum .kDLROCMHost = 11 - * } - */ - public static int kDLROCMHost() { - return kDLROCMHost; - } - - private static final int kDLExtDev = (int) 12L; - - /** - * {@snippet lang = c : * enum .kDLExtDev = 12 - * } - */ - public static int kDLExtDev() { - return kDLExtDev; - } - - private static final int kDLCUDAManaged = (int) 13L; - - /** - * {@snippet lang = c : * enum .kDLCUDAManaged = 13 - * } - */ - public static int kDLCUDAManaged() { - return kDLCUDAManaged; - } - - private static final int kDLOneAPI = (int) 14L; - - /** - * {@snippet lang = c : * enum .kDLOneAPI = 14 - * } - */ - public static int kDLOneAPI() { - return kDLOneAPI; - } - - private static final int kDLWebGPU = (int) 15L; - - /** - * {@snippet lang = c : * enum .kDLWebGPU = 15 - * } - */ - public static int kDLWebGPU() { - return kDLWebGPU; - } - - private static final int kDLHexagon = (int) 16L; - - /** - * {@snippet lang = c : * enum .kDLHexagon = 16 - * } - */ - public static int kDLHexagon() { - return kDLHexagon; - } - - private static final int kDLInt = (int) 0L; - - /** - * {@snippet lang = c : * enum .kDLInt = 0 - * } - */ - public static int kDLInt() { - return kDLInt; - } - - private static final int kDLUInt = (int) 1L; - - /** - * {@snippet lang = c : * enum .kDLUInt = 1 - * } - */ - public static int kDLUInt() { - return kDLUInt; - } - - private static final int kDLFloat = (int) 2L; - - /** - * {@snippet lang = c : * enum .kDLFloat = 2 - * } - */ - public static int kDLFloat() { - return kDLFloat; - } - - private static final int kDLOpaqueHandle = (int) 3L; - - /** - * {@snippet lang = c : * enum .kDLOpaqueHandle = 3 - * } - */ - public static int kDLOpaqueHandle() { - return kDLOpaqueHandle; - } - - private static final int kDLBfloat = (int) 4L; - - /** - * {@snippet lang = c : * enum .kDLBfloat = 4 - * } - */ - public static int kDLBfloat() { - return kDLBfloat; - } - - private static final int kDLComplex = (int) 5L; - - /** - * {@snippet lang = c : * enum .kDLComplex = 5 - * } - */ - public static int kDLComplex() { - return kDLComplex; - } - - private static final int kDLBool = (int) 6L; - - /** - * {@snippet lang = c : * enum .kDLBool = 6 - * } - */ - public static int kDLBool() { - return kDLBool; - } - - private static final int AUTO_SELECT = (int) 0L; - - /** - * {@snippet lang = c : * enum cuvsCagraGraphBuildAlgo.AUTO_SELECT = 0 - * } - */ - public static int AUTO_SELECT() { - return AUTO_SELECT; - } - - private static final int IVF_PQ = (int) 1L; - - /** - * {@snippet lang = c : * enum cuvsCagraGraphBuildAlgo.IVF_PQ = 1 - * } - */ - public static int IVF_PQ() { - return IVF_PQ; - } - - private static final int NN_DESCENT = (int) 2L; - - /** - * {@snippet lang = c : * enum cuvsCagraGraphBuildAlgo.NN_DESCENT = 2 - * } - */ - public static int NN_DESCENT() { - return NN_DESCENT; - } - - /** - * {@snippet lang = c : - * typedef struct cuvsCagraCompressionParams { - * uint32_t pq_bits; - * uint32_t pq_dim; - * uint32_t vq_n_centers; - * uint32_t kmeans_n_iters; - * double vq_kmeans_trainset_fraction; - * double pq_kmeans_trainset_fraction; - * } *cuvsCagraCompressionParams_t - * } - */ - public static final AddressLayout cuvsCagraCompressionParams_t = HnswH.C_POINTER; - /** - * {@snippet lang = c : - * typedef struct cuvsCagraIndexParams { - * cuvsDistanceType metric; - * long intermediate_graph_degree; - * long graph_degree; - * enum cuvsCagraGraphBuildAlgo build_algo; - * long nn_descent_niter; - * cuvsCagraCompressionParams_t compression; - * } *cuvsCagraIndexParams_t - * } - */ - public static final AddressLayout cuvsCagraIndexParams_t = HnswH.C_POINTER; - private static final int SINGLE_CTA = (int) 0L; - - /** - * {@snippet lang = c : * enum cuvsCagraSearchAlgo.SINGLE_CTA = 0 - * } - */ - public static int SINGLE_CTA() { - return SINGLE_CTA; - } - - private static final int MULTI_CTA = (int) 1L; - - /** - * {@snippet lang = c : * enum cuvsCagraSearchAlgo.MULTI_CTA = 1 - * } - */ - public static int MULTI_CTA() { - return MULTI_CTA; - } - - private static final int MULTI_KERNEL = (int) 2L; - - /** - * {@snippet lang = c : * enum cuvsCagraSearchAlgo.MULTI_KERNEL = 2 - * } - */ - public static int MULTI_KERNEL() { - return MULTI_KERNEL; - } - - private static final int AUTO = (int) 3L; - - /** - * {@snippet lang = c : * enum cuvsCagraSearchAlgo.AUTO = 3 - * } - */ - public static int AUTO() { - return AUTO; - } - - private static final int HASH = (int) 0L; - - /** - * {@snippet lang = c : * enum cuvsCagraHashMode.HASH = 0 - * } - */ - public static int HASH() { - return HASH; - } - - private static final int SMALL = (int) 1L; - - /** - * {@snippet lang = c : * enum cuvsCagraHashMode.SMALL = 1 - * } - */ - public static int SMALL() { - return SMALL; - } - - private static final int AUTO_HASH = (int) 2L; - - /** - * {@snippet lang = c : * enum cuvsCagraHashMode.AUTO_HASH = 2 - * } - */ - public static int AUTO_HASH() { - return AUTO_HASH; - } - - /** - * {@snippet lang = c : - * typedef struct cuvsCagraSearchParams { - * long max_queries; - * long itopk_size; - * long max_iterations; - * enum cuvsCagraSearchAlgo algo; - * long team_size; - * long search_width; - * long min_iterations; - * long thread_block_size; - * enum cuvsCagraHashMode hashmap_mode; - * long hashmap_min_bitlen; - * float hashmap_max_fill_rate; - * uint32_t num_random_samplings; - * uint64_t rand_xor_mask; - * } *cuvsCagraSearchParams_t - * } - */ - public static final AddressLayout cuvsCagraSearchParams_t = HnswH.C_POINTER; - /** - * {@snippet lang = c : * typedef cuvsCagraIndex *cuvsCagraIndex_t - * } - */ - public static final AddressLayout cuvsCagraIndex_t = HnswH.C_POINTER; - private static final int NONE = (int) 0L; - - /** - * {@snippet lang = c : * enum cuvsHnswHierarchy.NONE = 0 - * } - */ - public static int NONE() { - return NONE; - } - - private static final int CPU = (int) 1L; - - /** - * {@snippet lang = c : * enum cuvsHnswHierarchy.CPU = 1 - * } - */ - public static int CPU() { - return CPU; - } - - /** - * {@snippet lang = c : - * typedef struct cuvsHnswIndexParams { - * cuvsHnswHierarchy hierarchy; - * int ef_construction; - * int num_threads; - * } *cuvsHnswIndexParams_t - * } - */ - public static final AddressLayout cuvsHnswIndexParams_t = HnswH.C_POINTER; - /** - * {@snippet lang = c : * typedef cuvsHnswIndex *cuvsHnswIndex_t - * } - */ - public static final AddressLayout cuvsHnswIndex_t = HnswH.C_POINTER; - /** - * {@snippet lang = c : - * typedef struct cuvsHnswExtendParams { - * int num_threads; - * } *cuvsHnswExtendParams_t - * } - */ - public static final AddressLayout cuvsHnswExtendParams_t = HnswH.C_POINTER; - /** - * {@snippet lang = c : - * typedef struct cuvsHnswSearchParams { - * int32_t ef; - * int32_t num_threads; - * } *cuvsHnswSearchParams_t - * } - */ - public static final AddressLayout cuvsHnswSearchParams_t = HnswH.C_POINTER; - private static final long _POSIX_C_SOURCE = 200809L; - - /** - * {@snippet lang = c : * #define _POSIX_C_SOURCE 200809 - * } - */ - public static long _POSIX_C_SOURCE() { - return _POSIX_C_SOURCE; - } - - private static final int __TIMESIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __TIMESIZE 64 - * } - */ - public static int __TIMESIZE() { - return __TIMESIZE; - } - - private static final long __STDC_IEC_60559_BFP__ = 201404L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_60559_BFP__ 201404 - * } - */ - public static long __STDC_IEC_60559_BFP__() { - return __STDC_IEC_60559_BFP__; - } - - private static final long __STDC_IEC_60559_COMPLEX__ = 201404L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_60559_COMPLEX__ 201404 - * } - */ - public static long __STDC_IEC_60559_COMPLEX__() { - return __STDC_IEC_60559_COMPLEX__; - } - - private static final long __STDC_ISO_10646__ = 201706L; - - /** - * {@snippet lang = c : * #define __STDC_ISO_10646__ 201706 - * } - */ - public static long __STDC_ISO_10646__() { - return __STDC_ISO_10646__; - } - - private static final int __WCHAR_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define __WCHAR_MAX 2147483647 - * } - */ - public static int __WCHAR_MAX() { - return __WCHAR_MAX; - } - - private static final int __WCHAR_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define __WCHAR_MIN -2147483648 - * } - */ - public static int __WCHAR_MIN() { - return __WCHAR_MIN; - } - - private static final int INT8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT8_MIN -128 - * } - */ - public static int INT8_MIN() { - return INT8_MIN; - } - - private static final int INT16_MIN = (int) -32768L; - - /** - * {@snippet lang = c : * #define INT16_MIN -32768 - * } - */ - public static int INT16_MIN() { - return INT16_MIN; - } - - private static final int INT32_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define INT32_MIN -2147483648 - * } - */ - public static int INT32_MIN() { - return INT32_MIN; - } - - private static final long INT64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT64_MIN -9223372036854775808 - * } - */ - public static long INT64_MIN() { - return INT64_MIN; - } - - private static final int INT8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT8_MAX 127 - * } - */ - public static int INT8_MAX() { - return INT8_MAX; - } - - private static final int INT16_MAX = (int) 32767L; - - /** - * {@snippet lang = c : * #define INT16_MAX 32767 - * } - */ - public static int INT16_MAX() { - return INT16_MAX; - } - - private static final int INT32_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define INT32_MAX 2147483647 - * } - */ - public static int INT32_MAX() { - return INT32_MAX; - } - - private static final long INT64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT64_MAX 9223372036854775807 - * } - */ - public static long INT64_MAX() { - return INT64_MAX; - } - - private static final int UINT8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT8_MAX 255 - * } - */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - - private static final int UINT16_MAX = (int) 65535L; - - /** - * {@snippet lang = c : * #define UINT16_MAX 65535 - * } - */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - - private static final int UINT32_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define UINT32_MAX 4294967295 - * } - */ - public static int UINT32_MAX() { - return UINT32_MAX; - } - - private static final long UINT64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT64_MAX -1 - * } - */ - public static long UINT64_MAX() { - return UINT64_MAX; - } - - private static final int INT_LEAST8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT_LEAST8_MIN -128 - * } - */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; - } - - private static final int INT_LEAST16_MIN = (int) -32768L; - - /** - * {@snippet lang = c : * #define INT_LEAST16_MIN -32768 - * } - */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; - } - - private static final int INT_LEAST32_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define INT_LEAST32_MIN -2147483648 - * } - */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; - } - - private static final long INT_LEAST64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_LEAST64_MIN -9223372036854775808 - * } - */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; - } - - private static final int INT_LEAST8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT_LEAST8_MAX 127 - * } - */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; - } - - private static final int INT_LEAST16_MAX = (int) 32767L; - - /** - * {@snippet lang = c : * #define INT_LEAST16_MAX 32767 - * } - */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; - } - - private static final int INT_LEAST32_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define INT_LEAST32_MAX 2147483647 - * } - */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; - } - - private static final long INT_LEAST64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_LEAST64_MAX 9223372036854775807 - * } - */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; - } - - private static final int UINT_LEAST8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT_LEAST8_MAX 255 - * } - */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; - } - - private static final int UINT_LEAST16_MAX = (int) 65535L; - - /** - * {@snippet lang = c : * #define UINT_LEAST16_MAX 65535 - * } - */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; - } - - private static final int UINT_LEAST32_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define UINT_LEAST32_MAX 4294967295 - * } - */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; - } - - private static final long UINT_LEAST64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_LEAST64_MAX -1 - * } - */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; - } - - private static final int INT_FAST8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT_FAST8_MIN -128 - * } - */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; - } - - private static final long INT_FAST16_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST16_MIN -9223372036854775808 - * } - */ - public static long INT_FAST16_MIN() { - return INT_FAST16_MIN; - } - - private static final long INT_FAST32_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST32_MIN -9223372036854775808 - * } - */ - public static long INT_FAST32_MIN() { - return INT_FAST32_MIN; - } - - private static final long INT_FAST64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST64_MIN -9223372036854775808 - * } - */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; - } - - private static final int INT_FAST8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT_FAST8_MAX 127 - * } - */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; - } - - private static final long INT_FAST16_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST16_MAX 9223372036854775807 - * } - */ - public static long INT_FAST16_MAX() { - return INT_FAST16_MAX; - } - - private static final long INT_FAST32_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST32_MAX 9223372036854775807 - * } - */ - public static long INT_FAST32_MAX() { - return INT_FAST32_MAX; - } - - private static final long INT_FAST64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST64_MAX 9223372036854775807 - * } - */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; - } - - private static final int UINT_FAST8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT_FAST8_MAX 255 - * } - */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; - } - - private static final long UINT_FAST16_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST16_MAX -1 - * } - */ - public static long UINT_FAST16_MAX() { - return UINT_FAST16_MAX; - } - - private static final long UINT_FAST32_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST32_MAX -1 - * } - */ - public static long UINT_FAST32_MAX() { - return UINT_FAST32_MAX; - } - - private static final long UINT_FAST64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST64_MAX -1 - * } - */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; - } - - private static final long INTPTR_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INTPTR_MIN -9223372036854775808 - * } - */ - public static long INTPTR_MIN() { - return INTPTR_MIN; - } - - private static final long INTPTR_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INTPTR_MAX 9223372036854775807 - * } - */ - public static long INTPTR_MAX() { - return INTPTR_MAX; - } - - private static final long UINTPTR_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINTPTR_MAX -1 - * } - */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; - } - - private static final long INTMAX_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INTMAX_MIN -9223372036854775808 - * } - */ - public static long INTMAX_MIN() { - return INTMAX_MIN; - } - - private static final long INTMAX_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INTMAX_MAX 9223372036854775807 - * } - */ - public static long INTMAX_MAX() { - return INTMAX_MAX; - } - - private static final long UINTMAX_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINTMAX_MAX -1 - * } - */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; - } - - private static final long PTRDIFF_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define PTRDIFF_MIN -9223372036854775808 - * } - */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; - } - - private static final long PTRDIFF_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define PTRDIFF_MAX 9223372036854775807 - * } - */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; - } - - private static final int SIG_ATOMIC_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define SIG_ATOMIC_MIN -2147483648 - * } - */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; - } - - private static final int SIG_ATOMIC_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define SIG_ATOMIC_MAX 2147483647 - * } - */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; - } - - private static final long SIZE_MAX = -1L; - - /** - * {@snippet lang = c : * #define SIZE_MAX -1 - * } - */ - public static long SIZE_MAX() { - return SIZE_MAX; - } - - private static final int WCHAR_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define WCHAR_MIN -2147483648 - * } - */ - public static int WCHAR_MIN() { - return WCHAR_MIN; - } - - private static final int WCHAR_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define WCHAR_MAX 2147483647 - * } - */ - public static int WCHAR_MAX() { - return WCHAR_MAX; - } - - private static final int WINT_MIN = (int) 0L; - - /** - * {@snippet lang = c : * #define WINT_MIN 0 - * } - */ - public static int WINT_MIN() { - return WINT_MIN; - } - - private static final int WINT_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define WINT_MAX 4294967295 - * } - */ - public static int WINT_MAX() { - return WINT_MAX; - } - - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); - - /** - * {@snippet lang = c : * #define NULL (void*) 0 - * } - */ - public static MemorySegment NULL() { - return NULL; - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/IvfFlatH.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/IvfFlatH.java deleted file mode 100644 index 32cdeb8132..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/IvfFlatH.java +++ /dev/null @@ -1,2845 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.ValueLayout.JAVA_BYTE; - -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.PaddingLayout; -import java.lang.foreign.SequenceLayout; -import java.lang.foreign.StructLayout; -import java.lang.foreign.SymbolLookup; -import java.lang.foreign.ValueLayout; -import java.lang.foreign.ValueLayout.OfByte; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.lang.foreign.ValueLayout.OfShort; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.util.Arrays; -import java.util.stream.Collectors; - -public class IvfFlatH { - - IvfFlatH() { - // Should not be called directly - } - - static final Arena LIBRARY_ARENA = Arena.ofAuto(); - static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); - - static void traceDowncall(String name, Object... args) { - String traceArgs = Arrays.stream(args).map(Object::toString).collect(Collectors.joining(", ")); - System.out.printf("%s(%s)\n", name, traceArgs); - } - - static MemorySegment findOrThrow(String symbol) { - return SYMBOL_LOOKUP.find(symbol).orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); - } - - static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { - try { - return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); - } catch (ReflectiveOperationException ex) { - throw new AssertionError(ex); - } - } - - static MemoryLayout align(MemoryLayout layout, long align) { - return switch (layout) { - case PaddingLayout p -> p; - case ValueLayout v -> v.withByteAlignment(align); - case GroupLayout g -> { - MemoryLayout[] alignedMembers = g.memberLayouts().stream().map(m -> align(m, align)).toArray(MemoryLayout[]::new); - yield g instanceof StructLayout ? MemoryLayout.structLayout(alignedMembers) - : MemoryLayout.unionLayout(alignedMembers); - } - case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); - }; - } - - static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup().or(Linker.nativeLinker().defaultLookup()); - - public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; - public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; - public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; - public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; - public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; - public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; - public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; - public static final AddressLayout C_POINTER = ValueLayout.ADDRESS - .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); - public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; - private static final int _STDINT_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _STDINT_H 1 - * } - */ - public static int _STDINT_H() { - return _STDINT_H; - } - - private static final int _FEATURES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _FEATURES_H 1 - * } - */ - public static int _FEATURES_H() { - return _FEATURES_H; - } - - private static final int _DEFAULT_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _DEFAULT_SOURCE 1 - * } - */ - public static int _DEFAULT_SOURCE() { - return _DEFAULT_SOURCE; - } - - private static final int __GLIBC_USE_ISOC2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_ISOC2X 0 - * } - */ - public static int __GLIBC_USE_ISOC2X() { - return __GLIBC_USE_ISOC2X; - } - - private static final int __USE_ISOC11 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC11 1 - * } - */ - public static int __USE_ISOC11() { - return __USE_ISOC11; - } - - private static final int __USE_ISOC99 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC99 1 - * } - */ - public static int __USE_ISOC99() { - return __USE_ISOC99; - } - - private static final int __USE_ISOC95 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC95 1 - * } - */ - public static int __USE_ISOC95() { - return __USE_ISOC95; - } - - private static final int __USE_POSIX_IMPLICITLY = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX_IMPLICITLY 1 - * } - */ - public static int __USE_POSIX_IMPLICITLY() { - return __USE_POSIX_IMPLICITLY; - } - - private static final int _POSIX_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _POSIX_SOURCE 1 - * } - */ - public static int _POSIX_SOURCE() { - return _POSIX_SOURCE; - } - - private static final int __USE_POSIX = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX 1 - * } - */ - public static int __USE_POSIX() { - return __USE_POSIX; - } - - private static final int __USE_POSIX2 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX2 1 - * } - */ - public static int __USE_POSIX2() { - return __USE_POSIX2; - } - - private static final int __USE_POSIX199309 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX199309 1 - * } - */ - public static int __USE_POSIX199309() { - return __USE_POSIX199309; - } - - private static final int __USE_POSIX199506 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX199506 1 - * } - */ - public static int __USE_POSIX199506() { - return __USE_POSIX199506; - } - - private static final int __USE_XOPEN2K = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_XOPEN2K 1 - * } - */ - public static int __USE_XOPEN2K() { - return __USE_XOPEN2K; - } - - private static final int __USE_XOPEN2K8 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_XOPEN2K8 1 - * } - */ - public static int __USE_XOPEN2K8() { - return __USE_XOPEN2K8; - } - - private static final int _ATFILE_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _ATFILE_SOURCE 1 - * } - */ - public static int _ATFILE_SOURCE() { - return _ATFILE_SOURCE; - } - - private static final int __WORDSIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - - private static final int __WORDSIZE_TIME64_COMPAT32 = (int) 1L; - - /** - * {@snippet lang = c : * #define __WORDSIZE_TIME64_COMPAT32 1 - * } - */ - public static int __WORDSIZE_TIME64_COMPAT32() { - return __WORDSIZE_TIME64_COMPAT32; - } - - private static final int __SYSCALL_WORDSIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __SYSCALL_WORDSIZE 64 - * } - */ - public static int __SYSCALL_WORDSIZE() { - return __SYSCALL_WORDSIZE; - } - - private static final int __USE_MISC = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_MISC 1 - * } - */ - public static int __USE_MISC() { - return __USE_MISC; - } - - private static final int __USE_ATFILE = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ATFILE 1 - * } - */ - public static int __USE_ATFILE() { - return __USE_ATFILE; - } - - private static final int __USE_FORTIFY_LEVEL = (int) 0L; - - /** - * {@snippet lang = c : * #define __USE_FORTIFY_LEVEL 0 - * } - */ - public static int __USE_FORTIFY_LEVEL() { - return __USE_FORTIFY_LEVEL; - } - - private static final int __GLIBC_USE_DEPRECATED_GETS = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_DEPRECATED_GETS 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_GETS() { - return __GLIBC_USE_DEPRECATED_GETS; - } - - private static final int __GLIBC_USE_DEPRECATED_SCANF = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_DEPRECATED_SCANF 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_SCANF() { - return __GLIBC_USE_DEPRECATED_SCANF; - } - - private static final int _STDC_PREDEF_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _STDC_PREDEF_H 1 - * } - */ - public static int _STDC_PREDEF_H() { - return _STDC_PREDEF_H; - } - - private static final int __STDC_IEC_559__ = (int) 1L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_559__ 1 - * } - */ - public static int __STDC_IEC_559__() { - return __STDC_IEC_559__; - } - - private static final int __STDC_IEC_559_COMPLEX__ = (int) 1L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_559_COMPLEX__ 1 - * } - */ - public static int __STDC_IEC_559_COMPLEX__() { - return __STDC_IEC_559_COMPLEX__; - } - - private static final int __GNU_LIBRARY__ = (int) 6L; - - /** - * {@snippet lang = c : * #define __GNU_LIBRARY__ 6 - * } - */ - public static int __GNU_LIBRARY__() { - return __GNU_LIBRARY__; - } - - private static final int __GLIBC__ = (int) 2L; - - /** - * {@snippet lang = c : * #define __GLIBC__ 2 - * } - */ - public static int __GLIBC__() { - return __GLIBC__; - } - - private static final int __GLIBC_MINOR__ = (int) 35L; - - /** - * {@snippet lang = c : * #define __GLIBC_MINOR__ 35 - * } - */ - public static int __GLIBC_MINOR__() { - return __GLIBC_MINOR__; - } - - private static final int _SYS_CDEFS_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _SYS_CDEFS_H 1 - * } - */ - public static int _SYS_CDEFS_H() { - return _SYS_CDEFS_H; - } - - private static final int __glibc_c99_flexarr_available = (int) 1L; - - /** - * {@snippet lang = c : * #define __glibc_c99_flexarr_available 1 - * } - */ - public static int __glibc_c99_flexarr_available() { - return __glibc_c99_flexarr_available; - } - - private static final int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = (int) 0L; - - /** - * {@snippet lang = c : * #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 - * } - */ - public static int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI() { - return __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI; - } - - private static final int __HAVE_GENERIC_SELECTION = (int) 1L; - - /** - * {@snippet lang = c : * #define __HAVE_GENERIC_SELECTION 1 - * } - */ - public static int __HAVE_GENERIC_SELECTION() { - return __HAVE_GENERIC_SELECTION; - } - - private static final int __GLIBC_USE_LIB_EXT2 = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_LIB_EXT2 0 - * } - */ - public static int __GLIBC_USE_LIB_EXT2() { - return __GLIBC_USE_LIB_EXT2; - } - - private static final int __GLIBC_USE_IEC_60559_BFP_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_BFP_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT() { - return __GLIBC_USE_IEC_60559_BFP_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_BFP_EXT_C2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT_C2X() { - return __GLIBC_USE_IEC_60559_BFP_EXT_C2X; - } - - private static final int __GLIBC_USE_IEC_60559_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_EXT() { - return __GLIBC_USE_IEC_60559_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X; - } - - private static final int __GLIBC_USE_IEC_60559_TYPES_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_TYPES_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_TYPES_EXT() { - return __GLIBC_USE_IEC_60559_TYPES_EXT; - } - - private static final int _BITS_TYPES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TYPES_H 1 - * } - */ - public static int _BITS_TYPES_H() { - return _BITS_TYPES_H; - } - - private static final int _BITS_TYPESIZES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TYPESIZES_H 1 - * } - */ - public static int _BITS_TYPESIZES_H() { - return _BITS_TYPESIZES_H; - } - - private static final int __OFF_T_MATCHES_OFF64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __OFF_T_MATCHES_OFF64_T 1 - * } - */ - public static int __OFF_T_MATCHES_OFF64_T() { - return __OFF_T_MATCHES_OFF64_T; - } - - private static final int __INO_T_MATCHES_INO64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __INO_T_MATCHES_INO64_T 1 - * } - */ - public static int __INO_T_MATCHES_INO64_T() { - return __INO_T_MATCHES_INO64_T; - } - - private static final int __RLIM_T_MATCHES_RLIM64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __RLIM_T_MATCHES_RLIM64_T 1 - * } - */ - public static int __RLIM_T_MATCHES_RLIM64_T() { - return __RLIM_T_MATCHES_RLIM64_T; - } - - private static final int __STATFS_MATCHES_STATFS64 = (int) 1L; - - /** - * {@snippet lang = c : * #define __STATFS_MATCHES_STATFS64 1 - * } - */ - public static int __STATFS_MATCHES_STATFS64() { - return __STATFS_MATCHES_STATFS64; - } - - private static final int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = (int) 1L; - - /** - * {@snippet lang = c : * #define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 - * } - */ - public static int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64() { - return __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64; - } - - private static final int __FD_SETSIZE = (int) 1024L; - - /** - * {@snippet lang = c : * #define __FD_SETSIZE 1024 - * } - */ - public static int __FD_SETSIZE() { - return __FD_SETSIZE; - } - - private static final int _BITS_TIME64_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TIME64_H 1 - * } - */ - public static int _BITS_TIME64_H() { - return _BITS_TIME64_H; - } - - private static final int _BITS_WCHAR_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_WCHAR_H 1 - * } - */ - public static int _BITS_WCHAR_H() { - return _BITS_WCHAR_H; - } - - private static final int _BITS_STDINT_INTN_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_STDINT_INTN_H 1 - * } - */ - public static int _BITS_STDINT_INTN_H() { - return _BITS_STDINT_INTN_H; - } - - private static final int _BITS_STDINT_UINTN_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_STDINT_UINTN_H 1 - * } - */ - public static int _BITS_STDINT_UINTN_H() { - return _BITS_STDINT_UINTN_H; - } - - private static final int DLPACK_MAJOR_VERSION = (int) 1L; - - /** - * {@snippet lang = c : * #define DLPACK_MAJOR_VERSION 1 - * } - */ - public static int DLPACK_MAJOR_VERSION() { - return DLPACK_MAJOR_VERSION; - } - - private static final int DLPACK_MINOR_VERSION = (int) 0L; - - /** - * {@snippet lang = c : * #define DLPACK_MINOR_VERSION 0 - * } - */ - public static int DLPACK_MINOR_VERSION() { - return DLPACK_MINOR_VERSION; - } - - private static final int true_ = (int) 1L; - - /** - * {@snippet lang = c : * #define true 1 - * } - */ - public static int true_() { - return true_; - } - - private static final int false_ = (int) 0L; - - /** - * {@snippet lang = c : * #define false 0 - * } - */ - public static int false_() { - return false_; - } - - private static final int __bool_true_false_are_defined = (int) 1L; - - /** - * {@snippet lang = c : * #define __bool_true_false_are_defined 1 - * } - */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } - - /** - * {@snippet lang = c : * typedef unsigned char __u_char - * } - */ - public static final OfByte __u_char = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned short __u_short - * } - */ - public static final OfShort __u_short = IvfFlatH.C_SHORT; - /** - * {@snippet lang = c : * typedef unsigned int __u_int - * } - */ - public static final OfInt __u_int = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __u_long - * } - */ - public static final OfLong __u_long = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef signed char __int8_t - * } - */ - public static final OfByte __int8_t = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned char __uint8_t - * } - */ - public static final OfByte __uint8_t = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef short __int16_t - * } - */ - public static final OfShort __int16_t = IvfFlatH.C_SHORT; - /** - * {@snippet lang = c : * typedef unsigned short __uint16_t - * } - */ - public static final OfShort __uint16_t = IvfFlatH.C_SHORT; - /** - * {@snippet lang = c : * typedef int __int32_t - * } - */ - public static final OfInt __int32_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned int __uint32_t - * } - */ - public static final OfInt __uint32_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef long __int64_t - * } - */ - public static final OfLong __int64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __uint64_t - * } - */ - public static final OfLong __uint64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef __int8_t __int_least8_t - * } - */ - public static final OfByte __int_least8_t = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint8_t __uint_least8_t - * } - */ - public static final OfByte __uint_least8_t = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int16_t __int_least16_t - * } - */ - public static final OfShort __int_least16_t = IvfFlatH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint16_t __uint_least16_t - * } - */ - public static final OfShort __uint_least16_t = IvfFlatH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int32_t __int_least32_t - * } - */ - public static final OfInt __int_least32_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef __uint32_t __uint_least32_t - * } - */ - public static final OfInt __uint_least32_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef __int64_t __int_least64_t - * } - */ - public static final OfLong __int_least64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint64_t __uint_least64_t - * } - */ - public static final OfLong __uint_least64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long __quad_t - * } - */ - public static final OfLong __quad_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __u_quad_t - * } - */ - public static final OfLong __u_quad_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long __intmax_t - * } - */ - public static final OfLong __intmax_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __uintmax_t - * } - */ - public static final OfLong __uintmax_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __dev_t - * } - */ - public static final OfLong __dev_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __uid_t - * } - */ - public static final OfInt __uid_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned int __gid_t - * } - */ - public static final OfInt __gid_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __ino_t - * } - */ - public static final OfLong __ino_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __ino64_t - * } - */ - public static final OfLong __ino64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __mode_t - * } - */ - public static final OfInt __mode_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __nlink_t - * } - */ - public static final OfLong __nlink_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long __off_t - * } - */ - public static final OfLong __off_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long __off64_t - * } - */ - public static final OfLong __off64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef int __pid_t - * } - */ - public static final OfInt __pid_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef long __clock_t - * } - */ - public static final OfLong __clock_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __rlim_t - * } - */ - public static final OfLong __rlim_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __rlim64_t - * } - */ - public static final OfLong __rlim64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __id_t - * } - */ - public static final OfInt __id_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef long __time_t - * } - */ - public static final OfLong __time_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __useconds_t - * } - */ - public static final OfInt __useconds_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef long __suseconds_t - * } - */ - public static final OfLong __suseconds_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long __suseconds64_t - * } - */ - public static final OfLong __suseconds64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef int __daddr_t - * } - */ - public static final OfInt __daddr_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef int __key_t - * } - */ - public static final OfInt __key_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef int __clockid_t - * } - */ - public static final OfInt __clockid_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef void *__timer_t - * } - */ - public static final AddressLayout __timer_t = IvfFlatH.C_POINTER; - /** - * {@snippet lang = c : * typedef long __blksize_t - * } - */ - public static final OfLong __blksize_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long __blkcnt_t - * } - */ - public static final OfLong __blkcnt_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long __blkcnt64_t - * } - */ - public static final OfLong __blkcnt64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsblkcnt_t - * } - */ - public static final OfLong __fsblkcnt_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsblkcnt64_t - * } - */ - public static final OfLong __fsblkcnt64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsfilcnt_t - * } - */ - public static final OfLong __fsfilcnt_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsfilcnt64_t - * } - */ - public static final OfLong __fsfilcnt64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long __fsword_t - * } - */ - public static final OfLong __fsword_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long __ssize_t - * } - */ - public static final OfLong __ssize_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long __syscall_slong_t - * } - */ - public static final OfLong __syscall_slong_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __syscall_ulong_t - * } - */ - public static final OfLong __syscall_ulong_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef __off64_t __loff_t - * } - */ - public static final OfLong __loff_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef char *__caddr_t - * } - */ - public static final AddressLayout __caddr_t = IvfFlatH.C_POINTER; - /** - * {@snippet lang = c : * typedef long __intptr_t - * } - */ - public static final OfLong __intptr_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __socklen_t - * } - */ - public static final OfInt __socklen_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef int __sig_atomic_t - * } - */ - public static final OfInt __sig_atomic_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef __int8_t int8_t - * } - */ - public static final OfByte int8_t = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int16_t int16_t - * } - */ - public static final OfShort int16_t = IvfFlatH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int32_t int32_t - * } - */ - public static final OfInt int32_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef __int64_t int64_t - * } - */ - public static final OfLong int64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint8_t uint8_t - * } - */ - public static final OfByte uint8_t = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint16_t uint16_t - * } - */ - public static final OfShort uint16_t = IvfFlatH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint32_t uint32_t - * } - */ - public static final OfInt uint32_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef __uint64_t uint64_t - * } - */ - public static final OfLong uint64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef __int_least8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int_least16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = IvfFlatH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int_least32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef __int_least64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint_least8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint_least16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = IvfFlatH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint_least32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = IvfFlatH.C_INT; - /** - * {@snippet lang = c : * typedef __uint_least64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef signed char int_fast8_t - * } - */ - public static final OfByte int_fast8_t = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef long int_fast16_t - * } - */ - public static final OfLong int_fast16_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long int_fast32_t - * } - */ - public static final OfLong int_fast32_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long int_fast64_t - * } - */ - public static final OfLong int_fast64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned char uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = IvfFlatH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast16_t - * } - */ - public static final OfLong uint_fast16_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast32_t - * } - */ - public static final OfLong uint_fast32_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef long intptr_t - * } - */ - public static final OfLong intptr_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uintptr_t - * } - */ - public static final OfLong uintptr_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef __intmax_t intmax_t - * } - */ - public static final OfLong intmax_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef __uintmax_t uintmax_t - * } - */ - public static final OfLong uintmax_t = IvfFlatH.C_LONG; - private static final int CUVS_ERROR = (int) 0L; - - /** - * {@snippet lang = c : * enum .CUVS_ERROR = 0 - * } - */ - public static int CUVS_ERROR() { - return CUVS_ERROR; - } - - private static final int CUVS_SUCCESS = (int) 1L; - - /** - * {@snippet lang = c : * enum .CUVS_SUCCESS = 1 - * } - */ - public static int CUVS_SUCCESS() { - return CUVS_SUCCESS; - } - - /** - * {@snippet lang = c : * typedef uintptr_t cuvsResources_t - * } - */ - public static final OfLong cuvsResources_t = IvfFlatH.C_LONG; - private static final int L2Expanded = (int) 0L; - - /** - * {@snippet lang = c : * enum .L2Expanded = 0 - * } - */ - public static int L2Expanded() { - return L2Expanded; - } - - private static final int L2SqrtExpanded = (int) 1L; - - /** - * {@snippet lang = c : * enum .L2SqrtExpanded = 1 - * } - */ - public static int L2SqrtExpanded() { - return L2SqrtExpanded; - } - - private static final int CosineExpanded = (int) 2L; - - /** - * {@snippet lang = c : * enum .CosineExpanded = 2 - * } - */ - public static int CosineExpanded() { - return CosineExpanded; - } - - private static final int L1 = (int) 3L; - - /** - * {@snippet lang = c : * enum .L1 = 3 - * } - */ - public static int L1() { - return L1; - } - - private static final int L2Unexpanded = (int) 4L; - - /** - * {@snippet lang = c : * enum .L2Unexpanded = 4 - * } - */ - public static int L2Unexpanded() { - return L2Unexpanded; - } - - private static final int L2SqrtUnexpanded = (int) 5L; - - /** - * {@snippet lang = c : * enum .L2SqrtUnexpanded = 5 - * } - */ - public static int L2SqrtUnexpanded() { - return L2SqrtUnexpanded; - } - - private static final int InnerProduct = (int) 6L; - - /** - * {@snippet lang = c : * enum .InnerProduct = 6 - * } - */ - public static int InnerProduct() { - return InnerProduct; - } - - private static final int Linf = (int) 7L; - - /** - * {@snippet lang = c : * enum .Linf = 7 - * } - */ - public static int Linf() { - return Linf; - } - - private static final int Canberra = (int) 8L; - - /** - * {@snippet lang = c : * enum .Canberra = 8 - * } - */ - public static int Canberra() { - return Canberra; - } - - private static final int LpUnexpanded = (int) 9L; - - /** - * {@snippet lang = c : * enum .LpUnexpanded = 9 - * } - */ - public static int LpUnexpanded() { - return LpUnexpanded; - } - - private static final int CorrelationExpanded = (int) 10L; - - /** - * {@snippet lang = c : * enum .CorrelationExpanded = 10 - * } - */ - public static int CorrelationExpanded() { - return CorrelationExpanded; - } - - private static final int JaccardExpanded = (int) 11L; - - /** - * {@snippet lang = c : * enum .JaccardExpanded = 11 - * } - */ - public static int JaccardExpanded() { - return JaccardExpanded; - } - - private static final int HellingerExpanded = (int) 12L; - - /** - * {@snippet lang = c : * enum .HellingerExpanded = 12 - * } - */ - public static int HellingerExpanded() { - return HellingerExpanded; - } - - private static final int Haversine = (int) 13L; - - /** - * {@snippet lang = c : * enum .Haversine = 13 - * } - */ - public static int Haversine() { - return Haversine; - } - - private static final int BrayCurtis = (int) 14L; - - /** - * {@snippet lang = c : * enum .BrayCurtis = 14 - * } - */ - public static int BrayCurtis() { - return BrayCurtis; - } - - private static final int JensenShannon = (int) 15L; - - /** - * {@snippet lang = c : * enum .JensenShannon = 15 - * } - */ - public static int JensenShannon() { - return JensenShannon; - } - - private static final int HammingUnexpanded = (int) 16L; - - /** - * {@snippet lang = c : * enum .HammingUnexpanded = 16 - * } - */ - public static int HammingUnexpanded() { - return HammingUnexpanded; - } - - private static final int KLDivergence = (int) 17L; - - /** - * {@snippet lang = c : * enum .KLDivergence = 17 - * } - */ - public static int KLDivergence() { - return KLDivergence; - } - - private static final int RusselRaoExpanded = (int) 18L; - - /** - * {@snippet lang = c : * enum .RusselRaoExpanded = 18 - * } - */ - public static int RusselRaoExpanded() { - return RusselRaoExpanded; - } - - private static final int DiceExpanded = (int) 19L; - - /** - * {@snippet lang = c : * enum .DiceExpanded = 19 - * } - */ - public static int DiceExpanded() { - return DiceExpanded; - } - - private static final int Precomputed = (int) 100L; - - /** - * {@snippet lang = c : * enum .Precomputed = 100 - * } - */ - public static int Precomputed() { - return Precomputed; - } - - /** - * {@snippet lang = c : * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long size_t - * } - */ - public static final OfLong size_t = IvfFlatH.C_LONG; - /** - * {@snippet lang = c : * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = IvfFlatH.C_INT; - private static final int kDLCPU = (int) 1L; - - /** - * {@snippet lang = c : * enum .kDLCPU = 1 - * } - */ - public static int kDLCPU() { - return kDLCPU; - } - - private static final int kDLCUDA = (int) 2L; - - /** - * {@snippet lang = c : * enum .kDLCUDA = 2 - * } - */ - public static int kDLCUDA() { - return kDLCUDA; - } - - private static final int kDLCUDAHost = (int) 3L; - - /** - * {@snippet lang = c : * enum .kDLCUDAHost = 3 - * } - */ - public static int kDLCUDAHost() { - return kDLCUDAHost; - } - - private static final int kDLOpenCL = (int) 4L; - - /** - * {@snippet lang = c : * enum .kDLOpenCL = 4 - * } - */ - public static int kDLOpenCL() { - return kDLOpenCL; - } - - private static final int kDLVulkan = (int) 7L; - - /** - * {@snippet lang = c : * enum .kDLVulkan = 7 - * } - */ - public static int kDLVulkan() { - return kDLVulkan; - } - - private static final int kDLMetal = (int) 8L; - - /** - * {@snippet lang = c : * enum .kDLMetal = 8 - * } - */ - public static int kDLMetal() { - return kDLMetal; - } - - private static final int kDLVPI = (int) 9L; - - /** - * {@snippet lang = c : * enum .kDLVPI = 9 - * } - */ - public static int kDLVPI() { - return kDLVPI; - } - - private static final int kDLROCM = (int) 10L; - - /** - * {@snippet lang = c : * enum .kDLROCM = 10 - * } - */ - public static int kDLROCM() { - return kDLROCM; - } - - private static final int kDLROCMHost = (int) 11L; - - /** - * {@snippet lang = c : * enum .kDLROCMHost = 11 - * } - */ - public static int kDLROCMHost() { - return kDLROCMHost; - } - - private static final int kDLExtDev = (int) 12L; - - /** - * {@snippet lang = c : * enum .kDLExtDev = 12 - * } - */ - public static int kDLExtDev() { - return kDLExtDev; - } - - private static final int kDLCUDAManaged = (int) 13L; - - /** - * {@snippet lang = c : * enum .kDLCUDAManaged = 13 - * } - */ - public static int kDLCUDAManaged() { - return kDLCUDAManaged; - } - - private static final int kDLOneAPI = (int) 14L; - - /** - * {@snippet lang = c : * enum .kDLOneAPI = 14 - * } - */ - public static int kDLOneAPI() { - return kDLOneAPI; - } - - private static final int kDLWebGPU = (int) 15L; - - /** - * {@snippet lang = c : * enum .kDLWebGPU = 15 - * } - */ - public static int kDLWebGPU() { - return kDLWebGPU; - } - - private static final int kDLHexagon = (int) 16L; - - /** - * {@snippet lang = c : * enum .kDLHexagon = 16 - * } - */ - public static int kDLHexagon() { - return kDLHexagon; - } - - private static final int kDLMAIA = (int) 17L; - - /** - * {@snippet lang = c : * enum .kDLMAIA = 17 - * } - */ - public static int kDLMAIA() { - return kDLMAIA; - } - - private static final int kDLInt = (int) 0L; - - /** - * {@snippet lang = c : * enum .kDLInt = 0 - * } - */ - public static int kDLInt() { - return kDLInt; - } - - private static final int kDLUInt = (int) 1L; - - /** - * {@snippet lang = c : * enum .kDLUInt = 1 - * } - */ - public static int kDLUInt() { - return kDLUInt; - } - - private static final int kDLFloat = (int) 2L; - - /** - * {@snippet lang = c : * enum .kDLFloat = 2 - * } - */ - public static int kDLFloat() { - return kDLFloat; - } - - private static final int kDLOpaqueHandle = (int) 3L; - - /** - * {@snippet lang = c : * enum .kDLOpaqueHandle = 3 - * } - */ - public static int kDLOpaqueHandle() { - return kDLOpaqueHandle; - } - - private static final int kDLBfloat = (int) 4L; - - /** - * {@snippet lang = c : * enum .kDLBfloat = 4 - * } - */ - public static int kDLBfloat() { - return kDLBfloat; - } - - private static final int kDLComplex = (int) 5L; - - /** - * {@snippet lang = c : * enum .kDLComplex = 5 - * } - */ - public static int kDLComplex() { - return kDLComplex; - } - - private static final int kDLBool = (int) 6L; - - /** - * {@snippet lang = c : * enum .kDLBool = 6 - * } - */ - public static int kDLBool() { - return kDLBool; - } - - /** - * {@snippet lang = c : - * typedef struct cuvsIvfFlatIndexParams { - * cuvsDistanceType metric; - * float metric_arg; - * _Bool add_data_on_build; - * uint32_t n_lists; - * uint32_t kmeans_n_iters; - * double kmeans_trainset_fraction; - * _Bool adaptive_centers; - * _Bool conservative_memory_allocation; - * } *cuvsIvfFlatIndexParams_t - * } - */ - public static final AddressLayout cuvsIvfFlatIndexParams_t = IvfFlatH.C_POINTER; - - private static class cuvsIvfFlatIndexParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatIndexParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexParamsCreate(cuvsIvfFlatIndexParams_t *index_params) - * } - */ - public static FunctionDescriptor cuvsIvfFlatIndexParamsCreate$descriptor() { - return cuvsIvfFlatIndexParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexParamsCreate(cuvsIvfFlatIndexParams_t *index_params) - * } - */ - public static MethodHandle cuvsIvfFlatIndexParamsCreate$handle() { - return cuvsIvfFlatIndexParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexParamsCreate(cuvsIvfFlatIndexParams_t *index_params) - * } - */ - public static MemorySegment cuvsIvfFlatIndexParamsCreate$address() { - return cuvsIvfFlatIndexParamsCreate.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexParamsCreate(cuvsIvfFlatIndexParams_t *index_params) - * } - */ - public static int cuvsIvfFlatIndexParamsCreate(MemorySegment index_params) { - var mh$ = cuvsIvfFlatIndexParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatIndexParamsCreate", index_params); - } - return (int) mh$.invokeExact(index_params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfFlatIndexParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatIndexParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexParamsDestroy(cuvsIvfFlatIndexParams_t index_params) - * } - */ - public static FunctionDescriptor cuvsIvfFlatIndexParamsDestroy$descriptor() { - return cuvsIvfFlatIndexParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexParamsDestroy(cuvsIvfFlatIndexParams_t index_params) - * } - */ - public static MethodHandle cuvsIvfFlatIndexParamsDestroy$handle() { - return cuvsIvfFlatIndexParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexParamsDestroy(cuvsIvfFlatIndexParams_t index_params) - * } - */ - public static MemorySegment cuvsIvfFlatIndexParamsDestroy$address() { - return cuvsIvfFlatIndexParamsDestroy.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexParamsDestroy(cuvsIvfFlatIndexParams_t index_params) - * } - */ - public static int cuvsIvfFlatIndexParamsDestroy(MemorySegment index_params) { - var mh$ = cuvsIvfFlatIndexParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatIndexParamsDestroy", index_params); - } - return (int) mh$.invokeExact(index_params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * {@snippet lang = c : - * typedef struct cuvsIvfFlatSearchParams { - * uint32_t n_probes; - * } *cuvsIvfFlatSearchParams_t - * } - */ - public static final AddressLayout cuvsIvfFlatSearchParams_t = IvfFlatH.C_POINTER; - - private static class cuvsIvfFlatSearchParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatSearchParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearchParamsCreate(cuvsIvfFlatSearchParams_t *params) - * } - */ - public static FunctionDescriptor cuvsIvfFlatSearchParamsCreate$descriptor() { - return cuvsIvfFlatSearchParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearchParamsCreate(cuvsIvfFlatSearchParams_t *params) - * } - */ - public static MethodHandle cuvsIvfFlatSearchParamsCreate$handle() { - return cuvsIvfFlatSearchParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearchParamsCreate(cuvsIvfFlatSearchParams_t *params) - * } - */ - public static MemorySegment cuvsIvfFlatSearchParamsCreate$address() { - return cuvsIvfFlatSearchParamsCreate.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearchParamsCreate(cuvsIvfFlatSearchParams_t *params) - * } - */ - public static int cuvsIvfFlatSearchParamsCreate(MemorySegment params) { - var mh$ = cuvsIvfFlatSearchParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatSearchParamsCreate", params); - } - return (int) mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfFlatSearchParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatSearchParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearchParamsDestroy(cuvsIvfFlatSearchParams_t params) - * } - */ - public static FunctionDescriptor cuvsIvfFlatSearchParamsDestroy$descriptor() { - return cuvsIvfFlatSearchParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearchParamsDestroy(cuvsIvfFlatSearchParams_t params) - * } - */ - public static MethodHandle cuvsIvfFlatSearchParamsDestroy$handle() { - return cuvsIvfFlatSearchParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearchParamsDestroy(cuvsIvfFlatSearchParams_t params) - * } - */ - public static MemorySegment cuvsIvfFlatSearchParamsDestroy$address() { - return cuvsIvfFlatSearchParamsDestroy.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearchParamsDestroy(cuvsIvfFlatSearchParams_t params) - * } - */ - public static int cuvsIvfFlatSearchParamsDestroy(MemorySegment params) { - var mh$ = cuvsIvfFlatSearchParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatSearchParamsDestroy", params); - } - return (int) mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * {@snippet lang = c : * typedef cuvsIvfFlatIndex *cuvsIvfFlatIndex_t - * } - */ - public static final AddressLayout cuvsIvfFlatIndex_t = IvfFlatH.C_POINTER; - - private static class cuvsIvfFlatIndexCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatIndexCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexCreate(cuvsIvfFlatIndex_t *index) - * } - */ - public static FunctionDescriptor cuvsIvfFlatIndexCreate$descriptor() { - return cuvsIvfFlatIndexCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexCreate(cuvsIvfFlatIndex_t *index) - * } - */ - public static MethodHandle cuvsIvfFlatIndexCreate$handle() { - return cuvsIvfFlatIndexCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexCreate(cuvsIvfFlatIndex_t *index) - * } - */ - public static MemorySegment cuvsIvfFlatIndexCreate$address() { - return cuvsIvfFlatIndexCreate.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexCreate(cuvsIvfFlatIndex_t *index) - * } - */ - public static int cuvsIvfFlatIndexCreate(MemorySegment index) { - var mh$ = cuvsIvfFlatIndexCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatIndexCreate", index); - } - return (int) mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfFlatIndexDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatIndexDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexDestroy(cuvsIvfFlatIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfFlatIndexDestroy$descriptor() { - return cuvsIvfFlatIndexDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexDestroy(cuvsIvfFlatIndex_t index) - * } - */ - public static MethodHandle cuvsIvfFlatIndexDestroy$handle() { - return cuvsIvfFlatIndexDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexDestroy(cuvsIvfFlatIndex_t index) - * } - */ - public static MemorySegment cuvsIvfFlatIndexDestroy$address() { - return cuvsIvfFlatIndexDestroy.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatIndexDestroy(cuvsIvfFlatIndex_t index) - * } - */ - public static int cuvsIvfFlatIndexDestroy(MemorySegment index) { - var mh$ = cuvsIvfFlatIndexDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatIndexDestroy", index); - } - return (int) mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfFlatBuild { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_LONG, - IvfFlatH.C_POINTER, IvfFlatH.C_POINTER, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatBuild"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatBuild(cuvsResources_t res, cuvsIvfFlatIndexParams_t index_params, DLManagedTensor *dataset, cuvsIvfFlatIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfFlatBuild$descriptor() { - return cuvsIvfFlatBuild.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatBuild(cuvsResources_t res, cuvsIvfFlatIndexParams_t index_params, DLManagedTensor *dataset, cuvsIvfFlatIndex_t index) - * } - */ - public static MethodHandle cuvsIvfFlatBuild$handle() { - return cuvsIvfFlatBuild.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatBuild(cuvsResources_t res, cuvsIvfFlatIndexParams_t index_params, DLManagedTensor *dataset, cuvsIvfFlatIndex_t index) - * } - */ - public static MemorySegment cuvsIvfFlatBuild$address() { - return cuvsIvfFlatBuild.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatBuild(cuvsResources_t res, cuvsIvfFlatIndexParams_t index_params, DLManagedTensor *dataset, cuvsIvfFlatIndex_t index) - * } - */ - public static int cuvsIvfFlatBuild(long res, MemorySegment index_params, MemorySegment dataset, MemorySegment index) { - var mh$ = cuvsIvfFlatBuild.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatBuild", res, index_params, dataset, index); - } - return (int) mh$.invokeExact(res, index_params, dataset, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfFlatSearch { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_LONG, - IvfFlatH.C_POINTER, IvfFlatH.C_POINTER, IvfFlatH.C_POINTER, IvfFlatH.C_POINTER, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatSearch"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearch(cuvsResources_t res, cuvsIvfFlatSearchParams_t search_params, cuvsIvfFlatIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static FunctionDescriptor cuvsIvfFlatSearch$descriptor() { - return cuvsIvfFlatSearch.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearch(cuvsResources_t res, cuvsIvfFlatSearchParams_t search_params, cuvsIvfFlatIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static MethodHandle cuvsIvfFlatSearch$handle() { - return cuvsIvfFlatSearch.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearch(cuvsResources_t res, cuvsIvfFlatSearchParams_t search_params, cuvsIvfFlatIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static MemorySegment cuvsIvfFlatSearch$address() { - return cuvsIvfFlatSearch.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSearch(cuvsResources_t res, cuvsIvfFlatSearchParams_t search_params, cuvsIvfFlatIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static int cuvsIvfFlatSearch(long res, MemorySegment search_params, MemorySegment index, MemorySegment queries, - MemorySegment neighbors, MemorySegment distances) { - var mh$ = cuvsIvfFlatSearch.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatSearch", res, search_params, index, queries, neighbors, distances); - } - return (int) mh$.invokeExact(res, search_params, index, queries, neighbors, distances); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfFlatSerialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_LONG, - IvfFlatH.C_POINTER, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatSerialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSerialize(cuvsResources_t res, const char *filename, cuvsIvfFlatIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfFlatSerialize$descriptor() { - return cuvsIvfFlatSerialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSerialize(cuvsResources_t res, const char *filename, cuvsIvfFlatIndex_t index) - * } - */ - public static MethodHandle cuvsIvfFlatSerialize$handle() { - return cuvsIvfFlatSerialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSerialize(cuvsResources_t res, const char *filename, cuvsIvfFlatIndex_t index) - * } - */ - public static MemorySegment cuvsIvfFlatSerialize$address() { - return cuvsIvfFlatSerialize.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatSerialize(cuvsResources_t res, const char *filename, cuvsIvfFlatIndex_t index) - * } - */ - public static int cuvsIvfFlatSerialize(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsIvfFlatSerialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatSerialize", res, filename, index); - } - return (int) mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfFlatDeserialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_LONG, - IvfFlatH.C_POINTER, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatDeserialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatDeserialize(cuvsResources_t res, const char *filename, cuvsIvfFlatIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfFlatDeserialize$descriptor() { - return cuvsIvfFlatDeserialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatDeserialize(cuvsResources_t res, const char *filename, cuvsIvfFlatIndex_t index) - * } - */ - public static MethodHandle cuvsIvfFlatDeserialize$handle() { - return cuvsIvfFlatDeserialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatDeserialize(cuvsResources_t res, const char *filename, cuvsIvfFlatIndex_t index) - * } - */ - public static MemorySegment cuvsIvfFlatDeserialize$address() { - return cuvsIvfFlatDeserialize.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatDeserialize(cuvsResources_t res, const char *filename, cuvsIvfFlatIndex_t index) - * } - */ - public static int cuvsIvfFlatDeserialize(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsIvfFlatDeserialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatDeserialize", res, filename, index); - } - return (int) mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfFlatExtend { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfFlatH.C_INT, IvfFlatH.C_LONG, - IvfFlatH.C_POINTER, IvfFlatH.C_POINTER, IvfFlatH.C_POINTER); - - public static final MemorySegment ADDR = IvfFlatH.findOrThrow("cuvsIvfFlatExtend"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfFlatIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfFlatExtend$descriptor() { - return cuvsIvfFlatExtend.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfFlatIndex_t index) - * } - */ - public static MethodHandle cuvsIvfFlatExtend$handle() { - return cuvsIvfFlatExtend.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfFlatIndex_t index) - * } - */ - public static MemorySegment cuvsIvfFlatExtend$address() { - return cuvsIvfFlatExtend.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfFlatExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfFlatIndex_t index) - * } - */ - public static int cuvsIvfFlatExtend(long res, MemorySegment new_vectors, MemorySegment new_indices, - MemorySegment index) { - var mh$ = cuvsIvfFlatExtend.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfFlatExtend", res, new_vectors, new_indices, index); - } - return (int) mh$.invokeExact(res, new_vectors, new_indices, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static final long _POSIX_C_SOURCE = 200809L; - - /** - * {@snippet lang = c : * #define _POSIX_C_SOURCE 200809 - * } - */ - public static long _POSIX_C_SOURCE() { - return _POSIX_C_SOURCE; - } - - private static final int __TIMESIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __TIMESIZE 64 - * } - */ - public static int __TIMESIZE() { - return __TIMESIZE; - } - - private static final long __STDC_IEC_60559_BFP__ = 201404L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_60559_BFP__ 201404 - * } - */ - public static long __STDC_IEC_60559_BFP__() { - return __STDC_IEC_60559_BFP__; - } - - private static final long __STDC_IEC_60559_COMPLEX__ = 201404L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_60559_COMPLEX__ 201404 - * } - */ - public static long __STDC_IEC_60559_COMPLEX__() { - return __STDC_IEC_60559_COMPLEX__; - } - - private static final long __STDC_ISO_10646__ = 201706L; - - /** - * {@snippet lang = c : * #define __STDC_ISO_10646__ 201706 - * } - */ - public static long __STDC_ISO_10646__() { - return __STDC_ISO_10646__; - } - - private static final int __WCHAR_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define __WCHAR_MAX 2147483647 - * } - */ - public static int __WCHAR_MAX() { - return __WCHAR_MAX; - } - - private static final int __WCHAR_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define __WCHAR_MIN -2147483648 - * } - */ - public static int __WCHAR_MIN() { - return __WCHAR_MIN; - } - - private static final int INT8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT8_MIN -128 - * } - */ - public static int INT8_MIN() { - return INT8_MIN; - } - - private static final int INT16_MIN = (int) -32768L; - - /** - * {@snippet lang = c : * #define INT16_MIN -32768 - * } - */ - public static int INT16_MIN() { - return INT16_MIN; - } - - private static final int INT32_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define INT32_MIN -2147483648 - * } - */ - public static int INT32_MIN() { - return INT32_MIN; - } - - private static final long INT64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT64_MIN -9223372036854775808 - * } - */ - public static long INT64_MIN() { - return INT64_MIN; - } - - private static final int INT8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT8_MAX 127 - * } - */ - public static int INT8_MAX() { - return INT8_MAX; - } - - private static final int INT16_MAX = (int) 32767L; - - /** - * {@snippet lang = c : * #define INT16_MAX 32767 - * } - */ - public static int INT16_MAX() { - return INT16_MAX; - } - - private static final int INT32_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define INT32_MAX 2147483647 - * } - */ - public static int INT32_MAX() { - return INT32_MAX; - } - - private static final long INT64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT64_MAX 9223372036854775807 - * } - */ - public static long INT64_MAX() { - return INT64_MAX; - } - - private static final int UINT8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT8_MAX 255 - * } - */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - - private static final int UINT16_MAX = (int) 65535L; - - /** - * {@snippet lang = c : * #define UINT16_MAX 65535 - * } - */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - - private static final int UINT32_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define UINT32_MAX 4294967295 - * } - */ - public static int UINT32_MAX() { - return UINT32_MAX; - } - - private static final long UINT64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT64_MAX -1 - * } - */ - public static long UINT64_MAX() { - return UINT64_MAX; - } - - private static final int INT_LEAST8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT_LEAST8_MIN -128 - * } - */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; - } - - private static final int INT_LEAST16_MIN = (int) -32768L; - - /** - * {@snippet lang = c : * #define INT_LEAST16_MIN -32768 - * } - */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; - } - - private static final int INT_LEAST32_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define INT_LEAST32_MIN -2147483648 - * } - */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; - } - - private static final long INT_LEAST64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_LEAST64_MIN -9223372036854775808 - * } - */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; - } - - private static final int INT_LEAST8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT_LEAST8_MAX 127 - * } - */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; - } - - private static final int INT_LEAST16_MAX = (int) 32767L; - - /** - * {@snippet lang = c : * #define INT_LEAST16_MAX 32767 - * } - */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; - } - - private static final int INT_LEAST32_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define INT_LEAST32_MAX 2147483647 - * } - */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; - } - - private static final long INT_LEAST64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_LEAST64_MAX 9223372036854775807 - * } - */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; - } - - private static final int UINT_LEAST8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT_LEAST8_MAX 255 - * } - */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; - } - - private static final int UINT_LEAST16_MAX = (int) 65535L; - - /** - * {@snippet lang = c : * #define UINT_LEAST16_MAX 65535 - * } - */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; - } - - private static final int UINT_LEAST32_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define UINT_LEAST32_MAX 4294967295 - * } - */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; - } - - private static final long UINT_LEAST64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_LEAST64_MAX -1 - * } - */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; - } - - private static final int INT_FAST8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT_FAST8_MIN -128 - * } - */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; - } - - private static final long INT_FAST16_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST16_MIN -9223372036854775808 - * } - */ - public static long INT_FAST16_MIN() { - return INT_FAST16_MIN; - } - - private static final long INT_FAST32_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST32_MIN -9223372036854775808 - * } - */ - public static long INT_FAST32_MIN() { - return INT_FAST32_MIN; - } - - private static final long INT_FAST64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST64_MIN -9223372036854775808 - * } - */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; - } - - private static final int INT_FAST8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT_FAST8_MAX 127 - * } - */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; - } - - private static final long INT_FAST16_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST16_MAX 9223372036854775807 - * } - */ - public static long INT_FAST16_MAX() { - return INT_FAST16_MAX; - } - - private static final long INT_FAST32_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST32_MAX 9223372036854775807 - * } - */ - public static long INT_FAST32_MAX() { - return INT_FAST32_MAX; - } - - private static final long INT_FAST64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST64_MAX 9223372036854775807 - * } - */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; - } - - private static final int UINT_FAST8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT_FAST8_MAX 255 - * } - */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; - } - - private static final long UINT_FAST16_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST16_MAX -1 - * } - */ - public static long UINT_FAST16_MAX() { - return UINT_FAST16_MAX; - } - - private static final long UINT_FAST32_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST32_MAX -1 - * } - */ - public static long UINT_FAST32_MAX() { - return UINT_FAST32_MAX; - } - - private static final long UINT_FAST64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST64_MAX -1 - * } - */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; - } - - private static final long INTPTR_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INTPTR_MIN -9223372036854775808 - * } - */ - public static long INTPTR_MIN() { - return INTPTR_MIN; - } - - private static final long INTPTR_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INTPTR_MAX 9223372036854775807 - * } - */ - public static long INTPTR_MAX() { - return INTPTR_MAX; - } - - private static final long UINTPTR_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINTPTR_MAX -1 - * } - */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; - } - - private static final long INTMAX_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INTMAX_MIN -9223372036854775808 - * } - */ - public static long INTMAX_MIN() { - return INTMAX_MIN; - } - - private static final long INTMAX_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INTMAX_MAX 9223372036854775807 - * } - */ - public static long INTMAX_MAX() { - return INTMAX_MAX; - } - - private static final long UINTMAX_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINTMAX_MAX -1 - * } - */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; - } - - private static final long PTRDIFF_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define PTRDIFF_MIN -9223372036854775808 - * } - */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; - } - - private static final long PTRDIFF_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define PTRDIFF_MAX 9223372036854775807 - * } - */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; - } - - private static final int SIG_ATOMIC_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define SIG_ATOMIC_MIN -2147483648 - * } - */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; - } - - private static final int SIG_ATOMIC_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define SIG_ATOMIC_MAX 2147483647 - * } - */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; - } - - private static final long SIZE_MAX = -1L; - - /** - * {@snippet lang = c : * #define SIZE_MAX -1 - * } - */ - public static long SIZE_MAX() { - return SIZE_MAX; - } - - private static final int WCHAR_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define WCHAR_MIN -2147483648 - * } - */ - public static int WCHAR_MIN() { - return WCHAR_MIN; - } - - private static final int WCHAR_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define WCHAR_MAX 2147483647 - * } - */ - public static int WCHAR_MAX() { - return WCHAR_MAX; - } - - private static final int WINT_MIN = (int) 0L; - - /** - * {@snippet lang = c : * #define WINT_MIN 0 - * } - */ - public static int WINT_MIN() { - return WINT_MIN; - } - - private static final int WINT_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define WINT_MAX 4294967295 - * } - */ - public static int WINT_MAX() { - return WINT_MAX; - } - - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); - - /** - * {@snippet lang = c : * #define NULL (void*) 0 - * } - */ - public static MemorySegment NULL() { - return NULL; - } - - private static final long DLPACK_FLAG_BITMASK_READ_ONLY = 1L; - - /** - * {@snippet lang = c : * #define DLPACK_FLAG_BITMASK_READ_ONLY 1 - * } - */ - public static long DLPACK_FLAG_BITMASK_READ_ONLY() { - return DLPACK_FLAG_BITMASK_READ_ONLY; - } - - private static final long DLPACK_FLAG_BITMASK_IS_COPIED = 2L; - - /** - * {@snippet lang = c : * #define DLPACK_FLAG_BITMASK_IS_COPIED 2 - * } - */ - public static long DLPACK_FLAG_BITMASK_IS_COPIED() { - return DLPACK_FLAG_BITMASK_IS_COPIED; - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/IvfPqH.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/IvfPqH.java deleted file mode 100644 index 66d0ba5acb..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/IvfPqH.java +++ /dev/null @@ -1,3182 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.ValueLayout.JAVA_BYTE; - -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.PaddingLayout; -import java.lang.foreign.SequenceLayout; -import java.lang.foreign.StructLayout; -import java.lang.foreign.SymbolLookup; -import java.lang.foreign.ValueLayout; -import java.lang.foreign.ValueLayout.OfByte; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.lang.foreign.ValueLayout.OfShort; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.util.Arrays; -import java.util.stream.Collectors; - -public class IvfPqH { - - IvfPqH() { - // Should not be called directly - } - - static final Arena LIBRARY_ARENA = Arena.ofAuto(); - static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); - - static void traceDowncall(String name, Object... args) { - String traceArgs = Arrays.stream(args).map(Object::toString).collect(Collectors.joining(", ")); - System.out.printf("%s(%s)\n", name, traceArgs); - } - - static MemorySegment findOrThrow(String symbol) { - return SYMBOL_LOOKUP.find(symbol).orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); - } - - static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { - try { - return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); - } catch (ReflectiveOperationException ex) { - throw new AssertionError(ex); - } - } - - static MemoryLayout align(MemoryLayout layout, long align) { - return switch (layout) { - case PaddingLayout p -> p; - case ValueLayout v -> v.withByteAlignment(align); - case GroupLayout g -> { - MemoryLayout[] alignedMembers = g.memberLayouts().stream().map(m -> align(m, align)).toArray(MemoryLayout[]::new); - yield g instanceof StructLayout ? MemoryLayout.structLayout(alignedMembers) - : MemoryLayout.unionLayout(alignedMembers); - } - case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); - }; - } - - static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup().or(Linker.nativeLinker().defaultLookup()); - - public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; - public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; - public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; - public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; - public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; - public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; - public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; - public static final AddressLayout C_POINTER = ValueLayout.ADDRESS - .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); - public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; - private static final int _STDINT_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _STDINT_H 1 - * } - */ - public static int _STDINT_H() { - return _STDINT_H; - } - - private static final int _FEATURES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _FEATURES_H 1 - * } - */ - public static int _FEATURES_H() { - return _FEATURES_H; - } - - private static final int _DEFAULT_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _DEFAULT_SOURCE 1 - * } - */ - public static int _DEFAULT_SOURCE() { - return _DEFAULT_SOURCE; - } - - private static final int __GLIBC_USE_ISOC2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_ISOC2X 0 - * } - */ - public static int __GLIBC_USE_ISOC2X() { - return __GLIBC_USE_ISOC2X; - } - - private static final int __USE_ISOC11 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC11 1 - * } - */ - public static int __USE_ISOC11() { - return __USE_ISOC11; - } - - private static final int __USE_ISOC99 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC99 1 - * } - */ - public static int __USE_ISOC99() { - return __USE_ISOC99; - } - - private static final int __USE_ISOC95 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ISOC95 1 - * } - */ - public static int __USE_ISOC95() { - return __USE_ISOC95; - } - - private static final int __USE_POSIX_IMPLICITLY = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX_IMPLICITLY 1 - * } - */ - public static int __USE_POSIX_IMPLICITLY() { - return __USE_POSIX_IMPLICITLY; - } - - private static final int _POSIX_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _POSIX_SOURCE 1 - * } - */ - public static int _POSIX_SOURCE() { - return _POSIX_SOURCE; - } - - private static final int __USE_POSIX = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX 1 - * } - */ - public static int __USE_POSIX() { - return __USE_POSIX; - } - - private static final int __USE_POSIX2 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX2 1 - * } - */ - public static int __USE_POSIX2() { - return __USE_POSIX2; - } - - private static final int __USE_POSIX199309 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX199309 1 - * } - */ - public static int __USE_POSIX199309() { - return __USE_POSIX199309; - } - - private static final int __USE_POSIX199506 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_POSIX199506 1 - * } - */ - public static int __USE_POSIX199506() { - return __USE_POSIX199506; - } - - private static final int __USE_XOPEN2K = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_XOPEN2K 1 - * } - */ - public static int __USE_XOPEN2K() { - return __USE_XOPEN2K; - } - - private static final int __USE_XOPEN2K8 = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_XOPEN2K8 1 - * } - */ - public static int __USE_XOPEN2K8() { - return __USE_XOPEN2K8; - } - - private static final int _ATFILE_SOURCE = (int) 1L; - - /** - * {@snippet lang = c : * #define _ATFILE_SOURCE 1 - * } - */ - public static int _ATFILE_SOURCE() { - return _ATFILE_SOURCE; - } - - private static final int __WORDSIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - - private static final int __WORDSIZE_TIME64_COMPAT32 = (int) 1L; - - /** - * {@snippet lang = c : * #define __WORDSIZE_TIME64_COMPAT32 1 - * } - */ - public static int __WORDSIZE_TIME64_COMPAT32() { - return __WORDSIZE_TIME64_COMPAT32; - } - - private static final int __SYSCALL_WORDSIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __SYSCALL_WORDSIZE 64 - * } - */ - public static int __SYSCALL_WORDSIZE() { - return __SYSCALL_WORDSIZE; - } - - private static final int __USE_MISC = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_MISC 1 - * } - */ - public static int __USE_MISC() { - return __USE_MISC; - } - - private static final int __USE_ATFILE = (int) 1L; - - /** - * {@snippet lang = c : * #define __USE_ATFILE 1 - * } - */ - public static int __USE_ATFILE() { - return __USE_ATFILE; - } - - private static final int __USE_FORTIFY_LEVEL = (int) 0L; - - /** - * {@snippet lang = c : * #define __USE_FORTIFY_LEVEL 0 - * } - */ - public static int __USE_FORTIFY_LEVEL() { - return __USE_FORTIFY_LEVEL; - } - - private static final int __GLIBC_USE_DEPRECATED_GETS = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_DEPRECATED_GETS 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_GETS() { - return __GLIBC_USE_DEPRECATED_GETS; - } - - private static final int __GLIBC_USE_DEPRECATED_SCANF = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_DEPRECATED_SCANF 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_SCANF() { - return __GLIBC_USE_DEPRECATED_SCANF; - } - - private static final int _STDC_PREDEF_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _STDC_PREDEF_H 1 - * } - */ - public static int _STDC_PREDEF_H() { - return _STDC_PREDEF_H; - } - - private static final int __STDC_IEC_559__ = (int) 1L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_559__ 1 - * } - */ - public static int __STDC_IEC_559__() { - return __STDC_IEC_559__; - } - - private static final int __STDC_IEC_559_COMPLEX__ = (int) 1L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_559_COMPLEX__ 1 - * } - */ - public static int __STDC_IEC_559_COMPLEX__() { - return __STDC_IEC_559_COMPLEX__; - } - - private static final int __GNU_LIBRARY__ = (int) 6L; - - /** - * {@snippet lang = c : * #define __GNU_LIBRARY__ 6 - * } - */ - public static int __GNU_LIBRARY__() { - return __GNU_LIBRARY__; - } - - private static final int __GLIBC__ = (int) 2L; - - /** - * {@snippet lang = c : * #define __GLIBC__ 2 - * } - */ - public static int __GLIBC__() { - return __GLIBC__; - } - - private static final int __GLIBC_MINOR__ = (int) 35L; - - /** - * {@snippet lang = c : * #define __GLIBC_MINOR__ 35 - * } - */ - public static int __GLIBC_MINOR__() { - return __GLIBC_MINOR__; - } - - private static final int _SYS_CDEFS_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _SYS_CDEFS_H 1 - * } - */ - public static int _SYS_CDEFS_H() { - return _SYS_CDEFS_H; - } - - private static final int __glibc_c99_flexarr_available = (int) 1L; - - /** - * {@snippet lang = c : * #define __glibc_c99_flexarr_available 1 - * } - */ - public static int __glibc_c99_flexarr_available() { - return __glibc_c99_flexarr_available; - } - - private static final int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = (int) 0L; - - /** - * {@snippet lang = c : * #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 - * } - */ - public static int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI() { - return __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI; - } - - private static final int __HAVE_GENERIC_SELECTION = (int) 1L; - - /** - * {@snippet lang = c : * #define __HAVE_GENERIC_SELECTION 1 - * } - */ - public static int __HAVE_GENERIC_SELECTION() { - return __HAVE_GENERIC_SELECTION; - } - - private static final int __GLIBC_USE_LIB_EXT2 = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_LIB_EXT2 0 - * } - */ - public static int __GLIBC_USE_LIB_EXT2() { - return __GLIBC_USE_LIB_EXT2; - } - - private static final int __GLIBC_USE_IEC_60559_BFP_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_BFP_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT() { - return __GLIBC_USE_IEC_60559_BFP_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_BFP_EXT_C2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT_C2X() { - return __GLIBC_USE_IEC_60559_BFP_EXT_C2X; - } - - private static final int __GLIBC_USE_IEC_60559_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_EXT() { - return __GLIBC_USE_IEC_60559_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT; - } - - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X; - } - - private static final int __GLIBC_USE_IEC_60559_TYPES_EXT = (int) 0L; - - /** - * {@snippet lang = c : * #define __GLIBC_USE_IEC_60559_TYPES_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_TYPES_EXT() { - return __GLIBC_USE_IEC_60559_TYPES_EXT; - } - - private static final int _BITS_TYPES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TYPES_H 1 - * } - */ - public static int _BITS_TYPES_H() { - return _BITS_TYPES_H; - } - - private static final int _BITS_TYPESIZES_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TYPESIZES_H 1 - * } - */ - public static int _BITS_TYPESIZES_H() { - return _BITS_TYPESIZES_H; - } - - private static final int __OFF_T_MATCHES_OFF64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __OFF_T_MATCHES_OFF64_T 1 - * } - */ - public static int __OFF_T_MATCHES_OFF64_T() { - return __OFF_T_MATCHES_OFF64_T; - } - - private static final int __INO_T_MATCHES_INO64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __INO_T_MATCHES_INO64_T 1 - * } - */ - public static int __INO_T_MATCHES_INO64_T() { - return __INO_T_MATCHES_INO64_T; - } - - private static final int __RLIM_T_MATCHES_RLIM64_T = (int) 1L; - - /** - * {@snippet lang = c : * #define __RLIM_T_MATCHES_RLIM64_T 1 - * } - */ - public static int __RLIM_T_MATCHES_RLIM64_T() { - return __RLIM_T_MATCHES_RLIM64_T; - } - - private static final int __STATFS_MATCHES_STATFS64 = (int) 1L; - - /** - * {@snippet lang = c : * #define __STATFS_MATCHES_STATFS64 1 - * } - */ - public static int __STATFS_MATCHES_STATFS64() { - return __STATFS_MATCHES_STATFS64; - } - - private static final int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = (int) 1L; - - /** - * {@snippet lang = c : * #define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 - * } - */ - public static int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64() { - return __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64; - } - - private static final int __FD_SETSIZE = (int) 1024L; - - /** - * {@snippet lang = c : * #define __FD_SETSIZE 1024 - * } - */ - public static int __FD_SETSIZE() { - return __FD_SETSIZE; - } - - private static final int _BITS_TIME64_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_TIME64_H 1 - * } - */ - public static int _BITS_TIME64_H() { - return _BITS_TIME64_H; - } - - private static final int _BITS_WCHAR_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_WCHAR_H 1 - * } - */ - public static int _BITS_WCHAR_H() { - return _BITS_WCHAR_H; - } - - private static final int _BITS_STDINT_INTN_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_STDINT_INTN_H 1 - * } - */ - public static int _BITS_STDINT_INTN_H() { - return _BITS_STDINT_INTN_H; - } - - private static final int _BITS_STDINT_UINTN_H = (int) 1L; - - /** - * {@snippet lang = c : * #define _BITS_STDINT_UINTN_H 1 - * } - */ - public static int _BITS_STDINT_UINTN_H() { - return _BITS_STDINT_UINTN_H; - } - - private static final int DLPACK_MAJOR_VERSION = (int) 1L; - - /** - * {@snippet lang = c : * #define DLPACK_MAJOR_VERSION 1 - * } - */ - public static int DLPACK_MAJOR_VERSION() { - return DLPACK_MAJOR_VERSION; - } - - private static final int DLPACK_MINOR_VERSION = (int) 0L; - - /** - * {@snippet lang = c : * #define DLPACK_MINOR_VERSION 0 - * } - */ - public static int DLPACK_MINOR_VERSION() { - return DLPACK_MINOR_VERSION; - } - - private static final int true_ = (int) 1L; - - /** - * {@snippet lang = c : * #define true 1 - * } - */ - public static int true_() { - return true_; - } - - private static final int false_ = (int) 0L; - - /** - * {@snippet lang = c : * #define false 0 - * } - */ - public static int false_() { - return false_; - } - - private static final int __bool_true_false_are_defined = (int) 1L; - - /** - * {@snippet lang = c : * #define __bool_true_false_are_defined 1 - * } - */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } - - /** - * {@snippet lang = c : * typedef unsigned char __u_char - * } - */ - public static final OfByte __u_char = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned short __u_short - * } - */ - public static final OfShort __u_short = IvfPqH.C_SHORT; - /** - * {@snippet lang = c : * typedef unsigned int __u_int - * } - */ - public static final OfInt __u_int = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __u_long - * } - */ - public static final OfLong __u_long = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef signed char __int8_t - * } - */ - public static final OfByte __int8_t = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned char __uint8_t - * } - */ - public static final OfByte __uint8_t = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef short __int16_t - * } - */ - public static final OfShort __int16_t = IvfPqH.C_SHORT; - /** - * {@snippet lang = c : * typedef unsigned short __uint16_t - * } - */ - public static final OfShort __uint16_t = IvfPqH.C_SHORT; - /** - * {@snippet lang = c : * typedef int __int32_t - * } - */ - public static final OfInt __int32_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned int __uint32_t - * } - */ - public static final OfInt __uint32_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef long __int64_t - * } - */ - public static final OfLong __int64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __uint64_t - * } - */ - public static final OfLong __uint64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef __int8_t __int_least8_t - * } - */ - public static final OfByte __int_least8_t = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint8_t __uint_least8_t - * } - */ - public static final OfByte __uint_least8_t = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int16_t __int_least16_t - * } - */ - public static final OfShort __int_least16_t = IvfPqH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint16_t __uint_least16_t - * } - */ - public static final OfShort __uint_least16_t = IvfPqH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int32_t __int_least32_t - * } - */ - public static final OfInt __int_least32_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef __uint32_t __uint_least32_t - * } - */ - public static final OfInt __uint_least32_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef __int64_t __int_least64_t - * } - */ - public static final OfLong __int_least64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint64_t __uint_least64_t - * } - */ - public static final OfLong __uint_least64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long __quad_t - * } - */ - public static final OfLong __quad_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __u_quad_t - * } - */ - public static final OfLong __u_quad_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long __intmax_t - * } - */ - public static final OfLong __intmax_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __uintmax_t - * } - */ - public static final OfLong __uintmax_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __dev_t - * } - */ - public static final OfLong __dev_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __uid_t - * } - */ - public static final OfInt __uid_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned int __gid_t - * } - */ - public static final OfInt __gid_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __ino_t - * } - */ - public static final OfLong __ino_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __ino64_t - * } - */ - public static final OfLong __ino64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __mode_t - * } - */ - public static final OfInt __mode_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef unsigned long __nlink_t - * } - */ - public static final OfLong __nlink_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long __off_t - * } - */ - public static final OfLong __off_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long __off64_t - * } - */ - public static final OfLong __off64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef int __pid_t - * } - */ - public static final OfInt __pid_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef long __clock_t - * } - */ - public static final OfLong __clock_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __rlim_t - * } - */ - public static final OfLong __rlim_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __rlim64_t - * } - */ - public static final OfLong __rlim64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __id_t - * } - */ - public static final OfInt __id_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef long __time_t - * } - */ - public static final OfLong __time_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __useconds_t - * } - */ - public static final OfInt __useconds_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef long __suseconds_t - * } - */ - public static final OfLong __suseconds_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long __suseconds64_t - * } - */ - public static final OfLong __suseconds64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef int __daddr_t - * } - */ - public static final OfInt __daddr_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef int __key_t - * } - */ - public static final OfInt __key_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef int __clockid_t - * } - */ - public static final OfInt __clockid_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef void *__timer_t - * } - */ - public static final AddressLayout __timer_t = IvfPqH.C_POINTER; - /** - * {@snippet lang = c : * typedef long __blksize_t - * } - */ - public static final OfLong __blksize_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long __blkcnt_t - * } - */ - public static final OfLong __blkcnt_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long __blkcnt64_t - * } - */ - public static final OfLong __blkcnt64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsblkcnt_t - * } - */ - public static final OfLong __fsblkcnt_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsblkcnt64_t - * } - */ - public static final OfLong __fsblkcnt64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsfilcnt_t - * } - */ - public static final OfLong __fsfilcnt_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __fsfilcnt64_t - * } - */ - public static final OfLong __fsfilcnt64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long __fsword_t - * } - */ - public static final OfLong __fsword_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long __ssize_t - * } - */ - public static final OfLong __ssize_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long __syscall_slong_t - * } - */ - public static final OfLong __syscall_slong_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long __syscall_ulong_t - * } - */ - public static final OfLong __syscall_ulong_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef __off64_t __loff_t - * } - */ - public static final OfLong __loff_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef char *__caddr_t - * } - */ - public static final AddressLayout __caddr_t = IvfPqH.C_POINTER; - /** - * {@snippet lang = c : * typedef long __intptr_t - * } - */ - public static final OfLong __intptr_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned int __socklen_t - * } - */ - public static final OfInt __socklen_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef int __sig_atomic_t - * } - */ - public static final OfInt __sig_atomic_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef __int8_t int8_t - * } - */ - public static final OfByte int8_t = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int16_t int16_t - * } - */ - public static final OfShort int16_t = IvfPqH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int32_t int32_t - * } - */ - public static final OfInt int32_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef __int64_t int64_t - * } - */ - public static final OfLong int64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint8_t uint8_t - * } - */ - public static final OfByte uint8_t = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint16_t uint16_t - * } - */ - public static final OfShort uint16_t = IvfPqH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint32_t uint32_t - * } - */ - public static final OfInt uint32_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef __uint64_t uint64_t - * } - */ - public static final OfLong uint64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef __int_least8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef __int_least16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = IvfPqH.C_SHORT; - /** - * {@snippet lang = c : * typedef __int_least32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef __int_least64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef __uint_least8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef __uint_least16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = IvfPqH.C_SHORT; - /** - * {@snippet lang = c : * typedef __uint_least32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = IvfPqH.C_INT; - /** - * {@snippet lang = c : * typedef __uint_least64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef signed char int_fast8_t - * } - */ - public static final OfByte int_fast8_t = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef long int_fast16_t - * } - */ - public static final OfLong int_fast16_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long int_fast32_t - * } - */ - public static final OfLong int_fast32_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long int_fast64_t - * } - */ - public static final OfLong int_fast64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned char uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = IvfPqH.C_CHAR; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast16_t - * } - */ - public static final OfLong uint_fast16_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast32_t - * } - */ - public static final OfLong uint_fast32_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef long intptr_t - * } - */ - public static final OfLong intptr_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long uintptr_t - * } - */ - public static final OfLong uintptr_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef __intmax_t intmax_t - * } - */ - public static final OfLong intmax_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef __uintmax_t uintmax_t - * } - */ - public static final OfLong uintmax_t = IvfPqH.C_LONG; - private static final int CUVS_ERROR = (int) 0L; - - /** - * {@snippet lang = c : * enum .CUVS_ERROR = 0 - * } - */ - public static int CUVS_ERROR() { - return CUVS_ERROR; - } - - private static final int CUVS_SUCCESS = (int) 1L; - - /** - * {@snippet lang = c : * enum .CUVS_SUCCESS = 1 - * } - */ - public static int CUVS_SUCCESS() { - return CUVS_SUCCESS; - } - - /** - * {@snippet lang = c : * typedef uintptr_t cuvsResources_t - * } - */ - public static final OfLong cuvsResources_t = IvfPqH.C_LONG; - private static final int L2Expanded = (int) 0L; - - /** - * {@snippet lang = c : * enum .L2Expanded = 0 - * } - */ - public static int L2Expanded() { - return L2Expanded; - } - - private static final int L2SqrtExpanded = (int) 1L; - - /** - * {@snippet lang = c : * enum .L2SqrtExpanded = 1 - * } - */ - public static int L2SqrtExpanded() { - return L2SqrtExpanded; - } - - private static final int CosineExpanded = (int) 2L; - - /** - * {@snippet lang = c : * enum .CosineExpanded = 2 - * } - */ - public static int CosineExpanded() { - return CosineExpanded; - } - - private static final int L1 = (int) 3L; - - /** - * {@snippet lang = c : * enum .L1 = 3 - * } - */ - public static int L1() { - return L1; - } - - private static final int L2Unexpanded = (int) 4L; - - /** - * {@snippet lang = c : * enum .L2Unexpanded = 4 - * } - */ - public static int L2Unexpanded() { - return L2Unexpanded; - } - - private static final int L2SqrtUnexpanded = (int) 5L; - - /** - * {@snippet lang = c : * enum .L2SqrtUnexpanded = 5 - * } - */ - public static int L2SqrtUnexpanded() { - return L2SqrtUnexpanded; - } - - private static final int InnerProduct = (int) 6L; - - /** - * {@snippet lang = c : * enum .InnerProduct = 6 - * } - */ - public static int InnerProduct() { - return InnerProduct; - } - - private static final int Linf = (int) 7L; - - /** - * {@snippet lang = c : * enum .Linf = 7 - * } - */ - public static int Linf() { - return Linf; - } - - private static final int Canberra = (int) 8L; - - /** - * {@snippet lang = c : * enum .Canberra = 8 - * } - */ - public static int Canberra() { - return Canberra; - } - - private static final int LpUnexpanded = (int) 9L; - - /** - * {@snippet lang = c : * enum .LpUnexpanded = 9 - * } - */ - public static int LpUnexpanded() { - return LpUnexpanded; - } - - private static final int CorrelationExpanded = (int) 10L; - - /** - * {@snippet lang = c : * enum .CorrelationExpanded = 10 - * } - */ - public static int CorrelationExpanded() { - return CorrelationExpanded; - } - - private static final int JaccardExpanded = (int) 11L; - - /** - * {@snippet lang = c : * enum .JaccardExpanded = 11 - * } - */ - public static int JaccardExpanded() { - return JaccardExpanded; - } - - private static final int HellingerExpanded = (int) 12L; - - /** - * {@snippet lang = c : * enum .HellingerExpanded = 12 - * } - */ - public static int HellingerExpanded() { - return HellingerExpanded; - } - - private static final int Haversine = (int) 13L; - - /** - * {@snippet lang = c : * enum .Haversine = 13 - * } - */ - public static int Haversine() { - return Haversine; - } - - private static final int BrayCurtis = (int) 14L; - - /** - * {@snippet lang = c : * enum .BrayCurtis = 14 - * } - */ - public static int BrayCurtis() { - return BrayCurtis; - } - - private static final int JensenShannon = (int) 15L; - - /** - * {@snippet lang = c : * enum .JensenShannon = 15 - * } - */ - public static int JensenShannon() { - return JensenShannon; - } - - private static final int HammingUnexpanded = (int) 16L; - - /** - * {@snippet lang = c : * enum .HammingUnexpanded = 16 - * } - */ - public static int HammingUnexpanded() { - return HammingUnexpanded; - } - - private static final int KLDivergence = (int) 17L; - - /** - * {@snippet lang = c : * enum .KLDivergence = 17 - * } - */ - public static int KLDivergence() { - return KLDivergence; - } - - private static final int RusselRaoExpanded = (int) 18L; - - /** - * {@snippet lang = c : * enum .RusselRaoExpanded = 18 - * } - */ - public static int RusselRaoExpanded() { - return RusselRaoExpanded; - } - - private static final int DiceExpanded = (int) 19L; - - /** - * {@snippet lang = c : * enum .DiceExpanded = 19 - * } - */ - public static int DiceExpanded() { - return DiceExpanded; - } - - private static final int Precomputed = (int) 100L; - - /** - * {@snippet lang = c : * enum .Precomputed = 100 - * } - */ - public static int Precomputed() { - return Precomputed; - } - - /** - * {@snippet lang = c : * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef unsigned long size_t - * } - */ - public static final OfLong size_t = IvfPqH.C_LONG; - /** - * {@snippet lang = c : * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = IvfPqH.C_INT; - private static final int kDLCPU = (int) 1L; - - /** - * {@snippet lang = c : * enum .kDLCPU = 1 - * } - */ - public static int kDLCPU() { - return kDLCPU; - } - - private static final int kDLCUDA = (int) 2L; - - /** - * {@snippet lang = c : * enum .kDLCUDA = 2 - * } - */ - public static int kDLCUDA() { - return kDLCUDA; - } - - private static final int kDLCUDAHost = (int) 3L; - - /** - * {@snippet lang = c : * enum .kDLCUDAHost = 3 - * } - */ - public static int kDLCUDAHost() { - return kDLCUDAHost; - } - - private static final int kDLOpenCL = (int) 4L; - - /** - * {@snippet lang = c : * enum .kDLOpenCL = 4 - * } - */ - public static int kDLOpenCL() { - return kDLOpenCL; - } - - private static final int kDLVulkan = (int) 7L; - - /** - * {@snippet lang = c : * enum .kDLVulkan = 7 - * } - */ - public static int kDLVulkan() { - return kDLVulkan; - } - - private static final int kDLMetal = (int) 8L; - - /** - * {@snippet lang = c : * enum .kDLMetal = 8 - * } - */ - public static int kDLMetal() { - return kDLMetal; - } - - private static final int kDLVPI = (int) 9L; - - /** - * {@snippet lang = c : * enum .kDLVPI = 9 - * } - */ - public static int kDLVPI() { - return kDLVPI; - } - - private static final int kDLROCM = (int) 10L; - - /** - * {@snippet lang = c : * enum .kDLROCM = 10 - * } - */ - public static int kDLROCM() { - return kDLROCM; - } - - private static final int kDLROCMHost = (int) 11L; - - /** - * {@snippet lang = c : * enum .kDLROCMHost = 11 - * } - */ - public static int kDLROCMHost() { - return kDLROCMHost; - } - - private static final int kDLExtDev = (int) 12L; - - /** - * {@snippet lang = c : * enum .kDLExtDev = 12 - * } - */ - public static int kDLExtDev() { - return kDLExtDev; - } - - private static final int kDLCUDAManaged = (int) 13L; - - /** - * {@snippet lang = c : * enum .kDLCUDAManaged = 13 - * } - */ - public static int kDLCUDAManaged() { - return kDLCUDAManaged; - } - - private static final int kDLOneAPI = (int) 14L; - - /** - * {@snippet lang = c : * enum .kDLOneAPI = 14 - * } - */ - public static int kDLOneAPI() { - return kDLOneAPI; - } - - private static final int kDLWebGPU = (int) 15L; - - /** - * {@snippet lang = c : * enum .kDLWebGPU = 15 - * } - */ - public static int kDLWebGPU() { - return kDLWebGPU; - } - - private static final int kDLHexagon = (int) 16L; - - /** - * {@snippet lang = c : * enum .kDLHexagon = 16 - * } - */ - public static int kDLHexagon() { - return kDLHexagon; - } - - private static final int kDLMAIA = (int) 17L; - - /** - * {@snippet lang = c : * enum .kDLMAIA = 17 - * } - */ - public static int kDLMAIA() { - return kDLMAIA; - } - - private static final int kDLInt = (int) 0L; - - /** - * {@snippet lang = c : * enum .kDLInt = 0 - * } - */ - public static int kDLInt() { - return kDLInt; - } - - private static final int kDLUInt = (int) 1L; - - /** - * {@snippet lang = c : * enum .kDLUInt = 1 - * } - */ - public static int kDLUInt() { - return kDLUInt; - } - - private static final int kDLFloat = (int) 2L; - - /** - * {@snippet lang = c : * enum .kDLFloat = 2 - * } - */ - public static int kDLFloat() { - return kDLFloat; - } - - private static final int kDLOpaqueHandle = (int) 3L; - - /** - * {@snippet lang = c : * enum .kDLOpaqueHandle = 3 - * } - */ - public static int kDLOpaqueHandle() { - return kDLOpaqueHandle; - } - - private static final int kDLBfloat = (int) 4L; - - /** - * {@snippet lang = c : * enum .kDLBfloat = 4 - * } - */ - public static int kDLBfloat() { - return kDLBfloat; - } - - private static final int kDLComplex = (int) 5L; - - /** - * {@snippet lang = c : * enum .kDLComplex = 5 - * } - */ - public static int kDLComplex() { - return kDLComplex; - } - - private static final int kDLBool = (int) 6L; - - /** - * {@snippet lang = c : * enum .kDLBool = 6 - * } - */ - public static int kDLBool() { - return kDLBool; - } - - private static final int CUDA_R_16F = (int) 2L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_16F = 2 - * } - */ - public static int CUDA_R_16F() { - return CUDA_R_16F; - } - - private static final int CUDA_C_16F = (int) 6L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_16F = 6 - * } - */ - public static int CUDA_C_16F() { - return CUDA_C_16F; - } - - private static final int CUDA_R_16BF = (int) 14L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_16BF = 14 - * } - */ - public static int CUDA_R_16BF() { - return CUDA_R_16BF; - } - - private static final int CUDA_C_16BF = (int) 15L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_16BF = 15 - * } - */ - public static int CUDA_C_16BF() { - return CUDA_C_16BF; - } - - private static final int CUDA_R_32F = (int) 0L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_32F = 0 - * } - */ - public static int CUDA_R_32F() { - return CUDA_R_32F; - } - - private static final int CUDA_C_32F = (int) 4L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_32F = 4 - * } - */ - public static int CUDA_C_32F() { - return CUDA_C_32F; - } - - private static final int CUDA_R_64F = (int) 1L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_64F = 1 - * } - */ - public static int CUDA_R_64F() { - return CUDA_R_64F; - } - - private static final int CUDA_C_64F = (int) 5L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_64F = 5 - * } - */ - public static int CUDA_C_64F() { - return CUDA_C_64F; - } - - private static final int CUDA_R_4I = (int) 16L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_4I = 16 - * } - */ - public static int CUDA_R_4I() { - return CUDA_R_4I; - } - - private static final int CUDA_C_4I = (int) 17L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_4I = 17 - * } - */ - public static int CUDA_C_4I() { - return CUDA_C_4I; - } - - private static final int CUDA_R_4U = (int) 18L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_4U = 18 - * } - */ - public static int CUDA_R_4U() { - return CUDA_R_4U; - } - - private static final int CUDA_C_4U = (int) 19L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_4U = 19 - * } - */ - public static int CUDA_C_4U() { - return CUDA_C_4U; - } - - private static final int CUDA_R_8I = (int) 3L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_8I = 3 - * } - */ - public static int CUDA_R_8I() { - return CUDA_R_8I; - } - - private static final int CUDA_C_8I = (int) 7L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_8I = 7 - * } - */ - public static int CUDA_C_8I() { - return CUDA_C_8I; - } - - private static final int CUDA_R_8U = (int) 8L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_8U = 8 - * } - */ - public static int CUDA_R_8U() { - return CUDA_R_8U; - } - - private static final int CUDA_C_8U = (int) 9L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_8U = 9 - * } - */ - public static int CUDA_C_8U() { - return CUDA_C_8U; - } - - private static final int CUDA_R_16I = (int) 20L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_16I = 20 - * } - */ - public static int CUDA_R_16I() { - return CUDA_R_16I; - } - - private static final int CUDA_C_16I = (int) 21L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_16I = 21 - * } - */ - public static int CUDA_C_16I() { - return CUDA_C_16I; - } - - private static final int CUDA_R_16U = (int) 22L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_16U = 22 - * } - */ - public static int CUDA_R_16U() { - return CUDA_R_16U; - } - - private static final int CUDA_C_16U = (int) 23L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_16U = 23 - * } - */ - public static int CUDA_C_16U() { - return CUDA_C_16U; - } - - private static final int CUDA_R_32I = (int) 10L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_32I = 10 - * } - */ - public static int CUDA_R_32I() { - return CUDA_R_32I; - } - - private static final int CUDA_C_32I = (int) 11L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_32I = 11 - * } - */ - public static int CUDA_C_32I() { - return CUDA_C_32I; - } - - private static final int CUDA_R_32U = (int) 12L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_32U = 12 - * } - */ - public static int CUDA_R_32U() { - return CUDA_R_32U; - } - - private static final int CUDA_C_32U = (int) 13L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_32U = 13 - * } - */ - public static int CUDA_C_32U() { - return CUDA_C_32U; - } - - private static final int CUDA_R_64I = (int) 24L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_64I = 24 - * } - */ - public static int CUDA_R_64I() { - return CUDA_R_64I; - } - - private static final int CUDA_C_64I = (int) 25L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_64I = 25 - * } - */ - public static int CUDA_C_64I() { - return CUDA_C_64I; - } - - private static final int CUDA_R_64U = (int) 26L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_R_64U = 26 - * } - */ - public static int CUDA_R_64U() { - return CUDA_R_64U; - } - - private static final int CUDA_C_64U = (int) 27L; - - /** - * {@snippet lang = c : * enum cudaDataType_t.CUDA_C_64U = 27 - * } - */ - public static int CUDA_C_64U() { - return CUDA_C_64U; - } - - private static final int MAJOR_VERSION = (int) 0L; - - /** - * {@snippet lang = c : * enum libraryPropertyType_t.MAJOR_VERSION = 0 - * } - */ - public static int MAJOR_VERSION() { - return MAJOR_VERSION; - } - - private static final int MINOR_VERSION = (int) 1L; - - /** - * {@snippet lang = c : * enum libraryPropertyType_t.MINOR_VERSION = 1 - * } - */ - public static int MINOR_VERSION() { - return MINOR_VERSION; - } - - private static final int PATCH_LEVEL = (int) 2L; - - /** - * {@snippet lang = c : * enum libraryPropertyType_t.PATCH_LEVEL = 2 - * } - */ - public static int PATCH_LEVEL() { - return PATCH_LEVEL; - } - - private static final int PER_SUBSPACE = (int) 0L; - - /** - * {@snippet lang = c : * enum codebook_gen.PER_SUBSPACE = 0 - * } - */ - public static int PER_SUBSPACE() { - return PER_SUBSPACE; - } - - private static final int PER_CLUSTER = (int) 1L; - - /** - * {@snippet lang = c : * enum codebook_gen.PER_CLUSTER = 1 - * } - */ - public static int PER_CLUSTER() { - return PER_CLUSTER; - } - - /** - * {@snippet lang = c : - * typedef struct cuvsIvfPqIndexParams { - * cuvsDistanceType metric; - * float metric_arg; - * _Bool add_data_on_build; - * uint32_t n_lists; - * uint32_t kmeans_n_iters; - * double kmeans_trainset_fraction; - * uint32_t pq_bits; - * uint32_t pq_dim; - * enum codebook_gen codebook_kind; - * _Bool force_random_rotation; - * _Bool conservative_memory_allocation; - * uint32_t max_train_points_per_pq_code; - * } *cuvsIvfPqIndexParams_t - * } - */ - public static final AddressLayout cuvsIvfPqIndexParams_t = IvfPqH.C_POINTER; - - private static class cuvsIvfPqIndexParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqIndexParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) - * } - */ - public static FunctionDescriptor cuvsIvfPqIndexParamsCreate$descriptor() { - return cuvsIvfPqIndexParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) - * } - */ - public static MethodHandle cuvsIvfPqIndexParamsCreate$handle() { - return cuvsIvfPqIndexParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) - * } - */ - public static MemorySegment cuvsIvfPqIndexParamsCreate$address() { - return cuvsIvfPqIndexParamsCreate.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) - * } - */ - public static int cuvsIvfPqIndexParamsCreate(MemorySegment index_params) { - var mh$ = cuvsIvfPqIndexParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqIndexParamsCreate", index_params); - } - return (int) mh$.invokeExact(index_params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqIndexParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqIndexParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) - * } - */ - public static FunctionDescriptor cuvsIvfPqIndexParamsDestroy$descriptor() { - return cuvsIvfPqIndexParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) - * } - */ - public static MethodHandle cuvsIvfPqIndexParamsDestroy$handle() { - return cuvsIvfPqIndexParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) - * } - */ - public static MemorySegment cuvsIvfPqIndexParamsDestroy$address() { - return cuvsIvfPqIndexParamsDestroy.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) - * } - */ - public static int cuvsIvfPqIndexParamsDestroy(MemorySegment index_params) { - var mh$ = cuvsIvfPqIndexParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqIndexParamsDestroy", index_params); - } - return (int) mh$.invokeExact(index_params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * {@snippet lang = c : - * typedef struct cuvsIvfPqSearchParams { - * uint32_t n_probes; - * cudaDataType_t lut_dtype; - * cudaDataType_t internal_distance_dtype; - * double preferred_shmem_carveout; - * } *cuvsIvfPqSearchParams_t - * } - */ - public static final AddressLayout cuvsIvfPqSearchParams_t = IvfPqH.C_POINTER; - - private static class cuvsIvfPqSearchParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqSearchParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) - * } - */ - public static FunctionDescriptor cuvsIvfPqSearchParamsCreate$descriptor() { - return cuvsIvfPqSearchParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) - * } - */ - public static MethodHandle cuvsIvfPqSearchParamsCreate$handle() { - return cuvsIvfPqSearchParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) - * } - */ - public static MemorySegment cuvsIvfPqSearchParamsCreate$address() { - return cuvsIvfPqSearchParamsCreate.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) - * } - */ - public static int cuvsIvfPqSearchParamsCreate(MemorySegment params) { - var mh$ = cuvsIvfPqSearchParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqSearchParamsCreate", params); - } - return (int) mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqSearchParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqSearchParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) - * } - */ - public static FunctionDescriptor cuvsIvfPqSearchParamsDestroy$descriptor() { - return cuvsIvfPqSearchParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) - * } - */ - public static MethodHandle cuvsIvfPqSearchParamsDestroy$handle() { - return cuvsIvfPqSearchParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) - * } - */ - public static MemorySegment cuvsIvfPqSearchParamsDestroy$address() { - return cuvsIvfPqSearchParamsDestroy.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) - * } - */ - public static int cuvsIvfPqSearchParamsDestroy(MemorySegment params) { - var mh$ = cuvsIvfPqSearchParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqSearchParamsDestroy", params); - } - return (int) mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * {@snippet lang = c : * typedef cuvsIvfPq *cuvsIvfPqIndex_t - * } - */ - public static final AddressLayout cuvsIvfPqIndex_t = IvfPqH.C_POINTER; - - private static class cuvsIvfPqIndexCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqIndexCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) - * } - */ - public static FunctionDescriptor cuvsIvfPqIndexCreate$descriptor() { - return cuvsIvfPqIndexCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) - * } - */ - public static MethodHandle cuvsIvfPqIndexCreate$handle() { - return cuvsIvfPqIndexCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) - * } - */ - public static MemorySegment cuvsIvfPqIndexCreate$address() { - return cuvsIvfPqIndexCreate.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) - * } - */ - public static int cuvsIvfPqIndexCreate(MemorySegment index) { - var mh$ = cuvsIvfPqIndexCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqIndexCreate", index); - } - return (int) mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqIndexDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqIndexDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfPqIndexDestroy$descriptor() { - return cuvsIvfPqIndexDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) - * } - */ - public static MethodHandle cuvsIvfPqIndexDestroy$handle() { - return cuvsIvfPqIndexDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) - * } - */ - public static MemorySegment cuvsIvfPqIndexDestroy$address() { - return cuvsIvfPqIndexDestroy.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) - * } - */ - public static int cuvsIvfPqIndexDestroy(MemorySegment index) { - var mh$ = cuvsIvfPqIndexDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqIndexDestroy", index); - } - return (int) mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqBuild { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_LONG, - IvfPqH.C_POINTER, IvfPqH.C_POINTER, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqBuild"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfPqBuild$descriptor() { - return cuvsIvfPqBuild.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) - * } - */ - public static MethodHandle cuvsIvfPqBuild$handle() { - return cuvsIvfPqBuild.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) - * } - */ - public static MemorySegment cuvsIvfPqBuild$address() { - return cuvsIvfPqBuild.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) - * } - */ - public static int cuvsIvfPqBuild(long res, MemorySegment params, MemorySegment dataset, MemorySegment index) { - var mh$ = cuvsIvfPqBuild.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqBuild", res, params, dataset, index); - } - return (int) mh$.invokeExact(res, params, dataset, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqSearch { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_LONG, - IvfPqH.C_POINTER, IvfPqH.C_POINTER, IvfPqH.C_POINTER, IvfPqH.C_POINTER, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqSearch"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static FunctionDescriptor cuvsIvfPqSearch$descriptor() { - return cuvsIvfPqSearch.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static MethodHandle cuvsIvfPqSearch$handle() { - return cuvsIvfPqSearch.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static MemorySegment cuvsIvfPqSearch$address() { - return cuvsIvfPqSearch.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static int cuvsIvfPqSearch(long res, MemorySegment search_params, MemorySegment index, MemorySegment queries, - MemorySegment neighbors, MemorySegment distances) { - var mh$ = cuvsIvfPqSearch.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqSearch", res, search_params, index, queries, neighbors, distances); - } - return (int) mh$.invokeExact(res, search_params, index, queries, neighbors, distances); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqSerialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_LONG, - IvfPqH.C_POINTER, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqSerialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfPqSerialize$descriptor() { - return cuvsIvfPqSerialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static MethodHandle cuvsIvfPqSerialize$handle() { - return cuvsIvfPqSerialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static MemorySegment cuvsIvfPqSerialize$address() { - return cuvsIvfPqSerialize.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static int cuvsIvfPqSerialize(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsIvfPqSerialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqSerialize", res, filename, index); - } - return (int) mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqDeserialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_LONG, - IvfPqH.C_POINTER, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqDeserialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfPqDeserialize$descriptor() { - return cuvsIvfPqDeserialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static MethodHandle cuvsIvfPqDeserialize$handle() { - return cuvsIvfPqDeserialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static MemorySegment cuvsIvfPqDeserialize$address() { - return cuvsIvfPqDeserialize.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static int cuvsIvfPqDeserialize(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsIvfPqDeserialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqDeserialize", res, filename, index); - } - return (int) mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqExtend { - public static final FunctionDescriptor DESC = FunctionDescriptor.of(IvfPqH.C_INT, IvfPqH.C_LONG, - IvfPqH.C_POINTER, IvfPqH.C_POINTER, IvfPqH.C_POINTER); - - public static final MemorySegment ADDR = IvfPqH.findOrThrow("cuvsIvfPqExtend"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfPqExtend$descriptor() { - return cuvsIvfPqExtend.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) - * } - */ - public static MethodHandle cuvsIvfPqExtend$handle() { - return cuvsIvfPqExtend.HANDLE; - } - - /** - * Address for: - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) - * } - */ - public static MemorySegment cuvsIvfPqExtend$address() { - return cuvsIvfPqExtend.ADDR; - } - - /** - * {@snippet lang = c - * : * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) - * } - */ - public static int cuvsIvfPqExtend(long res, MemorySegment new_vectors, MemorySegment new_indices, - MemorySegment index) { - var mh$ = cuvsIvfPqExtend.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqExtend", res, new_vectors, new_indices, index); - } - return (int) mh$.invokeExact(res, new_vectors, new_indices, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static final long _POSIX_C_SOURCE = 200809L; - - /** - * {@snippet lang = c : * #define _POSIX_C_SOURCE 200809 - * } - */ - public static long _POSIX_C_SOURCE() { - return _POSIX_C_SOURCE; - } - - private static final int __TIMESIZE = (int) 64L; - - /** - * {@snippet lang = c : * #define __TIMESIZE 64 - * } - */ - public static int __TIMESIZE() { - return __TIMESIZE; - } - - private static final long __STDC_IEC_60559_BFP__ = 201404L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_60559_BFP__ 201404 - * } - */ - public static long __STDC_IEC_60559_BFP__() { - return __STDC_IEC_60559_BFP__; - } - - private static final long __STDC_IEC_60559_COMPLEX__ = 201404L; - - /** - * {@snippet lang = c : * #define __STDC_IEC_60559_COMPLEX__ 201404 - * } - */ - public static long __STDC_IEC_60559_COMPLEX__() { - return __STDC_IEC_60559_COMPLEX__; - } - - private static final long __STDC_ISO_10646__ = 201706L; - - /** - * {@snippet lang = c : * #define __STDC_ISO_10646__ 201706 - * } - */ - public static long __STDC_ISO_10646__() { - return __STDC_ISO_10646__; - } - - private static final int __WCHAR_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define __WCHAR_MAX 2147483647 - * } - */ - public static int __WCHAR_MAX() { - return __WCHAR_MAX; - } - - private static final int __WCHAR_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define __WCHAR_MIN -2147483648 - * } - */ - public static int __WCHAR_MIN() { - return __WCHAR_MIN; - } - - private static final int INT8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT8_MIN -128 - * } - */ - public static int INT8_MIN() { - return INT8_MIN; - } - - private static final int INT16_MIN = (int) -32768L; - - /** - * {@snippet lang = c : * #define INT16_MIN -32768 - * } - */ - public static int INT16_MIN() { - return INT16_MIN; - } - - private static final int INT32_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define INT32_MIN -2147483648 - * } - */ - public static int INT32_MIN() { - return INT32_MIN; - } - - private static final long INT64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT64_MIN -9223372036854775808 - * } - */ - public static long INT64_MIN() { - return INT64_MIN; - } - - private static final int INT8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT8_MAX 127 - * } - */ - public static int INT8_MAX() { - return INT8_MAX; - } - - private static final int INT16_MAX = (int) 32767L; - - /** - * {@snippet lang = c : * #define INT16_MAX 32767 - * } - */ - public static int INT16_MAX() { - return INT16_MAX; - } - - private static final int INT32_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define INT32_MAX 2147483647 - * } - */ - public static int INT32_MAX() { - return INT32_MAX; - } - - private static final long INT64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT64_MAX 9223372036854775807 - * } - */ - public static long INT64_MAX() { - return INT64_MAX; - } - - private static final int UINT8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT8_MAX 255 - * } - */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - - private static final int UINT16_MAX = (int) 65535L; - - /** - * {@snippet lang = c : * #define UINT16_MAX 65535 - * } - */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - - private static final int UINT32_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define UINT32_MAX 4294967295 - * } - */ - public static int UINT32_MAX() { - return UINT32_MAX; - } - - private static final long UINT64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT64_MAX -1 - * } - */ - public static long UINT64_MAX() { - return UINT64_MAX; - } - - private static final int INT_LEAST8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT_LEAST8_MIN -128 - * } - */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; - } - - private static final int INT_LEAST16_MIN = (int) -32768L; - - /** - * {@snippet lang = c : * #define INT_LEAST16_MIN -32768 - * } - */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; - } - - private static final int INT_LEAST32_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define INT_LEAST32_MIN -2147483648 - * } - */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; - } - - private static final long INT_LEAST64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_LEAST64_MIN -9223372036854775808 - * } - */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; - } - - private static final int INT_LEAST8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT_LEAST8_MAX 127 - * } - */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; - } - - private static final int INT_LEAST16_MAX = (int) 32767L; - - /** - * {@snippet lang = c : * #define INT_LEAST16_MAX 32767 - * } - */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; - } - - private static final int INT_LEAST32_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define INT_LEAST32_MAX 2147483647 - * } - */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; - } - - private static final long INT_LEAST64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_LEAST64_MAX 9223372036854775807 - * } - */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; - } - - private static final int UINT_LEAST8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT_LEAST8_MAX 255 - * } - */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; - } - - private static final int UINT_LEAST16_MAX = (int) 65535L; - - /** - * {@snippet lang = c : * #define UINT_LEAST16_MAX 65535 - * } - */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; - } - - private static final int UINT_LEAST32_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define UINT_LEAST32_MAX 4294967295 - * } - */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; - } - - private static final long UINT_LEAST64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_LEAST64_MAX -1 - * } - */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; - } - - private static final int INT_FAST8_MIN = (int) -128L; - - /** - * {@snippet lang = c : * #define INT_FAST8_MIN -128 - * } - */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; - } - - private static final long INT_FAST16_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST16_MIN -9223372036854775808 - * } - */ - public static long INT_FAST16_MIN() { - return INT_FAST16_MIN; - } - - private static final long INT_FAST32_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST32_MIN -9223372036854775808 - * } - */ - public static long INT_FAST32_MIN() { - return INT_FAST32_MIN; - } - - private static final long INT_FAST64_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INT_FAST64_MIN -9223372036854775808 - * } - */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; - } - - private static final int INT_FAST8_MAX = (int) 127L; - - /** - * {@snippet lang = c : * #define INT_FAST8_MAX 127 - * } - */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; - } - - private static final long INT_FAST16_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST16_MAX 9223372036854775807 - * } - */ - public static long INT_FAST16_MAX() { - return INT_FAST16_MAX; - } - - private static final long INT_FAST32_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST32_MAX 9223372036854775807 - * } - */ - public static long INT_FAST32_MAX() { - return INT_FAST32_MAX; - } - - private static final long INT_FAST64_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INT_FAST64_MAX 9223372036854775807 - * } - */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; - } - - private static final int UINT_FAST8_MAX = (int) 255L; - - /** - * {@snippet lang = c : * #define UINT_FAST8_MAX 255 - * } - */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; - } - - private static final long UINT_FAST16_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST16_MAX -1 - * } - */ - public static long UINT_FAST16_MAX() { - return UINT_FAST16_MAX; - } - - private static final long UINT_FAST32_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST32_MAX -1 - * } - */ - public static long UINT_FAST32_MAX() { - return UINT_FAST32_MAX; - } - - private static final long UINT_FAST64_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINT_FAST64_MAX -1 - * } - */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; - } - - private static final long INTPTR_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INTPTR_MIN -9223372036854775808 - * } - */ - public static long INTPTR_MIN() { - return INTPTR_MIN; - } - - private static final long INTPTR_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INTPTR_MAX 9223372036854775807 - * } - */ - public static long INTPTR_MAX() { - return INTPTR_MAX; - } - - private static final long UINTPTR_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINTPTR_MAX -1 - * } - */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; - } - - private static final long INTMAX_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define INTMAX_MIN -9223372036854775808 - * } - */ - public static long INTMAX_MIN() { - return INTMAX_MIN; - } - - private static final long INTMAX_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define INTMAX_MAX 9223372036854775807 - * } - */ - public static long INTMAX_MAX() { - return INTMAX_MAX; - } - - private static final long UINTMAX_MAX = -1L; - - /** - * {@snippet lang = c : * #define UINTMAX_MAX -1 - * } - */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; - } - - private static final long PTRDIFF_MIN = -9223372036854775808L; - - /** - * {@snippet lang = c : * #define PTRDIFF_MIN -9223372036854775808 - * } - */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; - } - - private static final long PTRDIFF_MAX = 9223372036854775807L; - - /** - * {@snippet lang = c : * #define PTRDIFF_MAX 9223372036854775807 - * } - */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; - } - - private static final int SIG_ATOMIC_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define SIG_ATOMIC_MIN -2147483648 - * } - */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; - } - - private static final int SIG_ATOMIC_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define SIG_ATOMIC_MAX 2147483647 - * } - */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; - } - - private static final long SIZE_MAX = -1L; - - /** - * {@snippet lang = c : * #define SIZE_MAX -1 - * } - */ - public static long SIZE_MAX() { - return SIZE_MAX; - } - - private static final int WCHAR_MIN = (int) -2147483648L; - - /** - * {@snippet lang = c : * #define WCHAR_MIN -2147483648 - * } - */ - public static int WCHAR_MIN() { - return WCHAR_MIN; - } - - private static final int WCHAR_MAX = (int) 2147483647L; - - /** - * {@snippet lang = c : * #define WCHAR_MAX 2147483647 - * } - */ - public static int WCHAR_MAX() { - return WCHAR_MAX; - } - - private static final int WINT_MIN = (int) 0L; - - /** - * {@snippet lang = c : * #define WINT_MIN 0 - * } - */ - public static int WINT_MIN() { - return WINT_MIN; - } - - private static final int WINT_MAX = (int) 4294967295L; - - /** - * {@snippet lang = c : * #define WINT_MAX 4294967295 - * } - */ - public static int WINT_MAX() { - return WINT_MAX; - } - - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); - - /** - * {@snippet lang = c : * #define NULL (void*) 0 - * } - */ - public static MemorySegment NULL() { - return NULL; - } - - private static final long DLPACK_FLAG_BITMASK_READ_ONLY = 1L; - - /** - * {@snippet lang = c : * #define DLPACK_FLAG_BITMASK_READ_ONLY 1 - * } - */ - public static long DLPACK_FLAG_BITMASK_READ_ONLY() { - return DLPACK_FLAG_BITMASK_READ_ONLY; - } - - private static final long DLPACK_FLAG_BITMASK_IS_COPIED = 2L; - - /** - * {@snippet lang = c : * #define DLPACK_FLAG_BITMASK_IS_COPIED 2 - * } - */ - public static long DLPACK_FLAG_BITMASK_IS_COPIED() { - return DLPACK_FLAG_BITMASK_IS_COPIED; - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI.java new file mode 100644 index 0000000000..57341923df --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI.java @@ -0,0 +1,13904 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +public class PanamaFFMAPI extends PanamaFFMAPI_1 { + + PanamaFFMAPI() { + // Should not be called directly + } + + private static class cudaMemPoolSetAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolSetAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) + * } + */ + public static FunctionDescriptor cudaMemPoolSetAttribute$descriptor() { + return cudaMemPoolSetAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) + * } + */ + public static MethodHandle cudaMemPoolSetAttribute$handle() { + return cudaMemPoolSetAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) + * } + */ + public static MemorySegment cudaMemPoolSetAttribute$address() { + return cudaMemPoolSetAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) + * } + */ + public static int cudaMemPoolSetAttribute(MemorySegment memPool, int attr, MemorySegment value) { + var mh$ = cudaMemPoolSetAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolSetAttribute", memPool, attr, value); + } + return (int)mh$.invokeExact(memPool, attr, value); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPoolGetAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolGetAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) + * } + */ + public static FunctionDescriptor cudaMemPoolGetAttribute$descriptor() { + return cudaMemPoolGetAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) + * } + */ + public static MethodHandle cudaMemPoolGetAttribute$handle() { + return cudaMemPoolGetAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) + * } + */ + public static MemorySegment cudaMemPoolGetAttribute$address() { + return cudaMemPoolGetAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) + * } + */ + public static int cudaMemPoolGetAttribute(MemorySegment memPool, int attr, MemorySegment value) { + var mh$ = cudaMemPoolGetAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolGetAttribute", memPool, attr, value); + } + return (int)mh$.invokeExact(memPool, attr, value); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPoolSetAccess { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolSetAccess"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const struct cudaMemAccessDesc *descList, size_t count) + * } + */ + public static FunctionDescriptor cudaMemPoolSetAccess$descriptor() { + return cudaMemPoolSetAccess.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const struct cudaMemAccessDesc *descList, size_t count) + * } + */ + public static MethodHandle cudaMemPoolSetAccess$handle() { + return cudaMemPoolSetAccess.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const struct cudaMemAccessDesc *descList, size_t count) + * } + */ + public static MemorySegment cudaMemPoolSetAccess$address() { + return cudaMemPoolSetAccess.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const struct cudaMemAccessDesc *descList, size_t count) + * } + */ + public static int cudaMemPoolSetAccess(MemorySegment memPool, MemorySegment descList, long count) { + var mh$ = cudaMemPoolSetAccess.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolSetAccess", memPool, descList, count); + } + return (int)mh$.invokeExact(memPool, descList, count); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPoolGetAccess { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolGetAccess"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolGetAccess(enum cudaMemAccessFlags *flags, cudaMemPool_t memPool, struct cudaMemLocation *location) + * } + */ + public static FunctionDescriptor cudaMemPoolGetAccess$descriptor() { + return cudaMemPoolGetAccess.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolGetAccess(enum cudaMemAccessFlags *flags, cudaMemPool_t memPool, struct cudaMemLocation *location) + * } + */ + public static MethodHandle cudaMemPoolGetAccess$handle() { + return cudaMemPoolGetAccess.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolGetAccess(enum cudaMemAccessFlags *flags, cudaMemPool_t memPool, struct cudaMemLocation *location) + * } + */ + public static MemorySegment cudaMemPoolGetAccess$address() { + return cudaMemPoolGetAccess.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolGetAccess(enum cudaMemAccessFlags *flags, cudaMemPool_t memPool, struct cudaMemLocation *location) + * } + */ + public static int cudaMemPoolGetAccess(MemorySegment flags, MemorySegment memPool, MemorySegment location) { + var mh$ = cudaMemPoolGetAccess.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolGetAccess", flags, memPool, location); + } + return (int)mh$.invokeExact(flags, memPool, location); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPoolCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolCreate(cudaMemPool_t *memPool, const struct cudaMemPoolProps *poolProps) + * } + */ + public static FunctionDescriptor cudaMemPoolCreate$descriptor() { + return cudaMemPoolCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolCreate(cudaMemPool_t *memPool, const struct cudaMemPoolProps *poolProps) + * } + */ + public static MethodHandle cudaMemPoolCreate$handle() { + return cudaMemPoolCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolCreate(cudaMemPool_t *memPool, const struct cudaMemPoolProps *poolProps) + * } + */ + public static MemorySegment cudaMemPoolCreate$address() { + return cudaMemPoolCreate.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolCreate(cudaMemPool_t *memPool, const struct cudaMemPoolProps *poolProps) + * } + */ + public static int cudaMemPoolCreate(MemorySegment memPool, MemorySegment poolProps) { + var mh$ = cudaMemPoolCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolCreate", memPool, poolProps); + } + return (int)mh$.invokeExact(memPool, poolProps); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPoolDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) + * } + */ + public static FunctionDescriptor cudaMemPoolDestroy$descriptor() { + return cudaMemPoolDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) + * } + */ + public static MethodHandle cudaMemPoolDestroy$handle() { + return cudaMemPoolDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) + * } + */ + public static MemorySegment cudaMemPoolDestroy$address() { + return cudaMemPoolDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) + * } + */ + public static int cudaMemPoolDestroy(MemorySegment memPool) { + var mh$ = cudaMemPoolDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolDestroy", memPool); + } + return (int)mh$.invokeExact(memPool); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMallocFromPoolAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocFromPoolAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocFromPoolAsync(void **ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMallocFromPoolAsync$descriptor() { + return cudaMallocFromPoolAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocFromPoolAsync(void **ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMallocFromPoolAsync$handle() { + return cudaMallocFromPoolAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocFromPoolAsync(void **ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMallocFromPoolAsync$address() { + return cudaMallocFromPoolAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMallocFromPoolAsync(void **ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) + * } + */ + public static int cudaMallocFromPoolAsync(MemorySegment ptr, long size, MemorySegment memPool, MemorySegment stream) { + var mh$ = cudaMallocFromPoolAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMallocFromPoolAsync", ptr, size, memPool, stream); + } + return (int)mh$.invokeExact(ptr, size, memPool, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPoolExportToShareableHandle { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolExportToShareableHandle"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolExportToShareableHandle(void *shareableHandle, cudaMemPool_t memPool, enum cudaMemAllocationHandleType handleType, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaMemPoolExportToShareableHandle$descriptor() { + return cudaMemPoolExportToShareableHandle.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolExportToShareableHandle(void *shareableHandle, cudaMemPool_t memPool, enum cudaMemAllocationHandleType handleType, unsigned int flags) + * } + */ + public static MethodHandle cudaMemPoolExportToShareableHandle$handle() { + return cudaMemPoolExportToShareableHandle.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolExportToShareableHandle(void *shareableHandle, cudaMemPool_t memPool, enum cudaMemAllocationHandleType handleType, unsigned int flags) + * } + */ + public static MemorySegment cudaMemPoolExportToShareableHandle$address() { + return cudaMemPoolExportToShareableHandle.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolExportToShareableHandle(void *shareableHandle, cudaMemPool_t memPool, enum cudaMemAllocationHandleType handleType, unsigned int flags) + * } + */ + public static int cudaMemPoolExportToShareableHandle(MemorySegment shareableHandle, MemorySegment memPool, int handleType, int flags) { + var mh$ = cudaMemPoolExportToShareableHandle.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolExportToShareableHandle", shareableHandle, memPool, handleType, flags); + } + return (int)mh$.invokeExact(shareableHandle, memPool, handleType, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPoolImportFromShareableHandle { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolImportFromShareableHandle"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t *memPool, void *shareableHandle, enum cudaMemAllocationHandleType handleType, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaMemPoolImportFromShareableHandle$descriptor() { + return cudaMemPoolImportFromShareableHandle.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t *memPool, void *shareableHandle, enum cudaMemAllocationHandleType handleType, unsigned int flags) + * } + */ + public static MethodHandle cudaMemPoolImportFromShareableHandle$handle() { + return cudaMemPoolImportFromShareableHandle.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t *memPool, void *shareableHandle, enum cudaMemAllocationHandleType handleType, unsigned int flags) + * } + */ + public static MemorySegment cudaMemPoolImportFromShareableHandle$address() { + return cudaMemPoolImportFromShareableHandle.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t *memPool, void *shareableHandle, enum cudaMemAllocationHandleType handleType, unsigned int flags) + * } + */ + public static int cudaMemPoolImportFromShareableHandle(MemorySegment memPool, MemorySegment shareableHandle, int handleType, int flags) { + var mh$ = cudaMemPoolImportFromShareableHandle.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolImportFromShareableHandle", memPool, shareableHandle, handleType, flags); + } + return (int)mh$.invokeExact(memPool, shareableHandle, handleType, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPoolExportPointer { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolExportPointer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolExportPointer(struct cudaMemPoolPtrExportData *exportData, void *ptr) + * } + */ + public static FunctionDescriptor cudaMemPoolExportPointer$descriptor() { + return cudaMemPoolExportPointer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolExportPointer(struct cudaMemPoolPtrExportData *exportData, void *ptr) + * } + */ + public static MethodHandle cudaMemPoolExportPointer$handle() { + return cudaMemPoolExportPointer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolExportPointer(struct cudaMemPoolPtrExportData *exportData, void *ptr) + * } + */ + public static MemorySegment cudaMemPoolExportPointer$address() { + return cudaMemPoolExportPointer.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolExportPointer(struct cudaMemPoolPtrExportData *exportData, void *ptr) + * } + */ + public static int cudaMemPoolExportPointer(MemorySegment exportData, MemorySegment ptr) { + var mh$ = cudaMemPoolExportPointer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolExportPointer", exportData, ptr); + } + return (int)mh$.invokeExact(exportData, ptr); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPoolImportPointer { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolImportPointer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolImportPointer(void **ptr, cudaMemPool_t memPool, struct cudaMemPoolPtrExportData *exportData) + * } + */ + public static FunctionDescriptor cudaMemPoolImportPointer$descriptor() { + return cudaMemPoolImportPointer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolImportPointer(void **ptr, cudaMemPool_t memPool, struct cudaMemPoolPtrExportData *exportData) + * } + */ + public static MethodHandle cudaMemPoolImportPointer$handle() { + return cudaMemPoolImportPointer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolImportPointer(void **ptr, cudaMemPool_t memPool, struct cudaMemPoolPtrExportData *exportData) + * } + */ + public static MemorySegment cudaMemPoolImportPointer$address() { + return cudaMemPoolImportPointer.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolImportPointer(void **ptr, cudaMemPool_t memPool, struct cudaMemPoolPtrExportData *exportData) + * } + */ + public static int cudaMemPoolImportPointer(MemorySegment ptr, MemorySegment memPool, MemorySegment exportData) { + var mh$ = cudaMemPoolImportPointer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolImportPointer", ptr, memPool, exportData); + } + return (int)mh$.invokeExact(ptr, memPool, exportData); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaPointerGetAttributes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaPointerGetAttributes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaPointerGetAttributes(struct cudaPointerAttributes *attributes, const void *ptr) + * } + */ + public static FunctionDescriptor cudaPointerGetAttributes$descriptor() { + return cudaPointerGetAttributes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaPointerGetAttributes(struct cudaPointerAttributes *attributes, const void *ptr) + * } + */ + public static MethodHandle cudaPointerGetAttributes$handle() { + return cudaPointerGetAttributes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaPointerGetAttributes(struct cudaPointerAttributes *attributes, const void *ptr) + * } + */ + public static MemorySegment cudaPointerGetAttributes$address() { + return cudaPointerGetAttributes.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaPointerGetAttributes(struct cudaPointerAttributes *attributes, const void *ptr) + * } + */ + public static int cudaPointerGetAttributes(MemorySegment attributes, MemorySegment ptr) { + var mh$ = cudaPointerGetAttributes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaPointerGetAttributes", attributes, ptr); + } + return (int)mh$.invokeExact(attributes, ptr); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceCanAccessPeer { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceCanAccessPeer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice) + * } + */ + public static FunctionDescriptor cudaDeviceCanAccessPeer$descriptor() { + return cudaDeviceCanAccessPeer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice) + * } + */ + public static MethodHandle cudaDeviceCanAccessPeer$handle() { + return cudaDeviceCanAccessPeer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice) + * } + */ + public static MemorySegment cudaDeviceCanAccessPeer$address() { + return cudaDeviceCanAccessPeer.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice) + * } + */ + public static int cudaDeviceCanAccessPeer(MemorySegment canAccessPeer, int device, int peerDevice) { + var mh$ = cudaDeviceCanAccessPeer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceCanAccessPeer", canAccessPeer, device, peerDevice); + } + return (int)mh$.invokeExact(canAccessPeer, device, peerDevice); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceEnablePeerAccess { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceEnablePeerAccess"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaDeviceEnablePeerAccess$descriptor() { + return cudaDeviceEnablePeerAccess.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) + * } + */ + public static MethodHandle cudaDeviceEnablePeerAccess$handle() { + return cudaDeviceEnablePeerAccess.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) + * } + */ + public static MemorySegment cudaDeviceEnablePeerAccess$address() { + return cudaDeviceEnablePeerAccess.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) + * } + */ + public static int cudaDeviceEnablePeerAccess(int peerDevice, int flags) { + var mh$ = cudaDeviceEnablePeerAccess.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceEnablePeerAccess", peerDevice, flags); + } + return (int)mh$.invokeExact(peerDevice, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceDisablePeerAccess { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceDisablePeerAccess"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) + * } + */ + public static FunctionDescriptor cudaDeviceDisablePeerAccess$descriptor() { + return cudaDeviceDisablePeerAccess.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) + * } + */ + public static MethodHandle cudaDeviceDisablePeerAccess$handle() { + return cudaDeviceDisablePeerAccess.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) + * } + */ + public static MemorySegment cudaDeviceDisablePeerAccess$address() { + return cudaDeviceDisablePeerAccess.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) + * } + */ + public static int cudaDeviceDisablePeerAccess(int peerDevice) { + var mh$ = cudaDeviceDisablePeerAccess.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceDisablePeerAccess", peerDevice); + } + return (int)mh$.invokeExact(peerDevice); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphicsUnregisterResource { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsUnregisterResource"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) + * } + */ + public static FunctionDescriptor cudaGraphicsUnregisterResource$descriptor() { + return cudaGraphicsUnregisterResource.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) + * } + */ + public static MethodHandle cudaGraphicsUnregisterResource$handle() { + return cudaGraphicsUnregisterResource.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) + * } + */ + public static MemorySegment cudaGraphicsUnregisterResource$address() { + return cudaGraphicsUnregisterResource.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) + * } + */ + public static int cudaGraphicsUnregisterResource(MemorySegment resource) { + var mh$ = cudaGraphicsUnregisterResource.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphicsUnregisterResource", resource); + } + return (int)mh$.invokeExact(resource); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphicsResourceSetMapFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsResourceSetMapFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaGraphicsResourceSetMapFlags$descriptor() { + return cudaGraphicsResourceSetMapFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) + * } + */ + public static MethodHandle cudaGraphicsResourceSetMapFlags$handle() { + return cudaGraphicsResourceSetMapFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) + * } + */ + public static MemorySegment cudaGraphicsResourceSetMapFlags$address() { + return cudaGraphicsResourceSetMapFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) + * } + */ + public static int cudaGraphicsResourceSetMapFlags(MemorySegment resource, int flags) { + var mh$ = cudaGraphicsResourceSetMapFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphicsResourceSetMapFlags", resource, flags); + } + return (int)mh$.invokeExact(resource, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphicsMapResources { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsMapResources"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaGraphicsMapResources$descriptor() { + return cudaGraphicsMapResources.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) + * } + */ + public static MethodHandle cudaGraphicsMapResources$handle() { + return cudaGraphicsMapResources.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) + * } + */ + public static MemorySegment cudaGraphicsMapResources$address() { + return cudaGraphicsMapResources.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) + * } + */ + public static int cudaGraphicsMapResources(int count, MemorySegment resources, MemorySegment stream) { + var mh$ = cudaGraphicsMapResources.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphicsMapResources", count, resources, stream); + } + return (int)mh$.invokeExact(count, resources, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphicsUnmapResources { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsUnmapResources"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaGraphicsUnmapResources$descriptor() { + return cudaGraphicsUnmapResources.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) + * } + */ + public static MethodHandle cudaGraphicsUnmapResources$handle() { + return cudaGraphicsUnmapResources.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) + * } + */ + public static MemorySegment cudaGraphicsUnmapResources$address() { + return cudaGraphicsUnmapResources.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) + * } + */ + public static int cudaGraphicsUnmapResources(int count, MemorySegment resources, MemorySegment stream) { + var mh$ = cudaGraphicsUnmapResources.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphicsUnmapResources", count, resources, stream); + } + return (int)mh$.invokeExact(count, resources, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphicsResourceGetMappedPointer { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsResourceGetMappedPointer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceGetMappedPointer(void **devPtr, size_t *size, cudaGraphicsResource_t resource) + * } + */ + public static FunctionDescriptor cudaGraphicsResourceGetMappedPointer$descriptor() { + return cudaGraphicsResourceGetMappedPointer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceGetMappedPointer(void **devPtr, size_t *size, cudaGraphicsResource_t resource) + * } + */ + public static MethodHandle cudaGraphicsResourceGetMappedPointer$handle() { + return cudaGraphicsResourceGetMappedPointer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceGetMappedPointer(void **devPtr, size_t *size, cudaGraphicsResource_t resource) + * } + */ + public static MemorySegment cudaGraphicsResourceGetMappedPointer$address() { + return cudaGraphicsResourceGetMappedPointer.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceGetMappedPointer(void **devPtr, size_t *size, cudaGraphicsResource_t resource) + * } + */ + public static int cudaGraphicsResourceGetMappedPointer(MemorySegment devPtr, MemorySegment size, MemorySegment resource) { + var mh$ = cudaGraphicsResourceGetMappedPointer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphicsResourceGetMappedPointer", devPtr, size, resource); + } + return (int)mh$.invokeExact(devPtr, size, resource); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphicsSubResourceGetMappedArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsSubResourceGetMappedArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t *array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) + * } + */ + public static FunctionDescriptor cudaGraphicsSubResourceGetMappedArray$descriptor() { + return cudaGraphicsSubResourceGetMappedArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t *array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) + * } + */ + public static MethodHandle cudaGraphicsSubResourceGetMappedArray$handle() { + return cudaGraphicsSubResourceGetMappedArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t *array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) + * } + */ + public static MemorySegment cudaGraphicsSubResourceGetMappedArray$address() { + return cudaGraphicsSubResourceGetMappedArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t *array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) + * } + */ + public static int cudaGraphicsSubResourceGetMappedArray(MemorySegment array, MemorySegment resource, int arrayIndex, int mipLevel) { + var mh$ = cudaGraphicsSubResourceGetMappedArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphicsSubResourceGetMappedArray", array, resource, arrayIndex, mipLevel); + } + return (int)mh$.invokeExact(array, resource, arrayIndex, mipLevel); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphicsResourceGetMappedMipmappedArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsResourceGetMappedMipmappedArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t *mipmappedArray, cudaGraphicsResource_t resource) + * } + */ + public static FunctionDescriptor cudaGraphicsResourceGetMappedMipmappedArray$descriptor() { + return cudaGraphicsResourceGetMappedMipmappedArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t *mipmappedArray, cudaGraphicsResource_t resource) + * } + */ + public static MethodHandle cudaGraphicsResourceGetMappedMipmappedArray$handle() { + return cudaGraphicsResourceGetMappedMipmappedArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t *mipmappedArray, cudaGraphicsResource_t resource) + * } + */ + public static MemorySegment cudaGraphicsResourceGetMappedMipmappedArray$address() { + return cudaGraphicsResourceGetMappedMipmappedArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t *mipmappedArray, cudaGraphicsResource_t resource) + * } + */ + public static int cudaGraphicsResourceGetMappedMipmappedArray(MemorySegment mipmappedArray, MemorySegment resource) { + var mh$ = cudaGraphicsResourceGetMappedMipmappedArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphicsResourceGetMappedMipmappedArray", mipmappedArray, resource); + } + return (int)mh$.invokeExact(mipmappedArray, resource); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetChannelDesc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetChannelDesc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetChannelDesc(struct cudaChannelFormatDesc *desc, cudaArray_const_t array) + * } + */ + public static FunctionDescriptor cudaGetChannelDesc$descriptor() { + return cudaGetChannelDesc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetChannelDesc(struct cudaChannelFormatDesc *desc, cudaArray_const_t array) + * } + */ + public static MethodHandle cudaGetChannelDesc$handle() { + return cudaGetChannelDesc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetChannelDesc(struct cudaChannelFormatDesc *desc, cudaArray_const_t array) + * } + */ + public static MemorySegment cudaGetChannelDesc$address() { + return cudaGetChannelDesc.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetChannelDesc(struct cudaChannelFormatDesc *desc, cudaArray_const_t array) + * } + */ + public static int cudaGetChannelDesc(MemorySegment desc, MemorySegment array) { + var mh$ = cudaGetChannelDesc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetChannelDesc", desc, array); + } + return (int)mh$.invokeExact(desc, array); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaCreateChannelDesc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + cudaChannelFormatDesc.layout(), + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaCreateChannelDesc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern struct cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, enum cudaChannelFormatKind f) + * } + */ + public static FunctionDescriptor cudaCreateChannelDesc$descriptor() { + return cudaCreateChannelDesc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern struct cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, enum cudaChannelFormatKind f) + * } + */ + public static MethodHandle cudaCreateChannelDesc$handle() { + return cudaCreateChannelDesc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern struct cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, enum cudaChannelFormatKind f) + * } + */ + public static MemorySegment cudaCreateChannelDesc$address() { + return cudaCreateChannelDesc.ADDR; + } + + /** + * {@snippet lang=c : + * extern struct cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, enum cudaChannelFormatKind f) + * } + */ + public static MemorySegment cudaCreateChannelDesc(SegmentAllocator allocator, int x, int y, int z, int w, int f) { + var mh$ = cudaCreateChannelDesc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaCreateChannelDesc", allocator, x, y, z, w, f); + } + return (MemorySegment)mh$.invokeExact(allocator, x, y, z, w, f); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaCreateTextureObject { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaCreateTextureObject"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaCreateTextureObject(cudaTextureObject_t *pTexObject, const struct cudaResourceDesc *pResDesc, const struct cudaTextureDesc *pTexDesc, const struct cudaResourceViewDesc *pResViewDesc) + * } + */ + public static FunctionDescriptor cudaCreateTextureObject$descriptor() { + return cudaCreateTextureObject.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaCreateTextureObject(cudaTextureObject_t *pTexObject, const struct cudaResourceDesc *pResDesc, const struct cudaTextureDesc *pTexDesc, const struct cudaResourceViewDesc *pResViewDesc) + * } + */ + public static MethodHandle cudaCreateTextureObject$handle() { + return cudaCreateTextureObject.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaCreateTextureObject(cudaTextureObject_t *pTexObject, const struct cudaResourceDesc *pResDesc, const struct cudaTextureDesc *pTexDesc, const struct cudaResourceViewDesc *pResViewDesc) + * } + */ + public static MemorySegment cudaCreateTextureObject$address() { + return cudaCreateTextureObject.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaCreateTextureObject(cudaTextureObject_t *pTexObject, const struct cudaResourceDesc *pResDesc, const struct cudaTextureDesc *pTexDesc, const struct cudaResourceViewDesc *pResViewDesc) + * } + */ + public static int cudaCreateTextureObject(MemorySegment pTexObject, MemorySegment pResDesc, MemorySegment pTexDesc, MemorySegment pResViewDesc) { + var mh$ = cudaCreateTextureObject.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaCreateTextureObject", pTexObject, pResDesc, pTexDesc, pResViewDesc); + } + return (int)mh$.invokeExact(pTexObject, pResDesc, pTexDesc, pResViewDesc); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDestroyTextureObject { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDestroyTextureObject"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) + * } + */ + public static FunctionDescriptor cudaDestroyTextureObject$descriptor() { + return cudaDestroyTextureObject.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) + * } + */ + public static MethodHandle cudaDestroyTextureObject$handle() { + return cudaDestroyTextureObject.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) + * } + */ + public static MemorySegment cudaDestroyTextureObject$address() { + return cudaDestroyTextureObject.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) + * } + */ + public static int cudaDestroyTextureObject(long texObject) { + var mh$ = cudaDestroyTextureObject.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDestroyTextureObject", texObject); + } + return (int)mh$.invokeExact(texObject); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetTextureObjectResourceDesc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetTextureObjectResourceDesc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaTextureObject_t texObject) + * } + */ + public static FunctionDescriptor cudaGetTextureObjectResourceDesc$descriptor() { + return cudaGetTextureObjectResourceDesc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaTextureObject_t texObject) + * } + */ + public static MethodHandle cudaGetTextureObjectResourceDesc$handle() { + return cudaGetTextureObjectResourceDesc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaTextureObject_t texObject) + * } + */ + public static MemorySegment cudaGetTextureObjectResourceDesc$address() { + return cudaGetTextureObjectResourceDesc.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaTextureObject_t texObject) + * } + */ + public static int cudaGetTextureObjectResourceDesc(MemorySegment pResDesc, long texObject) { + var mh$ = cudaGetTextureObjectResourceDesc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetTextureObjectResourceDesc", pResDesc, texObject); + } + return (int)mh$.invokeExact(pResDesc, texObject); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetTextureObjectTextureDesc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetTextureObjectTextureDesc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectTextureDesc(struct cudaTextureDesc *pTexDesc, cudaTextureObject_t texObject) + * } + */ + public static FunctionDescriptor cudaGetTextureObjectTextureDesc$descriptor() { + return cudaGetTextureObjectTextureDesc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectTextureDesc(struct cudaTextureDesc *pTexDesc, cudaTextureObject_t texObject) + * } + */ + public static MethodHandle cudaGetTextureObjectTextureDesc$handle() { + return cudaGetTextureObjectTextureDesc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectTextureDesc(struct cudaTextureDesc *pTexDesc, cudaTextureObject_t texObject) + * } + */ + public static MemorySegment cudaGetTextureObjectTextureDesc$address() { + return cudaGetTextureObjectTextureDesc.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectTextureDesc(struct cudaTextureDesc *pTexDesc, cudaTextureObject_t texObject) + * } + */ + public static int cudaGetTextureObjectTextureDesc(MemorySegment pTexDesc, long texObject) { + var mh$ = cudaGetTextureObjectTextureDesc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetTextureObjectTextureDesc", pTexDesc, texObject); + } + return (int)mh$.invokeExact(pTexDesc, texObject); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetTextureObjectResourceViewDesc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetTextureObjectResourceViewDesc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectResourceViewDesc(struct cudaResourceViewDesc *pResViewDesc, cudaTextureObject_t texObject) + * } + */ + public static FunctionDescriptor cudaGetTextureObjectResourceViewDesc$descriptor() { + return cudaGetTextureObjectResourceViewDesc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectResourceViewDesc(struct cudaResourceViewDesc *pResViewDesc, cudaTextureObject_t texObject) + * } + */ + public static MethodHandle cudaGetTextureObjectResourceViewDesc$handle() { + return cudaGetTextureObjectResourceViewDesc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectResourceViewDesc(struct cudaResourceViewDesc *pResViewDesc, cudaTextureObject_t texObject) + * } + */ + public static MemorySegment cudaGetTextureObjectResourceViewDesc$address() { + return cudaGetTextureObjectResourceViewDesc.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetTextureObjectResourceViewDesc(struct cudaResourceViewDesc *pResViewDesc, cudaTextureObject_t texObject) + * } + */ + public static int cudaGetTextureObjectResourceViewDesc(MemorySegment pResViewDesc, long texObject) { + var mh$ = cudaGetTextureObjectResourceViewDesc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetTextureObjectResourceViewDesc", pResViewDesc, texObject); + } + return (int)mh$.invokeExact(pResViewDesc, texObject); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaCreateSurfaceObject { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaCreateSurfaceObject"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t *pSurfObject, const struct cudaResourceDesc *pResDesc) + * } + */ + public static FunctionDescriptor cudaCreateSurfaceObject$descriptor() { + return cudaCreateSurfaceObject.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t *pSurfObject, const struct cudaResourceDesc *pResDesc) + * } + */ + public static MethodHandle cudaCreateSurfaceObject$handle() { + return cudaCreateSurfaceObject.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t *pSurfObject, const struct cudaResourceDesc *pResDesc) + * } + */ + public static MemorySegment cudaCreateSurfaceObject$address() { + return cudaCreateSurfaceObject.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t *pSurfObject, const struct cudaResourceDesc *pResDesc) + * } + */ + public static int cudaCreateSurfaceObject(MemorySegment pSurfObject, MemorySegment pResDesc) { + var mh$ = cudaCreateSurfaceObject.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaCreateSurfaceObject", pSurfObject, pResDesc); + } + return (int)mh$.invokeExact(pSurfObject, pResDesc); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDestroySurfaceObject { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDestroySurfaceObject"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) + * } + */ + public static FunctionDescriptor cudaDestroySurfaceObject$descriptor() { + return cudaDestroySurfaceObject.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) + * } + */ + public static MethodHandle cudaDestroySurfaceObject$handle() { + return cudaDestroySurfaceObject.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) + * } + */ + public static MemorySegment cudaDestroySurfaceObject$address() { + return cudaDestroySurfaceObject.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) + * } + */ + public static int cudaDestroySurfaceObject(long surfObject) { + var mh$ = cudaDestroySurfaceObject.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDestroySurfaceObject", surfObject); + } + return (int)mh$.invokeExact(surfObject); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetSurfaceObjectResourceDesc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetSurfaceObjectResourceDesc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetSurfaceObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaSurfaceObject_t surfObject) + * } + */ + public static FunctionDescriptor cudaGetSurfaceObjectResourceDesc$descriptor() { + return cudaGetSurfaceObjectResourceDesc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetSurfaceObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaSurfaceObject_t surfObject) + * } + */ + public static MethodHandle cudaGetSurfaceObjectResourceDesc$handle() { + return cudaGetSurfaceObjectResourceDesc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetSurfaceObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaSurfaceObject_t surfObject) + * } + */ + public static MemorySegment cudaGetSurfaceObjectResourceDesc$address() { + return cudaGetSurfaceObjectResourceDesc.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetSurfaceObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaSurfaceObject_t surfObject) + * } + */ + public static int cudaGetSurfaceObjectResourceDesc(MemorySegment pResDesc, long surfObject) { + var mh$ = cudaGetSurfaceObjectResourceDesc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetSurfaceObjectResourceDesc", pResDesc, surfObject); + } + return (int)mh$.invokeExact(pResDesc, surfObject); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDriverGetVersion { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDriverGetVersion"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDriverGetVersion(int *driverVersion) + * } + */ + public static FunctionDescriptor cudaDriverGetVersion$descriptor() { + return cudaDriverGetVersion.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDriverGetVersion(int *driverVersion) + * } + */ + public static MethodHandle cudaDriverGetVersion$handle() { + return cudaDriverGetVersion.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDriverGetVersion(int *driverVersion) + * } + */ + public static MemorySegment cudaDriverGetVersion$address() { + return cudaDriverGetVersion.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDriverGetVersion(int *driverVersion) + * } + */ + public static int cudaDriverGetVersion(MemorySegment driverVersion) { + var mh$ = cudaDriverGetVersion.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDriverGetVersion", driverVersion); + } + return (int)mh$.invokeExact(driverVersion); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaRuntimeGetVersion { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaRuntimeGetVersion"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaRuntimeGetVersion(int *runtimeVersion) + * } + */ + public static FunctionDescriptor cudaRuntimeGetVersion$descriptor() { + return cudaRuntimeGetVersion.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaRuntimeGetVersion(int *runtimeVersion) + * } + */ + public static MethodHandle cudaRuntimeGetVersion$handle() { + return cudaRuntimeGetVersion.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaRuntimeGetVersion(int *runtimeVersion) + * } + */ + public static MemorySegment cudaRuntimeGetVersion$address() { + return cudaRuntimeGetVersion.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaRuntimeGetVersion(int *runtimeVersion) + * } + */ + public static int cudaRuntimeGetVersion(MemorySegment runtimeVersion) { + var mh$ = cudaRuntimeGetVersion.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaRuntimeGetVersion", runtimeVersion); + } + return (int)mh$.invokeExact(runtimeVersion); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphCreate(cudaGraph_t *pGraph, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaGraphCreate$descriptor() { + return cudaGraphCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphCreate(cudaGraph_t *pGraph, unsigned int flags) + * } + */ + public static MethodHandle cudaGraphCreate$handle() { + return cudaGraphCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphCreate(cudaGraph_t *pGraph, unsigned int flags) + * } + */ + public static MemorySegment cudaGraphCreate$address() { + return cudaGraphCreate.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphCreate(cudaGraph_t *pGraph, unsigned int flags) + * } + */ + public static int cudaGraphCreate(MemorySegment pGraph, int flags) { + var mh$ = cudaGraphCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphCreate", pGraph, flags); + } + return (int)mh$.invokeExact(pGraph, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddKernelNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddKernelNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphAddKernelNode$descriptor() { + return cudaGraphAddKernelNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphAddKernelNode$handle() { + return cudaGraphAddKernelNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphAddKernelNode$address() { + return cudaGraphAddKernelNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static int cudaGraphAddKernelNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment pNodeParams) { + var mh$ = cudaGraphAddKernelNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddKernelNode", pGraphNode, graph, pDependencies, numDependencies, pNodeParams); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphKernelNodeGetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphKernelNodeGetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphKernelNodeGetParams$descriptor() { + return cudaGraphKernelNodeGetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphKernelNodeGetParams$handle() { + return cudaGraphKernelNodeGetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphKernelNodeGetParams$address() { + return cudaGraphKernelNodeGetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static int cudaGraphKernelNodeGetParams(MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphKernelNodeGetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphKernelNodeGetParams", node, pNodeParams); + } + return (int)mh$.invokeExact(node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphKernelNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphKernelNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphKernelNodeSetParams$descriptor() { + return cudaGraphKernelNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphKernelNodeSetParams$handle() { + return cudaGraphKernelNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphKernelNodeSetParams$address() { + return cudaGraphKernelNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static int cudaGraphKernelNodeSetParams(MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphKernelNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphKernelNodeSetParams", node, pNodeParams); + } + return (int)mh$.invokeExact(node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphKernelNodeCopyAttributes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphKernelNodeCopyAttributes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) + * } + */ + public static FunctionDescriptor cudaGraphKernelNodeCopyAttributes$descriptor() { + return cudaGraphKernelNodeCopyAttributes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) + * } + */ + public static MethodHandle cudaGraphKernelNodeCopyAttributes$handle() { + return cudaGraphKernelNodeCopyAttributes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) + * } + */ + public static MemorySegment cudaGraphKernelNodeCopyAttributes$address() { + return cudaGraphKernelNodeCopyAttributes.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) + * } + */ + public static int cudaGraphKernelNodeCopyAttributes(MemorySegment hSrc, MemorySegment hDst) { + var mh$ = cudaGraphKernelNodeCopyAttributes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphKernelNodeCopyAttributes", hSrc, hDst); + } + return (int)mh$.invokeExact(hSrc, hDst); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphKernelNodeGetAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphKernelNodeGetAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) + * } + */ + public static FunctionDescriptor cudaGraphKernelNodeGetAttribute$descriptor() { + return cudaGraphKernelNodeGetAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) + * } + */ + public static MethodHandle cudaGraphKernelNodeGetAttribute$handle() { + return cudaGraphKernelNodeGetAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) + * } + */ + public static MemorySegment cudaGraphKernelNodeGetAttribute$address() { + return cudaGraphKernelNodeGetAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) + * } + */ + public static int cudaGraphKernelNodeGetAttribute(MemorySegment hNode, int attr, MemorySegment value_out) { + var mh$ = cudaGraphKernelNodeGetAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphKernelNodeGetAttribute", hNode, attr, value_out); + } + return (int)mh$.invokeExact(hNode, attr, value_out); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphKernelNodeSetAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphKernelNodeSetAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) + * } + */ + public static FunctionDescriptor cudaGraphKernelNodeSetAttribute$descriptor() { + return cudaGraphKernelNodeSetAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) + * } + */ + public static MethodHandle cudaGraphKernelNodeSetAttribute$handle() { + return cudaGraphKernelNodeSetAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) + * } + */ + public static MemorySegment cudaGraphKernelNodeSetAttribute$address() { + return cudaGraphKernelNodeSetAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) + * } + */ + public static int cudaGraphKernelNodeSetAttribute(MemorySegment hNode, int attr, MemorySegment value) { + var mh$ = cudaGraphKernelNodeSetAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphKernelNodeSetAttribute", hNode, attr, value); + } + return (int)mh$.invokeExact(hNode, attr, value); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddMemcpyNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemcpyNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemcpy3DParms *pCopyParams) + * } + */ + public static FunctionDescriptor cudaGraphAddMemcpyNode$descriptor() { + return cudaGraphAddMemcpyNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemcpy3DParms *pCopyParams) + * } + */ + public static MethodHandle cudaGraphAddMemcpyNode$handle() { + return cudaGraphAddMemcpyNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemcpy3DParms *pCopyParams) + * } + */ + public static MemorySegment cudaGraphAddMemcpyNode$address() { + return cudaGraphAddMemcpyNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemcpy3DParms *pCopyParams) + * } + */ + public static int cudaGraphAddMemcpyNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment pCopyParams) { + var mh$ = cudaGraphAddMemcpyNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddMemcpyNode", pGraphNode, graph, pDependencies, numDependencies, pCopyParams); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, pCopyParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddMemcpyNodeToSymbol { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemcpyNodeToSymbol"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNodeToSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaGraphAddMemcpyNodeToSymbol$descriptor() { + return cudaGraphAddMemcpyNodeToSymbol.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNodeToSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaGraphAddMemcpyNodeToSymbol$handle() { + return cudaGraphAddMemcpyNodeToSymbol.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNodeToSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaGraphAddMemcpyNodeToSymbol$address() { + return cudaGraphAddMemcpyNodeToSymbol.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNodeToSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static int cudaGraphAddMemcpyNodeToSymbol(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment symbol, MemorySegment src, long count, long offset, int kind) { + var mh$ = cudaGraphAddMemcpyNodeToSymbol.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddMemcpyNodeToSymbol", pGraphNode, graph, pDependencies, numDependencies, symbol, src, count, offset, kind); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, symbol, src, count, offset, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddMemcpyNodeFromSymbol { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemcpyNodeFromSymbol"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNodeFromSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaGraphAddMemcpyNodeFromSymbol$descriptor() { + return cudaGraphAddMemcpyNodeFromSymbol.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNodeFromSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaGraphAddMemcpyNodeFromSymbol$handle() { + return cudaGraphAddMemcpyNodeFromSymbol.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNodeFromSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaGraphAddMemcpyNodeFromSymbol$address() { + return cudaGraphAddMemcpyNodeFromSymbol.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNodeFromSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static int cudaGraphAddMemcpyNodeFromSymbol(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment dst, MemorySegment symbol, long count, long offset, int kind) { + var mh$ = cudaGraphAddMemcpyNodeFromSymbol.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddMemcpyNodeFromSymbol", pGraphNode, graph, pDependencies, numDependencies, dst, symbol, count, offset, kind); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, dst, symbol, count, offset, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddMemcpyNode1D { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemcpyNode1D"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaGraphAddMemcpyNode1D$descriptor() { + return cudaGraphAddMemcpyNode1D.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaGraphAddMemcpyNode1D$handle() { + return cudaGraphAddMemcpyNode1D.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaGraphAddMemcpyNode1D$address() { + return cudaGraphAddMemcpyNode1D.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static int cudaGraphAddMemcpyNode1D(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment dst, MemorySegment src, long count, int kind) { + var mh$ = cudaGraphAddMemcpyNode1D.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddMemcpyNode1D", pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphMemcpyNodeGetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemcpyNodeGetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphMemcpyNodeGetParams$descriptor() { + return cudaGraphMemcpyNodeGetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static MethodHandle cudaGraphMemcpyNodeGetParams$handle() { + return cudaGraphMemcpyNodeGetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static MemorySegment cudaGraphMemcpyNodeGetParams$address() { + return cudaGraphMemcpyNodeGetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static int cudaGraphMemcpyNodeGetParams(MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphMemcpyNodeGetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphMemcpyNodeGetParams", node, pNodeParams); + } + return (int)mh$.invokeExact(node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphMemcpyNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemcpyNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphMemcpyNodeSetParams$descriptor() { + return cudaGraphMemcpyNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static MethodHandle cudaGraphMemcpyNodeSetParams$handle() { + return cudaGraphMemcpyNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static MemorySegment cudaGraphMemcpyNodeSetParams$address() { + return cudaGraphMemcpyNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static int cudaGraphMemcpyNodeSetParams(MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphMemcpyNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphMemcpyNodeSetParams", node, pNodeParams); + } + return (int)mh$.invokeExact(node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphMemcpyNodeSetParamsToSymbol { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemcpyNodeSetParamsToSymbol"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParamsToSymbol(cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaGraphMemcpyNodeSetParamsToSymbol$descriptor() { + return cudaGraphMemcpyNodeSetParamsToSymbol.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParamsToSymbol(cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaGraphMemcpyNodeSetParamsToSymbol$handle() { + return cudaGraphMemcpyNodeSetParamsToSymbol.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParamsToSymbol(cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaGraphMemcpyNodeSetParamsToSymbol$address() { + return cudaGraphMemcpyNodeSetParamsToSymbol.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParamsToSymbol(cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static int cudaGraphMemcpyNodeSetParamsToSymbol(MemorySegment node, MemorySegment symbol, MemorySegment src, long count, long offset, int kind) { + var mh$ = cudaGraphMemcpyNodeSetParamsToSymbol.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphMemcpyNodeSetParamsToSymbol", node, symbol, src, count, offset, kind); + } + return (int)mh$.invokeExact(node, symbol, src, count, offset, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphMemcpyNodeSetParamsFromSymbol { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemcpyNodeSetParamsFromSymbol"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParamsFromSymbol(cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaGraphMemcpyNodeSetParamsFromSymbol$descriptor() { + return cudaGraphMemcpyNodeSetParamsFromSymbol.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParamsFromSymbol(cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaGraphMemcpyNodeSetParamsFromSymbol$handle() { + return cudaGraphMemcpyNodeSetParamsFromSymbol.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParamsFromSymbol(cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaGraphMemcpyNodeSetParamsFromSymbol$address() { + return cudaGraphMemcpyNodeSetParamsFromSymbol.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParamsFromSymbol(cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static int cudaGraphMemcpyNodeSetParamsFromSymbol(MemorySegment node, MemorySegment dst, MemorySegment symbol, long count, long offset, int kind) { + var mh$ = cudaGraphMemcpyNodeSetParamsFromSymbol.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphMemcpyNodeSetParamsFromSymbol", node, dst, symbol, count, offset, kind); + } + return (int)mh$.invokeExact(node, dst, symbol, count, offset, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphMemcpyNodeSetParams1D { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemcpyNodeSetParams1D"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaGraphMemcpyNodeSetParams1D$descriptor() { + return cudaGraphMemcpyNodeSetParams1D.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaGraphMemcpyNodeSetParams1D$handle() { + return cudaGraphMemcpyNodeSetParams1D.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaGraphMemcpyNodeSetParams1D$address() { + return cudaGraphMemcpyNodeSetParams1D.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static int cudaGraphMemcpyNodeSetParams1D(MemorySegment node, MemorySegment dst, MemorySegment src, long count, int kind) { + var mh$ = cudaGraphMemcpyNodeSetParams1D.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphMemcpyNodeSetParams1D", node, dst, src, count, kind); + } + return (int)mh$.invokeExact(node, dst, src, count, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddMemsetNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemsetNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemsetParams *pMemsetParams) + * } + */ + public static FunctionDescriptor cudaGraphAddMemsetNode$descriptor() { + return cudaGraphAddMemsetNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemsetParams *pMemsetParams) + * } + */ + public static MethodHandle cudaGraphAddMemsetNode$handle() { + return cudaGraphAddMemsetNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemsetParams *pMemsetParams) + * } + */ + public static MemorySegment cudaGraphAddMemsetNode$address() { + return cudaGraphAddMemsetNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemsetParams *pMemsetParams) + * } + */ + public static int cudaGraphAddMemsetNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment pMemsetParams) { + var mh$ = cudaGraphAddMemsetNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddMemsetNode", pGraphNode, graph, pDependencies, numDependencies, pMemsetParams); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, pMemsetParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphMemsetNodeGetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemsetNodeGetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, struct cudaMemsetParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphMemsetNodeGetParams$descriptor() { + return cudaGraphMemsetNodeGetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, struct cudaMemsetParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphMemsetNodeGetParams$handle() { + return cudaGraphMemsetNodeGetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, struct cudaMemsetParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphMemsetNodeGetParams$address() { + return cudaGraphMemsetNodeGetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, struct cudaMemsetParams *pNodeParams) + * } + */ + public static int cudaGraphMemsetNodeGetParams(MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphMemsetNodeGetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphMemsetNodeGetParams", node, pNodeParams); + } + return (int)mh$.invokeExact(node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphMemsetNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemsetNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphMemsetNodeSetParams$descriptor() { + return cudaGraphMemsetNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphMemsetNodeSetParams$handle() { + return cudaGraphMemsetNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphMemsetNodeSetParams$address() { + return cudaGraphMemsetNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) + * } + */ + public static int cudaGraphMemsetNodeSetParams(MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphMemsetNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphMemsetNodeSetParams", node, pNodeParams); + } + return (int)mh$.invokeExact(node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddHostNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddHostNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddHostNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphAddHostNode$descriptor() { + return cudaGraphAddHostNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddHostNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphAddHostNode$handle() { + return cudaGraphAddHostNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddHostNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphAddHostNode$address() { + return cudaGraphAddHostNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddHostNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static int cudaGraphAddHostNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment pNodeParams) { + var mh$ = cudaGraphAddHostNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddHostNode", pGraphNode, graph, pDependencies, numDependencies, pNodeParams); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphHostNodeGetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphHostNodeGetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, struct cudaHostNodeParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphHostNodeGetParams$descriptor() { + return cudaGraphHostNodeGetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, struct cudaHostNodeParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphHostNodeGetParams$handle() { + return cudaGraphHostNodeGetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, struct cudaHostNodeParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphHostNodeGetParams$address() { + return cudaGraphHostNodeGetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, struct cudaHostNodeParams *pNodeParams) + * } + */ + public static int cudaGraphHostNodeGetParams(MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphHostNodeGetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphHostNodeGetParams", node, pNodeParams); + } + return (int)mh$.invokeExact(node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphHostNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphHostNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphHostNodeSetParams$descriptor() { + return cudaGraphHostNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphHostNodeSetParams$handle() { + return cudaGraphHostNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphHostNodeSetParams$address() { + return cudaGraphHostNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static int cudaGraphHostNodeSetParams(MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphHostNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphHostNodeSetParams", node, pNodeParams); + } + return (int)mh$.invokeExact(node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddChildGraphNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddChildGraphNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaGraph_t childGraph) + * } + */ + public static FunctionDescriptor cudaGraphAddChildGraphNode$descriptor() { + return cudaGraphAddChildGraphNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaGraph_t childGraph) + * } + */ + public static MethodHandle cudaGraphAddChildGraphNode$handle() { + return cudaGraphAddChildGraphNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaGraph_t childGraph) + * } + */ + public static MemorySegment cudaGraphAddChildGraphNode$address() { + return cudaGraphAddChildGraphNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaGraph_t childGraph) + * } + */ + public static int cudaGraphAddChildGraphNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment childGraph) { + var mh$ = cudaGraphAddChildGraphNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddChildGraphNode", pGraphNode, graph, pDependencies, numDependencies, childGraph); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, childGraph); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphChildGraphNodeGetGraph { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphChildGraphNodeGetGraph"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t *pGraph) + * } + */ + public static FunctionDescriptor cudaGraphChildGraphNodeGetGraph$descriptor() { + return cudaGraphChildGraphNodeGetGraph.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t *pGraph) + * } + */ + public static MethodHandle cudaGraphChildGraphNodeGetGraph$handle() { + return cudaGraphChildGraphNodeGetGraph.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t *pGraph) + * } + */ + public static MemorySegment cudaGraphChildGraphNodeGetGraph$address() { + return cudaGraphChildGraphNodeGetGraph.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t *pGraph) + * } + */ + public static int cudaGraphChildGraphNodeGetGraph(MemorySegment node, MemorySegment pGraph) { + var mh$ = cudaGraphChildGraphNodeGetGraph.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphChildGraphNodeGetGraph", node, pGraph); + } + return (int)mh$.invokeExact(node, pGraph); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddEmptyNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddEmptyNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies) + * } + */ + public static FunctionDescriptor cudaGraphAddEmptyNode$descriptor() { + return cudaGraphAddEmptyNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies) + * } + */ + public static MethodHandle cudaGraphAddEmptyNode$handle() { + return cudaGraphAddEmptyNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies) + * } + */ + public static MemorySegment cudaGraphAddEmptyNode$address() { + return cudaGraphAddEmptyNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies) + * } + */ + public static int cudaGraphAddEmptyNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies) { + var mh$ = cudaGraphAddEmptyNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddEmptyNode", pGraphNode, graph, pDependencies, numDependencies); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddEventRecordNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddEventRecordNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) + * } + */ + public static FunctionDescriptor cudaGraphAddEventRecordNode$descriptor() { + return cudaGraphAddEventRecordNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) + * } + */ + public static MethodHandle cudaGraphAddEventRecordNode$handle() { + return cudaGraphAddEventRecordNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) + * } + */ + public static MemorySegment cudaGraphAddEventRecordNode$address() { + return cudaGraphAddEventRecordNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) + * } + */ + public static int cudaGraphAddEventRecordNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment event) { + var mh$ = cudaGraphAddEventRecordNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddEventRecordNode", pGraphNode, graph, pDependencies, numDependencies, event); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphEventRecordNodeGetEvent { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphEventRecordNodeGetEvent"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) + * } + */ + public static FunctionDescriptor cudaGraphEventRecordNodeGetEvent$descriptor() { + return cudaGraphEventRecordNodeGetEvent.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) + * } + */ + public static MethodHandle cudaGraphEventRecordNodeGetEvent$handle() { + return cudaGraphEventRecordNodeGetEvent.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) + * } + */ + public static MemorySegment cudaGraphEventRecordNodeGetEvent$address() { + return cudaGraphEventRecordNodeGetEvent.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) + * } + */ + public static int cudaGraphEventRecordNodeGetEvent(MemorySegment node, MemorySegment event_out) { + var mh$ = cudaGraphEventRecordNodeGetEvent.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphEventRecordNodeGetEvent", node, event_out); + } + return (int)mh$.invokeExact(node, event_out); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphEventRecordNodeSetEvent { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphEventRecordNodeSetEvent"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) + * } + */ + public static FunctionDescriptor cudaGraphEventRecordNodeSetEvent$descriptor() { + return cudaGraphEventRecordNodeSetEvent.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) + * } + */ + public static MethodHandle cudaGraphEventRecordNodeSetEvent$handle() { + return cudaGraphEventRecordNodeSetEvent.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) + * } + */ + public static MemorySegment cudaGraphEventRecordNodeSetEvent$address() { + return cudaGraphEventRecordNodeSetEvent.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) + * } + */ + public static int cudaGraphEventRecordNodeSetEvent(MemorySegment node, MemorySegment event) { + var mh$ = cudaGraphEventRecordNodeSetEvent.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphEventRecordNodeSetEvent", node, event); + } + return (int)mh$.invokeExact(node, event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddEventWaitNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddEventWaitNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) + * } + */ + public static FunctionDescriptor cudaGraphAddEventWaitNode$descriptor() { + return cudaGraphAddEventWaitNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) + * } + */ + public static MethodHandle cudaGraphAddEventWaitNode$handle() { + return cudaGraphAddEventWaitNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) + * } + */ + public static MemorySegment cudaGraphAddEventWaitNode$address() { + return cudaGraphAddEventWaitNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) + * } + */ + public static int cudaGraphAddEventWaitNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment event) { + var mh$ = cudaGraphAddEventWaitNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddEventWaitNode", pGraphNode, graph, pDependencies, numDependencies, event); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphEventWaitNodeGetEvent { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphEventWaitNodeGetEvent"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) + * } + */ + public static FunctionDescriptor cudaGraphEventWaitNodeGetEvent$descriptor() { + return cudaGraphEventWaitNodeGetEvent.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) + * } + */ + public static MethodHandle cudaGraphEventWaitNodeGetEvent$handle() { + return cudaGraphEventWaitNodeGetEvent.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) + * } + */ + public static MemorySegment cudaGraphEventWaitNodeGetEvent$address() { + return cudaGraphEventWaitNodeGetEvent.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) + * } + */ + public static int cudaGraphEventWaitNodeGetEvent(MemorySegment node, MemorySegment event_out) { + var mh$ = cudaGraphEventWaitNodeGetEvent.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphEventWaitNodeGetEvent", node, event_out); + } + return (int)mh$.invokeExact(node, event_out); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphEventWaitNodeSetEvent { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphEventWaitNodeSetEvent"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) + * } + */ + public static FunctionDescriptor cudaGraphEventWaitNodeSetEvent$descriptor() { + return cudaGraphEventWaitNodeSetEvent.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) + * } + */ + public static MethodHandle cudaGraphEventWaitNodeSetEvent$handle() { + return cudaGraphEventWaitNodeSetEvent.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) + * } + */ + public static MemorySegment cudaGraphEventWaitNodeSetEvent$address() { + return cudaGraphEventWaitNodeSetEvent.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) + * } + */ + public static int cudaGraphEventWaitNodeSetEvent(MemorySegment node, MemorySegment event) { + var mh$ = cudaGraphEventWaitNodeSetEvent.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphEventWaitNodeSetEvent", node, event); + } + return (int)mh$.invokeExact(node, event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddExternalSemaphoresSignalNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddExternalSemaphoresSignalNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphAddExternalSemaphoresSignalNode$descriptor() { + return cudaGraphAddExternalSemaphoresSignalNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphAddExternalSemaphoresSignalNode$handle() { + return cudaGraphAddExternalSemaphoresSignalNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphAddExternalSemaphoresSignalNode$address() { + return cudaGraphAddExternalSemaphoresSignalNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static int cudaGraphAddExternalSemaphoresSignalNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment nodeParams) { + var mh$ = cudaGraphAddExternalSemaphoresSignalNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddExternalSemaphoresSignalNode", pGraphNode, graph, pDependencies, numDependencies, nodeParams); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExternalSemaphoresSignalNodeGetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExternalSemaphoresSignalNodeGetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreSignalNodeParams *params_out) + * } + */ + public static FunctionDescriptor cudaGraphExternalSemaphoresSignalNodeGetParams$descriptor() { + return cudaGraphExternalSemaphoresSignalNodeGetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreSignalNodeParams *params_out) + * } + */ + public static MethodHandle cudaGraphExternalSemaphoresSignalNodeGetParams$handle() { + return cudaGraphExternalSemaphoresSignalNodeGetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreSignalNodeParams *params_out) + * } + */ + public static MemorySegment cudaGraphExternalSemaphoresSignalNodeGetParams$address() { + return cudaGraphExternalSemaphoresSignalNodeGetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreSignalNodeParams *params_out) + * } + */ + public static int cudaGraphExternalSemaphoresSignalNodeGetParams(MemorySegment hNode, MemorySegment params_out) { + var mh$ = cudaGraphExternalSemaphoresSignalNodeGetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExternalSemaphoresSignalNodeGetParams", hNode, params_out); + } + return (int)mh$.invokeExact(hNode, params_out); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExternalSemaphoresSignalNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExternalSemaphoresSignalNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphExternalSemaphoresSignalNodeSetParams$descriptor() { + return cudaGraphExternalSemaphoresSignalNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphExternalSemaphoresSignalNodeSetParams$handle() { + return cudaGraphExternalSemaphoresSignalNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphExternalSemaphoresSignalNodeSetParams$address() { + return cudaGraphExternalSemaphoresSignalNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static int cudaGraphExternalSemaphoresSignalNodeSetParams(MemorySegment hNode, MemorySegment nodeParams) { + var mh$ = cudaGraphExternalSemaphoresSignalNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExternalSemaphoresSignalNodeSetParams", hNode, nodeParams); + } + return (int)mh$.invokeExact(hNode, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddExternalSemaphoresWaitNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddExternalSemaphoresWaitNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphAddExternalSemaphoresWaitNode$descriptor() { + return cudaGraphAddExternalSemaphoresWaitNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphAddExternalSemaphoresWaitNode$handle() { + return cudaGraphAddExternalSemaphoresWaitNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphAddExternalSemaphoresWaitNode$address() { + return cudaGraphAddExternalSemaphoresWaitNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static int cudaGraphAddExternalSemaphoresWaitNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment nodeParams) { + var mh$ = cudaGraphAddExternalSemaphoresWaitNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddExternalSemaphoresWaitNode", pGraphNode, graph, pDependencies, numDependencies, nodeParams); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExternalSemaphoresWaitNodeGetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExternalSemaphoresWaitNodeGetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreWaitNodeParams *params_out) + * } + */ + public static FunctionDescriptor cudaGraphExternalSemaphoresWaitNodeGetParams$descriptor() { + return cudaGraphExternalSemaphoresWaitNodeGetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreWaitNodeParams *params_out) + * } + */ + public static MethodHandle cudaGraphExternalSemaphoresWaitNodeGetParams$handle() { + return cudaGraphExternalSemaphoresWaitNodeGetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreWaitNodeParams *params_out) + * } + */ + public static MemorySegment cudaGraphExternalSemaphoresWaitNodeGetParams$address() { + return cudaGraphExternalSemaphoresWaitNodeGetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreWaitNodeParams *params_out) + * } + */ + public static int cudaGraphExternalSemaphoresWaitNodeGetParams(MemorySegment hNode, MemorySegment params_out) { + var mh$ = cudaGraphExternalSemaphoresWaitNodeGetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExternalSemaphoresWaitNodeGetParams", hNode, params_out); + } + return (int)mh$.invokeExact(hNode, params_out); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExternalSemaphoresWaitNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExternalSemaphoresWaitNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphExternalSemaphoresWaitNodeSetParams$descriptor() { + return cudaGraphExternalSemaphoresWaitNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphExternalSemaphoresWaitNodeSetParams$handle() { + return cudaGraphExternalSemaphoresWaitNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphExternalSemaphoresWaitNodeSetParams$address() { + return cudaGraphExternalSemaphoresWaitNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static int cudaGraphExternalSemaphoresWaitNodeSetParams(MemorySegment hNode, MemorySegment nodeParams) { + var mh$ = cudaGraphExternalSemaphoresWaitNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExternalSemaphoresWaitNodeSetParams", hNode, nodeParams); + } + return (int)mh$.invokeExact(hNode, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddMemAllocNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemAllocNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaMemAllocNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphAddMemAllocNode$descriptor() { + return cudaGraphAddMemAllocNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaMemAllocNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphAddMemAllocNode$handle() { + return cudaGraphAddMemAllocNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaMemAllocNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphAddMemAllocNode$address() { + return cudaGraphAddMemAllocNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaMemAllocNodeParams *nodeParams) + * } + */ + public static int cudaGraphAddMemAllocNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment nodeParams) { + var mh$ = cudaGraphAddMemAllocNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddMemAllocNode", pGraphNode, graph, pDependencies, numDependencies, nodeParams); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphMemAllocNodeGetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemAllocNodeGetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, struct cudaMemAllocNodeParams *params_out) + * } + */ + public static FunctionDescriptor cudaGraphMemAllocNodeGetParams$descriptor() { + return cudaGraphMemAllocNodeGetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, struct cudaMemAllocNodeParams *params_out) + * } + */ + public static MethodHandle cudaGraphMemAllocNodeGetParams$handle() { + return cudaGraphMemAllocNodeGetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, struct cudaMemAllocNodeParams *params_out) + * } + */ + public static MemorySegment cudaGraphMemAllocNodeGetParams$address() { + return cudaGraphMemAllocNodeGetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, struct cudaMemAllocNodeParams *params_out) + * } + */ + public static int cudaGraphMemAllocNodeGetParams(MemorySegment node, MemorySegment params_out) { + var mh$ = cudaGraphMemAllocNodeGetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphMemAllocNodeGetParams", node, params_out); + } + return (int)mh$.invokeExact(node, params_out); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddMemFreeNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemFreeNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dptr) + * } + */ + public static FunctionDescriptor cudaGraphAddMemFreeNode$descriptor() { + return cudaGraphAddMemFreeNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dptr) + * } + */ + public static MethodHandle cudaGraphAddMemFreeNode$handle() { + return cudaGraphAddMemFreeNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dptr) + * } + */ + public static MemorySegment cudaGraphAddMemFreeNode$address() { + return cudaGraphAddMemFreeNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dptr) + * } + */ + public static int cudaGraphAddMemFreeNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment dptr) { + var mh$ = cudaGraphAddMemFreeNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddMemFreeNode", pGraphNode, graph, pDependencies, numDependencies, dptr); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, dptr); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphMemFreeNodeGetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemFreeNodeGetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void *dptr_out) + * } + */ + public static FunctionDescriptor cudaGraphMemFreeNodeGetParams$descriptor() { + return cudaGraphMemFreeNodeGetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void *dptr_out) + * } + */ + public static MethodHandle cudaGraphMemFreeNodeGetParams$handle() { + return cudaGraphMemFreeNodeGetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void *dptr_out) + * } + */ + public static MemorySegment cudaGraphMemFreeNodeGetParams$address() { + return cudaGraphMemFreeNodeGetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void *dptr_out) + * } + */ + public static int cudaGraphMemFreeNodeGetParams(MemorySegment node, MemorySegment dptr_out) { + var mh$ = cudaGraphMemFreeNodeGetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphMemFreeNodeGetParams", node, dptr_out); + } + return (int)mh$.invokeExact(node, dptr_out); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGraphMemTrim { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGraphMemTrim"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGraphMemTrim(int device) + * } + */ + public static FunctionDescriptor cudaDeviceGraphMemTrim$descriptor() { + return cudaDeviceGraphMemTrim.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGraphMemTrim(int device) + * } + */ + public static MethodHandle cudaDeviceGraphMemTrim$handle() { + return cudaDeviceGraphMemTrim.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGraphMemTrim(int device) + * } + */ + public static MemorySegment cudaDeviceGraphMemTrim$address() { + return cudaDeviceGraphMemTrim.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGraphMemTrim(int device) + * } + */ + public static int cudaDeviceGraphMemTrim(int device) { + var mh$ = cudaDeviceGraphMemTrim.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGraphMemTrim", device); + } + return (int)mh$.invokeExact(device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetGraphMemAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetGraphMemAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) + * } + */ + public static FunctionDescriptor cudaDeviceGetGraphMemAttribute$descriptor() { + return cudaDeviceGetGraphMemAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) + * } + */ + public static MethodHandle cudaDeviceGetGraphMemAttribute$handle() { + return cudaDeviceGetGraphMemAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) + * } + */ + public static MemorySegment cudaDeviceGetGraphMemAttribute$address() { + return cudaDeviceGetGraphMemAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) + * } + */ + public static int cudaDeviceGetGraphMemAttribute(int device, int attr, MemorySegment value) { + var mh$ = cudaDeviceGetGraphMemAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetGraphMemAttribute", device, attr, value); + } + return (int)mh$.invokeExact(device, attr, value); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceSetGraphMemAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSetGraphMemAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) + * } + */ + public static FunctionDescriptor cudaDeviceSetGraphMemAttribute$descriptor() { + return cudaDeviceSetGraphMemAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) + * } + */ + public static MethodHandle cudaDeviceSetGraphMemAttribute$handle() { + return cudaDeviceSetGraphMemAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) + * } + */ + public static MemorySegment cudaDeviceSetGraphMemAttribute$address() { + return cudaDeviceSetGraphMemAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) + * } + */ + public static int cudaDeviceSetGraphMemAttribute(int device, int attr, MemorySegment value) { + var mh$ = cudaDeviceSetGraphMemAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceSetGraphMemAttribute", device, attr, value); + } + return (int)mh$.invokeExact(device, attr, value); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphClone { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphClone"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphClone(cudaGraph_t *pGraphClone, cudaGraph_t originalGraph) + * } + */ + public static FunctionDescriptor cudaGraphClone$descriptor() { + return cudaGraphClone.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphClone(cudaGraph_t *pGraphClone, cudaGraph_t originalGraph) + * } + */ + public static MethodHandle cudaGraphClone$handle() { + return cudaGraphClone.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphClone(cudaGraph_t *pGraphClone, cudaGraph_t originalGraph) + * } + */ + public static MemorySegment cudaGraphClone$address() { + return cudaGraphClone.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphClone(cudaGraph_t *pGraphClone, cudaGraph_t originalGraph) + * } + */ + public static int cudaGraphClone(MemorySegment pGraphClone, MemorySegment originalGraph) { + var mh$ = cudaGraphClone.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphClone", pGraphClone, originalGraph); + } + return (int)mh$.invokeExact(pGraphClone, originalGraph); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphNodeFindInClone { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeFindInClone"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t *pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) + * } + */ + public static FunctionDescriptor cudaGraphNodeFindInClone$descriptor() { + return cudaGraphNodeFindInClone.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t *pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) + * } + */ + public static MethodHandle cudaGraphNodeFindInClone$handle() { + return cudaGraphNodeFindInClone.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t *pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) + * } + */ + public static MemorySegment cudaGraphNodeFindInClone$address() { + return cudaGraphNodeFindInClone.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t *pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) + * } + */ + public static int cudaGraphNodeFindInClone(MemorySegment pNode, MemorySegment originalNode, MemorySegment clonedGraph) { + var mh$ = cudaGraphNodeFindInClone.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphNodeFindInClone", pNode, originalNode, clonedGraph); + } + return (int)mh$.invokeExact(pNode, originalNode, clonedGraph); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphNodeGetType { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetType"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, enum cudaGraphNodeType *pType) + * } + */ + public static FunctionDescriptor cudaGraphNodeGetType$descriptor() { + return cudaGraphNodeGetType.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, enum cudaGraphNodeType *pType) + * } + */ + public static MethodHandle cudaGraphNodeGetType$handle() { + return cudaGraphNodeGetType.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, enum cudaGraphNodeType *pType) + * } + */ + public static MemorySegment cudaGraphNodeGetType$address() { + return cudaGraphNodeGetType.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, enum cudaGraphNodeType *pType) + * } + */ + public static int cudaGraphNodeGetType(MemorySegment node, MemorySegment pType) { + var mh$ = cudaGraphNodeGetType.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphNodeGetType", node, pType); + } + return (int)mh$.invokeExact(node, pType); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphGetNodes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphGetNodes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t *nodes, size_t *numNodes) + * } + */ + public static FunctionDescriptor cudaGraphGetNodes$descriptor() { + return cudaGraphGetNodes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t *nodes, size_t *numNodes) + * } + */ + public static MethodHandle cudaGraphGetNodes$handle() { + return cudaGraphGetNodes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t *nodes, size_t *numNodes) + * } + */ + public static MemorySegment cudaGraphGetNodes$address() { + return cudaGraphGetNodes.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t *nodes, size_t *numNodes) + * } + */ + public static int cudaGraphGetNodes(MemorySegment graph, MemorySegment nodes, MemorySegment numNodes) { + var mh$ = cudaGraphGetNodes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphGetNodes", graph, nodes, numNodes); + } + return (int)mh$.invokeExact(graph, nodes, numNodes); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphGetRootNodes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphGetRootNodes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t *pRootNodes, size_t *pNumRootNodes) + * } + */ + public static FunctionDescriptor cudaGraphGetRootNodes$descriptor() { + return cudaGraphGetRootNodes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t *pRootNodes, size_t *pNumRootNodes) + * } + */ + public static MethodHandle cudaGraphGetRootNodes$handle() { + return cudaGraphGetRootNodes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t *pRootNodes, size_t *pNumRootNodes) + * } + */ + public static MemorySegment cudaGraphGetRootNodes$address() { + return cudaGraphGetRootNodes.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t *pRootNodes, size_t *pNumRootNodes) + * } + */ + public static int cudaGraphGetRootNodes(MemorySegment graph, MemorySegment pRootNodes, MemorySegment pNumRootNodes) { + var mh$ = cudaGraphGetRootNodes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphGetRootNodes", graph, pRootNodes, pNumRootNodes); + } + return (int)mh$.invokeExact(graph, pRootNodes, pNumRootNodes); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphGetEdges { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphGetEdges"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, size_t *numEdges) + * } + */ + public static FunctionDescriptor cudaGraphGetEdges$descriptor() { + return cudaGraphGetEdges.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, size_t *numEdges) + * } + */ + public static MethodHandle cudaGraphGetEdges$handle() { + return cudaGraphGetEdges.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, size_t *numEdges) + * } + */ + public static MemorySegment cudaGraphGetEdges$address() { + return cudaGraphGetEdges.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, size_t *numEdges) + * } + */ + public static int cudaGraphGetEdges(MemorySegment graph, MemorySegment from, MemorySegment to, MemorySegment numEdges) { + var mh$ = cudaGraphGetEdges.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphGetEdges", graph, from, to, numEdges); + } + return (int)mh$.invokeExact(graph, from, to, numEdges); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphGetEdges_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphGetEdges_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, cudaGraphEdgeData *edgeData, size_t *numEdges) + * } + */ + public static FunctionDescriptor cudaGraphGetEdges_v2$descriptor() { + return cudaGraphGetEdges_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, cudaGraphEdgeData *edgeData, size_t *numEdges) + * } + */ + public static MethodHandle cudaGraphGetEdges_v2$handle() { + return cudaGraphGetEdges_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, cudaGraphEdgeData *edgeData, size_t *numEdges) + * } + */ + public static MemorySegment cudaGraphGetEdges_v2$address() { + return cudaGraphGetEdges_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, cudaGraphEdgeData *edgeData, size_t *numEdges) + * } + */ + public static int cudaGraphGetEdges_v2(MemorySegment graph, MemorySegment from, MemorySegment to, MemorySegment edgeData, MemorySegment numEdges) { + var mh$ = cudaGraphGetEdges_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphGetEdges_v2", graph, from, to, edgeData, numEdges); + } + return (int)mh$.invokeExact(graph, from, to, edgeData, numEdges); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphNodeGetDependencies { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetDependencies"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, size_t *pNumDependencies) + * } + */ + public static FunctionDescriptor cudaGraphNodeGetDependencies$descriptor() { + return cudaGraphNodeGetDependencies.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, size_t *pNumDependencies) + * } + */ + public static MethodHandle cudaGraphNodeGetDependencies$handle() { + return cudaGraphNodeGetDependencies.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, size_t *pNumDependencies) + * } + */ + public static MemorySegment cudaGraphNodeGetDependencies$address() { + return cudaGraphNodeGetDependencies.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, size_t *pNumDependencies) + * } + */ + public static int cudaGraphNodeGetDependencies(MemorySegment node, MemorySegment pDependencies, MemorySegment pNumDependencies) { + var mh$ = cudaGraphNodeGetDependencies.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphNodeGetDependencies", node, pDependencies, pNumDependencies); + } + return (int)mh$.invokeExact(node, pDependencies, pNumDependencies); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphNodeGetDependencies_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetDependencies_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, cudaGraphEdgeData *edgeData, size_t *pNumDependencies) + * } + */ + public static FunctionDescriptor cudaGraphNodeGetDependencies_v2$descriptor() { + return cudaGraphNodeGetDependencies_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, cudaGraphEdgeData *edgeData, size_t *pNumDependencies) + * } + */ + public static MethodHandle cudaGraphNodeGetDependencies_v2$handle() { + return cudaGraphNodeGetDependencies_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, cudaGraphEdgeData *edgeData, size_t *pNumDependencies) + * } + */ + public static MemorySegment cudaGraphNodeGetDependencies_v2$address() { + return cudaGraphNodeGetDependencies_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, cudaGraphEdgeData *edgeData, size_t *pNumDependencies) + * } + */ + public static int cudaGraphNodeGetDependencies_v2(MemorySegment node, MemorySegment pDependencies, MemorySegment edgeData, MemorySegment pNumDependencies) { + var mh$ = cudaGraphNodeGetDependencies_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphNodeGetDependencies_v2", node, pDependencies, edgeData, pNumDependencies); + } + return (int)mh$.invokeExact(node, pDependencies, edgeData, pNumDependencies); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphNodeGetDependentNodes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetDependentNodes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, size_t *pNumDependentNodes) + * } + */ + public static FunctionDescriptor cudaGraphNodeGetDependentNodes$descriptor() { + return cudaGraphNodeGetDependentNodes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, size_t *pNumDependentNodes) + * } + */ + public static MethodHandle cudaGraphNodeGetDependentNodes$handle() { + return cudaGraphNodeGetDependentNodes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, size_t *pNumDependentNodes) + * } + */ + public static MemorySegment cudaGraphNodeGetDependentNodes$address() { + return cudaGraphNodeGetDependentNodes.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, size_t *pNumDependentNodes) + * } + */ + public static int cudaGraphNodeGetDependentNodes(MemorySegment node, MemorySegment pDependentNodes, MemorySegment pNumDependentNodes) { + var mh$ = cudaGraphNodeGetDependentNodes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphNodeGetDependentNodes", node, pDependentNodes, pNumDependentNodes); + } + return (int)mh$.invokeExact(node, pDependentNodes, pNumDependentNodes); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphNodeGetDependentNodes_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetDependentNodes_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, cudaGraphEdgeData *edgeData, size_t *pNumDependentNodes) + * } + */ + public static FunctionDescriptor cudaGraphNodeGetDependentNodes_v2$descriptor() { + return cudaGraphNodeGetDependentNodes_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, cudaGraphEdgeData *edgeData, size_t *pNumDependentNodes) + * } + */ + public static MethodHandle cudaGraphNodeGetDependentNodes_v2$handle() { + return cudaGraphNodeGetDependentNodes_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, cudaGraphEdgeData *edgeData, size_t *pNumDependentNodes) + * } + */ + public static MemorySegment cudaGraphNodeGetDependentNodes_v2$address() { + return cudaGraphNodeGetDependentNodes_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, cudaGraphEdgeData *edgeData, size_t *pNumDependentNodes) + * } + */ + public static int cudaGraphNodeGetDependentNodes_v2(MemorySegment node, MemorySegment pDependentNodes, MemorySegment edgeData, MemorySegment pNumDependentNodes) { + var mh$ = cudaGraphNodeGetDependentNodes_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphNodeGetDependentNodes_v2", node, pDependentNodes, edgeData, pNumDependentNodes); + } + return (int)mh$.invokeExact(node, pDependentNodes, edgeData, pNumDependentNodes); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddDependencies { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddDependencies"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) + * } + */ + public static FunctionDescriptor cudaGraphAddDependencies$descriptor() { + return cudaGraphAddDependencies.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) + * } + */ + public static MethodHandle cudaGraphAddDependencies$handle() { + return cudaGraphAddDependencies.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) + * } + */ + public static MemorySegment cudaGraphAddDependencies$address() { + return cudaGraphAddDependencies.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) + * } + */ + public static int cudaGraphAddDependencies(MemorySegment graph, MemorySegment from, MemorySegment to, long numDependencies) { + var mh$ = cudaGraphAddDependencies.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddDependencies", graph, from, to, numDependencies); + } + return (int)mh$.invokeExact(graph, from, to, numDependencies); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddDependencies_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddDependencies_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) + * } + */ + public static FunctionDescriptor cudaGraphAddDependencies_v2$descriptor() { + return cudaGraphAddDependencies_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) + * } + */ + public static MethodHandle cudaGraphAddDependencies_v2$handle() { + return cudaGraphAddDependencies_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) + * } + */ + public static MemorySegment cudaGraphAddDependencies_v2$address() { + return cudaGraphAddDependencies_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) + * } + */ + public static int cudaGraphAddDependencies_v2(MemorySegment graph, MemorySegment from, MemorySegment to, MemorySegment edgeData, long numDependencies) { + var mh$ = cudaGraphAddDependencies_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddDependencies_v2", graph, from, to, edgeData, numDependencies); + } + return (int)mh$.invokeExact(graph, from, to, edgeData, numDependencies); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphRemoveDependencies { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphRemoveDependencies"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) + * } + */ + public static FunctionDescriptor cudaGraphRemoveDependencies$descriptor() { + return cudaGraphRemoveDependencies.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) + * } + */ + public static MethodHandle cudaGraphRemoveDependencies$handle() { + return cudaGraphRemoveDependencies.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) + * } + */ + public static MemorySegment cudaGraphRemoveDependencies$address() { + return cudaGraphRemoveDependencies.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) + * } + */ + public static int cudaGraphRemoveDependencies(MemorySegment graph, MemorySegment from, MemorySegment to, long numDependencies) { + var mh$ = cudaGraphRemoveDependencies.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphRemoveDependencies", graph, from, to, numDependencies); + } + return (int)mh$.invokeExact(graph, from, to, numDependencies); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphRemoveDependencies_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphRemoveDependencies_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) + * } + */ + public static FunctionDescriptor cudaGraphRemoveDependencies_v2$descriptor() { + return cudaGraphRemoveDependencies_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) + * } + */ + public static MethodHandle cudaGraphRemoveDependencies_v2$handle() { + return cudaGraphRemoveDependencies_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) + * } + */ + public static MemorySegment cudaGraphRemoveDependencies_v2$address() { + return cudaGraphRemoveDependencies_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) + * } + */ + public static int cudaGraphRemoveDependencies_v2(MemorySegment graph, MemorySegment from, MemorySegment to, MemorySegment edgeData, long numDependencies) { + var mh$ = cudaGraphRemoveDependencies_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphRemoveDependencies_v2", graph, from, to, edgeData, numDependencies); + } + return (int)mh$.invokeExact(graph, from, to, edgeData, numDependencies); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphDestroyNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphDestroyNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) + * } + */ + public static FunctionDescriptor cudaGraphDestroyNode$descriptor() { + return cudaGraphDestroyNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) + * } + */ + public static MethodHandle cudaGraphDestroyNode$handle() { + return cudaGraphDestroyNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) + * } + */ + public static MemorySegment cudaGraphDestroyNode$address() { + return cudaGraphDestroyNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) + * } + */ + public static int cudaGraphDestroyNode(MemorySegment node) { + var mh$ = cudaGraphDestroyNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphDestroyNode", node); + } + return (int)mh$.invokeExact(node); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphInstantiate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphInstantiate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiate(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) + * } + */ + public static FunctionDescriptor cudaGraphInstantiate$descriptor() { + return cudaGraphInstantiate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiate(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) + * } + */ + public static MethodHandle cudaGraphInstantiate$handle() { + return cudaGraphInstantiate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiate(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) + * } + */ + public static MemorySegment cudaGraphInstantiate$address() { + return cudaGraphInstantiate.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiate(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) + * } + */ + public static int cudaGraphInstantiate(MemorySegment pGraphExec, MemorySegment graph, long flags) { + var mh$ = cudaGraphInstantiate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphInstantiate", pGraphExec, graph, flags); + } + return (int)mh$.invokeExact(pGraphExec, graph, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphInstantiateWithFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphInstantiateWithFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) + * } + */ + public static FunctionDescriptor cudaGraphInstantiateWithFlags$descriptor() { + return cudaGraphInstantiateWithFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) + * } + */ + public static MethodHandle cudaGraphInstantiateWithFlags$handle() { + return cudaGraphInstantiateWithFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) + * } + */ + public static MemorySegment cudaGraphInstantiateWithFlags$address() { + return cudaGraphInstantiateWithFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) + * } + */ + public static int cudaGraphInstantiateWithFlags(MemorySegment pGraphExec, MemorySegment graph, long flags) { + var mh$ = cudaGraphInstantiateWithFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphInstantiateWithFlags", pGraphExec, graph, flags); + } + return (int)mh$.invokeExact(pGraphExec, graph, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphInstantiateWithParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphInstantiateWithParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams *instantiateParams) + * } + */ + public static FunctionDescriptor cudaGraphInstantiateWithParams$descriptor() { + return cudaGraphInstantiateWithParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams *instantiateParams) + * } + */ + public static MethodHandle cudaGraphInstantiateWithParams$handle() { + return cudaGraphInstantiateWithParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams *instantiateParams) + * } + */ + public static MemorySegment cudaGraphInstantiateWithParams$address() { + return cudaGraphInstantiateWithParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams *instantiateParams) + * } + */ + public static int cudaGraphInstantiateWithParams(MemorySegment pGraphExec, MemorySegment graph, MemorySegment instantiateParams) { + var mh$ = cudaGraphInstantiateWithParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphInstantiateWithParams", pGraphExec, graph, instantiateParams); + } + return (int)mh$.invokeExact(pGraphExec, graph, instantiateParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecGetFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecGetFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long *flags) + * } + */ + public static FunctionDescriptor cudaGraphExecGetFlags$descriptor() { + return cudaGraphExecGetFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long *flags) + * } + */ + public static MethodHandle cudaGraphExecGetFlags$handle() { + return cudaGraphExecGetFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long *flags) + * } + */ + public static MemorySegment cudaGraphExecGetFlags$address() { + return cudaGraphExecGetFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long *flags) + * } + */ + public static int cudaGraphExecGetFlags(MemorySegment graphExec, MemorySegment flags) { + var mh$ = cudaGraphExecGetFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecGetFlags", graphExec, flags); + } + return (int)mh$.invokeExact(graphExec, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecKernelNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecKernelNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphExecKernelNodeSetParams$descriptor() { + return cudaGraphExecKernelNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphExecKernelNodeSetParams$handle() { + return cudaGraphExecKernelNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphExecKernelNodeSetParams$address() { + return cudaGraphExecKernelNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) + * } + */ + public static int cudaGraphExecKernelNodeSetParams(MemorySegment hGraphExec, MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphExecKernelNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecKernelNodeSetParams", hGraphExec, node, pNodeParams); + } + return (int)mh$.invokeExact(hGraphExec, node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecMemcpyNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecMemcpyNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphExecMemcpyNodeSetParams$descriptor() { + return cudaGraphExecMemcpyNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static MethodHandle cudaGraphExecMemcpyNodeSetParams$handle() { + return cudaGraphExecMemcpyNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static MemorySegment cudaGraphExecMemcpyNodeSetParams$address() { + return cudaGraphExecMemcpyNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) + * } + */ + public static int cudaGraphExecMemcpyNodeSetParams(MemorySegment hGraphExec, MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphExecMemcpyNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecMemcpyNodeSetParams", hGraphExec, node, pNodeParams); + } + return (int)mh$.invokeExact(hGraphExec, node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecMemcpyNodeSetParamsToSymbol { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecMemcpyNodeSetParamsToSymbol"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsToSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaGraphExecMemcpyNodeSetParamsToSymbol$descriptor() { + return cudaGraphExecMemcpyNodeSetParamsToSymbol.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsToSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaGraphExecMemcpyNodeSetParamsToSymbol$handle() { + return cudaGraphExecMemcpyNodeSetParamsToSymbol.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsToSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaGraphExecMemcpyNodeSetParamsToSymbol$address() { + return cudaGraphExecMemcpyNodeSetParamsToSymbol.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsToSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static int cudaGraphExecMemcpyNodeSetParamsToSymbol(MemorySegment hGraphExec, MemorySegment node, MemorySegment symbol, MemorySegment src, long count, long offset, int kind) { + var mh$ = cudaGraphExecMemcpyNodeSetParamsToSymbol.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecMemcpyNodeSetParamsToSymbol", hGraphExec, node, symbol, src, count, offset, kind); + } + return (int)mh$.invokeExact(hGraphExec, node, symbol, src, count, offset, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecMemcpyNodeSetParamsFromSymbol { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecMemcpyNodeSetParamsFromSymbol"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsFromSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaGraphExecMemcpyNodeSetParamsFromSymbol$descriptor() { + return cudaGraphExecMemcpyNodeSetParamsFromSymbol.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsFromSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaGraphExecMemcpyNodeSetParamsFromSymbol$handle() { + return cudaGraphExecMemcpyNodeSetParamsFromSymbol.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsFromSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaGraphExecMemcpyNodeSetParamsFromSymbol$address() { + return cudaGraphExecMemcpyNodeSetParamsFromSymbol.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsFromSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static int cudaGraphExecMemcpyNodeSetParamsFromSymbol(MemorySegment hGraphExec, MemorySegment node, MemorySegment dst, MemorySegment symbol, long count, long offset, int kind) { + var mh$ = cudaGraphExecMemcpyNodeSetParamsFromSymbol.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecMemcpyNodeSetParamsFromSymbol", hGraphExec, node, dst, symbol, count, offset, kind); + } + return (int)mh$.invokeExact(hGraphExec, node, dst, symbol, count, offset, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecMemcpyNodeSetParams1D { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecMemcpyNodeSetParams1D"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaGraphExecMemcpyNodeSetParams1D$descriptor() { + return cudaGraphExecMemcpyNodeSetParams1D.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaGraphExecMemcpyNodeSetParams1D$handle() { + return cudaGraphExecMemcpyNodeSetParams1D.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaGraphExecMemcpyNodeSetParams1D$address() { + return cudaGraphExecMemcpyNodeSetParams1D.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static int cudaGraphExecMemcpyNodeSetParams1D(MemorySegment hGraphExec, MemorySegment node, MemorySegment dst, MemorySegment src, long count, int kind) { + var mh$ = cudaGraphExecMemcpyNodeSetParams1D.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecMemcpyNodeSetParams1D", hGraphExec, node, dst, src, count, kind); + } + return (int)mh$.invokeExact(hGraphExec, node, dst, src, count, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecMemsetNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecMemsetNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphExecMemsetNodeSetParams$descriptor() { + return cudaGraphExecMemsetNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphExecMemsetNodeSetParams$handle() { + return cudaGraphExecMemsetNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphExecMemsetNodeSetParams$address() { + return cudaGraphExecMemsetNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) + * } + */ + public static int cudaGraphExecMemsetNodeSetParams(MemorySegment hGraphExec, MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphExecMemsetNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecMemsetNodeSetParams", hGraphExec, node, pNodeParams); + } + return (int)mh$.invokeExact(hGraphExec, node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecHostNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecHostNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static FunctionDescriptor cudaGraphExecHostNodeSetParams$descriptor() { + return cudaGraphExecHostNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static MethodHandle cudaGraphExecHostNodeSetParams$handle() { + return cudaGraphExecHostNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static MemorySegment cudaGraphExecHostNodeSetParams$address() { + return cudaGraphExecHostNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) + * } + */ + public static int cudaGraphExecHostNodeSetParams(MemorySegment hGraphExec, MemorySegment node, MemorySegment pNodeParams) { + var mh$ = cudaGraphExecHostNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecHostNodeSetParams", hGraphExec, node, pNodeParams); + } + return (int)mh$.invokeExact(hGraphExec, node, pNodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecChildGraphNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecChildGraphNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) + * } + */ + public static FunctionDescriptor cudaGraphExecChildGraphNodeSetParams$descriptor() { + return cudaGraphExecChildGraphNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) + * } + */ + public static MethodHandle cudaGraphExecChildGraphNodeSetParams$handle() { + return cudaGraphExecChildGraphNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) + * } + */ + public static MemorySegment cudaGraphExecChildGraphNodeSetParams$address() { + return cudaGraphExecChildGraphNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) + * } + */ + public static int cudaGraphExecChildGraphNodeSetParams(MemorySegment hGraphExec, MemorySegment node, MemorySegment childGraph) { + var mh$ = cudaGraphExecChildGraphNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecChildGraphNodeSetParams", hGraphExec, node, childGraph); + } + return (int)mh$.invokeExact(hGraphExec, node, childGraph); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecEventRecordNodeSetEvent { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecEventRecordNodeSetEvent"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) + * } + */ + public static FunctionDescriptor cudaGraphExecEventRecordNodeSetEvent$descriptor() { + return cudaGraphExecEventRecordNodeSetEvent.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) + * } + */ + public static MethodHandle cudaGraphExecEventRecordNodeSetEvent$handle() { + return cudaGraphExecEventRecordNodeSetEvent.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) + * } + */ + public static MemorySegment cudaGraphExecEventRecordNodeSetEvent$address() { + return cudaGraphExecEventRecordNodeSetEvent.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) + * } + */ + public static int cudaGraphExecEventRecordNodeSetEvent(MemorySegment hGraphExec, MemorySegment hNode, MemorySegment event) { + var mh$ = cudaGraphExecEventRecordNodeSetEvent.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecEventRecordNodeSetEvent", hGraphExec, hNode, event); + } + return (int)mh$.invokeExact(hGraphExec, hNode, event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecEventWaitNodeSetEvent { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecEventWaitNodeSetEvent"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) + * } + */ + public static FunctionDescriptor cudaGraphExecEventWaitNodeSetEvent$descriptor() { + return cudaGraphExecEventWaitNodeSetEvent.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) + * } + */ + public static MethodHandle cudaGraphExecEventWaitNodeSetEvent$handle() { + return cudaGraphExecEventWaitNodeSetEvent.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) + * } + */ + public static MemorySegment cudaGraphExecEventWaitNodeSetEvent$address() { + return cudaGraphExecEventWaitNodeSetEvent.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) + * } + */ + public static int cudaGraphExecEventWaitNodeSetEvent(MemorySegment hGraphExec, MemorySegment hNode, MemorySegment event) { + var mh$ = cudaGraphExecEventWaitNodeSetEvent.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecEventWaitNodeSetEvent", hGraphExec, hNode, event); + } + return (int)mh$.invokeExact(hGraphExec, hNode, event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecExternalSemaphoresSignalNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecExternalSemaphoresSignalNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphExecExternalSemaphoresSignalNodeSetParams$descriptor() { + return cudaGraphExecExternalSemaphoresSignalNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphExecExternalSemaphoresSignalNodeSetParams$handle() { + return cudaGraphExecExternalSemaphoresSignalNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphExecExternalSemaphoresSignalNodeSetParams$address() { + return cudaGraphExecExternalSemaphoresSignalNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) + * } + */ + public static int cudaGraphExecExternalSemaphoresSignalNodeSetParams(MemorySegment hGraphExec, MemorySegment hNode, MemorySegment nodeParams) { + var mh$ = cudaGraphExecExternalSemaphoresSignalNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecExternalSemaphoresSignalNodeSetParams", hGraphExec, hNode, nodeParams); + } + return (int)mh$.invokeExact(hGraphExec, hNode, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecExternalSemaphoresWaitNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecExternalSemaphoresWaitNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphExecExternalSemaphoresWaitNodeSetParams$descriptor() { + return cudaGraphExecExternalSemaphoresWaitNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphExecExternalSemaphoresWaitNodeSetParams$handle() { + return cudaGraphExecExternalSemaphoresWaitNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphExecExternalSemaphoresWaitNodeSetParams$address() { + return cudaGraphExecExternalSemaphoresWaitNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) + * } + */ + public static int cudaGraphExecExternalSemaphoresWaitNodeSetParams(MemorySegment hGraphExec, MemorySegment hNode, MemorySegment nodeParams) { + var mh$ = cudaGraphExecExternalSemaphoresWaitNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecExternalSemaphoresWaitNodeSetParams", hGraphExec, hNode, nodeParams); + } + return (int)mh$.invokeExact(hGraphExec, hNode, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphNodeSetEnabled { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeSetEnabled"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) + * } + */ + public static FunctionDescriptor cudaGraphNodeSetEnabled$descriptor() { + return cudaGraphNodeSetEnabled.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) + * } + */ + public static MethodHandle cudaGraphNodeSetEnabled$handle() { + return cudaGraphNodeSetEnabled.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) + * } + */ + public static MemorySegment cudaGraphNodeSetEnabled$address() { + return cudaGraphNodeSetEnabled.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) + * } + */ + public static int cudaGraphNodeSetEnabled(MemorySegment hGraphExec, MemorySegment hNode, int isEnabled) { + var mh$ = cudaGraphNodeSetEnabled.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphNodeSetEnabled", hGraphExec, hNode, isEnabled); + } + return (int)mh$.invokeExact(hGraphExec, hNode, isEnabled); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphNodeGetEnabled { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetEnabled"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int *isEnabled) + * } + */ + public static FunctionDescriptor cudaGraphNodeGetEnabled$descriptor() { + return cudaGraphNodeGetEnabled.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int *isEnabled) + * } + */ + public static MethodHandle cudaGraphNodeGetEnabled$handle() { + return cudaGraphNodeGetEnabled.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int *isEnabled) + * } + */ + public static MemorySegment cudaGraphNodeGetEnabled$address() { + return cudaGraphNodeGetEnabled.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int *isEnabled) + * } + */ + public static int cudaGraphNodeGetEnabled(MemorySegment hGraphExec, MemorySegment hNode, MemorySegment isEnabled) { + var mh$ = cudaGraphNodeGetEnabled.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphNodeGetEnabled", hGraphExec, hNode, isEnabled); + } + return (int)mh$.invokeExact(hGraphExec, hNode, isEnabled); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecUpdate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecUpdate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo *resultInfo) + * } + */ + public static FunctionDescriptor cudaGraphExecUpdate$descriptor() { + return cudaGraphExecUpdate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo *resultInfo) + * } + */ + public static MethodHandle cudaGraphExecUpdate$handle() { + return cudaGraphExecUpdate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo *resultInfo) + * } + */ + public static MemorySegment cudaGraphExecUpdate$address() { + return cudaGraphExecUpdate.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo *resultInfo) + * } + */ + public static int cudaGraphExecUpdate(MemorySegment hGraphExec, MemorySegment hGraph, MemorySegment resultInfo) { + var mh$ = cudaGraphExecUpdate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecUpdate", hGraphExec, hGraph, resultInfo); + } + return (int)mh$.invokeExact(hGraphExec, hGraph, resultInfo); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphUpload { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphUpload"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaGraphUpload$descriptor() { + return cudaGraphUpload.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) + * } + */ + public static MethodHandle cudaGraphUpload$handle() { + return cudaGraphUpload.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) + * } + */ + public static MemorySegment cudaGraphUpload$address() { + return cudaGraphUpload.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) + * } + */ + public static int cudaGraphUpload(MemorySegment graphExec, MemorySegment stream) { + var mh$ = cudaGraphUpload.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphUpload", graphExec, stream); + } + return (int)mh$.invokeExact(graphExec, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphLaunch { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphLaunch"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaGraphLaunch$descriptor() { + return cudaGraphLaunch.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) + * } + */ + public static MethodHandle cudaGraphLaunch$handle() { + return cudaGraphLaunch.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) + * } + */ + public static MemorySegment cudaGraphLaunch$address() { + return cudaGraphLaunch.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) + * } + */ + public static int cudaGraphLaunch(MemorySegment graphExec, MemorySegment stream) { + var mh$ = cudaGraphLaunch.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphLaunch", graphExec, stream); + } + return (int)mh$.invokeExact(graphExec, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) + * } + */ + public static FunctionDescriptor cudaGraphExecDestroy$descriptor() { + return cudaGraphExecDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) + * } + */ + public static MethodHandle cudaGraphExecDestroy$handle() { + return cudaGraphExecDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) + * } + */ + public static MemorySegment cudaGraphExecDestroy$address() { + return cudaGraphExecDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) + * } + */ + public static int cudaGraphExecDestroy(MemorySegment graphExec) { + var mh$ = cudaGraphExecDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecDestroy", graphExec); + } + return (int)mh$.invokeExact(graphExec); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphDestroy(cudaGraph_t graph) + * } + */ + public static FunctionDescriptor cudaGraphDestroy$descriptor() { + return cudaGraphDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphDestroy(cudaGraph_t graph) + * } + */ + public static MethodHandle cudaGraphDestroy$handle() { + return cudaGraphDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphDestroy(cudaGraph_t graph) + * } + */ + public static MemorySegment cudaGraphDestroy$address() { + return cudaGraphDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphDestroy(cudaGraph_t graph) + * } + */ + public static int cudaGraphDestroy(MemorySegment graph) { + var mh$ = cudaGraphDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphDestroy", graph); + } + return (int)mh$.invokeExact(graph); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphDebugDotPrint { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphDebugDotPrint"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char *path, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaGraphDebugDotPrint$descriptor() { + return cudaGraphDebugDotPrint.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char *path, unsigned int flags) + * } + */ + public static MethodHandle cudaGraphDebugDotPrint$handle() { + return cudaGraphDebugDotPrint.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char *path, unsigned int flags) + * } + */ + public static MemorySegment cudaGraphDebugDotPrint$address() { + return cudaGraphDebugDotPrint.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char *path, unsigned int flags) + * } + */ + public static int cudaGraphDebugDotPrint(MemorySegment graph, MemorySegment path, int flags) { + var mh$ = cudaGraphDebugDotPrint.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphDebugDotPrint", graph, path, flags); + } + return (int)mh$.invokeExact(graph, path, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaUserObjectCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaUserObjectCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectCreate(cudaUserObject_t *object_out, void *ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaUserObjectCreate$descriptor() { + return cudaUserObjectCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectCreate(cudaUserObject_t *object_out, void *ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) + * } + */ + public static MethodHandle cudaUserObjectCreate$handle() { + return cudaUserObjectCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectCreate(cudaUserObject_t *object_out, void *ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) + * } + */ + public static MemorySegment cudaUserObjectCreate$address() { + return cudaUserObjectCreate.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectCreate(cudaUserObject_t *object_out, void *ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) + * } + */ + public static int cudaUserObjectCreate(MemorySegment object_out, MemorySegment ptr, MemorySegment destroy, int initialRefcount, int flags) { + var mh$ = cudaUserObjectCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaUserObjectCreate", object_out, ptr, destroy, initialRefcount, flags); + } + return (int)mh$.invokeExact(object_out, ptr, destroy, initialRefcount, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaUserObjectRetain { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaUserObjectRetain"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) + * } + */ + public static FunctionDescriptor cudaUserObjectRetain$descriptor() { + return cudaUserObjectRetain.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) + * } + */ + public static MethodHandle cudaUserObjectRetain$handle() { + return cudaUserObjectRetain.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) + * } + */ + public static MemorySegment cudaUserObjectRetain$address() { + return cudaUserObjectRetain.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) + * } + */ + public static int cudaUserObjectRetain(MemorySegment object, int count) { + var mh$ = cudaUserObjectRetain.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaUserObjectRetain", object, count); + } + return (int)mh$.invokeExact(object, count); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaUserObjectRelease { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaUserObjectRelease"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) + * } + */ + public static FunctionDescriptor cudaUserObjectRelease$descriptor() { + return cudaUserObjectRelease.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) + * } + */ + public static MethodHandle cudaUserObjectRelease$handle() { + return cudaUserObjectRelease.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) + * } + */ + public static MemorySegment cudaUserObjectRelease$address() { + return cudaUserObjectRelease.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) + * } + */ + public static int cudaUserObjectRelease(MemorySegment object, int count) { + var mh$ = cudaUserObjectRelease.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaUserObjectRelease", object, count); + } + return (int)mh$.invokeExact(object, count); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphRetainUserObject { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphRetainUserObject"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaGraphRetainUserObject$descriptor() { + return cudaGraphRetainUserObject.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) + * } + */ + public static MethodHandle cudaGraphRetainUserObject$handle() { + return cudaGraphRetainUserObject.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) + * } + */ + public static MemorySegment cudaGraphRetainUserObject$address() { + return cudaGraphRetainUserObject.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) + * } + */ + public static int cudaGraphRetainUserObject(MemorySegment graph, MemorySegment object, int count, int flags) { + var mh$ = cudaGraphRetainUserObject.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphRetainUserObject", graph, object, count, flags); + } + return (int)mh$.invokeExact(graph, object, count, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphReleaseUserObject { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphReleaseUserObject"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) + * } + */ + public static FunctionDescriptor cudaGraphReleaseUserObject$descriptor() { + return cudaGraphReleaseUserObject.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) + * } + */ + public static MethodHandle cudaGraphReleaseUserObject$handle() { + return cudaGraphReleaseUserObject.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) + * } + */ + public static MemorySegment cudaGraphReleaseUserObject$address() { + return cudaGraphReleaseUserObject.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) + * } + */ + public static int cudaGraphReleaseUserObject(MemorySegment graph, MemorySegment object, int count) { + var mh$ = cudaGraphReleaseUserObject.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphReleaseUserObject", graph, object, count); + } + return (int)mh$.invokeExact(graph, object, count); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddNode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddNode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphAddNode$descriptor() { + return cudaGraphAddNode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphAddNode$handle() { + return cudaGraphAddNode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphAddNode$address() { + return cudaGraphAddNode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static int cudaGraphAddNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment nodeParams) { + var mh$ = cudaGraphAddNode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddNode", pGraphNode, graph, pDependencies, numDependencies, nodeParams); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphAddNode_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddNode_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphAddNode_v2$descriptor() { + return cudaGraphAddNode_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphAddNode_v2$handle() { + return cudaGraphAddNode_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphAddNode_v2$address() { + return cudaGraphAddNode_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static int cudaGraphAddNode_v2(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, MemorySegment dependencyData, long numDependencies, MemorySegment nodeParams) { + var mh$ = cudaGraphAddNode_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphAddNode_v2", pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams); + } + return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphNodeSetParams$descriptor() { + return cudaGraphNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphNodeSetParams$handle() { + return cudaGraphNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphNodeSetParams$address() { + return cudaGraphNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static int cudaGraphNodeSetParams(MemorySegment node, MemorySegment nodeParams) { + var mh$ = cudaGraphNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphNodeSetParams", node, nodeParams); + } + return (int)mh$.invokeExact(node, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphExecNodeSetParams { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecNodeSetParams"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static FunctionDescriptor cudaGraphExecNodeSetParams$descriptor() { + return cudaGraphExecNodeSetParams.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static MethodHandle cudaGraphExecNodeSetParams$handle() { + return cudaGraphExecNodeSetParams.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static MemorySegment cudaGraphExecNodeSetParams$address() { + return cudaGraphExecNodeSetParams.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) + * } + */ + public static int cudaGraphExecNodeSetParams(MemorySegment graphExec, MemorySegment node, MemorySegment nodeParams) { + var mh$ = cudaGraphExecNodeSetParams.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphExecNodeSetParams", graphExec, node, nodeParams); + } + return (int)mh$.invokeExact(graphExec, node, nodeParams); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGraphConditionalHandleCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphConditionalHandleCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle *pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaGraphConditionalHandleCreate$descriptor() { + return cudaGraphConditionalHandleCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle *pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) + * } + */ + public static MethodHandle cudaGraphConditionalHandleCreate$handle() { + return cudaGraphConditionalHandleCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle *pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) + * } + */ + public static MemorySegment cudaGraphConditionalHandleCreate$address() { + return cudaGraphConditionalHandleCreate.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle *pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) + * } + */ + public static int cudaGraphConditionalHandleCreate(MemorySegment pHandle_out, MemorySegment graph, int defaultLaunchValue, int flags) { + var mh$ = cudaGraphConditionalHandleCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGraphConditionalHandleCreate", pHandle_out, graph, defaultLaunchValue, flags); + } + return (int)mh$.invokeExact(pHandle_out, graph, defaultLaunchValue, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetDriverEntryPoint { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDriverEntryPoint"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDriverEntryPoint(const char *symbol, void **funcPtr, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) + * } + */ + public static FunctionDescriptor cudaGetDriverEntryPoint$descriptor() { + return cudaGetDriverEntryPoint.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDriverEntryPoint(const char *symbol, void **funcPtr, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) + * } + */ + public static MethodHandle cudaGetDriverEntryPoint$handle() { + return cudaGetDriverEntryPoint.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDriverEntryPoint(const char *symbol, void **funcPtr, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) + * } + */ + public static MemorySegment cudaGetDriverEntryPoint$address() { + return cudaGetDriverEntryPoint.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetDriverEntryPoint(const char *symbol, void **funcPtr, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) + * } + */ + public static int cudaGetDriverEntryPoint(MemorySegment symbol, MemorySegment funcPtr, long flags, MemorySegment driverStatus) { + var mh$ = cudaGetDriverEntryPoint.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetDriverEntryPoint", symbol, funcPtr, flags, driverStatus); + } + return (int)mh$.invokeExact(symbol, funcPtr, flags, driverStatus); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetDriverEntryPointByVersion { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDriverEntryPointByVersion"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDriverEntryPointByVersion(const char *symbol, void **funcPtr, unsigned int cudaVersion, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) + * } + */ + public static FunctionDescriptor cudaGetDriverEntryPointByVersion$descriptor() { + return cudaGetDriverEntryPointByVersion.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDriverEntryPointByVersion(const char *symbol, void **funcPtr, unsigned int cudaVersion, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) + * } + */ + public static MethodHandle cudaGetDriverEntryPointByVersion$handle() { + return cudaGetDriverEntryPointByVersion.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDriverEntryPointByVersion(const char *symbol, void **funcPtr, unsigned int cudaVersion, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) + * } + */ + public static MemorySegment cudaGetDriverEntryPointByVersion$address() { + return cudaGetDriverEntryPointByVersion.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetDriverEntryPointByVersion(const char *symbol, void **funcPtr, unsigned int cudaVersion, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) + * } + */ + public static int cudaGetDriverEntryPointByVersion(MemorySegment symbol, MemorySegment funcPtr, int cudaVersion, long flags, MemorySegment driverStatus) { + var mh$ = cudaGetDriverEntryPointByVersion.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetDriverEntryPointByVersion", symbol, funcPtr, cudaVersion, flags, driverStatus); + } + return (int)mh$.invokeExact(symbol, funcPtr, cudaVersion, flags, driverStatus); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetExportTable { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetExportTable"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetExportTable(const void **ppExportTable, const cudaUUID_t *pExportTableId) + * } + */ + public static FunctionDescriptor cudaGetExportTable$descriptor() { + return cudaGetExportTable.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetExportTable(const void **ppExportTable, const cudaUUID_t *pExportTableId) + * } + */ + public static MethodHandle cudaGetExportTable$handle() { + return cudaGetExportTable.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetExportTable(const void **ppExportTable, const cudaUUID_t *pExportTableId) + * } + */ + public static MemorySegment cudaGetExportTable$address() { + return cudaGetExportTable.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetExportTable(const void **ppExportTable, const cudaUUID_t *pExportTableId) + * } + */ + public static int cudaGetExportTable(MemorySegment ppExportTable, MemorySegment pExportTableId) { + var mh$ = cudaGetExportTable.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetExportTable", ppExportTable, pExportTableId); + } + return (int)mh$.invokeExact(ppExportTable, pExportTableId); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetFuncBySymbol { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetFuncBySymbol"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetFuncBySymbol(cudaFunction_t *functionPtr, const void *symbolPtr) + * } + */ + public static FunctionDescriptor cudaGetFuncBySymbol$descriptor() { + return cudaGetFuncBySymbol.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetFuncBySymbol(cudaFunction_t *functionPtr, const void *symbolPtr) + * } + */ + public static MethodHandle cudaGetFuncBySymbol$handle() { + return cudaGetFuncBySymbol.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetFuncBySymbol(cudaFunction_t *functionPtr, const void *symbolPtr) + * } + */ + public static MemorySegment cudaGetFuncBySymbol$address() { + return cudaGetFuncBySymbol.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetFuncBySymbol(cudaFunction_t *functionPtr, const void *symbolPtr) + * } + */ + public static int cudaGetFuncBySymbol(MemorySegment functionPtr, MemorySegment symbolPtr) { + var mh$ = cudaGetFuncBySymbol.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetFuncBySymbol", functionPtr, symbolPtr); + } + return (int)mh$.invokeExact(functionPtr, symbolPtr); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetKernel { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetKernel"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetKernel(cudaKernel_t *kernelPtr, const void *entryFuncAddr) + * } + */ + public static FunctionDescriptor cudaGetKernel$descriptor() { + return cudaGetKernel.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetKernel(cudaKernel_t *kernelPtr, const void *entryFuncAddr) + * } + */ + public static MethodHandle cudaGetKernel$handle() { + return cudaGetKernel.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetKernel(cudaKernel_t *kernelPtr, const void *entryFuncAddr) + * } + */ + public static MemorySegment cudaGetKernel$address() { + return cudaGetKernel.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetKernel(cudaKernel_t *kernelPtr, const void *entryFuncAddr) + * } + */ + public static int cudaGetKernel(MemorySegment kernelPtr, MemorySegment entryFuncAddr) { + var mh$ = cudaGetKernel.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetKernel", kernelPtr, entryFuncAddr); + } + return (int)mh$.invokeExact(kernelPtr, entryFuncAddr); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef unsigned char __u_char + * } + */ + public static final OfByte __u_char = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned short __u_short + * } + */ + public static final OfShort __u_short = PanamaFFMAPI.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned int __u_int + * } + */ + public static final OfInt __u_int = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long __u_long + * } + */ + public static final OfLong __u_long = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef signed char __int8_t + * } + */ + public static final OfByte __int8_t = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned char __uint8_t + * } + */ + public static final OfByte __uint8_t = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef short __int16_t + * } + */ + public static final OfShort __int16_t = PanamaFFMAPI.C_SHORT; + /** + * {@snippet lang=c : + * typedef unsigned short __uint16_t + * } + */ + public static final OfShort __uint16_t = PanamaFFMAPI.C_SHORT; + /** + * {@snippet lang=c : + * typedef int __int32_t + * } + */ + public static final OfInt __int32_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned int __uint32_t + * } + */ + public static final OfInt __uint32_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef long __int64_t + * } + */ + public static final OfLong __int64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __uint64_t + * } + */ + public static final OfLong __uint64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef __int8_t __int_least8_t + * } + */ + public static final OfByte __int_least8_t = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef __uint8_t __uint_least8_t + * } + */ + public static final OfByte __uint_least8_t = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef __int16_t __int_least16_t + * } + */ + public static final OfShort __int_least16_t = PanamaFFMAPI.C_SHORT; + /** + * {@snippet lang=c : + * typedef __uint16_t __uint_least16_t + * } + */ + public static final OfShort __uint_least16_t = PanamaFFMAPI.C_SHORT; + /** + * {@snippet lang=c : + * typedef __int32_t __int_least32_t + * } + */ + public static final OfInt __int_least32_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef __uint32_t __uint_least32_t + * } + */ + public static final OfInt __uint_least32_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef __int64_t __int_least64_t + * } + */ + public static final OfLong __int_least64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef __uint64_t __uint_least64_t + * } + */ + public static final OfLong __uint_least64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long __quad_t + * } + */ + public static final OfLong __quad_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __u_quad_t + * } + */ + public static final OfLong __u_quad_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long __intmax_t + * } + */ + public static final OfLong __intmax_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __uintmax_t + * } + */ + public static final OfLong __uintmax_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __dev_t + * } + */ + public static final OfLong __dev_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned int __uid_t + * } + */ + public static final OfInt __uid_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned int __gid_t + * } + */ + public static final OfInt __gid_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long __ino_t + * } + */ + public static final OfLong __ino_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __ino64_t + * } + */ + public static final OfLong __ino64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned int __mode_t + * } + */ + public static final OfInt __mode_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef unsigned long __nlink_t + * } + */ + public static final OfLong __nlink_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long __off_t + * } + */ + public static final OfLong __off_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long __off64_t + * } + */ + public static final OfLong __off64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef int __pid_t + * } + */ + public static final OfInt __pid_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef long __clock_t + * } + */ + public static final OfLong __clock_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __rlim_t + * } + */ + public static final OfLong __rlim_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __rlim64_t + * } + */ + public static final OfLong __rlim64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned int __id_t + * } + */ + public static final OfInt __id_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef long __time_t + * } + */ + public static final OfLong __time_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned int __useconds_t + * } + */ + public static final OfInt __useconds_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef long __suseconds_t + * } + */ + public static final OfLong __suseconds_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long __suseconds64_t + * } + */ + public static final OfLong __suseconds64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef int __daddr_t + * } + */ + public static final OfInt __daddr_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef int __key_t + * } + */ + public static final OfInt __key_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef int __clockid_t + * } + */ + public static final OfInt __clockid_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef void *__timer_t + * } + */ + public static final AddressLayout __timer_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef long __blksize_t + * } + */ + public static final OfLong __blksize_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long __blkcnt_t + * } + */ + public static final OfLong __blkcnt_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long __blkcnt64_t + * } + */ + public static final OfLong __blkcnt64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __fsblkcnt_t + * } + */ + public static final OfLong __fsblkcnt_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __fsblkcnt64_t + * } + */ + public static final OfLong __fsblkcnt64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __fsfilcnt_t + * } + */ + public static final OfLong __fsfilcnt_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __fsfilcnt64_t + * } + */ + public static final OfLong __fsfilcnt64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long __fsword_t + * } + */ + public static final OfLong __fsword_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long __ssize_t + * } + */ + public static final OfLong __ssize_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long __syscall_slong_t + * } + */ + public static final OfLong __syscall_slong_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long __syscall_ulong_t + * } + */ + public static final OfLong __syscall_ulong_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef __off64_t __loff_t + * } + */ + public static final OfLong __loff_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef char *__caddr_t + * } + */ + public static final AddressLayout __caddr_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef long __intptr_t + * } + */ + public static final OfLong __intptr_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned int __socklen_t + * } + */ + public static final OfInt __socklen_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef int __sig_atomic_t + * } + */ + public static final OfInt __sig_atomic_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef __int8_t int8_t + * } + */ + public static final OfByte int8_t = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef __int16_t int16_t + * } + */ + public static final OfShort int16_t = PanamaFFMAPI.C_SHORT; + /** + * {@snippet lang=c : + * typedef __int32_t int32_t + * } + */ + public static final OfInt int32_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef __int64_t int64_t + * } + */ + public static final OfLong int64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef __uint8_t uint8_t + * } + */ + public static final OfByte uint8_t = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef __uint16_t uint16_t + * } + */ + public static final OfShort uint16_t = PanamaFFMAPI.C_SHORT; + /** + * {@snippet lang=c : + * typedef __uint32_t uint32_t + * } + */ + public static final OfInt uint32_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef __uint64_t uint64_t + * } + */ + public static final OfLong uint64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef __int_least8_t int_least8_t + * } + */ + public static final OfByte int_least8_t = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef __int_least16_t int_least16_t + * } + */ + public static final OfShort int_least16_t = PanamaFFMAPI.C_SHORT; + /** + * {@snippet lang=c : + * typedef __int_least32_t int_least32_t + * } + */ + public static final OfInt int_least32_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef __int_least64_t int_least64_t + * } + */ + public static final OfLong int_least64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef __uint_least8_t uint_least8_t + * } + */ + public static final OfByte uint_least8_t = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef __uint_least16_t uint_least16_t + * } + */ + public static final OfShort uint_least16_t = PanamaFFMAPI.C_SHORT; + /** + * {@snippet lang=c : + * typedef __uint_least32_t uint_least32_t + * } + */ + public static final OfInt uint_least32_t = PanamaFFMAPI.C_INT; + /** + * {@snippet lang=c : + * typedef __uint_least64_t uint_least64_t + * } + */ + public static final OfLong uint_least64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef signed char int_fast8_t + * } + */ + public static final OfByte int_fast8_t = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef long int_fast16_t + * } + */ + public static final OfLong int_fast16_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long int_fast32_t + * } + */ + public static final OfLong int_fast32_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long int_fast64_t + * } + */ + public static final OfLong int_fast64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned char uint_fast8_t + * } + */ + public static final OfByte uint_fast8_t = PanamaFFMAPI.C_CHAR; + /** + * {@snippet lang=c : + * typedef unsigned long uint_fast16_t + * } + */ + public static final OfLong uint_fast16_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long uint_fast32_t + * } + */ + public static final OfLong uint_fast32_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long uint_fast64_t + * } + */ + public static final OfLong uint_fast64_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef long intptr_t + * } + */ + public static final OfLong intptr_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long uintptr_t + * } + */ + public static final OfLong uintptr_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef __intmax_t intmax_t + * } + */ + public static final OfLong intmax_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef __uintmax_t uintmax_t + * } + */ + public static final OfLong uintmax_t = PanamaFFMAPI.C_LONG; + private static final int CUVS_ERROR = (int)0L; + /** + * {@snippet lang=c : + * enum .CUVS_ERROR = 0 + * } + */ + public static int CUVS_ERROR() { + return CUVS_ERROR; + } + private static final int CUVS_SUCCESS = (int)1L; + /** + * {@snippet lang=c : + * enum .CUVS_SUCCESS = 1 + * } + */ + public static int CUVS_SUCCESS() { + return CUVS_SUCCESS; + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * const char *cuvsGetLastErrorText() + * } + */ + public static class cuvsGetLastErrorText { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_POINTER ); + private static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsGetLastErrorText"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private cuvsGetLastErrorText(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * const char *cuvsGetLastErrorText() + * } + */ + public static cuvsGetLastErrorText makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new cuvsGetLastErrorText(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public MemorySegment apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsGetLastErrorText", x0); + } + return (MemorySegment)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class cuvsSetLastErrorText { + public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsSetLastErrorText"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * void cuvsSetLastErrorText(const char *error) + * } + */ + public static FunctionDescriptor cuvsSetLastErrorText$descriptor() { + return cuvsSetLastErrorText.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * void cuvsSetLastErrorText(const char *error) + * } + */ + public static MethodHandle cuvsSetLastErrorText$handle() { + return cuvsSetLastErrorText.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * void cuvsSetLastErrorText(const char *error) + * } + */ + public static MemorySegment cuvsSetLastErrorText$address() { + return cuvsSetLastErrorText.ADDR; + } + + /** + * {@snippet lang=c : + * void cuvsSetLastErrorText(const char *error) + * } + */ + public static void cuvsSetLastErrorText(MemorySegment error) { + var mh$ = cuvsSetLastErrorText.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsSetLastErrorText", error); + } + mh$.invokeExact(error); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef uintptr_t cuvsResources_t + * } + */ + public static final OfLong cuvsResources_t = PanamaFFMAPI.C_LONG; + + private static class cuvsResourcesCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsResourcesCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsResourcesCreate(cuvsResources_t *res) + * } + */ + public static FunctionDescriptor cuvsResourcesCreate$descriptor() { + return cuvsResourcesCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsResourcesCreate(cuvsResources_t *res) + * } + */ + public static MethodHandle cuvsResourcesCreate$handle() { + return cuvsResourcesCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsResourcesCreate(cuvsResources_t *res) + * } + */ + public static MemorySegment cuvsResourcesCreate$address() { + return cuvsResourcesCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsResourcesCreate(cuvsResources_t *res) + * } + */ + public static int cuvsResourcesCreate(MemorySegment res) { + var mh$ = cuvsResourcesCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsResourcesCreate", res); + } + return (int)mh$.invokeExact(res); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsResourcesDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsResourcesDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsResourcesDestroy(cuvsResources_t res) + * } + */ + public static FunctionDescriptor cuvsResourcesDestroy$descriptor() { + return cuvsResourcesDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsResourcesDestroy(cuvsResources_t res) + * } + */ + public static MethodHandle cuvsResourcesDestroy$handle() { + return cuvsResourcesDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsResourcesDestroy(cuvsResources_t res) + * } + */ + public static MemorySegment cuvsResourcesDestroy$address() { + return cuvsResourcesDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsResourcesDestroy(cuvsResources_t res) + * } + */ + public static int cuvsResourcesDestroy(long res) { + var mh$ = cuvsResourcesDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsResourcesDestroy", res); + } + return (int)mh$.invokeExact(res); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsStreamSet { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsStreamSet"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsStreamSet(cuvsResources_t res, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cuvsStreamSet$descriptor() { + return cuvsStreamSet.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsStreamSet(cuvsResources_t res, cudaStream_t stream) + * } + */ + public static MethodHandle cuvsStreamSet$handle() { + return cuvsStreamSet.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsStreamSet(cuvsResources_t res, cudaStream_t stream) + * } + */ + public static MemorySegment cuvsStreamSet$address() { + return cuvsStreamSet.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsStreamSet(cuvsResources_t res, cudaStream_t stream) + * } + */ + public static int cuvsStreamSet(long res, MemorySegment stream) { + var mh$ = cuvsStreamSet.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsStreamSet", res, stream); + } + return (int)mh$.invokeExact(res, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsStreamGet { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsStreamGet"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsStreamGet(cuvsResources_t res, cudaStream_t *stream) + * } + */ + public static FunctionDescriptor cuvsStreamGet$descriptor() { + return cuvsStreamGet.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsStreamGet(cuvsResources_t res, cudaStream_t *stream) + * } + */ + public static MethodHandle cuvsStreamGet$handle() { + return cuvsStreamGet.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsStreamGet(cuvsResources_t res, cudaStream_t *stream) + * } + */ + public static MemorySegment cuvsStreamGet$address() { + return cuvsStreamGet.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsStreamGet(cuvsResources_t res, cudaStream_t *stream) + * } + */ + public static int cuvsStreamGet(long res, MemorySegment stream) { + var mh$ = cuvsStreamGet.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsStreamGet", res, stream); + } + return (int)mh$.invokeExact(res, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsStreamSync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsStreamSync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsStreamSync(cuvsResources_t res) + * } + */ + public static FunctionDescriptor cuvsStreamSync$descriptor() { + return cuvsStreamSync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsStreamSync(cuvsResources_t res) + * } + */ + public static MethodHandle cuvsStreamSync$handle() { + return cuvsStreamSync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsStreamSync(cuvsResources_t res) + * } + */ + public static MemorySegment cuvsStreamSync$address() { + return cuvsStreamSync.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsStreamSync(cuvsResources_t res) + * } + */ + public static int cuvsStreamSync(long res) { + var mh$ = cuvsStreamSync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsStreamSync", res); + } + return (int)mh$.invokeExact(res); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsRMMAlloc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMAlloc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMAlloc(cuvsResources_t res, void **ptr, size_t bytes) + * } + */ + public static FunctionDescriptor cuvsRMMAlloc$descriptor() { + return cuvsRMMAlloc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMAlloc(cuvsResources_t res, void **ptr, size_t bytes) + * } + */ + public static MethodHandle cuvsRMMAlloc$handle() { + return cuvsRMMAlloc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMAlloc(cuvsResources_t res, void **ptr, size_t bytes) + * } + */ + public static MemorySegment cuvsRMMAlloc$address() { + return cuvsRMMAlloc.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsRMMAlloc(cuvsResources_t res, void **ptr, size_t bytes) + * } + */ + public static int cuvsRMMAlloc(long res, MemorySegment ptr, long bytes) { + var mh$ = cuvsRMMAlloc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsRMMAlloc", res, ptr, bytes); + } + return (int)mh$.invokeExact(res, ptr, bytes); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsRMMFree { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMFree"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMFree(cuvsResources_t res, void *ptr, size_t bytes) + * } + */ + public static FunctionDescriptor cuvsRMMFree$descriptor() { + return cuvsRMMFree.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMFree(cuvsResources_t res, void *ptr, size_t bytes) + * } + */ + public static MethodHandle cuvsRMMFree$handle() { + return cuvsRMMFree.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMFree(cuvsResources_t res, void *ptr, size_t bytes) + * } + */ + public static MemorySegment cuvsRMMFree$address() { + return cuvsRMMFree.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsRMMFree(cuvsResources_t res, void *ptr, size_t bytes) + * } + */ + public static int cuvsRMMFree(long res, MemorySegment ptr, long bytes) { + var mh$ = cuvsRMMFree.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsRMMFree", res, ptr, bytes); + } + return (int)mh$.invokeExact(res, ptr, bytes); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsRMMPoolMemoryResourceEnable { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_BOOL + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMPoolMemoryResourceEnable"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMPoolMemoryResourceEnable(int initial_pool_size_percent, int max_pool_size_percent, bool managed) + * } + */ + public static FunctionDescriptor cuvsRMMPoolMemoryResourceEnable$descriptor() { + return cuvsRMMPoolMemoryResourceEnable.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMPoolMemoryResourceEnable(int initial_pool_size_percent, int max_pool_size_percent, bool managed) + * } + */ + public static MethodHandle cuvsRMMPoolMemoryResourceEnable$handle() { + return cuvsRMMPoolMemoryResourceEnable.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMPoolMemoryResourceEnable(int initial_pool_size_percent, int max_pool_size_percent, bool managed) + * } + */ + public static MemorySegment cuvsRMMPoolMemoryResourceEnable$address() { + return cuvsRMMPoolMemoryResourceEnable.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsRMMPoolMemoryResourceEnable(int initial_pool_size_percent, int max_pool_size_percent, bool managed) + * } + */ + public static int cuvsRMMPoolMemoryResourceEnable(int initial_pool_size_percent, int max_pool_size_percent, boolean managed) { + var mh$ = cuvsRMMPoolMemoryResourceEnable.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsRMMPoolMemoryResourceEnable", initial_pool_size_percent, max_pool_size_percent, managed); + } + return (int)mh$.invokeExact(initial_pool_size_percent, max_pool_size_percent, managed); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + /** + * Variadic invoker class for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMMemoryResourceReset() + * } + */ + public static class cuvsRMMMemoryResourceReset { + private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT ); + private static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMMemoryResourceReset"); + + private final MethodHandle handle; + private final FunctionDescriptor descriptor; + private final MethodHandle spreader; + + private cuvsRMMMemoryResourceReset(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { + this.handle = handle; + this.descriptor = descriptor; + this.spreader = spreader; + } + + /** + * Variadic invoker factory for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMMemoryResourceReset() + * } + */ + public static cuvsRMMMemoryResourceReset makeInvoker(MemoryLayout... layouts) { + FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); + Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); + var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); + var spreader$ = mh$.asSpreader(Object[].class, layouts.length); + return new cuvsRMMMemoryResourceReset(mh$, desc$, spreader$); + } + + /** + * {@return the address} + */ + public static MemorySegment address() { + return ADDR; + } + + /** + * {@return the specialized method handle} + */ + public MethodHandle handle() { + return handle; + } + + /** + * {@return the specialized descriptor} + */ + public FunctionDescriptor descriptor() { + return descriptor; + } + + public int apply(Object... x0) { + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsRMMMemoryResourceReset", x0); + } + return (int)spreader.invokeExact(x0); + } catch(IllegalArgumentException | ClassCastException ex$) { + throw ex$; // rethrow IAE from passing wrong number/type of args + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + } + + private static class cuvsRMMHostAlloc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMHostAlloc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMHostAlloc(void **ptr, size_t bytes) + * } + */ + public static FunctionDescriptor cuvsRMMHostAlloc$descriptor() { + return cuvsRMMHostAlloc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMHostAlloc(void **ptr, size_t bytes) + * } + */ + public static MethodHandle cuvsRMMHostAlloc$handle() { + return cuvsRMMHostAlloc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMHostAlloc(void **ptr, size_t bytes) + * } + */ + public static MemorySegment cuvsRMMHostAlloc$address() { + return cuvsRMMHostAlloc.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsRMMHostAlloc(void **ptr, size_t bytes) + * } + */ + public static int cuvsRMMHostAlloc(MemorySegment ptr, long bytes) { + var mh$ = cuvsRMMHostAlloc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsRMMHostAlloc", ptr, bytes); + } + return (int)mh$.invokeExact(ptr, bytes); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsRMMHostFree { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMHostFree"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMHostFree(void *ptr, size_t bytes) + * } + */ + public static FunctionDescriptor cuvsRMMHostFree$descriptor() { + return cuvsRMMHostFree.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMHostFree(void *ptr, size_t bytes) + * } + */ + public static MethodHandle cuvsRMMHostFree$handle() { + return cuvsRMMHostFree.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsRMMHostFree(void *ptr, size_t bytes) + * } + */ + public static MemorySegment cuvsRMMHostFree$address() { + return cuvsRMMHostFree.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsRMMHostFree(void *ptr, size_t bytes) + * } + */ + public static int cuvsRMMHostFree(MemorySegment ptr, long bytes) { + var mh$ = cuvsRMMHostFree.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsRMMHostFree", ptr, bytes); + } + return (int)mh$.invokeExact(ptr, bytes); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static final int L2Expanded = (int)0L; + /** + * {@snippet lang=c : + * enum .L2Expanded = 0 + * } + */ + public static int L2Expanded() { + return L2Expanded; + } + private static final int L2SqrtExpanded = (int)1L; + /** + * {@snippet lang=c : + * enum .L2SqrtExpanded = 1 + * } + */ + public static int L2SqrtExpanded() { + return L2SqrtExpanded; + } + private static final int CosineExpanded = (int)2L; + /** + * {@snippet lang=c : + * enum .CosineExpanded = 2 + * } + */ + public static int CosineExpanded() { + return CosineExpanded; + } + private static final int L1 = (int)3L; + /** + * {@snippet lang=c : + * enum .L1 = 3 + * } + */ + public static int L1() { + return L1; + } + private static final int L2Unexpanded = (int)4L; + /** + * {@snippet lang=c : + * enum .L2Unexpanded = 4 + * } + */ + public static int L2Unexpanded() { + return L2Unexpanded; + } + private static final int L2SqrtUnexpanded = (int)5L; + /** + * {@snippet lang=c : + * enum .L2SqrtUnexpanded = 5 + * } + */ + public static int L2SqrtUnexpanded() { + return L2SqrtUnexpanded; + } + private static final int InnerProduct = (int)6L; + /** + * {@snippet lang=c : + * enum .InnerProduct = 6 + * } + */ + public static int InnerProduct() { + return InnerProduct; + } + private static final int Linf = (int)7L; + /** + * {@snippet lang=c : + * enum .Linf = 7 + * } + */ + public static int Linf() { + return Linf; + } + private static final int Canberra = (int)8L; + /** + * {@snippet lang=c : + * enum .Canberra = 8 + * } + */ + public static int Canberra() { + return Canberra; + } + private static final int LpUnexpanded = (int)9L; + /** + * {@snippet lang=c : + * enum .LpUnexpanded = 9 + * } + */ + public static int LpUnexpanded() { + return LpUnexpanded; + } + private static final int CorrelationExpanded = (int)10L; + /** + * {@snippet lang=c : + * enum .CorrelationExpanded = 10 + * } + */ + public static int CorrelationExpanded() { + return CorrelationExpanded; + } + private static final int JaccardExpanded = (int)11L; + /** + * {@snippet lang=c : + * enum .JaccardExpanded = 11 + * } + */ + public static int JaccardExpanded() { + return JaccardExpanded; + } + private static final int HellingerExpanded = (int)12L; + /** + * {@snippet lang=c : + * enum .HellingerExpanded = 12 + * } + */ + public static int HellingerExpanded() { + return HellingerExpanded; + } + private static final int Haversine = (int)13L; + /** + * {@snippet lang=c : + * enum .Haversine = 13 + * } + */ + public static int Haversine() { + return Haversine; + } + private static final int BrayCurtis = (int)14L; + /** + * {@snippet lang=c : + * enum .BrayCurtis = 14 + * } + */ + public static int BrayCurtis() { + return BrayCurtis; + } + private static final int JensenShannon = (int)15L; + /** + * {@snippet lang=c : + * enum .JensenShannon = 15 + * } + */ + public static int JensenShannon() { + return JensenShannon; + } + private static final int HammingUnexpanded = (int)16L; + /** + * {@snippet lang=c : + * enum .HammingUnexpanded = 16 + * } + */ + public static int HammingUnexpanded() { + return HammingUnexpanded; + } + private static final int KLDivergence = (int)17L; + /** + * {@snippet lang=c : + * enum .KLDivergence = 17 + * } + */ + public static int KLDivergence() { + return KLDivergence; + } + private static final int RusselRaoExpanded = (int)18L; + /** + * {@snippet lang=c : + * enum .RusselRaoExpanded = 18 + * } + */ + public static int RusselRaoExpanded() { + return RusselRaoExpanded; + } + private static final int DiceExpanded = (int)19L; + /** + * {@snippet lang=c : + * enum .DiceExpanded = 19 + * } + */ + public static int DiceExpanded() { + return DiceExpanded; + } + private static final int BitwiseHamming = (int)20L; + /** + * {@snippet lang=c : + * enum .BitwiseHamming = 20 + * } + */ + public static int BitwiseHamming() { + return BitwiseHamming; + } + private static final int Precomputed = (int)100L; + /** + * {@snippet lang=c : + * enum .Precomputed = 100 + * } + */ + public static int Precomputed() { + return Precomputed; + } + private static final int kDLCPU = (int)1L; + /** + * {@snippet lang=c : + * enum .kDLCPU = 1 + * } + */ + public static int kDLCPU() { + return kDLCPU; + } + private static final int kDLCUDA = (int)2L; + /** + * {@snippet lang=c : + * enum .kDLCUDA = 2 + * } + */ + public static int kDLCUDA() { + return kDLCUDA; + } + private static final int kDLCUDAHost = (int)3L; + /** + * {@snippet lang=c : + * enum .kDLCUDAHost = 3 + * } + */ + public static int kDLCUDAHost() { + return kDLCUDAHost; + } + private static final int kDLOpenCL = (int)4L; + /** + * {@snippet lang=c : + * enum .kDLOpenCL = 4 + * } + */ + public static int kDLOpenCL() { + return kDLOpenCL; + } + private static final int kDLVulkan = (int)7L; + /** + * {@snippet lang=c : + * enum .kDLVulkan = 7 + * } + */ + public static int kDLVulkan() { + return kDLVulkan; + } + private static final int kDLMetal = (int)8L; + /** + * {@snippet lang=c : + * enum .kDLMetal = 8 + * } + */ + public static int kDLMetal() { + return kDLMetal; + } + private static final int kDLVPI = (int)9L; + /** + * {@snippet lang=c : + * enum .kDLVPI = 9 + * } + */ + public static int kDLVPI() { + return kDLVPI; + } + private static final int kDLROCM = (int)10L; + /** + * {@snippet lang=c : + * enum .kDLROCM = 10 + * } + */ + public static int kDLROCM() { + return kDLROCM; + } + private static final int kDLROCMHost = (int)11L; + /** + * {@snippet lang=c : + * enum .kDLROCMHost = 11 + * } + */ + public static int kDLROCMHost() { + return kDLROCMHost; + } + private static final int kDLExtDev = (int)12L; + /** + * {@snippet lang=c : + * enum .kDLExtDev = 12 + * } + */ + public static int kDLExtDev() { + return kDLExtDev; + } + private static final int kDLCUDAManaged = (int)13L; + /** + * {@snippet lang=c : + * enum .kDLCUDAManaged = 13 + * } + */ + public static int kDLCUDAManaged() { + return kDLCUDAManaged; + } + private static final int kDLOneAPI = (int)14L; + /** + * {@snippet lang=c : + * enum .kDLOneAPI = 14 + * } + */ + public static int kDLOneAPI() { + return kDLOneAPI; + } + private static final int kDLWebGPU = (int)15L; + /** + * {@snippet lang=c : + * enum .kDLWebGPU = 15 + * } + */ + public static int kDLWebGPU() { + return kDLWebGPU; + } + private static final int kDLHexagon = (int)16L; + /** + * {@snippet lang=c : + * enum .kDLHexagon = 16 + * } + */ + public static int kDLHexagon() { + return kDLHexagon; + } + private static final int kDLInt = (int)0L; + /** + * {@snippet lang=c : + * enum .kDLInt = 0 + * } + */ + public static int kDLInt() { + return kDLInt; + } + private static final int kDLUInt = (int)1L; + /** + * {@snippet lang=c : + * enum .kDLUInt = 1 + * } + */ + public static int kDLUInt() { + return kDLUInt; + } + private static final int kDLFloat = (int)2L; + /** + * {@snippet lang=c : + * enum .kDLFloat = 2 + * } + */ + public static int kDLFloat() { + return kDLFloat; + } + private static final int kDLOpaqueHandle = (int)3L; + /** + * {@snippet lang=c : + * enum .kDLOpaqueHandle = 3 + * } + */ + public static int kDLOpaqueHandle() { + return kDLOpaqueHandle; + } + private static final int kDLBfloat = (int)4L; + /** + * {@snippet lang=c : + * enum .kDLBfloat = 4 + * } + */ + public static int kDLBfloat() { + return kDLBfloat; + } + private static final int kDLComplex = (int)5L; + /** + * {@snippet lang=c : + * enum .kDLComplex = 5 + * } + */ + public static int kDLComplex() { + return kDLComplex; + } + private static final int kDLBool = (int)6L; + /** + * {@snippet lang=c : + * enum .kDLBool = 6 + * } + */ + public static int kDLBool() { + return kDLBool; + } + private static final int NO_FILTER = (int)0L; + /** + * {@snippet lang=c : + * enum cuvsFilterType.NO_FILTER = 0 + * } + */ + public static int NO_FILTER() { + return NO_FILTER; + } + private static final int BITSET = (int)1L; + /** + * {@snippet lang=c : + * enum cuvsFilterType.BITSET = 1 + * } + */ + public static int BITSET() { + return BITSET; + } + private static final int BITMAP = (int)2L; + /** + * {@snippet lang=c : + * enum cuvsFilterType.BITMAP = 2 + * } + */ + public static int BITMAP() { + return BITMAP; + } + private static final int PER_SUBSPACE = (int)0L; + /** + * {@snippet lang=c : + * enum codebook_gen.PER_SUBSPACE = 0 + * } + */ + public static int PER_SUBSPACE() { + return PER_SUBSPACE; + } + private static final int PER_CLUSTER = (int)1L; + /** + * {@snippet lang=c : + * enum codebook_gen.PER_CLUSTER = 1 + * } + */ + public static int PER_CLUSTER() { + return PER_CLUSTER; + } + /** + * {@snippet lang=c : + * typedef struct cuvsIvfPqIndexParams { + * cuvsDistanceType metric; + * float metric_arg; + * bool add_data_on_build; + * uint32_t n_lists; + * uint32_t kmeans_n_iters; + * double kmeans_trainset_fraction; + * uint32_t pq_bits; + * uint32_t pq_dim; + * enum codebook_gen codebook_kind; + * bool force_random_rotation; + * bool conservative_memory_allocation; + * uint32_t max_train_points_per_pq_code; + * } *cuvsIvfPqIndexParams_t + * } + */ + public static final AddressLayout cuvsIvfPqIndexParams_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsIvfPqIndexParamsCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqIndexParamsCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) + * } + */ + public static FunctionDescriptor cuvsIvfPqIndexParamsCreate$descriptor() { + return cuvsIvfPqIndexParamsCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) + * } + */ + public static MethodHandle cuvsIvfPqIndexParamsCreate$handle() { + return cuvsIvfPqIndexParamsCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) + * } + */ + public static MemorySegment cuvsIvfPqIndexParamsCreate$address() { + return cuvsIvfPqIndexParamsCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) + * } + */ + public static int cuvsIvfPqIndexParamsCreate(MemorySegment index_params) { + var mh$ = cuvsIvfPqIndexParamsCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqIndexParamsCreate", index_params); + } + return (int)mh$.invokeExact(index_params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsIvfPqIndexParamsDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqIndexParamsDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) + * } + */ + public static FunctionDescriptor cuvsIvfPqIndexParamsDestroy$descriptor() { + return cuvsIvfPqIndexParamsDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) + * } + */ + public static MethodHandle cuvsIvfPqIndexParamsDestroy$handle() { + return cuvsIvfPqIndexParamsDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) + * } + */ + public static MemorySegment cuvsIvfPqIndexParamsDestroy$address() { + return cuvsIvfPqIndexParamsDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) + * } + */ + public static int cuvsIvfPqIndexParamsDestroy(MemorySegment index_params) { + var mh$ = cuvsIvfPqIndexParamsDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqIndexParamsDestroy", index_params); + } + return (int)mh$.invokeExact(index_params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef struct cuvsIvfPqSearchParams { + * uint32_t n_probes; + * cudaDataType_t lut_dtype; + * cudaDataType_t internal_distance_dtype; + * double preferred_shmem_carveout; + * } *cuvsIvfPqSearchParams_t + * } + */ + public static final AddressLayout cuvsIvfPqSearchParams_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsIvfPqSearchParamsCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqSearchParamsCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) + * } + */ + public static FunctionDescriptor cuvsIvfPqSearchParamsCreate$descriptor() { + return cuvsIvfPqSearchParamsCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) + * } + */ + public static MethodHandle cuvsIvfPqSearchParamsCreate$handle() { + return cuvsIvfPqSearchParamsCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) + * } + */ + public static MemorySegment cuvsIvfPqSearchParamsCreate$address() { + return cuvsIvfPqSearchParamsCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) + * } + */ + public static int cuvsIvfPqSearchParamsCreate(MemorySegment params) { + var mh$ = cuvsIvfPqSearchParamsCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqSearchParamsCreate", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsIvfPqSearchParamsDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqSearchParamsDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) + * } + */ + public static FunctionDescriptor cuvsIvfPqSearchParamsDestroy$descriptor() { + return cuvsIvfPqSearchParamsDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) + * } + */ + public static MethodHandle cuvsIvfPqSearchParamsDestroy$handle() { + return cuvsIvfPqSearchParamsDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) + * } + */ + public static MemorySegment cuvsIvfPqSearchParamsDestroy$address() { + return cuvsIvfPqSearchParamsDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) + * } + */ + public static int cuvsIvfPqSearchParamsDestroy(MemorySegment params) { + var mh$ = cuvsIvfPqSearchParamsDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqSearchParamsDestroy", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef cuvsIvfPqIndex *cuvsIvfPqIndex_t + * } + */ + public static final AddressLayout cuvsIvfPqIndex_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsIvfPqIndexCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqIndexCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) + * } + */ + public static FunctionDescriptor cuvsIvfPqIndexCreate$descriptor() { + return cuvsIvfPqIndexCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) + * } + */ + public static MethodHandle cuvsIvfPqIndexCreate$handle() { + return cuvsIvfPqIndexCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) + * } + */ + public static MemorySegment cuvsIvfPqIndexCreate$address() { + return cuvsIvfPqIndexCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) + * } + */ + public static int cuvsIvfPqIndexCreate(MemorySegment index) { + var mh$ = cuvsIvfPqIndexCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqIndexCreate", index); + } + return (int)mh$.invokeExact(index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsIvfPqIndexDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqIndexDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) + * } + */ + public static FunctionDescriptor cuvsIvfPqIndexDestroy$descriptor() { + return cuvsIvfPqIndexDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) + * } + */ + public static MethodHandle cuvsIvfPqIndexDestroy$handle() { + return cuvsIvfPqIndexDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) + * } + */ + public static MemorySegment cuvsIvfPqIndexDestroy$address() { + return cuvsIvfPqIndexDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) + * } + */ + public static int cuvsIvfPqIndexDestroy(MemorySegment index) { + var mh$ = cuvsIvfPqIndexDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqIndexDestroy", index); + } + return (int)mh$.invokeExact(index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsIvfPqBuild { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqBuild"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) + * } + */ + public static FunctionDescriptor cuvsIvfPqBuild$descriptor() { + return cuvsIvfPqBuild.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) + * } + */ + public static MethodHandle cuvsIvfPqBuild$handle() { + return cuvsIvfPqBuild.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) + * } + */ + public static MemorySegment cuvsIvfPqBuild$address() { + return cuvsIvfPqBuild.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) + * } + */ + public static int cuvsIvfPqBuild(long res, MemorySegment params, MemorySegment dataset, MemorySegment index) { + var mh$ = cuvsIvfPqBuild.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqBuild", res, params, dataset, index); + } + return (int)mh$.invokeExact(res, params, dataset, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsIvfPqSearch { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqSearch"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) + * } + */ + public static FunctionDescriptor cuvsIvfPqSearch$descriptor() { + return cuvsIvfPqSearch.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) + * } + */ + public static MethodHandle cuvsIvfPqSearch$handle() { + return cuvsIvfPqSearch.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) + * } + */ + public static MemorySegment cuvsIvfPqSearch$address() { + return cuvsIvfPqSearch.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) + * } + */ + public static int cuvsIvfPqSearch(long res, MemorySegment search_params, MemorySegment index, MemorySegment queries, MemorySegment neighbors, MemorySegment distances) { + var mh$ = cuvsIvfPqSearch.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqSearch", res, search_params, index, queries, neighbors, distances); + } + return (int)mh$.invokeExact(res, search_params, index, queries, neighbors, distances); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsIvfPqSerialize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqSerialize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) + * } + */ + public static FunctionDescriptor cuvsIvfPqSerialize$descriptor() { + return cuvsIvfPqSerialize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) + * } + */ + public static MethodHandle cuvsIvfPqSerialize$handle() { + return cuvsIvfPqSerialize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) + * } + */ + public static MemorySegment cuvsIvfPqSerialize$address() { + return cuvsIvfPqSerialize.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) + * } + */ + public static int cuvsIvfPqSerialize(long res, MemorySegment filename, MemorySegment index) { + var mh$ = cuvsIvfPqSerialize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqSerialize", res, filename, index); + } + return (int)mh$.invokeExact(res, filename, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsIvfPqDeserialize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqDeserialize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) + * } + */ + public static FunctionDescriptor cuvsIvfPqDeserialize$descriptor() { + return cuvsIvfPqDeserialize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) + * } + */ + public static MethodHandle cuvsIvfPqDeserialize$handle() { + return cuvsIvfPqDeserialize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) + * } + */ + public static MemorySegment cuvsIvfPqDeserialize$address() { + return cuvsIvfPqDeserialize.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) + * } + */ + public static int cuvsIvfPqDeserialize(long res, MemorySegment filename, MemorySegment index) { + var mh$ = cuvsIvfPqDeserialize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqDeserialize", res, filename, index); + } + return (int)mh$.invokeExact(res, filename, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsIvfPqExtend { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqExtend"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) + * } + */ + public static FunctionDescriptor cuvsIvfPqExtend$descriptor() { + return cuvsIvfPqExtend.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) + * } + */ + public static MethodHandle cuvsIvfPqExtend$handle() { + return cuvsIvfPqExtend.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) + * } + */ + public static MemorySegment cuvsIvfPqExtend$address() { + return cuvsIvfPqExtend.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) + * } + */ + public static int cuvsIvfPqExtend(long res, MemorySegment new_vectors, MemorySegment new_indices, MemorySegment index) { + var mh$ = cuvsIvfPqExtend.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsIvfPqExtend", res, new_vectors, new_indices, index); + } + return (int)mh$.invokeExact(res, new_vectors, new_indices, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static final int AUTO_SELECT = (int)0L; + /** + * {@snippet lang=c : + * enum cuvsCagraGraphBuildAlgo.AUTO_SELECT = 0 + * } + */ + public static int AUTO_SELECT() { + return AUTO_SELECT; + } + private static final int IVF_PQ = (int)1L; + /** + * {@snippet lang=c : + * enum cuvsCagraGraphBuildAlgo.IVF_PQ = 1 + * } + */ + public static int IVF_PQ() { + return IVF_PQ; + } + private static final int NN_DESCENT = (int)2L; + /** + * {@snippet lang=c : + * enum cuvsCagraGraphBuildAlgo.NN_DESCENT = 2 + * } + */ + public static int NN_DESCENT() { + return NN_DESCENT; + } + private static final int ITERATIVE_CAGRA_SEARCH = (int)3L; + /** + * {@snippet lang=c : + * enum cuvsCagraGraphBuildAlgo.ITERATIVE_CAGRA_SEARCH = 3 + * } + */ + public static int ITERATIVE_CAGRA_SEARCH() { + return ITERATIVE_CAGRA_SEARCH; + } + /** + * {@snippet lang=c : + * typedef struct cuvsCagraCompressionParams { + * uint32_t pq_bits; + * uint32_t pq_dim; + * uint32_t vq_n_centers; + * uint32_t kmeans_n_iters; + * double vq_kmeans_trainset_fraction; + * double pq_kmeans_trainset_fraction; + * } *cuvsCagraCompressionParams_t + * } + */ + public static final AddressLayout cuvsCagraCompressionParams_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct cuvsIvfPqParams { + * cuvsIvfPqIndexParams_t ivf_pq_build_params; + * cuvsIvfPqSearchParams_t ivf_pq_search_params; + * float refinement_rate; + * } *cuvsIvfPqParams_t + * } + */ + public static final AddressLayout cuvsIvfPqParams_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct cuvsCagraIndexParams { + * cuvsDistanceType metric; + * size_t intermediate_graph_degree; + * size_t graph_degree; + * enum cuvsCagraGraphBuildAlgo build_algo; + * size_t nn_descent_niter; + * cuvsCagraCompressionParams_t compression; + * cuvsIvfPqParams_t graph_build_params; + * } *cuvsCagraIndexParams_t + * } + */ + public static final AddressLayout cuvsCagraIndexParams_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsCagraIndexParamsCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraIndexParamsCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexParamsCreate(cuvsCagraIndexParams_t *params) + * } + */ + public static FunctionDescriptor cuvsCagraIndexParamsCreate$descriptor() { + return cuvsCagraIndexParamsCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexParamsCreate(cuvsCagraIndexParams_t *params) + * } + */ + public static MethodHandle cuvsCagraIndexParamsCreate$handle() { + return cuvsCagraIndexParamsCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexParamsCreate(cuvsCagraIndexParams_t *params) + * } + */ + public static MemorySegment cuvsCagraIndexParamsCreate$address() { + return cuvsCagraIndexParamsCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexParamsCreate(cuvsCagraIndexParams_t *params) + * } + */ + public static int cuvsCagraIndexParamsCreate(MemorySegment params) { + var mh$ = cuvsCagraIndexParamsCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraIndexParamsCreate", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraIndexParamsDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraIndexParamsDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexParamsDestroy(cuvsCagraIndexParams_t params) + * } + */ + public static FunctionDescriptor cuvsCagraIndexParamsDestroy$descriptor() { + return cuvsCagraIndexParamsDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexParamsDestroy(cuvsCagraIndexParams_t params) + * } + */ + public static MethodHandle cuvsCagraIndexParamsDestroy$handle() { + return cuvsCagraIndexParamsDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexParamsDestroy(cuvsCagraIndexParams_t params) + * } + */ + public static MemorySegment cuvsCagraIndexParamsDestroy$address() { + return cuvsCagraIndexParamsDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexParamsDestroy(cuvsCagraIndexParams_t params) + * } + */ + public static int cuvsCagraIndexParamsDestroy(MemorySegment params) { + var mh$ = cuvsCagraIndexParamsDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraIndexParamsDestroy", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraCompressionParamsCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraCompressionParamsCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraCompressionParamsCreate(cuvsCagraCompressionParams_t *params) + * } + */ + public static FunctionDescriptor cuvsCagraCompressionParamsCreate$descriptor() { + return cuvsCagraCompressionParamsCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraCompressionParamsCreate(cuvsCagraCompressionParams_t *params) + * } + */ + public static MethodHandle cuvsCagraCompressionParamsCreate$handle() { + return cuvsCagraCompressionParamsCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraCompressionParamsCreate(cuvsCagraCompressionParams_t *params) + * } + */ + public static MemorySegment cuvsCagraCompressionParamsCreate$address() { + return cuvsCagraCompressionParamsCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraCompressionParamsCreate(cuvsCagraCompressionParams_t *params) + * } + */ + public static int cuvsCagraCompressionParamsCreate(MemorySegment params) { + var mh$ = cuvsCagraCompressionParamsCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraCompressionParamsCreate", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraCompressionParamsDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraCompressionParamsDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraCompressionParamsDestroy(cuvsCagraCompressionParams_t params) + * } + */ + public static FunctionDescriptor cuvsCagraCompressionParamsDestroy$descriptor() { + return cuvsCagraCompressionParamsDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraCompressionParamsDestroy(cuvsCagraCompressionParams_t params) + * } + */ + public static MethodHandle cuvsCagraCompressionParamsDestroy$handle() { + return cuvsCagraCompressionParamsDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraCompressionParamsDestroy(cuvsCagraCompressionParams_t params) + * } + */ + public static MemorySegment cuvsCagraCompressionParamsDestroy$address() { + return cuvsCagraCompressionParamsDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraCompressionParamsDestroy(cuvsCagraCompressionParams_t params) + * } + */ + public static int cuvsCagraCompressionParamsDestroy(MemorySegment params) { + var mh$ = cuvsCagraCompressionParamsDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraCompressionParamsDestroy", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef struct cuvsCagraExtendParams { + * uint32_t max_chunk_size; + * } *cuvsCagraExtendParams_t + * } + */ + public static final AddressLayout cuvsCagraExtendParams_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsCagraExtendParamsCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraExtendParamsCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtendParamsCreate(cuvsCagraExtendParams_t *params) + * } + */ + public static FunctionDescriptor cuvsCagraExtendParamsCreate$descriptor() { + return cuvsCagraExtendParamsCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtendParamsCreate(cuvsCagraExtendParams_t *params) + * } + */ + public static MethodHandle cuvsCagraExtendParamsCreate$handle() { + return cuvsCagraExtendParamsCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtendParamsCreate(cuvsCagraExtendParams_t *params) + * } + */ + public static MemorySegment cuvsCagraExtendParamsCreate$address() { + return cuvsCagraExtendParamsCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtendParamsCreate(cuvsCagraExtendParams_t *params) + * } + */ + public static int cuvsCagraExtendParamsCreate(MemorySegment params) { + var mh$ = cuvsCagraExtendParamsCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraExtendParamsCreate", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraExtendParamsDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraExtendParamsDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtendParamsDestroy(cuvsCagraExtendParams_t params) + * } + */ + public static FunctionDescriptor cuvsCagraExtendParamsDestroy$descriptor() { + return cuvsCagraExtendParamsDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtendParamsDestroy(cuvsCagraExtendParams_t params) + * } + */ + public static MethodHandle cuvsCagraExtendParamsDestroy$handle() { + return cuvsCagraExtendParamsDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtendParamsDestroy(cuvsCagraExtendParams_t params) + * } + */ + public static MemorySegment cuvsCagraExtendParamsDestroy$address() { + return cuvsCagraExtendParamsDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtendParamsDestroy(cuvsCagraExtendParams_t params) + * } + */ + public static int cuvsCagraExtendParamsDestroy(MemorySegment params) { + var mh$ = cuvsCagraExtendParamsDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraExtendParamsDestroy", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static final int SINGLE_CTA = (int)0L; + /** + * {@snippet lang=c : + * enum cuvsCagraSearchAlgo.SINGLE_CTA = 0 + * } + */ + public static int SINGLE_CTA() { + return SINGLE_CTA; + } + private static final int MULTI_CTA = (int)1L; + /** + * {@snippet lang=c : + * enum cuvsCagraSearchAlgo.MULTI_CTA = 1 + * } + */ + public static int MULTI_CTA() { + return MULTI_CTA; + } + private static final int MULTI_KERNEL = (int)2L; + /** + * {@snippet lang=c : + * enum cuvsCagraSearchAlgo.MULTI_KERNEL = 2 + * } + */ + public static int MULTI_KERNEL() { + return MULTI_KERNEL; + } + private static final int AUTO = (int)3L; + /** + * {@snippet lang=c : + * enum cuvsCagraSearchAlgo.AUTO = 3 + * } + */ + public static int AUTO() { + return AUTO; + } + private static final int HASH = (int)0L; + /** + * {@snippet lang=c : + * enum cuvsCagraHashMode.HASH = 0 + * } + */ + public static int HASH() { + return HASH; + } + private static final int SMALL = (int)1L; + /** + * {@snippet lang=c : + * enum cuvsCagraHashMode.SMALL = 1 + * } + */ + public static int SMALL() { + return SMALL; + } + private static final int AUTO_HASH = (int)2L; + /** + * {@snippet lang=c : + * enum cuvsCagraHashMode.AUTO_HASH = 2 + * } + */ + public static int AUTO_HASH() { + return AUTO_HASH; + } + /** + * {@snippet lang=c : + * typedef struct cuvsCagraSearchParams { + * size_t max_queries; + * size_t itopk_size; + * size_t max_iterations; + * enum cuvsCagraSearchAlgo algo; + * size_t team_size; + * size_t search_width; + * size_t min_iterations; + * size_t thread_block_size; + * enum cuvsCagraHashMode hashmap_mode; + * size_t hashmap_min_bitlen; + * float hashmap_max_fill_rate; + * uint32_t num_random_samplings; + * uint64_t rand_xor_mask; + * } *cuvsCagraSearchParams_t + * } + */ + public static final AddressLayout cuvsCagraSearchParams_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsCagraSearchParamsCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraSearchParamsCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearchParamsCreate(cuvsCagraSearchParams_t *params) + * } + */ + public static FunctionDescriptor cuvsCagraSearchParamsCreate$descriptor() { + return cuvsCagraSearchParamsCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearchParamsCreate(cuvsCagraSearchParams_t *params) + * } + */ + public static MethodHandle cuvsCagraSearchParamsCreate$handle() { + return cuvsCagraSearchParamsCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearchParamsCreate(cuvsCagraSearchParams_t *params) + * } + */ + public static MemorySegment cuvsCagraSearchParamsCreate$address() { + return cuvsCagraSearchParamsCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearchParamsCreate(cuvsCagraSearchParams_t *params) + * } + */ + public static int cuvsCagraSearchParamsCreate(MemorySegment params) { + var mh$ = cuvsCagraSearchParamsCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraSearchParamsCreate", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraSearchParamsDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraSearchParamsDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearchParamsDestroy(cuvsCagraSearchParams_t params) + * } + */ + public static FunctionDescriptor cuvsCagraSearchParamsDestroy$descriptor() { + return cuvsCagraSearchParamsDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearchParamsDestroy(cuvsCagraSearchParams_t params) + * } + */ + public static MethodHandle cuvsCagraSearchParamsDestroy$handle() { + return cuvsCagraSearchParamsDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearchParamsDestroy(cuvsCagraSearchParams_t params) + * } + */ + public static MemorySegment cuvsCagraSearchParamsDestroy$address() { + return cuvsCagraSearchParamsDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearchParamsDestroy(cuvsCagraSearchParams_t params) + * } + */ + public static int cuvsCagraSearchParamsDestroy(MemorySegment params) { + var mh$ = cuvsCagraSearchParamsDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraSearchParamsDestroy", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef cuvsCagraIndex *cuvsCagraIndex_t + * } + */ + public static final AddressLayout cuvsCagraIndex_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsCagraIndexCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraIndexCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexCreate(cuvsCagraIndex_t *index) + * } + */ + public static FunctionDescriptor cuvsCagraIndexCreate$descriptor() { + return cuvsCagraIndexCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexCreate(cuvsCagraIndex_t *index) + * } + */ + public static MethodHandle cuvsCagraIndexCreate$handle() { + return cuvsCagraIndexCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexCreate(cuvsCagraIndex_t *index) + * } + */ + public static MemorySegment cuvsCagraIndexCreate$address() { + return cuvsCagraIndexCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexCreate(cuvsCagraIndex_t *index) + * } + */ + public static int cuvsCagraIndexCreate(MemorySegment index) { + var mh$ = cuvsCagraIndexCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraIndexCreate", index); + } + return (int)mh$.invokeExact(index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraIndexDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraIndexDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index) + * } + */ + public static FunctionDescriptor cuvsCagraIndexDestroy$descriptor() { + return cuvsCagraIndexDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index) + * } + */ + public static MethodHandle cuvsCagraIndexDestroy$handle() { + return cuvsCagraIndexDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index) + * } + */ + public static MemorySegment cuvsCagraIndexDestroy$address() { + return cuvsCagraIndexDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index) + * } + */ + public static int cuvsCagraIndexDestroy(MemorySegment index) { + var mh$ = cuvsCagraIndexDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraIndexDestroy", index); + } + return (int)mh$.invokeExact(index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraIndexGetDims { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraIndexGetDims"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int *dim) + * } + */ + public static FunctionDescriptor cuvsCagraIndexGetDims$descriptor() { + return cuvsCagraIndexGetDims.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int *dim) + * } + */ + public static MethodHandle cuvsCagraIndexGetDims$handle() { + return cuvsCagraIndexGetDims.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int *dim) + * } + */ + public static MemorySegment cuvsCagraIndexGetDims$address() { + return cuvsCagraIndexGetDims.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int *dim) + * } + */ + public static int cuvsCagraIndexGetDims(MemorySegment index, MemorySegment dim) { + var mh$ = cuvsCagraIndexGetDims.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraIndexGetDims", index, dim); + } + return (int)mh$.invokeExact(index, dim); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraBuild { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraBuild"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraBuild(cuvsResources_t res, cuvsCagraIndexParams_t params, DLManagedTensor *dataset, cuvsCagraIndex_t index) + * } + */ + public static FunctionDescriptor cuvsCagraBuild$descriptor() { + return cuvsCagraBuild.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraBuild(cuvsResources_t res, cuvsCagraIndexParams_t params, DLManagedTensor *dataset, cuvsCagraIndex_t index) + * } + */ + public static MethodHandle cuvsCagraBuild$handle() { + return cuvsCagraBuild.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraBuild(cuvsResources_t res, cuvsCagraIndexParams_t params, DLManagedTensor *dataset, cuvsCagraIndex_t index) + * } + */ + public static MemorySegment cuvsCagraBuild$address() { + return cuvsCagraBuild.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraBuild(cuvsResources_t res, cuvsCagraIndexParams_t params, DLManagedTensor *dataset, cuvsCagraIndex_t index) + * } + */ + public static int cuvsCagraBuild(long res, MemorySegment params, MemorySegment dataset, MemorySegment index) { + var mh$ = cuvsCagraBuild.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraBuild", res, params, dataset, index); + } + return (int)mh$.invokeExact(res, params, dataset, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraExtend { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraExtend"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtend(cuvsResources_t res, cuvsCagraExtendParams_t params, DLManagedTensor *additional_dataset, cuvsCagraIndex_t index, DLManagedTensor *return_dataset) + * } + */ + public static FunctionDescriptor cuvsCagraExtend$descriptor() { + return cuvsCagraExtend.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtend(cuvsResources_t res, cuvsCagraExtendParams_t params, DLManagedTensor *additional_dataset, cuvsCagraIndex_t index, DLManagedTensor *return_dataset) + * } + */ + public static MethodHandle cuvsCagraExtend$handle() { + return cuvsCagraExtend.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtend(cuvsResources_t res, cuvsCagraExtendParams_t params, DLManagedTensor *additional_dataset, cuvsCagraIndex_t index, DLManagedTensor *return_dataset) + * } + */ + public static MemorySegment cuvsCagraExtend$address() { + return cuvsCagraExtend.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraExtend(cuvsResources_t res, cuvsCagraExtendParams_t params, DLManagedTensor *additional_dataset, cuvsCagraIndex_t index, DLManagedTensor *return_dataset) + * } + */ + public static int cuvsCagraExtend(long res, MemorySegment params, MemorySegment additional_dataset, MemorySegment index, MemorySegment return_dataset) { + var mh$ = cuvsCagraExtend.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraExtend", res, params, additional_dataset, index, return_dataset); + } + return (int)mh$.invokeExact(res, params, additional_dataset, index, return_dataset); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraSearch { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + cuvsFilter.layout() + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraSearch"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearch(cuvsResources_t res, cuvsCagraSearchParams_t params, cuvsCagraIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter filter) + * } + */ + public static FunctionDescriptor cuvsCagraSearch$descriptor() { + return cuvsCagraSearch.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearch(cuvsResources_t res, cuvsCagraSearchParams_t params, cuvsCagraIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter filter) + * } + */ + public static MethodHandle cuvsCagraSearch$handle() { + return cuvsCagraSearch.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearch(cuvsResources_t res, cuvsCagraSearchParams_t params, cuvsCagraIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter filter) + * } + */ + public static MemorySegment cuvsCagraSearch$address() { + return cuvsCagraSearch.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraSearch(cuvsResources_t res, cuvsCagraSearchParams_t params, cuvsCagraIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter filter) + * } + */ + public static int cuvsCagraSearch(long res, MemorySegment params, MemorySegment index, MemorySegment queries, MemorySegment neighbors, MemorySegment distances, MemorySegment filter) { + var mh$ = cuvsCagraSearch.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraSearch", res, params, index, queries, neighbors, distances, filter); + } + return (int)mh$.invokeExact(res, params, index, queries, neighbors, distances, filter); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraSerialize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_BOOL + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraSerialize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSerialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index, bool include_dataset) + * } + */ + public static FunctionDescriptor cuvsCagraSerialize$descriptor() { + return cuvsCagraSerialize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSerialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index, bool include_dataset) + * } + */ + public static MethodHandle cuvsCagraSerialize$handle() { + return cuvsCagraSerialize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSerialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index, bool include_dataset) + * } + */ + public static MemorySegment cuvsCagraSerialize$address() { + return cuvsCagraSerialize.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraSerialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index, bool include_dataset) + * } + */ + public static int cuvsCagraSerialize(long res, MemorySegment filename, MemorySegment index, boolean include_dataset) { + var mh$ = cuvsCagraSerialize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraSerialize", res, filename, index, include_dataset); + } + return (int)mh$.invokeExact(res, filename, index, include_dataset); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraSerializeToHnswlib { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraSerializeToHnswlib"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) + * } + */ + public static FunctionDescriptor cuvsCagraSerializeToHnswlib$descriptor() { + return cuvsCagraSerializeToHnswlib.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) + * } + */ + public static MethodHandle cuvsCagraSerializeToHnswlib$handle() { + return cuvsCagraSerializeToHnswlib.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) + * } + */ + public static MemorySegment cuvsCagraSerializeToHnswlib$address() { + return cuvsCagraSerializeToHnswlib.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) + * } + */ + public static int cuvsCagraSerializeToHnswlib(long res, MemorySegment filename, MemorySegment index) { + var mh$ = cuvsCagraSerializeToHnswlib.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraSerializeToHnswlib", res, filename, index); + } + return (int)mh$.invokeExact(res, filename, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsCagraDeserialize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraDeserialize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraDeserialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) + * } + */ + public static FunctionDescriptor cuvsCagraDeserialize$descriptor() { + return cuvsCagraDeserialize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraDeserialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) + * } + */ + public static MethodHandle cuvsCagraDeserialize$handle() { + return cuvsCagraDeserialize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsCagraDeserialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) + * } + */ + public static MemorySegment cuvsCagraDeserialize$address() { + return cuvsCagraDeserialize.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsCagraDeserialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) + * } + */ + public static int cuvsCagraDeserialize(long res, MemorySegment filename, MemorySegment index) { + var mh$ = cuvsCagraDeserialize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsCagraDeserialize", res, filename, index); + } + return (int)mh$.invokeExact(res, filename, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef cuvsBruteForceIndex *cuvsBruteForceIndex_t + * } + */ + public static final AddressLayout cuvsBruteForceIndex_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsBruteForceIndexCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceIndexCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceIndexCreate(cuvsBruteForceIndex_t *index) + * } + */ + public static FunctionDescriptor cuvsBruteForceIndexCreate$descriptor() { + return cuvsBruteForceIndexCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceIndexCreate(cuvsBruteForceIndex_t *index) + * } + */ + public static MethodHandle cuvsBruteForceIndexCreate$handle() { + return cuvsBruteForceIndexCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceIndexCreate(cuvsBruteForceIndex_t *index) + * } + */ + public static MemorySegment cuvsBruteForceIndexCreate$address() { + return cuvsBruteForceIndexCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceIndexCreate(cuvsBruteForceIndex_t *index) + * } + */ + public static int cuvsBruteForceIndexCreate(MemorySegment index) { + var mh$ = cuvsBruteForceIndexCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsBruteForceIndexCreate", index); + } + return (int)mh$.invokeExact(index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsBruteForceIndexDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceIndexDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceIndexDestroy(cuvsBruteForceIndex_t index) + * } + */ + public static FunctionDescriptor cuvsBruteForceIndexDestroy$descriptor() { + return cuvsBruteForceIndexDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceIndexDestroy(cuvsBruteForceIndex_t index) + * } + */ + public static MethodHandle cuvsBruteForceIndexDestroy$handle() { + return cuvsBruteForceIndexDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceIndexDestroy(cuvsBruteForceIndex_t index) + * } + */ + public static MemorySegment cuvsBruteForceIndexDestroy$address() { + return cuvsBruteForceIndexDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceIndexDestroy(cuvsBruteForceIndex_t index) + * } + */ + public static int cuvsBruteForceIndexDestroy(MemorySegment index) { + var mh$ = cuvsBruteForceIndexDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsBruteForceIndexDestroy", index); + } + return (int)mh$.invokeExact(index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsBruteForceBuild { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_FLOAT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceBuild"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceBuild(cuvsResources_t res, DLManagedTensor *dataset, cuvsDistanceType metric, float metric_arg, cuvsBruteForceIndex_t index) + * } + */ + public static FunctionDescriptor cuvsBruteForceBuild$descriptor() { + return cuvsBruteForceBuild.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceBuild(cuvsResources_t res, DLManagedTensor *dataset, cuvsDistanceType metric, float metric_arg, cuvsBruteForceIndex_t index) + * } + */ + public static MethodHandle cuvsBruteForceBuild$handle() { + return cuvsBruteForceBuild.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceBuild(cuvsResources_t res, DLManagedTensor *dataset, cuvsDistanceType metric, float metric_arg, cuvsBruteForceIndex_t index) + * } + */ + public static MemorySegment cuvsBruteForceBuild$address() { + return cuvsBruteForceBuild.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceBuild(cuvsResources_t res, DLManagedTensor *dataset, cuvsDistanceType metric, float metric_arg, cuvsBruteForceIndex_t index) + * } + */ + public static int cuvsBruteForceBuild(long res, MemorySegment dataset, int metric, float metric_arg, MemorySegment index) { + var mh$ = cuvsBruteForceBuild.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsBruteForceBuild", res, dataset, metric, metric_arg, index); + } + return (int)mh$.invokeExact(res, dataset, metric, metric_arg, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsBruteForceSearch { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + cuvsFilter.layout() + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceSearch"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceSearch(cuvsResources_t res, cuvsBruteForceIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter prefilter) + * } + */ + public static FunctionDescriptor cuvsBruteForceSearch$descriptor() { + return cuvsBruteForceSearch.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceSearch(cuvsResources_t res, cuvsBruteForceIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter prefilter) + * } + */ + public static MethodHandle cuvsBruteForceSearch$handle() { + return cuvsBruteForceSearch.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceSearch(cuvsResources_t res, cuvsBruteForceIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter prefilter) + * } + */ + public static MemorySegment cuvsBruteForceSearch$address() { + return cuvsBruteForceSearch.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceSearch(cuvsResources_t res, cuvsBruteForceIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter prefilter) + * } + */ + public static int cuvsBruteForceSearch(long res, MemorySegment index, MemorySegment queries, MemorySegment neighbors, MemorySegment distances, MemorySegment prefilter) { + var mh$ = cuvsBruteForceSearch.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsBruteForceSearch", res, index, queries, neighbors, distances, prefilter); + } + return (int)mh$.invokeExact(res, index, queries, neighbors, distances, prefilter); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsBruteForceSerialize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceSerialize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceSerialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) + * } + */ + public static FunctionDescriptor cuvsBruteForceSerialize$descriptor() { + return cuvsBruteForceSerialize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceSerialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) + * } + */ + public static MethodHandle cuvsBruteForceSerialize$handle() { + return cuvsBruteForceSerialize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceSerialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) + * } + */ + public static MemorySegment cuvsBruteForceSerialize$address() { + return cuvsBruteForceSerialize.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceSerialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) + * } + */ + public static int cuvsBruteForceSerialize(long res, MemorySegment filename, MemorySegment index) { + var mh$ = cuvsBruteForceSerialize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsBruteForceSerialize", res, filename, index); + } + return (int)mh$.invokeExact(res, filename, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsBruteForceDeserialize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceDeserialize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceDeserialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) + * } + */ + public static FunctionDescriptor cuvsBruteForceDeserialize$descriptor() { + return cuvsBruteForceDeserialize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceDeserialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) + * } + */ + public static MethodHandle cuvsBruteForceDeserialize$handle() { + return cuvsBruteForceDeserialize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceDeserialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) + * } + */ + public static MemorySegment cuvsBruteForceDeserialize$address() { + return cuvsBruteForceDeserialize.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsBruteForceDeserialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) + * } + */ + public static int cuvsBruteForceDeserialize(long res, MemorySegment filename, MemorySegment index) { + var mh$ = cuvsBruteForceDeserialize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsBruteForceDeserialize", res, filename, index); + } + return (int)mh$.invokeExact(res, filename, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static final int NONE = (int)0L; + /** + * {@snippet lang=c : + * enum cuvsHnswHierarchy.NONE = 0 + * } + */ + public static int NONE() { + return NONE; + } + private static final int CPU = (int)1L; + /** + * {@snippet lang=c : + * enum cuvsHnswHierarchy.CPU = 1 + * } + */ + public static int CPU() { + return CPU; + } + private static final int GPU = (int)2L; + /** + * {@snippet lang=c : + * enum cuvsHnswHierarchy.GPU = 2 + * } + */ + public static int GPU() { + return GPU; + } + /** + * {@snippet lang=c : + * typedef struct cuvsHnswIndexParams { + * enum cuvsHnswHierarchy hierarchy; + * int ef_construction; + * int num_threads; + * } *cuvsHnswIndexParams_t + * } + */ + public static final AddressLayout cuvsHnswIndexParams_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsHnswIndexParamsCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswIndexParamsCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexParamsCreate(cuvsHnswIndexParams_t *params) + * } + */ + public static FunctionDescriptor cuvsHnswIndexParamsCreate$descriptor() { + return cuvsHnswIndexParamsCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexParamsCreate(cuvsHnswIndexParams_t *params) + * } + */ + public static MethodHandle cuvsHnswIndexParamsCreate$handle() { + return cuvsHnswIndexParamsCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexParamsCreate(cuvsHnswIndexParams_t *params) + * } + */ + public static MemorySegment cuvsHnswIndexParamsCreate$address() { + return cuvsHnswIndexParamsCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexParamsCreate(cuvsHnswIndexParams_t *params) + * } + */ + public static int cuvsHnswIndexParamsCreate(MemorySegment params) { + var mh$ = cuvsHnswIndexParamsCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswIndexParamsCreate", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsHnswIndexParamsDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswIndexParamsDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexParamsDestroy(cuvsHnswIndexParams_t params) + * } + */ + public static FunctionDescriptor cuvsHnswIndexParamsDestroy$descriptor() { + return cuvsHnswIndexParamsDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexParamsDestroy(cuvsHnswIndexParams_t params) + * } + */ + public static MethodHandle cuvsHnswIndexParamsDestroy$handle() { + return cuvsHnswIndexParamsDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexParamsDestroy(cuvsHnswIndexParams_t params) + * } + */ + public static MemorySegment cuvsHnswIndexParamsDestroy$address() { + return cuvsHnswIndexParamsDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexParamsDestroy(cuvsHnswIndexParams_t params) + * } + */ + public static int cuvsHnswIndexParamsDestroy(MemorySegment params) { + var mh$ = cuvsHnswIndexParamsDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswIndexParamsDestroy", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef cuvsHnswIndex *cuvsHnswIndex_t + * } + */ + public static final AddressLayout cuvsHnswIndex_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsHnswIndexCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswIndexCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexCreate(cuvsHnswIndex_t *index) + * } + */ + public static FunctionDescriptor cuvsHnswIndexCreate$descriptor() { + return cuvsHnswIndexCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexCreate(cuvsHnswIndex_t *index) + * } + */ + public static MethodHandle cuvsHnswIndexCreate$handle() { + return cuvsHnswIndexCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexCreate(cuvsHnswIndex_t *index) + * } + */ + public static MemorySegment cuvsHnswIndexCreate$address() { + return cuvsHnswIndexCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexCreate(cuvsHnswIndex_t *index) + * } + */ + public static int cuvsHnswIndexCreate(MemorySegment index) { + var mh$ = cuvsHnswIndexCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswIndexCreate", index); + } + return (int)mh$.invokeExact(index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsHnswIndexDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswIndexDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexDestroy(cuvsHnswIndex_t index) + * } + */ + public static FunctionDescriptor cuvsHnswIndexDestroy$descriptor() { + return cuvsHnswIndexDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexDestroy(cuvsHnswIndex_t index) + * } + */ + public static MethodHandle cuvsHnswIndexDestroy$handle() { + return cuvsHnswIndexDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexDestroy(cuvsHnswIndex_t index) + * } + */ + public static MemorySegment cuvsHnswIndexDestroy$address() { + return cuvsHnswIndexDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswIndexDestroy(cuvsHnswIndex_t index) + * } + */ + public static int cuvsHnswIndexDestroy(MemorySegment index) { + var mh$ = cuvsHnswIndexDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswIndexDestroy", index); + } + return (int)mh$.invokeExact(index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef struct cuvsHnswExtendParams { + * int num_threads; + * } *cuvsHnswExtendParams_t + * } + */ + public static final AddressLayout cuvsHnswExtendParams_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsHnswExtendParamsCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswExtendParamsCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtendParamsCreate(cuvsHnswExtendParams_t *params) + * } + */ + public static FunctionDescriptor cuvsHnswExtendParamsCreate$descriptor() { + return cuvsHnswExtendParamsCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtendParamsCreate(cuvsHnswExtendParams_t *params) + * } + */ + public static MethodHandle cuvsHnswExtendParamsCreate$handle() { + return cuvsHnswExtendParamsCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtendParamsCreate(cuvsHnswExtendParams_t *params) + * } + */ + public static MemorySegment cuvsHnswExtendParamsCreate$address() { + return cuvsHnswExtendParamsCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtendParamsCreate(cuvsHnswExtendParams_t *params) + * } + */ + public static int cuvsHnswExtendParamsCreate(MemorySegment params) { + var mh$ = cuvsHnswExtendParamsCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswExtendParamsCreate", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsHnswExtendParamsDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswExtendParamsDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtendParamsDestroy(cuvsHnswExtendParams_t params) + * } + */ + public static FunctionDescriptor cuvsHnswExtendParamsDestroy$descriptor() { + return cuvsHnswExtendParamsDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtendParamsDestroy(cuvsHnswExtendParams_t params) + * } + */ + public static MethodHandle cuvsHnswExtendParamsDestroy$handle() { + return cuvsHnswExtendParamsDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtendParamsDestroy(cuvsHnswExtendParams_t params) + * } + */ + public static MemorySegment cuvsHnswExtendParamsDestroy$address() { + return cuvsHnswExtendParamsDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtendParamsDestroy(cuvsHnswExtendParams_t params) + * } + */ + public static int cuvsHnswExtendParamsDestroy(MemorySegment params) { + var mh$ = cuvsHnswExtendParamsDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswExtendParamsDestroy", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsHnswFromCagra { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswFromCagra"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswFromCagra(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index) + * } + */ + public static FunctionDescriptor cuvsHnswFromCagra$descriptor() { + return cuvsHnswFromCagra.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswFromCagra(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index) + * } + */ + public static MethodHandle cuvsHnswFromCagra$handle() { + return cuvsHnswFromCagra.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswFromCagra(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index) + * } + */ + public static MemorySegment cuvsHnswFromCagra$address() { + return cuvsHnswFromCagra.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswFromCagra(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index) + * } + */ + public static int cuvsHnswFromCagra(long res, MemorySegment params, MemorySegment cagra_index, MemorySegment hnsw_index) { + var mh$ = cuvsHnswFromCagra.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswFromCagra", res, params, cagra_index, hnsw_index); + } + return (int)mh$.invokeExact(res, params, cagra_index, hnsw_index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsHnswFromCagraWithDataset { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswFromCagraWithDataset"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswFromCagraWithDataset(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index, DLManagedTensor *dataset_tensor) + * } + */ + public static FunctionDescriptor cuvsHnswFromCagraWithDataset$descriptor() { + return cuvsHnswFromCagraWithDataset.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswFromCagraWithDataset(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index, DLManagedTensor *dataset_tensor) + * } + */ + public static MethodHandle cuvsHnswFromCagraWithDataset$handle() { + return cuvsHnswFromCagraWithDataset.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswFromCagraWithDataset(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index, DLManagedTensor *dataset_tensor) + * } + */ + public static MemorySegment cuvsHnswFromCagraWithDataset$address() { + return cuvsHnswFromCagraWithDataset.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswFromCagraWithDataset(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index, DLManagedTensor *dataset_tensor) + * } + */ + public static int cuvsHnswFromCagraWithDataset(long res, MemorySegment params, MemorySegment cagra_index, MemorySegment hnsw_index, MemorySegment dataset_tensor) { + var mh$ = cuvsHnswFromCagraWithDataset.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswFromCagraWithDataset", res, params, cagra_index, hnsw_index, dataset_tensor); + } + return (int)mh$.invokeExact(res, params, cagra_index, hnsw_index, dataset_tensor); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsHnswExtend { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswExtend"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtend(cuvsResources_t res, cuvsHnswExtendParams_t params, DLManagedTensor *additional_dataset, cuvsHnswIndex_t index) + * } + */ + public static FunctionDescriptor cuvsHnswExtend$descriptor() { + return cuvsHnswExtend.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtend(cuvsResources_t res, cuvsHnswExtendParams_t params, DLManagedTensor *additional_dataset, cuvsHnswIndex_t index) + * } + */ + public static MethodHandle cuvsHnswExtend$handle() { + return cuvsHnswExtend.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtend(cuvsResources_t res, cuvsHnswExtendParams_t params, DLManagedTensor *additional_dataset, cuvsHnswIndex_t index) + * } + */ + public static MemorySegment cuvsHnswExtend$address() { + return cuvsHnswExtend.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswExtend(cuvsResources_t res, cuvsHnswExtendParams_t params, DLManagedTensor *additional_dataset, cuvsHnswIndex_t index) + * } + */ + public static int cuvsHnswExtend(long res, MemorySegment params, MemorySegment additional_dataset, MemorySegment index) { + var mh$ = cuvsHnswExtend.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswExtend", res, params, additional_dataset, index); + } + return (int)mh$.invokeExact(res, params, additional_dataset, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet lang=c : + * typedef struct cuvsHnswSearchParams { + * int32_t ef; + * int32_t num_threads; + * } *cuvsHnswSearchParams_t + * } + */ + public static final AddressLayout cuvsHnswSearchParams_t = PanamaFFMAPI.C_POINTER; + + private static class cuvsHnswSearchParamsCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswSearchParamsCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearchParamsCreate(cuvsHnswSearchParams_t *params) + * } + */ + public static FunctionDescriptor cuvsHnswSearchParamsCreate$descriptor() { + return cuvsHnswSearchParamsCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearchParamsCreate(cuvsHnswSearchParams_t *params) + * } + */ + public static MethodHandle cuvsHnswSearchParamsCreate$handle() { + return cuvsHnswSearchParamsCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearchParamsCreate(cuvsHnswSearchParams_t *params) + * } + */ + public static MemorySegment cuvsHnswSearchParamsCreate$address() { + return cuvsHnswSearchParamsCreate.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearchParamsCreate(cuvsHnswSearchParams_t *params) + * } + */ + public static int cuvsHnswSearchParamsCreate(MemorySegment params) { + var mh$ = cuvsHnswSearchParamsCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswSearchParamsCreate", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsHnswSearchParamsDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswSearchParamsDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearchParamsDestroy(cuvsHnswSearchParams_t params) + * } + */ + public static FunctionDescriptor cuvsHnswSearchParamsDestroy$descriptor() { + return cuvsHnswSearchParamsDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearchParamsDestroy(cuvsHnswSearchParams_t params) + * } + */ + public static MethodHandle cuvsHnswSearchParamsDestroy$handle() { + return cuvsHnswSearchParamsDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearchParamsDestroy(cuvsHnswSearchParams_t params) + * } + */ + public static MemorySegment cuvsHnswSearchParamsDestroy$address() { + return cuvsHnswSearchParamsDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearchParamsDestroy(cuvsHnswSearchParams_t params) + * } + */ + public static int cuvsHnswSearchParamsDestroy(MemorySegment params) { + var mh$ = cuvsHnswSearchParamsDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswSearchParamsDestroy", params); + } + return (int)mh$.invokeExact(params); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsHnswSearch { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswSearch"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearch(cuvsResources_t res, cuvsHnswSearchParams_t params, cuvsHnswIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) + * } + */ + public static FunctionDescriptor cuvsHnswSearch$descriptor() { + return cuvsHnswSearch.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearch(cuvsResources_t res, cuvsHnswSearchParams_t params, cuvsHnswIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) + * } + */ + public static MethodHandle cuvsHnswSearch$handle() { + return cuvsHnswSearch.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearch(cuvsResources_t res, cuvsHnswSearchParams_t params, cuvsHnswIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) + * } + */ + public static MemorySegment cuvsHnswSearch$address() { + return cuvsHnswSearch.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswSearch(cuvsResources_t res, cuvsHnswSearchParams_t params, cuvsHnswIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) + * } + */ + public static int cuvsHnswSearch(long res, MemorySegment params, MemorySegment index, MemorySegment queries, MemorySegment neighbors, MemorySegment distances) { + var mh$ = cuvsHnswSearch.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswSearch", res, params, index, queries, neighbors, distances); + } + return (int)mh$.invokeExact(res, params, index, queries, neighbors, distances); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsHnswSerialize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswSerialize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSerialize(cuvsResources_t res, const char *filename, cuvsHnswIndex_t index) + * } + */ + public static FunctionDescriptor cuvsHnswSerialize$descriptor() { + return cuvsHnswSerialize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSerialize(cuvsResources_t res, const char *filename, cuvsHnswIndex_t index) + * } + */ + public static MethodHandle cuvsHnswSerialize$handle() { + return cuvsHnswSerialize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswSerialize(cuvsResources_t res, const char *filename, cuvsHnswIndex_t index) + * } + */ + public static MemorySegment cuvsHnswSerialize$address() { + return cuvsHnswSerialize.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswSerialize(cuvsResources_t res, const char *filename, cuvsHnswIndex_t index) + * } + */ + public static int cuvsHnswSerialize(long res, MemorySegment filename, MemorySegment index) { + var mh$ = cuvsHnswSerialize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswSerialize", res, filename, index); + } + return (int)mh$.invokeExact(res, filename, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cuvsHnswDeserialize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswDeserialize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswDeserialize(cuvsResources_t res, cuvsHnswIndexParams_t params, const char *filename, int dim, cuvsDistanceType metric, cuvsHnswIndex_t index) + * } + */ + public static FunctionDescriptor cuvsHnswDeserialize$descriptor() { + return cuvsHnswDeserialize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswDeserialize(cuvsResources_t res, cuvsHnswIndexParams_t params, const char *filename, int dim, cuvsDistanceType metric, cuvsHnswIndex_t index) + * } + */ + public static MethodHandle cuvsHnswDeserialize$handle() { + return cuvsHnswDeserialize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * cuvsError_t cuvsHnswDeserialize(cuvsResources_t res, cuvsHnswIndexParams_t params, const char *filename, int dim, cuvsDistanceType metric, cuvsHnswIndex_t index) + * } + */ + public static MemorySegment cuvsHnswDeserialize$address() { + return cuvsHnswDeserialize.ADDR; + } + + /** + * {@snippet lang=c : + * cuvsError_t cuvsHnswDeserialize(cuvsResources_t res, cuvsHnswIndexParams_t params, const char *filename, int dim, cuvsDistanceType metric, cuvsHnswIndex_t index) + * } + */ + public static int cuvsHnswDeserialize(long res, MemorySegment params, MemorySegment filename, int dim, int metric, MemorySegment index) { + var mh$ = cuvsHnswDeserialize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cuvsHnswDeserialize", res, params, filename, dim, metric, index); + } + return (int)mh$.invokeExact(res, params, filename, dim, metric, index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + private static final long _POSIX_C_SOURCE = 200809L; + /** + * {@snippet lang=c : + * #define _POSIX_C_SOURCE 200809 + * } + */ + public static long _POSIX_C_SOURCE() { + return _POSIX_C_SOURCE; + } + private static final int __TIMESIZE = (int)64L; + /** + * {@snippet lang=c : + * #define __TIMESIZE 64 + * } + */ + public static int __TIMESIZE() { + return __TIMESIZE; + } + private static final long __STDC_IEC_60559_BFP__ = 201404L; + /** + * {@snippet lang=c : + * #define __STDC_IEC_60559_BFP__ 201404 + * } + */ + public static long __STDC_IEC_60559_BFP__() { + return __STDC_IEC_60559_BFP__; + } + private static final long __STDC_IEC_60559_COMPLEX__ = 201404L; + /** + * {@snippet lang=c : + * #define __STDC_IEC_60559_COMPLEX__ 201404 + * } + */ + public static long __STDC_IEC_60559_COMPLEX__() { + return __STDC_IEC_60559_COMPLEX__; + } + private static final long __STDC_ISO_10646__ = 201706L; + /** + * {@snippet lang=c : + * #define __STDC_ISO_10646__ 201706 + * } + */ + public static long __STDC_ISO_10646__() { + return __STDC_ISO_10646__; + } + private static final long LLONG_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define LLONG_MIN -9223372036854775808 + * } + */ + public static long LLONG_MIN() { + return LLONG_MIN; + } + private static final long LLONG_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define LLONG_MAX 9223372036854775807 + * } + */ + public static long LLONG_MAX() { + return LLONG_MAX; + } + private static final long ULLONG_MAX = -1L; + /** + * {@snippet lang=c : + * #define ULLONG_MAX -1 + * } + */ + public static long ULLONG_MAX() { + return ULLONG_MAX; + } + private static final int PTHREAD_DESTRUCTOR_ITERATIONS = (int)4L; + /** + * {@snippet lang=c : + * #define PTHREAD_DESTRUCTOR_ITERATIONS 4 + * } + */ + public static int PTHREAD_DESTRUCTOR_ITERATIONS() { + return PTHREAD_DESTRUCTOR_ITERATIONS; + } + private static final int SEM_VALUE_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define SEM_VALUE_MAX 2147483647 + * } + */ + public static int SEM_VALUE_MAX() { + return SEM_VALUE_MAX; + } + private static final long SSIZE_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define SSIZE_MAX 9223372036854775807 + * } + */ + public static long SSIZE_MAX() { + return SSIZE_MAX; + } + private static final int BC_BASE_MAX = (int)99L; + /** + * {@snippet lang=c : + * #define BC_BASE_MAX 99 + * } + */ + public static int BC_BASE_MAX() { + return BC_BASE_MAX; + } + private static final int BC_DIM_MAX = (int)2048L; + /** + * {@snippet lang=c : + * #define BC_DIM_MAX 2048 + * } + */ + public static int BC_DIM_MAX() { + return BC_DIM_MAX; + } + private static final int BC_SCALE_MAX = (int)99L; + /** + * {@snippet lang=c : + * #define BC_SCALE_MAX 99 + * } + */ + public static int BC_SCALE_MAX() { + return BC_SCALE_MAX; + } + private static final int BC_STRING_MAX = (int)1000L; + /** + * {@snippet lang=c : + * #define BC_STRING_MAX 1000 + * } + */ + public static int BC_STRING_MAX() { + return BC_STRING_MAX; + } + private static final int EXPR_NEST_MAX = (int)32L; + /** + * {@snippet lang=c : + * #define EXPR_NEST_MAX 32 + * } + */ + public static int EXPR_NEST_MAX() { + return EXPR_NEST_MAX; + } + private static final int LINE_MAX = (int)2048L; + /** + * {@snippet lang=c : + * #define LINE_MAX 2048 + * } + */ + public static int LINE_MAX() { + return LINE_MAX; + } + private static final int RE_DUP_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define RE_DUP_MAX 32767 + * } + */ + public static int RE_DUP_MAX() { + return RE_DUP_MAX; + } + private static final int SCHAR_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define SCHAR_MAX 127 + * } + */ + public static int SCHAR_MAX() { + return SCHAR_MAX; + } + private static final int SHRT_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define SHRT_MAX 32767 + * } + */ + public static int SHRT_MAX() { + return SHRT_MAX; + } + private static final int INT_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT_MAX 2147483647 + * } + */ + public static int INT_MAX() { + return INT_MAX; + } + private static final long LONG_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define LONG_MAX 9223372036854775807 + * } + */ + public static long LONG_MAX() { + return LONG_MAX; + } + private static final int SCHAR_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define SCHAR_MIN -128 + * } + */ + public static int SCHAR_MIN() { + return SCHAR_MIN; + } + private static final int SHRT_MIN = (int)-32768L; + /** + * {@snippet lang=c : + * #define SHRT_MIN -32768 + * } + */ + public static int SHRT_MIN() { + return SHRT_MIN; + } + private static final int INT_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define INT_MIN -2147483648 + * } + */ + public static int INT_MIN() { + return INT_MIN; + } + private static final long LONG_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define LONG_MIN -9223372036854775808 + * } + */ + public static long LONG_MIN() { + return LONG_MIN; + } + private static final int UCHAR_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UCHAR_MAX 255 + * } + */ + public static int UCHAR_MAX() { + return UCHAR_MAX; + } + private static final int USHRT_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define USHRT_MAX 65535 + * } + */ + public static int USHRT_MAX() { + return USHRT_MAX; + } + private static final int UINT_MAX = (int)4294967295L; + /** + * {@snippet lang=c : + * #define UINT_MAX 4294967295 + * } + */ + public static int UINT_MAX() { + return UINT_MAX; + } + private static final long ULONG_MAX = -1L; + /** + * {@snippet lang=c : + * #define ULONG_MAX -1 + * } + */ + public static long ULONG_MAX() { + return ULONG_MAX; + } + private static final int CHAR_BIT = (int)8L; + /** + * {@snippet lang=c : + * #define CHAR_BIT 8 + * } + */ + public static int CHAR_BIT() { + return CHAR_BIT; + } + private static final int CHAR_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define CHAR_MIN -128 + * } + */ + public static int CHAR_MIN() { + return CHAR_MIN; + } + private static final int CHAR_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define CHAR_MAX 127 + * } + */ + public static int CHAR_MAX() { + return CHAR_MAX; + } + private static final MemorySegment NULL = MemorySegment.ofAddress(0L); + /** + * {@snippet lang=c : + * #define NULL (void*) 0 + * } + */ + public static MemorySegment NULL() { + return NULL; + } + private static final MemorySegment cudaStreamLegacy = MemorySegment.ofAddress(1L); + /** + * {@snippet lang=c : + * #define cudaStreamLegacy (void*) 1 + * } + */ + public static MemorySegment cudaStreamLegacy() { + return cudaStreamLegacy; + } + private static final MemorySegment cudaStreamPerThread = MemorySegment.ofAddress(2L); + /** + * {@snippet lang=c : + * #define cudaStreamPerThread (void*) 2 + * } + */ + public static MemorySegment cudaStreamPerThread() { + return cudaStreamPerThread; + } + private static final int cudaCpuDeviceId = (int)-1L; + /** + * {@snippet lang=c : + * #define cudaCpuDeviceId -1 + * } + */ + public static int cudaCpuDeviceId() { + return cudaCpuDeviceId; + } + private static final int cudaInvalidDeviceId = (int)-2L; + /** + * {@snippet lang=c : + * #define cudaInvalidDeviceId -2 + * } + */ + public static int cudaInvalidDeviceId() { + return cudaInvalidDeviceId; + } + private static final int cudaStreamAttributeAccessPolicyWindow = (int)1L; + /** + * {@snippet lang=c : + * #define cudaStreamAttributeAccessPolicyWindow 1 + * } + */ + public static int cudaStreamAttributeAccessPolicyWindow() { + return cudaStreamAttributeAccessPolicyWindow; + } + private static final int cudaStreamAttributeSynchronizationPolicy = (int)3L; + /** + * {@snippet lang=c : + * #define cudaStreamAttributeSynchronizationPolicy 3 + * } + */ + public static int cudaStreamAttributeSynchronizationPolicy() { + return cudaStreamAttributeSynchronizationPolicy; + } + private static final int cudaStreamAttributeMemSyncDomainMap = (int)9L; + /** + * {@snippet lang=c : + * #define cudaStreamAttributeMemSyncDomainMap 9 + * } + */ + public static int cudaStreamAttributeMemSyncDomainMap() { + return cudaStreamAttributeMemSyncDomainMap; + } + private static final int cudaStreamAttributeMemSyncDomain = (int)10L; + /** + * {@snippet lang=c : + * #define cudaStreamAttributeMemSyncDomain 10 + * } + */ + public static int cudaStreamAttributeMemSyncDomain() { + return cudaStreamAttributeMemSyncDomain; + } + private static final int cudaStreamAttributePriority = (int)8L; + /** + * {@snippet lang=c : + * #define cudaStreamAttributePriority 8 + * } + */ + public static int cudaStreamAttributePriority() { + return cudaStreamAttributePriority; + } + private static final int cudaKernelNodeAttributeAccessPolicyWindow = (int)1L; + /** + * {@snippet lang=c : + * #define cudaKernelNodeAttributeAccessPolicyWindow 1 + * } + */ + public static int cudaKernelNodeAttributeAccessPolicyWindow() { + return cudaKernelNodeAttributeAccessPolicyWindow; + } + private static final int cudaKernelNodeAttributeCooperative = (int)2L; + /** + * {@snippet lang=c : + * #define cudaKernelNodeAttributeCooperative 2 + * } + */ + public static int cudaKernelNodeAttributeCooperative() { + return cudaKernelNodeAttributeCooperative; + } + private static final int cudaKernelNodeAttributePriority = (int)8L; + /** + * {@snippet lang=c : + * #define cudaKernelNodeAttributePriority 8 + * } + */ + public static int cudaKernelNodeAttributePriority() { + return cudaKernelNodeAttributePriority; + } + private static final int cudaKernelNodeAttributeClusterDimension = (int)4L; + /** + * {@snippet lang=c : + * #define cudaKernelNodeAttributeClusterDimension 4 + * } + */ + public static int cudaKernelNodeAttributeClusterDimension() { + return cudaKernelNodeAttributeClusterDimension; + } + private static final int cudaKernelNodeAttributeClusterSchedulingPolicyPreference = (int)5L; + /** + * {@snippet lang=c : + * #define cudaKernelNodeAttributeClusterSchedulingPolicyPreference 5 + * } + */ + public static int cudaKernelNodeAttributeClusterSchedulingPolicyPreference() { + return cudaKernelNodeAttributeClusterSchedulingPolicyPreference; + } + private static final int cudaKernelNodeAttributeMemSyncDomainMap = (int)9L; + /** + * {@snippet lang=c : + * #define cudaKernelNodeAttributeMemSyncDomainMap 9 + * } + */ + public static int cudaKernelNodeAttributeMemSyncDomainMap() { + return cudaKernelNodeAttributeMemSyncDomainMap; + } + private static final int cudaKernelNodeAttributeMemSyncDomain = (int)10L; + /** + * {@snippet lang=c : + * #define cudaKernelNodeAttributeMemSyncDomain 10 + * } + */ + public static int cudaKernelNodeAttributeMemSyncDomain() { + return cudaKernelNodeAttributeMemSyncDomain; + } + private static final int cudaKernelNodeAttributePreferredSharedMemoryCarveout = (int)14L; + /** + * {@snippet lang=c : + * #define cudaKernelNodeAttributePreferredSharedMemoryCarveout 14 + * } + */ + public static int cudaKernelNodeAttributePreferredSharedMemoryCarveout() { + return cudaKernelNodeAttributePreferredSharedMemoryCarveout; + } + private static final int cudaKernelNodeAttributeDeviceUpdatableKernelNode = (int)13L; + /** + * {@snippet lang=c : + * #define cudaKernelNodeAttributeDeviceUpdatableKernelNode 13 + * } + */ + public static int cudaKernelNodeAttributeDeviceUpdatableKernelNode() { + return cudaKernelNodeAttributeDeviceUpdatableKernelNode; + } + private static final int __CUDART_API_VERSION = (int)12060L; + /** + * {@snippet lang=c : + * #define __CUDART_API_VERSION 12060 + * } + */ + public static int __CUDART_API_VERSION() { + return __CUDART_API_VERSION; + } + private static final int __WCHAR_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define __WCHAR_MAX 2147483647 + * } + */ + public static int __WCHAR_MAX() { + return __WCHAR_MAX; + } + private static final int __WCHAR_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define __WCHAR_MIN -2147483648 + * } + */ + public static int __WCHAR_MIN() { + return __WCHAR_MIN; + } + private static final int INT8_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define INT8_MIN -128 + * } + */ + public static int INT8_MIN() { + return INT8_MIN; + } + private static final int INT16_MIN = (int)-32768L; + /** + * {@snippet lang=c : + * #define INT16_MIN -32768 + * } + */ + public static int INT16_MIN() { + return INT16_MIN; + } + private static final int INT32_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define INT32_MIN -2147483648 + * } + */ + public static int INT32_MIN() { + return INT32_MIN; + } + private static final long INT64_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT64_MIN -9223372036854775808 + * } + */ + public static long INT64_MIN() { + return INT64_MIN; + } + private static final int INT8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT8_MAX 127 + * } + */ + public static int INT8_MAX() { + return INT8_MAX; + } + private static final int INT16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT16_MAX 32767 + * } + */ + public static int INT16_MAX() { + return INT16_MAX; + } + private static final int INT32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT32_MAX 2147483647 + * } + */ + public static int INT32_MAX() { + return INT32_MAX; + } + private static final long INT64_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT64_MAX 9223372036854775807 + * } + */ + public static long INT64_MAX() { + return INT64_MAX; + } + private static final int UINT8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT8_MAX 255 + * } + */ + public static int UINT8_MAX() { + return UINT8_MAX; + } + private static final int UINT16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT16_MAX 65535 + * } + */ + public static int UINT16_MAX() { + return UINT16_MAX; + } + private static final int UINT32_MAX = (int)4294967295L; + /** + * {@snippet lang=c : + * #define UINT32_MAX 4294967295 + * } + */ + public static int UINT32_MAX() { + return UINT32_MAX; + } + private static final long UINT64_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT64_MAX -1 + * } + */ + public static long UINT64_MAX() { + return UINT64_MAX; + } + private static final int INT_LEAST8_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define INT_LEAST8_MIN -128 + * } + */ + public static int INT_LEAST8_MIN() { + return INT_LEAST8_MIN; + } + private static final int INT_LEAST16_MIN = (int)-32768L; + /** + * {@snippet lang=c : + * #define INT_LEAST16_MIN -32768 + * } + */ + public static int INT_LEAST16_MIN() { + return INT_LEAST16_MIN; + } + private static final int INT_LEAST32_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define INT_LEAST32_MIN -2147483648 + * } + */ + public static int INT_LEAST32_MIN() { + return INT_LEAST32_MIN; + } + private static final long INT_LEAST64_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT_LEAST64_MIN -9223372036854775808 + * } + */ + public static long INT_LEAST64_MIN() { + return INT_LEAST64_MIN; + } + private static final int INT_LEAST8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT_LEAST8_MAX 127 + * } + */ + public static int INT_LEAST8_MAX() { + return INT_LEAST8_MAX; + } + private static final int INT_LEAST16_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define INT_LEAST16_MAX 32767 + * } + */ + public static int INT_LEAST16_MAX() { + return INT_LEAST16_MAX; + } + private static final int INT_LEAST32_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define INT_LEAST32_MAX 2147483647 + * } + */ + public static int INT_LEAST32_MAX() { + return INT_LEAST32_MAX; + } + private static final long INT_LEAST64_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT_LEAST64_MAX 9223372036854775807 + * } + */ + public static long INT_LEAST64_MAX() { + return INT_LEAST64_MAX; + } + private static final int UINT_LEAST8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT_LEAST8_MAX 255 + * } + */ + public static int UINT_LEAST8_MAX() { + return UINT_LEAST8_MAX; + } + private static final int UINT_LEAST16_MAX = (int)65535L; + /** + * {@snippet lang=c : + * #define UINT_LEAST16_MAX 65535 + * } + */ + public static int UINT_LEAST16_MAX() { + return UINT_LEAST16_MAX; + } + private static final int UINT_LEAST32_MAX = (int)4294967295L; + /** + * {@snippet lang=c : + * #define UINT_LEAST32_MAX 4294967295 + * } + */ + public static int UINT_LEAST32_MAX() { + return UINT_LEAST32_MAX; + } + private static final long UINT_LEAST64_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT_LEAST64_MAX -1 + * } + */ + public static long UINT_LEAST64_MAX() { + return UINT_LEAST64_MAX; + } + private static final int INT_FAST8_MIN = (int)-128L; + /** + * {@snippet lang=c : + * #define INT_FAST8_MIN -128 + * } + */ + public static int INT_FAST8_MIN() { + return INT_FAST8_MIN; + } + private static final long INT_FAST16_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT_FAST16_MIN -9223372036854775808 + * } + */ + public static long INT_FAST16_MIN() { + return INT_FAST16_MIN; + } + private static final long INT_FAST32_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT_FAST32_MIN -9223372036854775808 + * } + */ + public static long INT_FAST32_MIN() { + return INT_FAST32_MIN; + } + private static final long INT_FAST64_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INT_FAST64_MIN -9223372036854775808 + * } + */ + public static long INT_FAST64_MIN() { + return INT_FAST64_MIN; + } + private static final int INT_FAST8_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define INT_FAST8_MAX 127 + * } + */ + public static int INT_FAST8_MAX() { + return INT_FAST8_MAX; + } + private static final long INT_FAST16_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT_FAST16_MAX 9223372036854775807 + * } + */ + public static long INT_FAST16_MAX() { + return INT_FAST16_MAX; + } + private static final long INT_FAST32_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT_FAST32_MAX 9223372036854775807 + * } + */ + public static long INT_FAST32_MAX() { + return INT_FAST32_MAX; + } + private static final long INT_FAST64_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INT_FAST64_MAX 9223372036854775807 + * } + */ + public static long INT_FAST64_MAX() { + return INT_FAST64_MAX; + } + private static final int UINT_FAST8_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define UINT_FAST8_MAX 255 + * } + */ + public static int UINT_FAST8_MAX() { + return UINT_FAST8_MAX; + } + private static final long UINT_FAST16_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT_FAST16_MAX -1 + * } + */ + public static long UINT_FAST16_MAX() { + return UINT_FAST16_MAX; + } + private static final long UINT_FAST32_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT_FAST32_MAX -1 + * } + */ + public static long UINT_FAST32_MAX() { + return UINT_FAST32_MAX; + } + private static final long UINT_FAST64_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINT_FAST64_MAX -1 + * } + */ + public static long UINT_FAST64_MAX() { + return UINT_FAST64_MAX; + } + private static final long INTPTR_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INTPTR_MIN -9223372036854775808 + * } + */ + public static long INTPTR_MIN() { + return INTPTR_MIN; + } + private static final long INTPTR_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INTPTR_MAX 9223372036854775807 + * } + */ + public static long INTPTR_MAX() { + return INTPTR_MAX; + } + private static final long UINTPTR_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINTPTR_MAX -1 + * } + */ + public static long UINTPTR_MAX() { + return UINTPTR_MAX; + } + private static final long INTMAX_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define INTMAX_MIN -9223372036854775808 + * } + */ + public static long INTMAX_MIN() { + return INTMAX_MIN; + } + private static final long INTMAX_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define INTMAX_MAX 9223372036854775807 + * } + */ + public static long INTMAX_MAX() { + return INTMAX_MAX; + } + private static final long UINTMAX_MAX = -1L; + /** + * {@snippet lang=c : + * #define UINTMAX_MAX -1 + * } + */ + public static long UINTMAX_MAX() { + return UINTMAX_MAX; + } + private static final long PTRDIFF_MIN = -9223372036854775808L; + /** + * {@snippet lang=c : + * #define PTRDIFF_MIN -9223372036854775808 + * } + */ + public static long PTRDIFF_MIN() { + return PTRDIFF_MIN; + } + private static final long PTRDIFF_MAX = 9223372036854775807L; + /** + * {@snippet lang=c : + * #define PTRDIFF_MAX 9223372036854775807 + * } + */ + public static long PTRDIFF_MAX() { + return PTRDIFF_MAX; + } + private static final int SIG_ATOMIC_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define SIG_ATOMIC_MIN -2147483648 + * } + */ + public static int SIG_ATOMIC_MIN() { + return SIG_ATOMIC_MIN; + } + private static final int SIG_ATOMIC_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define SIG_ATOMIC_MAX 2147483647 + * } + */ + public static int SIG_ATOMIC_MAX() { + return SIG_ATOMIC_MAX; + } + private static final long SIZE_MAX = -1L; + /** + * {@snippet lang=c : + * #define SIZE_MAX -1 + * } + */ + public static long SIZE_MAX() { + return SIZE_MAX; + } + private static final int WCHAR_MIN = (int)-2147483648L; + /** + * {@snippet lang=c : + * #define WCHAR_MIN -2147483648 + * } + */ + public static int WCHAR_MIN() { + return WCHAR_MIN; + } + private static final int WCHAR_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define WCHAR_MAX 2147483647 + * } + */ + public static int WCHAR_MAX() { + return WCHAR_MAX; + } + private static final int WINT_MIN = (int)0L; + /** + * {@snippet lang=c : + * #define WINT_MIN 0 + * } + */ + public static int WINT_MIN() { + return WINT_MIN; + } + private static final int WINT_MAX = (int)4294967295L; + /** + * {@snippet lang=c : + * #define WINT_MAX 4294967295 + * } + */ + public static int WINT_MAX() { + return WINT_MAX; + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI_1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI_1.java new file mode 100644 index 0000000000..3860573f18 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI_1.java @@ -0,0 +1,17672 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +public class PanamaFFMAPI_1 { + + PanamaFFMAPI_1() { + // Should not be called directly + } + + static final Arena LIBRARY_ARENA = Arena.ofAuto(); + static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); + + static void traceDowncall(String name, Object... args) { + String traceArgs = Arrays.stream(args) + .map(Object::toString) + .collect(Collectors.joining(", ")); + System.out.printf("%s(%s)\n", name, traceArgs); + } + + static MemorySegment findOrThrow(String symbol) { + return SYMBOL_LOOKUP.find(symbol) + .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); + } catch (ReflectiveOperationException ex) { + throw new AssertionError(ex); + } + } + + static MemoryLayout align(MemoryLayout layout, long align) { + return switch (layout) { + case PaddingLayout p -> p; + case ValueLayout v -> v.withByteAlignment(align); + case GroupLayout g -> { + MemoryLayout[] alignedMembers = g.memberLayouts().stream() + .map(m -> align(m, align)).toArray(MemoryLayout[]::new); + yield g instanceof StructLayout ? + MemoryLayout.structLayout(alignedMembers) : MemoryLayout.unionLayout(alignedMembers); + } + case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); + }; + } + + static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup() + .or(Linker.nativeLinker().defaultLookup()); + + public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; + public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; + public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; + public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; + public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; + public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; + public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; + public static final AddressLayout C_POINTER = ValueLayout.ADDRESS + .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); + public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; + private static final int _LIBC_LIMITS_H_ = (int)1L; + /** + * {@snippet lang=c : + * #define _LIBC_LIMITS_H_ 1 + * } + */ + public static int _LIBC_LIMITS_H_() { + return _LIBC_LIMITS_H_; + } + private static final int _FEATURES_H = (int)1L; + /** + * {@snippet lang=c : + * #define _FEATURES_H 1 + * } + */ + public static int _FEATURES_H() { + return _FEATURES_H; + } + private static final int _DEFAULT_SOURCE = (int)1L; + /** + * {@snippet lang=c : + * #define _DEFAULT_SOURCE 1 + * } + */ + public static int _DEFAULT_SOURCE() { + return _DEFAULT_SOURCE; + } + private static final int __GLIBC_USE_ISOC2X = (int)0L; + /** + * {@snippet lang=c : + * #define __GLIBC_USE_ISOC2X 0 + * } + */ + public static int __GLIBC_USE_ISOC2X() { + return __GLIBC_USE_ISOC2X; + } + private static final int __USE_ISOC11 = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_ISOC11 1 + * } + */ + public static int __USE_ISOC11() { + return __USE_ISOC11; + } + private static final int __USE_ISOC99 = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_ISOC99 1 + * } + */ + public static int __USE_ISOC99() { + return __USE_ISOC99; + } + private static final int __USE_ISOC95 = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_ISOC95 1 + * } + */ + public static int __USE_ISOC95() { + return __USE_ISOC95; + } + private static final int __USE_POSIX_IMPLICITLY = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_POSIX_IMPLICITLY 1 + * } + */ + public static int __USE_POSIX_IMPLICITLY() { + return __USE_POSIX_IMPLICITLY; + } + private static final int _POSIX_SOURCE = (int)1L; + /** + * {@snippet lang=c : + * #define _POSIX_SOURCE 1 + * } + */ + public static int _POSIX_SOURCE() { + return _POSIX_SOURCE; + } + private static final int __USE_POSIX = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_POSIX 1 + * } + */ + public static int __USE_POSIX() { + return __USE_POSIX; + } + private static final int __USE_POSIX2 = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_POSIX2 1 + * } + */ + public static int __USE_POSIX2() { + return __USE_POSIX2; + } + private static final int __USE_POSIX199309 = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_POSIX199309 1 + * } + */ + public static int __USE_POSIX199309() { + return __USE_POSIX199309; + } + private static final int __USE_POSIX199506 = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_POSIX199506 1 + * } + */ + public static int __USE_POSIX199506() { + return __USE_POSIX199506; + } + private static final int __USE_XOPEN2K = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_XOPEN2K 1 + * } + */ + public static int __USE_XOPEN2K() { + return __USE_XOPEN2K; + } + private static final int __USE_XOPEN2K8 = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_XOPEN2K8 1 + * } + */ + public static int __USE_XOPEN2K8() { + return __USE_XOPEN2K8; + } + private static final int _ATFILE_SOURCE = (int)1L; + /** + * {@snippet lang=c : + * #define _ATFILE_SOURCE 1 + * } + */ + public static int _ATFILE_SOURCE() { + return _ATFILE_SOURCE; + } + private static final int __WORDSIZE = (int)64L; + /** + * {@snippet lang=c : + * #define __WORDSIZE 64 + * } + */ + public static int __WORDSIZE() { + return __WORDSIZE; + } + private static final int __WORDSIZE_TIME64_COMPAT32 = (int)1L; + /** + * {@snippet lang=c : + * #define __WORDSIZE_TIME64_COMPAT32 1 + * } + */ + public static int __WORDSIZE_TIME64_COMPAT32() { + return __WORDSIZE_TIME64_COMPAT32; + } + private static final int __SYSCALL_WORDSIZE = (int)64L; + /** + * {@snippet lang=c : + * #define __SYSCALL_WORDSIZE 64 + * } + */ + public static int __SYSCALL_WORDSIZE() { + return __SYSCALL_WORDSIZE; + } + private static final int __USE_MISC = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_MISC 1 + * } + */ + public static int __USE_MISC() { + return __USE_MISC; + } + private static final int __USE_ATFILE = (int)1L; + /** + * {@snippet lang=c : + * #define __USE_ATFILE 1 + * } + */ + public static int __USE_ATFILE() { + return __USE_ATFILE; + } + private static final int __USE_FORTIFY_LEVEL = (int)0L; + /** + * {@snippet lang=c : + * #define __USE_FORTIFY_LEVEL 0 + * } + */ + public static int __USE_FORTIFY_LEVEL() { + return __USE_FORTIFY_LEVEL; + } + private static final int __GLIBC_USE_DEPRECATED_GETS = (int)0L; + /** + * {@snippet lang=c : + * #define __GLIBC_USE_DEPRECATED_GETS 0 + * } + */ + public static int __GLIBC_USE_DEPRECATED_GETS() { + return __GLIBC_USE_DEPRECATED_GETS; + } + private static final int __GLIBC_USE_DEPRECATED_SCANF = (int)0L; + /** + * {@snippet lang=c : + * #define __GLIBC_USE_DEPRECATED_SCANF 0 + * } + */ + public static int __GLIBC_USE_DEPRECATED_SCANF() { + return __GLIBC_USE_DEPRECATED_SCANF; + } + private static final int _STDC_PREDEF_H = (int)1L; + /** + * {@snippet lang=c : + * #define _STDC_PREDEF_H 1 + * } + */ + public static int _STDC_PREDEF_H() { + return _STDC_PREDEF_H; + } + private static final int __STDC_IEC_559__ = (int)1L; + /** + * {@snippet lang=c : + * #define __STDC_IEC_559__ 1 + * } + */ + public static int __STDC_IEC_559__() { + return __STDC_IEC_559__; + } + private static final int __STDC_IEC_559_COMPLEX__ = (int)1L; + /** + * {@snippet lang=c : + * #define __STDC_IEC_559_COMPLEX__ 1 + * } + */ + public static int __STDC_IEC_559_COMPLEX__() { + return __STDC_IEC_559_COMPLEX__; + } + private static final int __GNU_LIBRARY__ = (int)6L; + /** + * {@snippet lang=c : + * #define __GNU_LIBRARY__ 6 + * } + */ + public static int __GNU_LIBRARY__() { + return __GNU_LIBRARY__; + } + private static final int __GLIBC__ = (int)2L; + /** + * {@snippet lang=c : + * #define __GLIBC__ 2 + * } + */ + public static int __GLIBC__() { + return __GLIBC__; + } + private static final int __GLIBC_MINOR__ = (int)35L; + /** + * {@snippet lang=c : + * #define __GLIBC_MINOR__ 35 + * } + */ + public static int __GLIBC_MINOR__() { + return __GLIBC_MINOR__; + } + private static final int _SYS_CDEFS_H = (int)1L; + /** + * {@snippet lang=c : + * #define _SYS_CDEFS_H 1 + * } + */ + public static int _SYS_CDEFS_H() { + return _SYS_CDEFS_H; + } + private static final int __glibc_c99_flexarr_available = (int)1L; + /** + * {@snippet lang=c : + * #define __glibc_c99_flexarr_available 1 + * } + */ + public static int __glibc_c99_flexarr_available() { + return __glibc_c99_flexarr_available; + } + private static final int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = (int)0L; + /** + * {@snippet lang=c : + * #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 + * } + */ + public static int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI() { + return __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI; + } + private static final int __HAVE_GENERIC_SELECTION = (int)1L; + /** + * {@snippet lang=c : + * #define __HAVE_GENERIC_SELECTION 1 + * } + */ + public static int __HAVE_GENERIC_SELECTION() { + return __HAVE_GENERIC_SELECTION; + } + private static final int __GLIBC_USE_LIB_EXT2 = (int)0L; + /** + * {@snippet lang=c : + * #define __GLIBC_USE_LIB_EXT2 0 + * } + */ + public static int __GLIBC_USE_LIB_EXT2() { + return __GLIBC_USE_LIB_EXT2; + } + private static final int __GLIBC_USE_IEC_60559_BFP_EXT = (int)0L; + /** + * {@snippet lang=c : + * #define __GLIBC_USE_IEC_60559_BFP_EXT 0 + * } + */ + public static int __GLIBC_USE_IEC_60559_BFP_EXT() { + return __GLIBC_USE_IEC_60559_BFP_EXT; + } + private static final int __GLIBC_USE_IEC_60559_BFP_EXT_C2X = (int)0L; + /** + * {@snippet lang=c : + * #define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 + * } + */ + public static int __GLIBC_USE_IEC_60559_BFP_EXT_C2X() { + return __GLIBC_USE_IEC_60559_BFP_EXT_C2X; + } + private static final int __GLIBC_USE_IEC_60559_EXT = (int)0L; + /** + * {@snippet lang=c : + * #define __GLIBC_USE_IEC_60559_EXT 0 + * } + */ + public static int __GLIBC_USE_IEC_60559_EXT() { + return __GLIBC_USE_IEC_60559_EXT; + } + private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT = (int)0L; + /** + * {@snippet lang=c : + * #define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 + * } + */ + public static int __GLIBC_USE_IEC_60559_FUNCS_EXT() { + return __GLIBC_USE_IEC_60559_FUNCS_EXT; + } + private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = (int)0L; + /** + * {@snippet lang=c : + * #define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 + * } + */ + public static int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X() { + return __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X; + } + private static final int __GLIBC_USE_IEC_60559_TYPES_EXT = (int)0L; + /** + * {@snippet lang=c : + * #define __GLIBC_USE_IEC_60559_TYPES_EXT 0 + * } + */ + public static int __GLIBC_USE_IEC_60559_TYPES_EXT() { + return __GLIBC_USE_IEC_60559_TYPES_EXT; + } + private static final int MB_LEN_MAX = (int)16L; + /** + * {@snippet lang=c : + * #define MB_LEN_MAX 16 + * } + */ + public static int MB_LEN_MAX() { + return MB_LEN_MAX; + } + private static final int _BITS_POSIX1_LIM_H = (int)1L; + /** + * {@snippet lang=c : + * #define _BITS_POSIX1_LIM_H 1 + * } + */ + public static int _BITS_POSIX1_LIM_H() { + return _BITS_POSIX1_LIM_H; + } + private static final int _POSIX_AIO_LISTIO_MAX = (int)2L; + /** + * {@snippet lang=c : + * #define _POSIX_AIO_LISTIO_MAX 2 + * } + */ + public static int _POSIX_AIO_LISTIO_MAX() { + return _POSIX_AIO_LISTIO_MAX; + } + private static final int _POSIX_AIO_MAX = (int)1L; + /** + * {@snippet lang=c : + * #define _POSIX_AIO_MAX 1 + * } + */ + public static int _POSIX_AIO_MAX() { + return _POSIX_AIO_MAX; + } + private static final int _POSIX_ARG_MAX = (int)4096L; + /** + * {@snippet lang=c : + * #define _POSIX_ARG_MAX 4096 + * } + */ + public static int _POSIX_ARG_MAX() { + return _POSIX_ARG_MAX; + } + private static final int _POSIX_CHILD_MAX = (int)25L; + /** + * {@snippet lang=c : + * #define _POSIX_CHILD_MAX 25 + * } + */ + public static int _POSIX_CHILD_MAX() { + return _POSIX_CHILD_MAX; + } + private static final int _POSIX_DELAYTIMER_MAX = (int)32L; + /** + * {@snippet lang=c : + * #define _POSIX_DELAYTIMER_MAX 32 + * } + */ + public static int _POSIX_DELAYTIMER_MAX() { + return _POSIX_DELAYTIMER_MAX; + } + private static final int _POSIX_HOST_NAME_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define _POSIX_HOST_NAME_MAX 255 + * } + */ + public static int _POSIX_HOST_NAME_MAX() { + return _POSIX_HOST_NAME_MAX; + } + private static final int _POSIX_LINK_MAX = (int)8L; + /** + * {@snippet lang=c : + * #define _POSIX_LINK_MAX 8 + * } + */ + public static int _POSIX_LINK_MAX() { + return _POSIX_LINK_MAX; + } + private static final int _POSIX_LOGIN_NAME_MAX = (int)9L; + /** + * {@snippet lang=c : + * #define _POSIX_LOGIN_NAME_MAX 9 + * } + */ + public static int _POSIX_LOGIN_NAME_MAX() { + return _POSIX_LOGIN_NAME_MAX; + } + private static final int _POSIX_MAX_CANON = (int)255L; + /** + * {@snippet lang=c : + * #define _POSIX_MAX_CANON 255 + * } + */ + public static int _POSIX_MAX_CANON() { + return _POSIX_MAX_CANON; + } + private static final int _POSIX_MAX_INPUT = (int)255L; + /** + * {@snippet lang=c : + * #define _POSIX_MAX_INPUT 255 + * } + */ + public static int _POSIX_MAX_INPUT() { + return _POSIX_MAX_INPUT; + } + private static final int _POSIX_MQ_OPEN_MAX = (int)8L; + /** + * {@snippet lang=c : + * #define _POSIX_MQ_OPEN_MAX 8 + * } + */ + public static int _POSIX_MQ_OPEN_MAX() { + return _POSIX_MQ_OPEN_MAX; + } + private static final int _POSIX_MQ_PRIO_MAX = (int)32L; + /** + * {@snippet lang=c : + * #define _POSIX_MQ_PRIO_MAX 32 + * } + */ + public static int _POSIX_MQ_PRIO_MAX() { + return _POSIX_MQ_PRIO_MAX; + } + private static final int _POSIX_NAME_MAX = (int)14L; + /** + * {@snippet lang=c : + * #define _POSIX_NAME_MAX 14 + * } + */ + public static int _POSIX_NAME_MAX() { + return _POSIX_NAME_MAX; + } + private static final int _POSIX_NGROUPS_MAX = (int)8L; + /** + * {@snippet lang=c : + * #define _POSIX_NGROUPS_MAX 8 + * } + */ + public static int _POSIX_NGROUPS_MAX() { + return _POSIX_NGROUPS_MAX; + } + private static final int _POSIX_OPEN_MAX = (int)20L; + /** + * {@snippet lang=c : + * #define _POSIX_OPEN_MAX 20 + * } + */ + public static int _POSIX_OPEN_MAX() { + return _POSIX_OPEN_MAX; + } + private static final int _POSIX_PATH_MAX = (int)256L; + /** + * {@snippet lang=c : + * #define _POSIX_PATH_MAX 256 + * } + */ + public static int _POSIX_PATH_MAX() { + return _POSIX_PATH_MAX; + } + private static final int _POSIX_PIPE_BUF = (int)512L; + /** + * {@snippet lang=c : + * #define _POSIX_PIPE_BUF 512 + * } + */ + public static int _POSIX_PIPE_BUF() { + return _POSIX_PIPE_BUF; + } + private static final int _POSIX_RE_DUP_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define _POSIX_RE_DUP_MAX 255 + * } + */ + public static int _POSIX_RE_DUP_MAX() { + return _POSIX_RE_DUP_MAX; + } + private static final int _POSIX_RTSIG_MAX = (int)8L; + /** + * {@snippet lang=c : + * #define _POSIX_RTSIG_MAX 8 + * } + */ + public static int _POSIX_RTSIG_MAX() { + return _POSIX_RTSIG_MAX; + } + private static final int _POSIX_SEM_NSEMS_MAX = (int)256L; + /** + * {@snippet lang=c : + * #define _POSIX_SEM_NSEMS_MAX 256 + * } + */ + public static int _POSIX_SEM_NSEMS_MAX() { + return _POSIX_SEM_NSEMS_MAX; + } + private static final int _POSIX_SEM_VALUE_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define _POSIX_SEM_VALUE_MAX 32767 + * } + */ + public static int _POSIX_SEM_VALUE_MAX() { + return _POSIX_SEM_VALUE_MAX; + } + private static final int _POSIX_SIGQUEUE_MAX = (int)32L; + /** + * {@snippet lang=c : + * #define _POSIX_SIGQUEUE_MAX 32 + * } + */ + public static int _POSIX_SIGQUEUE_MAX() { + return _POSIX_SIGQUEUE_MAX; + } + private static final int _POSIX_SSIZE_MAX = (int)32767L; + /** + * {@snippet lang=c : + * #define _POSIX_SSIZE_MAX 32767 + * } + */ + public static int _POSIX_SSIZE_MAX() { + return _POSIX_SSIZE_MAX; + } + private static final int _POSIX_STREAM_MAX = (int)8L; + /** + * {@snippet lang=c : + * #define _POSIX_STREAM_MAX 8 + * } + */ + public static int _POSIX_STREAM_MAX() { + return _POSIX_STREAM_MAX; + } + private static final int _POSIX_SYMLINK_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define _POSIX_SYMLINK_MAX 255 + * } + */ + public static int _POSIX_SYMLINK_MAX() { + return _POSIX_SYMLINK_MAX; + } + private static final int _POSIX_SYMLOOP_MAX = (int)8L; + /** + * {@snippet lang=c : + * #define _POSIX_SYMLOOP_MAX 8 + * } + */ + public static int _POSIX_SYMLOOP_MAX() { + return _POSIX_SYMLOOP_MAX; + } + private static final int _POSIX_TIMER_MAX = (int)32L; + /** + * {@snippet lang=c : + * #define _POSIX_TIMER_MAX 32 + * } + */ + public static int _POSIX_TIMER_MAX() { + return _POSIX_TIMER_MAX; + } + private static final int _POSIX_TTY_NAME_MAX = (int)9L; + /** + * {@snippet lang=c : + * #define _POSIX_TTY_NAME_MAX 9 + * } + */ + public static int _POSIX_TTY_NAME_MAX() { + return _POSIX_TTY_NAME_MAX; + } + private static final int _POSIX_TZNAME_MAX = (int)6L; + /** + * {@snippet lang=c : + * #define _POSIX_TZNAME_MAX 6 + * } + */ + public static int _POSIX_TZNAME_MAX() { + return _POSIX_TZNAME_MAX; + } + private static final int _POSIX_CLOCKRES_MIN = (int)20000000L; + /** + * {@snippet lang=c : + * #define _POSIX_CLOCKRES_MIN 20000000 + * } + */ + public static int _POSIX_CLOCKRES_MIN() { + return _POSIX_CLOCKRES_MIN; + } + private static final int NR_OPEN = (int)1024L; + /** + * {@snippet lang=c : + * #define NR_OPEN 1024 + * } + */ + public static int NR_OPEN() { + return NR_OPEN; + } + private static final int NGROUPS_MAX = (int)65536L; + /** + * {@snippet lang=c : + * #define NGROUPS_MAX 65536 + * } + */ + public static int NGROUPS_MAX() { + return NGROUPS_MAX; + } + private static final int ARG_MAX = (int)131072L; + /** + * {@snippet lang=c : + * #define ARG_MAX 131072 + * } + */ + public static int ARG_MAX() { + return ARG_MAX; + } + private static final int LINK_MAX = (int)127L; + /** + * {@snippet lang=c : + * #define LINK_MAX 127 + * } + */ + public static int LINK_MAX() { + return LINK_MAX; + } + private static final int MAX_CANON = (int)255L; + /** + * {@snippet lang=c : + * #define MAX_CANON 255 + * } + */ + public static int MAX_CANON() { + return MAX_CANON; + } + private static final int MAX_INPUT = (int)255L; + /** + * {@snippet lang=c : + * #define MAX_INPUT 255 + * } + */ + public static int MAX_INPUT() { + return MAX_INPUT; + } + private static final int NAME_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define NAME_MAX 255 + * } + */ + public static int NAME_MAX() { + return NAME_MAX; + } + private static final int PATH_MAX = (int)4096L; + /** + * {@snippet lang=c : + * #define PATH_MAX 4096 + * } + */ + public static int PATH_MAX() { + return PATH_MAX; + } + private static final int PIPE_BUF = (int)4096L; + /** + * {@snippet lang=c : + * #define PIPE_BUF 4096 + * } + */ + public static int PIPE_BUF() { + return PIPE_BUF; + } + private static final int XATTR_NAME_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define XATTR_NAME_MAX 255 + * } + */ + public static int XATTR_NAME_MAX() { + return XATTR_NAME_MAX; + } + private static final int XATTR_SIZE_MAX = (int)65536L; + /** + * {@snippet lang=c : + * #define XATTR_SIZE_MAX 65536 + * } + */ + public static int XATTR_SIZE_MAX() { + return XATTR_SIZE_MAX; + } + private static final int XATTR_LIST_MAX = (int)65536L; + /** + * {@snippet lang=c : + * #define XATTR_LIST_MAX 65536 + * } + */ + public static int XATTR_LIST_MAX() { + return XATTR_LIST_MAX; + } + private static final int RTSIG_MAX = (int)32L; + /** + * {@snippet lang=c : + * #define RTSIG_MAX 32 + * } + */ + public static int RTSIG_MAX() { + return RTSIG_MAX; + } + private static final int _POSIX_THREAD_KEYS_MAX = (int)128L; + /** + * {@snippet lang=c : + * #define _POSIX_THREAD_KEYS_MAX 128 + * } + */ + public static int _POSIX_THREAD_KEYS_MAX() { + return _POSIX_THREAD_KEYS_MAX; + } + private static final int PTHREAD_KEYS_MAX = (int)1024L; + /** + * {@snippet lang=c : + * #define PTHREAD_KEYS_MAX 1024 + * } + */ + public static int PTHREAD_KEYS_MAX() { + return PTHREAD_KEYS_MAX; + } + private static final int _POSIX_THREAD_DESTRUCTOR_ITERATIONS = (int)4L; + /** + * {@snippet lang=c : + * #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 + * } + */ + public static int _POSIX_THREAD_DESTRUCTOR_ITERATIONS() { + return _POSIX_THREAD_DESTRUCTOR_ITERATIONS; + } + private static final int _POSIX_THREAD_THREADS_MAX = (int)64L; + /** + * {@snippet lang=c : + * #define _POSIX_THREAD_THREADS_MAX 64 + * } + */ + public static int _POSIX_THREAD_THREADS_MAX() { + return _POSIX_THREAD_THREADS_MAX; + } + private static final int AIO_PRIO_DELTA_MAX = (int)20L; + /** + * {@snippet lang=c : + * #define AIO_PRIO_DELTA_MAX 20 + * } + */ + public static int AIO_PRIO_DELTA_MAX() { + return AIO_PRIO_DELTA_MAX; + } + private static final int PTHREAD_STACK_MIN = (int)16384L; + /** + * {@snippet lang=c : + * #define PTHREAD_STACK_MIN 16384 + * } + */ + public static int PTHREAD_STACK_MIN() { + return PTHREAD_STACK_MIN; + } + private static final int DELAYTIMER_MAX = (int)2147483647L; + /** + * {@snippet lang=c : + * #define DELAYTIMER_MAX 2147483647 + * } + */ + public static int DELAYTIMER_MAX() { + return DELAYTIMER_MAX; + } + private static final int TTY_NAME_MAX = (int)32L; + /** + * {@snippet lang=c : + * #define TTY_NAME_MAX 32 + * } + */ + public static int TTY_NAME_MAX() { + return TTY_NAME_MAX; + } + private static final int LOGIN_NAME_MAX = (int)256L; + /** + * {@snippet lang=c : + * #define LOGIN_NAME_MAX 256 + * } + */ + public static int LOGIN_NAME_MAX() { + return LOGIN_NAME_MAX; + } + private static final int HOST_NAME_MAX = (int)64L; + /** + * {@snippet lang=c : + * #define HOST_NAME_MAX 64 + * } + */ + public static int HOST_NAME_MAX() { + return HOST_NAME_MAX; + } + private static final int MQ_PRIO_MAX = (int)32768L; + /** + * {@snippet lang=c : + * #define MQ_PRIO_MAX 32768 + * } + */ + public static int MQ_PRIO_MAX() { + return MQ_PRIO_MAX; + } + private static final int _BITS_POSIX2_LIM_H = (int)1L; + /** + * {@snippet lang=c : + * #define _BITS_POSIX2_LIM_H 1 + * } + */ + public static int _BITS_POSIX2_LIM_H() { + return _BITS_POSIX2_LIM_H; + } + private static final int _POSIX2_BC_BASE_MAX = (int)99L; + /** + * {@snippet lang=c : + * #define _POSIX2_BC_BASE_MAX 99 + * } + */ + public static int _POSIX2_BC_BASE_MAX() { + return _POSIX2_BC_BASE_MAX; + } + private static final int _POSIX2_BC_DIM_MAX = (int)2048L; + /** + * {@snippet lang=c : + * #define _POSIX2_BC_DIM_MAX 2048 + * } + */ + public static int _POSIX2_BC_DIM_MAX() { + return _POSIX2_BC_DIM_MAX; + } + private static final int _POSIX2_BC_SCALE_MAX = (int)99L; + /** + * {@snippet lang=c : + * #define _POSIX2_BC_SCALE_MAX 99 + * } + */ + public static int _POSIX2_BC_SCALE_MAX() { + return _POSIX2_BC_SCALE_MAX; + } + private static final int _POSIX2_BC_STRING_MAX = (int)1000L; + /** + * {@snippet lang=c : + * #define _POSIX2_BC_STRING_MAX 1000 + * } + */ + public static int _POSIX2_BC_STRING_MAX() { + return _POSIX2_BC_STRING_MAX; + } + private static final int _POSIX2_COLL_WEIGHTS_MAX = (int)2L; + /** + * {@snippet lang=c : + * #define _POSIX2_COLL_WEIGHTS_MAX 2 + * } + */ + public static int _POSIX2_COLL_WEIGHTS_MAX() { + return _POSIX2_COLL_WEIGHTS_MAX; + } + private static final int _POSIX2_EXPR_NEST_MAX = (int)32L; + /** + * {@snippet lang=c : + * #define _POSIX2_EXPR_NEST_MAX 32 + * } + */ + public static int _POSIX2_EXPR_NEST_MAX() { + return _POSIX2_EXPR_NEST_MAX; + } + private static final int _POSIX2_LINE_MAX = (int)2048L; + /** + * {@snippet lang=c : + * #define _POSIX2_LINE_MAX 2048 + * } + */ + public static int _POSIX2_LINE_MAX() { + return _POSIX2_LINE_MAX; + } + private static final int _POSIX2_RE_DUP_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define _POSIX2_RE_DUP_MAX 255 + * } + */ + public static int _POSIX2_RE_DUP_MAX() { + return _POSIX2_RE_DUP_MAX; + } + private static final int _POSIX2_CHARCLASS_NAME_MAX = (int)14L; + /** + * {@snippet lang=c : + * #define _POSIX2_CHARCLASS_NAME_MAX 14 + * } + */ + public static int _POSIX2_CHARCLASS_NAME_MAX() { + return _POSIX2_CHARCLASS_NAME_MAX; + } + private static final int COLL_WEIGHTS_MAX = (int)255L; + /** + * {@snippet lang=c : + * #define COLL_WEIGHTS_MAX 255 + * } + */ + public static int COLL_WEIGHTS_MAX() { + return COLL_WEIGHTS_MAX; + } + private static final int CHARCLASS_NAME_MAX = (int)2048L; + /** + * {@snippet lang=c : + * #define CHARCLASS_NAME_MAX 2048 + * } + */ + public static int CHARCLASS_NAME_MAX() { + return CHARCLASS_NAME_MAX; + } + private static final int cudaHostAllocDefault = (int)0L; + /** + * {@snippet lang=c : + * #define cudaHostAllocDefault 0 + * } + */ + public static int cudaHostAllocDefault() { + return cudaHostAllocDefault; + } + private static final int cudaHostAllocPortable = (int)1L; + /** + * {@snippet lang=c : + * #define cudaHostAllocPortable 1 + * } + */ + public static int cudaHostAllocPortable() { + return cudaHostAllocPortable; + } + private static final int cudaHostAllocMapped = (int)2L; + /** + * {@snippet lang=c : + * #define cudaHostAllocMapped 2 + * } + */ + public static int cudaHostAllocMapped() { + return cudaHostAllocMapped; + } + private static final int cudaHostAllocWriteCombined = (int)4L; + /** + * {@snippet lang=c : + * #define cudaHostAllocWriteCombined 4 + * } + */ + public static int cudaHostAllocWriteCombined() { + return cudaHostAllocWriteCombined; + } + private static final int cudaHostRegisterDefault = (int)0L; + /** + * {@snippet lang=c : + * #define cudaHostRegisterDefault 0 + * } + */ + public static int cudaHostRegisterDefault() { + return cudaHostRegisterDefault; + } + private static final int cudaHostRegisterPortable = (int)1L; + /** + * {@snippet lang=c : + * #define cudaHostRegisterPortable 1 + * } + */ + public static int cudaHostRegisterPortable() { + return cudaHostRegisterPortable; + } + private static final int cudaHostRegisterMapped = (int)2L; + /** + * {@snippet lang=c : + * #define cudaHostRegisterMapped 2 + * } + */ + public static int cudaHostRegisterMapped() { + return cudaHostRegisterMapped; + } + private static final int cudaHostRegisterIoMemory = (int)4L; + /** + * {@snippet lang=c : + * #define cudaHostRegisterIoMemory 4 + * } + */ + public static int cudaHostRegisterIoMemory() { + return cudaHostRegisterIoMemory; + } + private static final int cudaHostRegisterReadOnly = (int)8L; + /** + * {@snippet lang=c : + * #define cudaHostRegisterReadOnly 8 + * } + */ + public static int cudaHostRegisterReadOnly() { + return cudaHostRegisterReadOnly; + } + private static final int cudaPeerAccessDefault = (int)0L; + /** + * {@snippet lang=c : + * #define cudaPeerAccessDefault 0 + * } + */ + public static int cudaPeerAccessDefault() { + return cudaPeerAccessDefault; + } + private static final int cudaStreamDefault = (int)0L; + /** + * {@snippet lang=c : + * #define cudaStreamDefault 0 + * } + */ + public static int cudaStreamDefault() { + return cudaStreamDefault; + } + private static final int cudaStreamNonBlocking = (int)1L; + /** + * {@snippet lang=c : + * #define cudaStreamNonBlocking 1 + * } + */ + public static int cudaStreamNonBlocking() { + return cudaStreamNonBlocking; + } + private static final int cudaEventDefault = (int)0L; + /** + * {@snippet lang=c : + * #define cudaEventDefault 0 + * } + */ + public static int cudaEventDefault() { + return cudaEventDefault; + } + private static final int cudaEventBlockingSync = (int)1L; + /** + * {@snippet lang=c : + * #define cudaEventBlockingSync 1 + * } + */ + public static int cudaEventBlockingSync() { + return cudaEventBlockingSync; + } + private static final int cudaEventDisableTiming = (int)2L; + /** + * {@snippet lang=c : + * #define cudaEventDisableTiming 2 + * } + */ + public static int cudaEventDisableTiming() { + return cudaEventDisableTiming; + } + private static final int cudaEventInterprocess = (int)4L; + /** + * {@snippet lang=c : + * #define cudaEventInterprocess 4 + * } + */ + public static int cudaEventInterprocess() { + return cudaEventInterprocess; + } + private static final int cudaEventRecordDefault = (int)0L; + /** + * {@snippet lang=c : + * #define cudaEventRecordDefault 0 + * } + */ + public static int cudaEventRecordDefault() { + return cudaEventRecordDefault; + } + private static final int cudaEventRecordExternal = (int)1L; + /** + * {@snippet lang=c : + * #define cudaEventRecordExternal 1 + * } + */ + public static int cudaEventRecordExternal() { + return cudaEventRecordExternal; + } + private static final int cudaEventWaitDefault = (int)0L; + /** + * {@snippet lang=c : + * #define cudaEventWaitDefault 0 + * } + */ + public static int cudaEventWaitDefault() { + return cudaEventWaitDefault; + } + private static final int cudaEventWaitExternal = (int)1L; + /** + * {@snippet lang=c : + * #define cudaEventWaitExternal 1 + * } + */ + public static int cudaEventWaitExternal() { + return cudaEventWaitExternal; + } + private static final int cudaDeviceScheduleAuto = (int)0L; + /** + * {@snippet lang=c : + * #define cudaDeviceScheduleAuto 0 + * } + */ + public static int cudaDeviceScheduleAuto() { + return cudaDeviceScheduleAuto; + } + private static final int cudaDeviceScheduleSpin = (int)1L; + /** + * {@snippet lang=c : + * #define cudaDeviceScheduleSpin 1 + * } + */ + public static int cudaDeviceScheduleSpin() { + return cudaDeviceScheduleSpin; + } + private static final int cudaDeviceScheduleYield = (int)2L; + /** + * {@snippet lang=c : + * #define cudaDeviceScheduleYield 2 + * } + */ + public static int cudaDeviceScheduleYield() { + return cudaDeviceScheduleYield; + } + private static final int cudaDeviceScheduleBlockingSync = (int)4L; + /** + * {@snippet lang=c : + * #define cudaDeviceScheduleBlockingSync 4 + * } + */ + public static int cudaDeviceScheduleBlockingSync() { + return cudaDeviceScheduleBlockingSync; + } + private static final int cudaDeviceBlockingSync = (int)4L; + /** + * {@snippet lang=c : + * #define cudaDeviceBlockingSync 4 + * } + */ + public static int cudaDeviceBlockingSync() { + return cudaDeviceBlockingSync; + } + private static final int cudaDeviceScheduleMask = (int)7L; + /** + * {@snippet lang=c : + * #define cudaDeviceScheduleMask 7 + * } + */ + public static int cudaDeviceScheduleMask() { + return cudaDeviceScheduleMask; + } + private static final int cudaDeviceMapHost = (int)8L; + /** + * {@snippet lang=c : + * #define cudaDeviceMapHost 8 + * } + */ + public static int cudaDeviceMapHost() { + return cudaDeviceMapHost; + } + private static final int cudaDeviceLmemResizeToMax = (int)16L; + /** + * {@snippet lang=c : + * #define cudaDeviceLmemResizeToMax 16 + * } + */ + public static int cudaDeviceLmemResizeToMax() { + return cudaDeviceLmemResizeToMax; + } + private static final int cudaDeviceSyncMemops = (int)128L; + /** + * {@snippet lang=c : + * #define cudaDeviceSyncMemops 128 + * } + */ + public static int cudaDeviceSyncMemops() { + return cudaDeviceSyncMemops; + } + private static final int cudaDeviceMask = (int)255L; + /** + * {@snippet lang=c : + * #define cudaDeviceMask 255 + * } + */ + public static int cudaDeviceMask() { + return cudaDeviceMask; + } + private static final int cudaArrayDefault = (int)0L; + /** + * {@snippet lang=c : + * #define cudaArrayDefault 0 + * } + */ + public static int cudaArrayDefault() { + return cudaArrayDefault; + } + private static final int cudaArrayLayered = (int)1L; + /** + * {@snippet lang=c : + * #define cudaArrayLayered 1 + * } + */ + public static int cudaArrayLayered() { + return cudaArrayLayered; + } + private static final int cudaArraySurfaceLoadStore = (int)2L; + /** + * {@snippet lang=c : + * #define cudaArraySurfaceLoadStore 2 + * } + */ + public static int cudaArraySurfaceLoadStore() { + return cudaArraySurfaceLoadStore; + } + private static final int cudaArrayCubemap = (int)4L; + /** + * {@snippet lang=c : + * #define cudaArrayCubemap 4 + * } + */ + public static int cudaArrayCubemap() { + return cudaArrayCubemap; + } + private static final int cudaArrayTextureGather = (int)8L; + /** + * {@snippet lang=c : + * #define cudaArrayTextureGather 8 + * } + */ + public static int cudaArrayTextureGather() { + return cudaArrayTextureGather; + } + private static final int cudaArrayColorAttachment = (int)32L; + /** + * {@snippet lang=c : + * #define cudaArrayColorAttachment 32 + * } + */ + public static int cudaArrayColorAttachment() { + return cudaArrayColorAttachment; + } + private static final int cudaArraySparse = (int)64L; + /** + * {@snippet lang=c : + * #define cudaArraySparse 64 + * } + */ + public static int cudaArraySparse() { + return cudaArraySparse; + } + private static final int cudaArrayDeferredMapping = (int)128L; + /** + * {@snippet lang=c : + * #define cudaArrayDeferredMapping 128 + * } + */ + public static int cudaArrayDeferredMapping() { + return cudaArrayDeferredMapping; + } + private static final int cudaIpcMemLazyEnablePeerAccess = (int)1L; + /** + * {@snippet lang=c : + * #define cudaIpcMemLazyEnablePeerAccess 1 + * } + */ + public static int cudaIpcMemLazyEnablePeerAccess() { + return cudaIpcMemLazyEnablePeerAccess; + } + private static final int cudaMemAttachGlobal = (int)1L; + /** + * {@snippet lang=c : + * #define cudaMemAttachGlobal 1 + * } + */ + public static int cudaMemAttachGlobal() { + return cudaMemAttachGlobal; + } + private static final int cudaMemAttachHost = (int)2L; + /** + * {@snippet lang=c : + * #define cudaMemAttachHost 2 + * } + */ + public static int cudaMemAttachHost() { + return cudaMemAttachHost; + } + private static final int cudaMemAttachSingle = (int)4L; + /** + * {@snippet lang=c : + * #define cudaMemAttachSingle 4 + * } + */ + public static int cudaMemAttachSingle() { + return cudaMemAttachSingle; + } + private static final int cudaOccupancyDefault = (int)0L; + /** + * {@snippet lang=c : + * #define cudaOccupancyDefault 0 + * } + */ + public static int cudaOccupancyDefault() { + return cudaOccupancyDefault; + } + private static final int cudaOccupancyDisableCachingOverride = (int)1L; + /** + * {@snippet lang=c : + * #define cudaOccupancyDisableCachingOverride 1 + * } + */ + public static int cudaOccupancyDisableCachingOverride() { + return cudaOccupancyDisableCachingOverride; + } + private static final int cudaInitDeviceFlagsAreValid = (int)1L; + /** + * {@snippet lang=c : + * #define cudaInitDeviceFlagsAreValid 1 + * } + */ + public static int cudaInitDeviceFlagsAreValid() { + return cudaInitDeviceFlagsAreValid; + } + private static final int cudaCooperativeLaunchMultiDeviceNoPreSync = (int)1L; + /** + * {@snippet lang=c : + * #define cudaCooperativeLaunchMultiDeviceNoPreSync 1 + * } + */ + public static int cudaCooperativeLaunchMultiDeviceNoPreSync() { + return cudaCooperativeLaunchMultiDeviceNoPreSync; + } + private static final int cudaCooperativeLaunchMultiDeviceNoPostSync = (int)2L; + /** + * {@snippet lang=c : + * #define cudaCooperativeLaunchMultiDeviceNoPostSync 2 + * } + */ + public static int cudaCooperativeLaunchMultiDeviceNoPostSync() { + return cudaCooperativeLaunchMultiDeviceNoPostSync; + } + private static final int cudaArraySparsePropertiesSingleMipTail = (int)1L; + /** + * {@snippet lang=c : + * #define cudaArraySparsePropertiesSingleMipTail 1 + * } + */ + public static int cudaArraySparsePropertiesSingleMipTail() { + return cudaArraySparsePropertiesSingleMipTail; + } + private static final int CUDA_IPC_HANDLE_SIZE = (int)64L; + /** + * {@snippet lang=c : + * #define CUDA_IPC_HANDLE_SIZE 64 + * } + */ + public static int CUDA_IPC_HANDLE_SIZE() { + return CUDA_IPC_HANDLE_SIZE; + } + private static final int cudaExternalMemoryDedicated = (int)1L; + /** + * {@snippet lang=c : + * #define cudaExternalMemoryDedicated 1 + * } + */ + public static int cudaExternalMemoryDedicated() { + return cudaExternalMemoryDedicated; + } + private static final int cudaExternalSemaphoreSignalSkipNvSciBufMemSync = (int)1L; + /** + * {@snippet lang=c : + * #define cudaExternalSemaphoreSignalSkipNvSciBufMemSync 1 + * } + */ + public static int cudaExternalSemaphoreSignalSkipNvSciBufMemSync() { + return cudaExternalSemaphoreSignalSkipNvSciBufMemSync; + } + private static final int cudaExternalSemaphoreWaitSkipNvSciBufMemSync = (int)2L; + /** + * {@snippet lang=c : + * #define cudaExternalSemaphoreWaitSkipNvSciBufMemSync 2 + * } + */ + public static int cudaExternalSemaphoreWaitSkipNvSciBufMemSync() { + return cudaExternalSemaphoreWaitSkipNvSciBufMemSync; + } + private static final int cudaNvSciSyncAttrSignal = (int)1L; + /** + * {@snippet lang=c : + * #define cudaNvSciSyncAttrSignal 1 + * } + */ + public static int cudaNvSciSyncAttrSignal() { + return cudaNvSciSyncAttrSignal; + } + private static final int cudaNvSciSyncAttrWait = (int)2L; + /** + * {@snippet lang=c : + * #define cudaNvSciSyncAttrWait 2 + * } + */ + public static int cudaNvSciSyncAttrWait() { + return cudaNvSciSyncAttrWait; + } + private static final int cudaGraphKernelNodePortDefault = (int)0L; + /** + * {@snippet lang=c : + * #define cudaGraphKernelNodePortDefault 0 + * } + */ + public static int cudaGraphKernelNodePortDefault() { + return cudaGraphKernelNodePortDefault; + } + private static final int cudaGraphKernelNodePortProgrammatic = (int)1L; + /** + * {@snippet lang=c : + * #define cudaGraphKernelNodePortProgrammatic 1 + * } + */ + public static int cudaGraphKernelNodePortProgrammatic() { + return cudaGraphKernelNodePortProgrammatic; + } + private static final int cudaGraphKernelNodePortLaunchCompletion = (int)2L; + /** + * {@snippet lang=c : + * #define cudaGraphKernelNodePortLaunchCompletion 2 + * } + */ + public static int cudaGraphKernelNodePortLaunchCompletion() { + return cudaGraphKernelNodePortLaunchCompletion; + } + private static final int cudaSurfaceType1D = (int)1L; + /** + * {@snippet lang=c : + * #define cudaSurfaceType1D 1 + * } + */ + public static int cudaSurfaceType1D() { + return cudaSurfaceType1D; + } + private static final int cudaSurfaceType2D = (int)2L; + /** + * {@snippet lang=c : + * #define cudaSurfaceType2D 2 + * } + */ + public static int cudaSurfaceType2D() { + return cudaSurfaceType2D; + } + private static final int cudaSurfaceType3D = (int)3L; + /** + * {@snippet lang=c : + * #define cudaSurfaceType3D 3 + * } + */ + public static int cudaSurfaceType3D() { + return cudaSurfaceType3D; + } + private static final int cudaSurfaceTypeCubemap = (int)12L; + /** + * {@snippet lang=c : + * #define cudaSurfaceTypeCubemap 12 + * } + */ + public static int cudaSurfaceTypeCubemap() { + return cudaSurfaceTypeCubemap; + } + private static final int cudaSurfaceType1DLayered = (int)241L; + /** + * {@snippet lang=c : + * #define cudaSurfaceType1DLayered 241 + * } + */ + public static int cudaSurfaceType1DLayered() { + return cudaSurfaceType1DLayered; + } + private static final int cudaSurfaceType2DLayered = (int)242L; + /** + * {@snippet lang=c : + * #define cudaSurfaceType2DLayered 242 + * } + */ + public static int cudaSurfaceType2DLayered() { + return cudaSurfaceType2DLayered; + } + private static final int cudaSurfaceTypeCubemapLayered = (int)252L; + /** + * {@snippet lang=c : + * #define cudaSurfaceTypeCubemapLayered 252 + * } + */ + public static int cudaSurfaceTypeCubemapLayered() { + return cudaSurfaceTypeCubemapLayered; + } + private static final int cudaTextureType1D = (int)1L; + /** + * {@snippet lang=c : + * #define cudaTextureType1D 1 + * } + */ + public static int cudaTextureType1D() { + return cudaTextureType1D; + } + private static final int cudaTextureType2D = (int)2L; + /** + * {@snippet lang=c : + * #define cudaTextureType2D 2 + * } + */ + public static int cudaTextureType2D() { + return cudaTextureType2D; + } + private static final int cudaTextureType3D = (int)3L; + /** + * {@snippet lang=c : + * #define cudaTextureType3D 3 + * } + */ + public static int cudaTextureType3D() { + return cudaTextureType3D; + } + private static final int cudaTextureTypeCubemap = (int)12L; + /** + * {@snippet lang=c : + * #define cudaTextureTypeCubemap 12 + * } + */ + public static int cudaTextureTypeCubemap() { + return cudaTextureTypeCubemap; + } + private static final int cudaTextureType1DLayered = (int)241L; + /** + * {@snippet lang=c : + * #define cudaTextureType1DLayered 241 + * } + */ + public static int cudaTextureType1DLayered() { + return cudaTextureType1DLayered; + } + private static final int cudaTextureType2DLayered = (int)242L; + /** + * {@snippet lang=c : + * #define cudaTextureType2DLayered 242 + * } + */ + public static int cudaTextureType2DLayered() { + return cudaTextureType2DLayered; + } + private static final int cudaTextureTypeCubemapLayered = (int)252L; + /** + * {@snippet lang=c : + * #define cudaTextureTypeCubemapLayered 252 + * } + */ + public static int cudaTextureTypeCubemapLayered() { + return cudaTextureTypeCubemapLayered; + } + private static final int CUDART_VERSION = (int)12060L; + /** + * {@snippet lang=c : + * #define CUDART_VERSION 12060 + * } + */ + public static int CUDART_VERSION() { + return CUDART_VERSION; + } + private static final int true_ = (int)1L; + /** + * {@snippet lang=c : + * #define true 1 + * } + */ + public static int true_() { + return true_; + } + private static final int false_ = (int)0L; + /** + * {@snippet lang=c : + * #define false 0 + * } + */ + public static int false_() { + return false_; + } + private static final int __bool_true_false_are_defined = (int)1L; + /** + * {@snippet lang=c : + * #define __bool_true_false_are_defined 1 + * } + */ + public static int __bool_true_false_are_defined() { + return __bool_true_false_are_defined; + } + private static final int _STDINT_H = (int)1L; + /** + * {@snippet lang=c : + * #define _STDINT_H 1 + * } + */ + public static int _STDINT_H() { + return _STDINT_H; + } + private static final int _BITS_TYPES_H = (int)1L; + /** + * {@snippet lang=c : + * #define _BITS_TYPES_H 1 + * } + */ + public static int _BITS_TYPES_H() { + return _BITS_TYPES_H; + } + private static final int _BITS_TYPESIZES_H = (int)1L; + /** + * {@snippet lang=c : + * #define _BITS_TYPESIZES_H 1 + * } + */ + public static int _BITS_TYPESIZES_H() { + return _BITS_TYPESIZES_H; + } + private static final int __OFF_T_MATCHES_OFF64_T = (int)1L; + /** + * {@snippet lang=c : + * #define __OFF_T_MATCHES_OFF64_T 1 + * } + */ + public static int __OFF_T_MATCHES_OFF64_T() { + return __OFF_T_MATCHES_OFF64_T; + } + private static final int __INO_T_MATCHES_INO64_T = (int)1L; + /** + * {@snippet lang=c : + * #define __INO_T_MATCHES_INO64_T 1 + * } + */ + public static int __INO_T_MATCHES_INO64_T() { + return __INO_T_MATCHES_INO64_T; + } + private static final int __RLIM_T_MATCHES_RLIM64_T = (int)1L; + /** + * {@snippet lang=c : + * #define __RLIM_T_MATCHES_RLIM64_T 1 + * } + */ + public static int __RLIM_T_MATCHES_RLIM64_T() { + return __RLIM_T_MATCHES_RLIM64_T; + } + private static final int __STATFS_MATCHES_STATFS64 = (int)1L; + /** + * {@snippet lang=c : + * #define __STATFS_MATCHES_STATFS64 1 + * } + */ + public static int __STATFS_MATCHES_STATFS64() { + return __STATFS_MATCHES_STATFS64; + } + private static final int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = (int)1L; + /** + * {@snippet lang=c : + * #define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 + * } + */ + public static int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64() { + return __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64; + } + private static final int __FD_SETSIZE = (int)1024L; + /** + * {@snippet lang=c : + * #define __FD_SETSIZE 1024 + * } + */ + public static int __FD_SETSIZE() { + return __FD_SETSIZE; + } + private static final int _BITS_TIME64_H = (int)1L; + /** + * {@snippet lang=c : + * #define _BITS_TIME64_H 1 + * } + */ + public static int _BITS_TIME64_H() { + return _BITS_TIME64_H; + } + private static final int _BITS_WCHAR_H = (int)1L; + /** + * {@snippet lang=c : + * #define _BITS_WCHAR_H 1 + * } + */ + public static int _BITS_WCHAR_H() { + return _BITS_WCHAR_H; + } + private static final int _BITS_STDINT_INTN_H = (int)1L; + /** + * {@snippet lang=c : + * #define _BITS_STDINT_INTN_H 1 + * } + */ + public static int _BITS_STDINT_INTN_H() { + return _BITS_STDINT_INTN_H; + } + private static final int _BITS_STDINT_UINTN_H = (int)1L; + /** + * {@snippet lang=c : + * #define _BITS_STDINT_UINTN_H 1 + * } + */ + public static int _BITS_STDINT_UINTN_H() { + return _BITS_STDINT_UINTN_H; + } + private static final int DLPACK_VERSION = (int)80L; + /** + * {@snippet lang=c : + * #define DLPACK_VERSION 80 + * } + */ + public static int DLPACK_VERSION() { + return DLPACK_VERSION; + } + private static final int DLPACK_ABI_VERSION = (int)1L; + /** + * {@snippet lang=c : + * #define DLPACK_ABI_VERSION 1 + * } + */ + public static int DLPACK_ABI_VERSION() { + return DLPACK_ABI_VERSION; + } + private static final int cudaRoundNearest = (int)0L; + /** + * {@snippet lang=c : + * enum cudaRoundMode.cudaRoundNearest = 0 + * } + */ + public static int cudaRoundNearest() { + return cudaRoundNearest; + } + private static final int cudaRoundZero = (int)1L; + /** + * {@snippet lang=c : + * enum cudaRoundMode.cudaRoundZero = 1 + * } + */ + public static int cudaRoundZero() { + return cudaRoundZero; + } + private static final int cudaRoundPosInf = (int)2L; + /** + * {@snippet lang=c : + * enum cudaRoundMode.cudaRoundPosInf = 2 + * } + */ + public static int cudaRoundPosInf() { + return cudaRoundPosInf; + } + private static final int cudaRoundMinInf = (int)3L; + /** + * {@snippet lang=c : + * enum cudaRoundMode.cudaRoundMinInf = 3 + * } + */ + public static int cudaRoundMinInf() { + return cudaRoundMinInf; + } + /** + * {@snippet lang=c : + * typedef long ptrdiff_t + * } + */ + public static final OfLong ptrdiff_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef unsigned long size_t + * } + */ + public static final OfLong size_t = PanamaFFMAPI.C_LONG; + /** + * {@snippet lang=c : + * typedef int wchar_t + * } + */ + public static final OfInt wchar_t = PanamaFFMAPI.C_INT; + private static final int cudaSuccess = (int)0L; + /** + * {@snippet lang=c : + * enum cudaError.cudaSuccess = 0 + * } + */ + public static int cudaSuccess() { + return cudaSuccess; + } + private static final int cudaErrorInvalidValue = (int)1L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidValue = 1 + * } + */ + public static int cudaErrorInvalidValue() { + return cudaErrorInvalidValue; + } + private static final int cudaErrorMemoryAllocation = (int)2L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMemoryAllocation = 2 + * } + */ + public static int cudaErrorMemoryAllocation() { + return cudaErrorMemoryAllocation; + } + private static final int cudaErrorInitializationError = (int)3L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInitializationError = 3 + * } + */ + public static int cudaErrorInitializationError() { + return cudaErrorInitializationError; + } + private static final int cudaErrorCudartUnloading = (int)4L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorCudartUnloading = 4 + * } + */ + public static int cudaErrorCudartUnloading() { + return cudaErrorCudartUnloading; + } + private static final int cudaErrorProfilerDisabled = (int)5L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorProfilerDisabled = 5 + * } + */ + public static int cudaErrorProfilerDisabled() { + return cudaErrorProfilerDisabled; + } + private static final int cudaErrorProfilerNotInitialized = (int)6L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorProfilerNotInitialized = 6 + * } + */ + public static int cudaErrorProfilerNotInitialized() { + return cudaErrorProfilerNotInitialized; + } + private static final int cudaErrorProfilerAlreadyStarted = (int)7L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorProfilerAlreadyStarted = 7 + * } + */ + public static int cudaErrorProfilerAlreadyStarted() { + return cudaErrorProfilerAlreadyStarted; + } + private static final int cudaErrorProfilerAlreadyStopped = (int)8L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorProfilerAlreadyStopped = 8 + * } + */ + public static int cudaErrorProfilerAlreadyStopped() { + return cudaErrorProfilerAlreadyStopped; + } + private static final int cudaErrorInvalidConfiguration = (int)9L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidConfiguration = 9 + * } + */ + public static int cudaErrorInvalidConfiguration() { + return cudaErrorInvalidConfiguration; + } + private static final int cudaErrorInvalidPitchValue = (int)12L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidPitchValue = 12 + * } + */ + public static int cudaErrorInvalidPitchValue() { + return cudaErrorInvalidPitchValue; + } + private static final int cudaErrorInvalidSymbol = (int)13L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidSymbol = 13 + * } + */ + public static int cudaErrorInvalidSymbol() { + return cudaErrorInvalidSymbol; + } + private static final int cudaErrorInvalidHostPointer = (int)16L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidHostPointer = 16 + * } + */ + public static int cudaErrorInvalidHostPointer() { + return cudaErrorInvalidHostPointer; + } + private static final int cudaErrorInvalidDevicePointer = (int)17L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidDevicePointer = 17 + * } + */ + public static int cudaErrorInvalidDevicePointer() { + return cudaErrorInvalidDevicePointer; + } + private static final int cudaErrorInvalidTexture = (int)18L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidTexture = 18 + * } + */ + public static int cudaErrorInvalidTexture() { + return cudaErrorInvalidTexture; + } + private static final int cudaErrorInvalidTextureBinding = (int)19L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidTextureBinding = 19 + * } + */ + public static int cudaErrorInvalidTextureBinding() { + return cudaErrorInvalidTextureBinding; + } + private static final int cudaErrorInvalidChannelDescriptor = (int)20L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidChannelDescriptor = 20 + * } + */ + public static int cudaErrorInvalidChannelDescriptor() { + return cudaErrorInvalidChannelDescriptor; + } + private static final int cudaErrorInvalidMemcpyDirection = (int)21L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidMemcpyDirection = 21 + * } + */ + public static int cudaErrorInvalidMemcpyDirection() { + return cudaErrorInvalidMemcpyDirection; + } + private static final int cudaErrorAddressOfConstant = (int)22L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorAddressOfConstant = 22 + * } + */ + public static int cudaErrorAddressOfConstant() { + return cudaErrorAddressOfConstant; + } + private static final int cudaErrorTextureFetchFailed = (int)23L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorTextureFetchFailed = 23 + * } + */ + public static int cudaErrorTextureFetchFailed() { + return cudaErrorTextureFetchFailed; + } + private static final int cudaErrorTextureNotBound = (int)24L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorTextureNotBound = 24 + * } + */ + public static int cudaErrorTextureNotBound() { + return cudaErrorTextureNotBound; + } + private static final int cudaErrorSynchronizationError = (int)25L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorSynchronizationError = 25 + * } + */ + public static int cudaErrorSynchronizationError() { + return cudaErrorSynchronizationError; + } + private static final int cudaErrorInvalidFilterSetting = (int)26L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidFilterSetting = 26 + * } + */ + public static int cudaErrorInvalidFilterSetting() { + return cudaErrorInvalidFilterSetting; + } + private static final int cudaErrorInvalidNormSetting = (int)27L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidNormSetting = 27 + * } + */ + public static int cudaErrorInvalidNormSetting() { + return cudaErrorInvalidNormSetting; + } + private static final int cudaErrorMixedDeviceExecution = (int)28L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMixedDeviceExecution = 28 + * } + */ + public static int cudaErrorMixedDeviceExecution() { + return cudaErrorMixedDeviceExecution; + } + private static final int cudaErrorNotYetImplemented = (int)31L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorNotYetImplemented = 31 + * } + */ + public static int cudaErrorNotYetImplemented() { + return cudaErrorNotYetImplemented; + } + private static final int cudaErrorMemoryValueTooLarge = (int)32L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMemoryValueTooLarge = 32 + * } + */ + public static int cudaErrorMemoryValueTooLarge() { + return cudaErrorMemoryValueTooLarge; + } + private static final int cudaErrorStubLibrary = (int)34L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorStubLibrary = 34 + * } + */ + public static int cudaErrorStubLibrary() { + return cudaErrorStubLibrary; + } + private static final int cudaErrorInsufficientDriver = (int)35L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInsufficientDriver = 35 + * } + */ + public static int cudaErrorInsufficientDriver() { + return cudaErrorInsufficientDriver; + } + private static final int cudaErrorCallRequiresNewerDriver = (int)36L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorCallRequiresNewerDriver = 36 + * } + */ + public static int cudaErrorCallRequiresNewerDriver() { + return cudaErrorCallRequiresNewerDriver; + } + private static final int cudaErrorInvalidSurface = (int)37L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidSurface = 37 + * } + */ + public static int cudaErrorInvalidSurface() { + return cudaErrorInvalidSurface; + } + private static final int cudaErrorDuplicateVariableName = (int)43L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorDuplicateVariableName = 43 + * } + */ + public static int cudaErrorDuplicateVariableName() { + return cudaErrorDuplicateVariableName; + } + private static final int cudaErrorDuplicateTextureName = (int)44L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorDuplicateTextureName = 44 + * } + */ + public static int cudaErrorDuplicateTextureName() { + return cudaErrorDuplicateTextureName; + } + private static final int cudaErrorDuplicateSurfaceName = (int)45L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorDuplicateSurfaceName = 45 + * } + */ + public static int cudaErrorDuplicateSurfaceName() { + return cudaErrorDuplicateSurfaceName; + } + private static final int cudaErrorDevicesUnavailable = (int)46L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorDevicesUnavailable = 46 + * } + */ + public static int cudaErrorDevicesUnavailable() { + return cudaErrorDevicesUnavailable; + } + private static final int cudaErrorIncompatibleDriverContext = (int)49L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorIncompatibleDriverContext = 49 + * } + */ + public static int cudaErrorIncompatibleDriverContext() { + return cudaErrorIncompatibleDriverContext; + } + private static final int cudaErrorMissingConfiguration = (int)52L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMissingConfiguration = 52 + * } + */ + public static int cudaErrorMissingConfiguration() { + return cudaErrorMissingConfiguration; + } + private static final int cudaErrorPriorLaunchFailure = (int)53L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorPriorLaunchFailure = 53 + * } + */ + public static int cudaErrorPriorLaunchFailure() { + return cudaErrorPriorLaunchFailure; + } + private static final int cudaErrorLaunchMaxDepthExceeded = (int)65L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorLaunchMaxDepthExceeded = 65 + * } + */ + public static int cudaErrorLaunchMaxDepthExceeded() { + return cudaErrorLaunchMaxDepthExceeded; + } + private static final int cudaErrorLaunchFileScopedTex = (int)66L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorLaunchFileScopedTex = 66 + * } + */ + public static int cudaErrorLaunchFileScopedTex() { + return cudaErrorLaunchFileScopedTex; + } + private static final int cudaErrorLaunchFileScopedSurf = (int)67L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorLaunchFileScopedSurf = 67 + * } + */ + public static int cudaErrorLaunchFileScopedSurf() { + return cudaErrorLaunchFileScopedSurf; + } + private static final int cudaErrorSyncDepthExceeded = (int)68L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorSyncDepthExceeded = 68 + * } + */ + public static int cudaErrorSyncDepthExceeded() { + return cudaErrorSyncDepthExceeded; + } + private static final int cudaErrorLaunchPendingCountExceeded = (int)69L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorLaunchPendingCountExceeded = 69 + * } + */ + public static int cudaErrorLaunchPendingCountExceeded() { + return cudaErrorLaunchPendingCountExceeded; + } + private static final int cudaErrorInvalidDeviceFunction = (int)98L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidDeviceFunction = 98 + * } + */ + public static int cudaErrorInvalidDeviceFunction() { + return cudaErrorInvalidDeviceFunction; + } + private static final int cudaErrorNoDevice = (int)100L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorNoDevice = 100 + * } + */ + public static int cudaErrorNoDevice() { + return cudaErrorNoDevice; + } + private static final int cudaErrorInvalidDevice = (int)101L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidDevice = 101 + * } + */ + public static int cudaErrorInvalidDevice() { + return cudaErrorInvalidDevice; + } + private static final int cudaErrorDeviceNotLicensed = (int)102L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorDeviceNotLicensed = 102 + * } + */ + public static int cudaErrorDeviceNotLicensed() { + return cudaErrorDeviceNotLicensed; + } + private static final int cudaErrorSoftwareValidityNotEstablished = (int)103L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorSoftwareValidityNotEstablished = 103 + * } + */ + public static int cudaErrorSoftwareValidityNotEstablished() { + return cudaErrorSoftwareValidityNotEstablished; + } + private static final int cudaErrorStartupFailure = (int)127L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorStartupFailure = 127 + * } + */ + public static int cudaErrorStartupFailure() { + return cudaErrorStartupFailure; + } + private static final int cudaErrorInvalidKernelImage = (int)200L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidKernelImage = 200 + * } + */ + public static int cudaErrorInvalidKernelImage() { + return cudaErrorInvalidKernelImage; + } + private static final int cudaErrorDeviceUninitialized = (int)201L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorDeviceUninitialized = 201 + * } + */ + public static int cudaErrorDeviceUninitialized() { + return cudaErrorDeviceUninitialized; + } + private static final int cudaErrorMapBufferObjectFailed = (int)205L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMapBufferObjectFailed = 205 + * } + */ + public static int cudaErrorMapBufferObjectFailed() { + return cudaErrorMapBufferObjectFailed; + } + private static final int cudaErrorUnmapBufferObjectFailed = (int)206L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorUnmapBufferObjectFailed = 206 + * } + */ + public static int cudaErrorUnmapBufferObjectFailed() { + return cudaErrorUnmapBufferObjectFailed; + } + private static final int cudaErrorArrayIsMapped = (int)207L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorArrayIsMapped = 207 + * } + */ + public static int cudaErrorArrayIsMapped() { + return cudaErrorArrayIsMapped; + } + private static final int cudaErrorAlreadyMapped = (int)208L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorAlreadyMapped = 208 + * } + */ + public static int cudaErrorAlreadyMapped() { + return cudaErrorAlreadyMapped; + } + private static final int cudaErrorNoKernelImageForDevice = (int)209L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorNoKernelImageForDevice = 209 + * } + */ + public static int cudaErrorNoKernelImageForDevice() { + return cudaErrorNoKernelImageForDevice; + } + private static final int cudaErrorAlreadyAcquired = (int)210L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorAlreadyAcquired = 210 + * } + */ + public static int cudaErrorAlreadyAcquired() { + return cudaErrorAlreadyAcquired; + } + private static final int cudaErrorNotMapped = (int)211L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorNotMapped = 211 + * } + */ + public static int cudaErrorNotMapped() { + return cudaErrorNotMapped; + } + private static final int cudaErrorNotMappedAsArray = (int)212L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorNotMappedAsArray = 212 + * } + */ + public static int cudaErrorNotMappedAsArray() { + return cudaErrorNotMappedAsArray; + } + private static final int cudaErrorNotMappedAsPointer = (int)213L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorNotMappedAsPointer = 213 + * } + */ + public static int cudaErrorNotMappedAsPointer() { + return cudaErrorNotMappedAsPointer; + } + private static final int cudaErrorECCUncorrectable = (int)214L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorECCUncorrectable = 214 + * } + */ + public static int cudaErrorECCUncorrectable() { + return cudaErrorECCUncorrectable; + } + private static final int cudaErrorUnsupportedLimit = (int)215L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorUnsupportedLimit = 215 + * } + */ + public static int cudaErrorUnsupportedLimit() { + return cudaErrorUnsupportedLimit; + } + private static final int cudaErrorDeviceAlreadyInUse = (int)216L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorDeviceAlreadyInUse = 216 + * } + */ + public static int cudaErrorDeviceAlreadyInUse() { + return cudaErrorDeviceAlreadyInUse; + } + private static final int cudaErrorPeerAccessUnsupported = (int)217L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorPeerAccessUnsupported = 217 + * } + */ + public static int cudaErrorPeerAccessUnsupported() { + return cudaErrorPeerAccessUnsupported; + } + private static final int cudaErrorInvalidPtx = (int)218L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidPtx = 218 + * } + */ + public static int cudaErrorInvalidPtx() { + return cudaErrorInvalidPtx; + } + private static final int cudaErrorInvalidGraphicsContext = (int)219L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidGraphicsContext = 219 + * } + */ + public static int cudaErrorInvalidGraphicsContext() { + return cudaErrorInvalidGraphicsContext; + } + private static final int cudaErrorNvlinkUncorrectable = (int)220L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorNvlinkUncorrectable = 220 + * } + */ + public static int cudaErrorNvlinkUncorrectable() { + return cudaErrorNvlinkUncorrectable; + } + private static final int cudaErrorJitCompilerNotFound = (int)221L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorJitCompilerNotFound = 221 + * } + */ + public static int cudaErrorJitCompilerNotFound() { + return cudaErrorJitCompilerNotFound; + } + private static final int cudaErrorUnsupportedPtxVersion = (int)222L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorUnsupportedPtxVersion = 222 + * } + */ + public static int cudaErrorUnsupportedPtxVersion() { + return cudaErrorUnsupportedPtxVersion; + } + private static final int cudaErrorJitCompilationDisabled = (int)223L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorJitCompilationDisabled = 223 + * } + */ + public static int cudaErrorJitCompilationDisabled() { + return cudaErrorJitCompilationDisabled; + } + private static final int cudaErrorUnsupportedExecAffinity = (int)224L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorUnsupportedExecAffinity = 224 + * } + */ + public static int cudaErrorUnsupportedExecAffinity() { + return cudaErrorUnsupportedExecAffinity; + } + private static final int cudaErrorUnsupportedDevSideSync = (int)225L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorUnsupportedDevSideSync = 225 + * } + */ + public static int cudaErrorUnsupportedDevSideSync() { + return cudaErrorUnsupportedDevSideSync; + } + private static final int cudaErrorInvalidSource = (int)300L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidSource = 300 + * } + */ + public static int cudaErrorInvalidSource() { + return cudaErrorInvalidSource; + } + private static final int cudaErrorFileNotFound = (int)301L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorFileNotFound = 301 + * } + */ + public static int cudaErrorFileNotFound() { + return cudaErrorFileNotFound; + } + private static final int cudaErrorSharedObjectSymbolNotFound = (int)302L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorSharedObjectSymbolNotFound = 302 + * } + */ + public static int cudaErrorSharedObjectSymbolNotFound() { + return cudaErrorSharedObjectSymbolNotFound; + } + private static final int cudaErrorSharedObjectInitFailed = (int)303L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorSharedObjectInitFailed = 303 + * } + */ + public static int cudaErrorSharedObjectInitFailed() { + return cudaErrorSharedObjectInitFailed; + } + private static final int cudaErrorOperatingSystem = (int)304L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorOperatingSystem = 304 + * } + */ + public static int cudaErrorOperatingSystem() { + return cudaErrorOperatingSystem; + } + private static final int cudaErrorInvalidResourceHandle = (int)400L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidResourceHandle = 400 + * } + */ + public static int cudaErrorInvalidResourceHandle() { + return cudaErrorInvalidResourceHandle; + } + private static final int cudaErrorIllegalState = (int)401L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorIllegalState = 401 + * } + */ + public static int cudaErrorIllegalState() { + return cudaErrorIllegalState; + } + private static final int cudaErrorLossyQuery = (int)402L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorLossyQuery = 402 + * } + */ + public static int cudaErrorLossyQuery() { + return cudaErrorLossyQuery; + } + private static final int cudaErrorSymbolNotFound = (int)500L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorSymbolNotFound = 500 + * } + */ + public static int cudaErrorSymbolNotFound() { + return cudaErrorSymbolNotFound; + } + private static final int cudaErrorNotReady = (int)600L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorNotReady = 600 + * } + */ + public static int cudaErrorNotReady() { + return cudaErrorNotReady; + } + private static final int cudaErrorIllegalAddress = (int)700L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorIllegalAddress = 700 + * } + */ + public static int cudaErrorIllegalAddress() { + return cudaErrorIllegalAddress; + } + private static final int cudaErrorLaunchOutOfResources = (int)701L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorLaunchOutOfResources = 701 + * } + */ + public static int cudaErrorLaunchOutOfResources() { + return cudaErrorLaunchOutOfResources; + } + private static final int cudaErrorLaunchTimeout = (int)702L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorLaunchTimeout = 702 + * } + */ + public static int cudaErrorLaunchTimeout() { + return cudaErrorLaunchTimeout; + } + private static final int cudaErrorLaunchIncompatibleTexturing = (int)703L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorLaunchIncompatibleTexturing = 703 + * } + */ + public static int cudaErrorLaunchIncompatibleTexturing() { + return cudaErrorLaunchIncompatibleTexturing; + } + private static final int cudaErrorPeerAccessAlreadyEnabled = (int)704L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorPeerAccessAlreadyEnabled = 704 + * } + */ + public static int cudaErrorPeerAccessAlreadyEnabled() { + return cudaErrorPeerAccessAlreadyEnabled; + } + private static final int cudaErrorPeerAccessNotEnabled = (int)705L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorPeerAccessNotEnabled = 705 + * } + */ + public static int cudaErrorPeerAccessNotEnabled() { + return cudaErrorPeerAccessNotEnabled; + } + private static final int cudaErrorSetOnActiveProcess = (int)708L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorSetOnActiveProcess = 708 + * } + */ + public static int cudaErrorSetOnActiveProcess() { + return cudaErrorSetOnActiveProcess; + } + private static final int cudaErrorContextIsDestroyed = (int)709L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorContextIsDestroyed = 709 + * } + */ + public static int cudaErrorContextIsDestroyed() { + return cudaErrorContextIsDestroyed; + } + private static final int cudaErrorAssert = (int)710L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorAssert = 710 + * } + */ + public static int cudaErrorAssert() { + return cudaErrorAssert; + } + private static final int cudaErrorTooManyPeers = (int)711L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorTooManyPeers = 711 + * } + */ + public static int cudaErrorTooManyPeers() { + return cudaErrorTooManyPeers; + } + private static final int cudaErrorHostMemoryAlreadyRegistered = (int)712L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorHostMemoryAlreadyRegistered = 712 + * } + */ + public static int cudaErrorHostMemoryAlreadyRegistered() { + return cudaErrorHostMemoryAlreadyRegistered; + } + private static final int cudaErrorHostMemoryNotRegistered = (int)713L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorHostMemoryNotRegistered = 713 + * } + */ + public static int cudaErrorHostMemoryNotRegistered() { + return cudaErrorHostMemoryNotRegistered; + } + private static final int cudaErrorHardwareStackError = (int)714L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorHardwareStackError = 714 + * } + */ + public static int cudaErrorHardwareStackError() { + return cudaErrorHardwareStackError; + } + private static final int cudaErrorIllegalInstruction = (int)715L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorIllegalInstruction = 715 + * } + */ + public static int cudaErrorIllegalInstruction() { + return cudaErrorIllegalInstruction; + } + private static final int cudaErrorMisalignedAddress = (int)716L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMisalignedAddress = 716 + * } + */ + public static int cudaErrorMisalignedAddress() { + return cudaErrorMisalignedAddress; + } + private static final int cudaErrorInvalidAddressSpace = (int)717L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidAddressSpace = 717 + * } + */ + public static int cudaErrorInvalidAddressSpace() { + return cudaErrorInvalidAddressSpace; + } + private static final int cudaErrorInvalidPc = (int)718L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidPc = 718 + * } + */ + public static int cudaErrorInvalidPc() { + return cudaErrorInvalidPc; + } + private static final int cudaErrorLaunchFailure = (int)719L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorLaunchFailure = 719 + * } + */ + public static int cudaErrorLaunchFailure() { + return cudaErrorLaunchFailure; + } + private static final int cudaErrorCooperativeLaunchTooLarge = (int)720L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorCooperativeLaunchTooLarge = 720 + * } + */ + public static int cudaErrorCooperativeLaunchTooLarge() { + return cudaErrorCooperativeLaunchTooLarge; + } + private static final int cudaErrorNotPermitted = (int)800L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorNotPermitted = 800 + * } + */ + public static int cudaErrorNotPermitted() { + return cudaErrorNotPermitted; + } + private static final int cudaErrorNotSupported = (int)801L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorNotSupported = 801 + * } + */ + public static int cudaErrorNotSupported() { + return cudaErrorNotSupported; + } + private static final int cudaErrorSystemNotReady = (int)802L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorSystemNotReady = 802 + * } + */ + public static int cudaErrorSystemNotReady() { + return cudaErrorSystemNotReady; + } + private static final int cudaErrorSystemDriverMismatch = (int)803L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorSystemDriverMismatch = 803 + * } + */ + public static int cudaErrorSystemDriverMismatch() { + return cudaErrorSystemDriverMismatch; + } + private static final int cudaErrorCompatNotSupportedOnDevice = (int)804L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorCompatNotSupportedOnDevice = 804 + * } + */ + public static int cudaErrorCompatNotSupportedOnDevice() { + return cudaErrorCompatNotSupportedOnDevice; + } + private static final int cudaErrorMpsConnectionFailed = (int)805L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMpsConnectionFailed = 805 + * } + */ + public static int cudaErrorMpsConnectionFailed() { + return cudaErrorMpsConnectionFailed; + } + private static final int cudaErrorMpsRpcFailure = (int)806L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMpsRpcFailure = 806 + * } + */ + public static int cudaErrorMpsRpcFailure() { + return cudaErrorMpsRpcFailure; + } + private static final int cudaErrorMpsServerNotReady = (int)807L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMpsServerNotReady = 807 + * } + */ + public static int cudaErrorMpsServerNotReady() { + return cudaErrorMpsServerNotReady; + } + private static final int cudaErrorMpsMaxClientsReached = (int)808L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMpsMaxClientsReached = 808 + * } + */ + public static int cudaErrorMpsMaxClientsReached() { + return cudaErrorMpsMaxClientsReached; + } + private static final int cudaErrorMpsMaxConnectionsReached = (int)809L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMpsMaxConnectionsReached = 809 + * } + */ + public static int cudaErrorMpsMaxConnectionsReached() { + return cudaErrorMpsMaxConnectionsReached; + } + private static final int cudaErrorMpsClientTerminated = (int)810L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorMpsClientTerminated = 810 + * } + */ + public static int cudaErrorMpsClientTerminated() { + return cudaErrorMpsClientTerminated; + } + private static final int cudaErrorCdpNotSupported = (int)811L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorCdpNotSupported = 811 + * } + */ + public static int cudaErrorCdpNotSupported() { + return cudaErrorCdpNotSupported; + } + private static final int cudaErrorCdpVersionMismatch = (int)812L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorCdpVersionMismatch = 812 + * } + */ + public static int cudaErrorCdpVersionMismatch() { + return cudaErrorCdpVersionMismatch; + } + private static final int cudaErrorStreamCaptureUnsupported = (int)900L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorStreamCaptureUnsupported = 900 + * } + */ + public static int cudaErrorStreamCaptureUnsupported() { + return cudaErrorStreamCaptureUnsupported; + } + private static final int cudaErrorStreamCaptureInvalidated = (int)901L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorStreamCaptureInvalidated = 901 + * } + */ + public static int cudaErrorStreamCaptureInvalidated() { + return cudaErrorStreamCaptureInvalidated; + } + private static final int cudaErrorStreamCaptureMerge = (int)902L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorStreamCaptureMerge = 902 + * } + */ + public static int cudaErrorStreamCaptureMerge() { + return cudaErrorStreamCaptureMerge; + } + private static final int cudaErrorStreamCaptureUnmatched = (int)903L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorStreamCaptureUnmatched = 903 + * } + */ + public static int cudaErrorStreamCaptureUnmatched() { + return cudaErrorStreamCaptureUnmatched; + } + private static final int cudaErrorStreamCaptureUnjoined = (int)904L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorStreamCaptureUnjoined = 904 + * } + */ + public static int cudaErrorStreamCaptureUnjoined() { + return cudaErrorStreamCaptureUnjoined; + } + private static final int cudaErrorStreamCaptureIsolation = (int)905L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorStreamCaptureIsolation = 905 + * } + */ + public static int cudaErrorStreamCaptureIsolation() { + return cudaErrorStreamCaptureIsolation; + } + private static final int cudaErrorStreamCaptureImplicit = (int)906L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorStreamCaptureImplicit = 906 + * } + */ + public static int cudaErrorStreamCaptureImplicit() { + return cudaErrorStreamCaptureImplicit; + } + private static final int cudaErrorCapturedEvent = (int)907L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorCapturedEvent = 907 + * } + */ + public static int cudaErrorCapturedEvent() { + return cudaErrorCapturedEvent; + } + private static final int cudaErrorStreamCaptureWrongThread = (int)908L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorStreamCaptureWrongThread = 908 + * } + */ + public static int cudaErrorStreamCaptureWrongThread() { + return cudaErrorStreamCaptureWrongThread; + } + private static final int cudaErrorTimeout = (int)909L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorTimeout = 909 + * } + */ + public static int cudaErrorTimeout() { + return cudaErrorTimeout; + } + private static final int cudaErrorGraphExecUpdateFailure = (int)910L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorGraphExecUpdateFailure = 910 + * } + */ + public static int cudaErrorGraphExecUpdateFailure() { + return cudaErrorGraphExecUpdateFailure; + } + private static final int cudaErrorExternalDevice = (int)911L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorExternalDevice = 911 + * } + */ + public static int cudaErrorExternalDevice() { + return cudaErrorExternalDevice; + } + private static final int cudaErrorInvalidClusterSize = (int)912L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidClusterSize = 912 + * } + */ + public static int cudaErrorInvalidClusterSize() { + return cudaErrorInvalidClusterSize; + } + private static final int cudaErrorFunctionNotLoaded = (int)913L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorFunctionNotLoaded = 913 + * } + */ + public static int cudaErrorFunctionNotLoaded() { + return cudaErrorFunctionNotLoaded; + } + private static final int cudaErrorInvalidResourceType = (int)914L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidResourceType = 914 + * } + */ + public static int cudaErrorInvalidResourceType() { + return cudaErrorInvalidResourceType; + } + private static final int cudaErrorInvalidResourceConfiguration = (int)915L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorInvalidResourceConfiguration = 915 + * } + */ + public static int cudaErrorInvalidResourceConfiguration() { + return cudaErrorInvalidResourceConfiguration; + } + private static final int cudaErrorUnknown = (int)999L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorUnknown = 999 + * } + */ + public static int cudaErrorUnknown() { + return cudaErrorUnknown; + } + private static final int cudaErrorApiFailureBase = (int)10000L; + /** + * {@snippet lang=c : + * enum cudaError.cudaErrorApiFailureBase = 10000 + * } + */ + public static int cudaErrorApiFailureBase() { + return cudaErrorApiFailureBase; + } + private static final int cudaChannelFormatKindSigned = (int)0L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindSigned = 0 + * } + */ + public static int cudaChannelFormatKindSigned() { + return cudaChannelFormatKindSigned; + } + private static final int cudaChannelFormatKindUnsigned = (int)1L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsigned = 1 + * } + */ + public static int cudaChannelFormatKindUnsigned() { + return cudaChannelFormatKindUnsigned; + } + private static final int cudaChannelFormatKindFloat = (int)2L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindFloat = 2 + * } + */ + public static int cudaChannelFormatKindFloat() { + return cudaChannelFormatKindFloat; + } + private static final int cudaChannelFormatKindNone = (int)3L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindNone = 3 + * } + */ + public static int cudaChannelFormatKindNone() { + return cudaChannelFormatKindNone; + } + private static final int cudaChannelFormatKindNV12 = (int)4L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindNV12 = 4 + * } + */ + public static int cudaChannelFormatKindNV12() { + return cudaChannelFormatKindNV12; + } + private static final int cudaChannelFormatKindUnsignedNormalized8X1 = (int)5L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1 = 5 + * } + */ + public static int cudaChannelFormatKindUnsignedNormalized8X1() { + return cudaChannelFormatKindUnsignedNormalized8X1; + } + private static final int cudaChannelFormatKindUnsignedNormalized8X2 = (int)6L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2 = 6 + * } + */ + public static int cudaChannelFormatKindUnsignedNormalized8X2() { + return cudaChannelFormatKindUnsignedNormalized8X2; + } + private static final int cudaChannelFormatKindUnsignedNormalized8X4 = (int)7L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4 = 7 + * } + */ + public static int cudaChannelFormatKindUnsignedNormalized8X4() { + return cudaChannelFormatKindUnsignedNormalized8X4; + } + private static final int cudaChannelFormatKindUnsignedNormalized16X1 = (int)8L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1 = 8 + * } + */ + public static int cudaChannelFormatKindUnsignedNormalized16X1() { + return cudaChannelFormatKindUnsignedNormalized16X1; + } + private static final int cudaChannelFormatKindUnsignedNormalized16X2 = (int)9L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2 = 9 + * } + */ + public static int cudaChannelFormatKindUnsignedNormalized16X2() { + return cudaChannelFormatKindUnsignedNormalized16X2; + } + private static final int cudaChannelFormatKindUnsignedNormalized16X4 = (int)10L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4 = 10 + * } + */ + public static int cudaChannelFormatKindUnsignedNormalized16X4() { + return cudaChannelFormatKindUnsignedNormalized16X4; + } + private static final int cudaChannelFormatKindSignedNormalized8X1 = (int)11L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1 = 11 + * } + */ + public static int cudaChannelFormatKindSignedNormalized8X1() { + return cudaChannelFormatKindSignedNormalized8X1; + } + private static final int cudaChannelFormatKindSignedNormalized8X2 = (int)12L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2 = 12 + * } + */ + public static int cudaChannelFormatKindSignedNormalized8X2() { + return cudaChannelFormatKindSignedNormalized8X2; + } + private static final int cudaChannelFormatKindSignedNormalized8X4 = (int)13L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4 = 13 + * } + */ + public static int cudaChannelFormatKindSignedNormalized8X4() { + return cudaChannelFormatKindSignedNormalized8X4; + } + private static final int cudaChannelFormatKindSignedNormalized16X1 = (int)14L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1 = 14 + * } + */ + public static int cudaChannelFormatKindSignedNormalized16X1() { + return cudaChannelFormatKindSignedNormalized16X1; + } + private static final int cudaChannelFormatKindSignedNormalized16X2 = (int)15L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2 = 15 + * } + */ + public static int cudaChannelFormatKindSignedNormalized16X2() { + return cudaChannelFormatKindSignedNormalized16X2; + } + private static final int cudaChannelFormatKindSignedNormalized16X4 = (int)16L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4 = 16 + * } + */ + public static int cudaChannelFormatKindSignedNormalized16X4() { + return cudaChannelFormatKindSignedNormalized16X4; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed1 = (int)17L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1 = 17 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed1() { + return cudaChannelFormatKindUnsignedBlockCompressed1; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed1SRGB = (int)18L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB = 18 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed1SRGB() { + return cudaChannelFormatKindUnsignedBlockCompressed1SRGB; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed2 = (int)19L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2 = 19 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed2() { + return cudaChannelFormatKindUnsignedBlockCompressed2; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed2SRGB = (int)20L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB = 20 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed2SRGB() { + return cudaChannelFormatKindUnsignedBlockCompressed2SRGB; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed3 = (int)21L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3 = 21 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed3() { + return cudaChannelFormatKindUnsignedBlockCompressed3; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed3SRGB = (int)22L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB = 22 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed3SRGB() { + return cudaChannelFormatKindUnsignedBlockCompressed3SRGB; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed4 = (int)23L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4 = 23 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed4() { + return cudaChannelFormatKindUnsignedBlockCompressed4; + } + private static final int cudaChannelFormatKindSignedBlockCompressed4 = (int)24L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4 = 24 + * } + */ + public static int cudaChannelFormatKindSignedBlockCompressed4() { + return cudaChannelFormatKindSignedBlockCompressed4; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed5 = (int)25L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5 = 25 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed5() { + return cudaChannelFormatKindUnsignedBlockCompressed5; + } + private static final int cudaChannelFormatKindSignedBlockCompressed5 = (int)26L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5 = 26 + * } + */ + public static int cudaChannelFormatKindSignedBlockCompressed5() { + return cudaChannelFormatKindSignedBlockCompressed5; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed6H = (int)27L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H = 27 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed6H() { + return cudaChannelFormatKindUnsignedBlockCompressed6H; + } + private static final int cudaChannelFormatKindSignedBlockCompressed6H = (int)28L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H = 28 + * } + */ + public static int cudaChannelFormatKindSignedBlockCompressed6H() { + return cudaChannelFormatKindSignedBlockCompressed6H; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed7 = (int)29L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7 = 29 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed7() { + return cudaChannelFormatKindUnsignedBlockCompressed7; + } + private static final int cudaChannelFormatKindUnsignedBlockCompressed7SRGB = (int)30L; + /** + * {@snippet lang=c : + * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB = 30 + * } + */ + public static int cudaChannelFormatKindUnsignedBlockCompressed7SRGB() { + return cudaChannelFormatKindUnsignedBlockCompressed7SRGB; + } + /** + * {@snippet lang=c : + * typedef struct cudaArray *cudaArray_t + * } + */ + public static final AddressLayout cudaArray_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef const struct cudaArray *cudaArray_const_t + * } + */ + public static final AddressLayout cudaArray_const_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct cudaMipmappedArray *cudaMipmappedArray_t + * } + */ + public static final AddressLayout cudaMipmappedArray_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef const struct cudaMipmappedArray *cudaMipmappedArray_const_t + * } + */ + public static final AddressLayout cudaMipmappedArray_const_t = PanamaFFMAPI.C_POINTER; + private static final int cudaMemoryTypeUnregistered = (int)0L; + /** + * {@snippet lang=c : + * enum cudaMemoryType.cudaMemoryTypeUnregistered = 0 + * } + */ + public static int cudaMemoryTypeUnregistered() { + return cudaMemoryTypeUnregistered; + } + private static final int cudaMemoryTypeHost = (int)1L; + /** + * {@snippet lang=c : + * enum cudaMemoryType.cudaMemoryTypeHost = 1 + * } + */ + public static int cudaMemoryTypeHost() { + return cudaMemoryTypeHost; + } + private static final int cudaMemoryTypeDevice = (int)2L; + /** + * {@snippet lang=c : + * enum cudaMemoryType.cudaMemoryTypeDevice = 2 + * } + */ + public static int cudaMemoryTypeDevice() { + return cudaMemoryTypeDevice; + } + private static final int cudaMemoryTypeManaged = (int)3L; + /** + * {@snippet lang=c : + * enum cudaMemoryType.cudaMemoryTypeManaged = 3 + * } + */ + public static int cudaMemoryTypeManaged() { + return cudaMemoryTypeManaged; + } + private static final int cudaMemcpyHostToHost = (int)0L; + /** + * {@snippet lang=c : + * enum cudaMemcpyKind.cudaMemcpyHostToHost = 0 + * } + */ + public static int cudaMemcpyHostToHost() { + return cudaMemcpyHostToHost; + } + private static final int cudaMemcpyHostToDevice = (int)1L; + /** + * {@snippet lang=c : + * enum cudaMemcpyKind.cudaMemcpyHostToDevice = 1 + * } + */ + public static int cudaMemcpyHostToDevice() { + return cudaMemcpyHostToDevice; + } + private static final int cudaMemcpyDeviceToHost = (int)2L; + /** + * {@snippet lang=c : + * enum cudaMemcpyKind.cudaMemcpyDeviceToHost = 2 + * } + */ + public static int cudaMemcpyDeviceToHost() { + return cudaMemcpyDeviceToHost; + } + private static final int cudaMemcpyDeviceToDevice = (int)3L; + /** + * {@snippet lang=c : + * enum cudaMemcpyKind.cudaMemcpyDeviceToDevice = 3 + * } + */ + public static int cudaMemcpyDeviceToDevice() { + return cudaMemcpyDeviceToDevice; + } + private static final int cudaMemcpyDefault = (int)4L; + /** + * {@snippet lang=c : + * enum cudaMemcpyKind.cudaMemcpyDefault = 4 + * } + */ + public static int cudaMemcpyDefault() { + return cudaMemcpyDefault; + } + private static final int cudaAccessPropertyNormal = (int)0L; + /** + * {@snippet lang=c : + * enum cudaAccessProperty.cudaAccessPropertyNormal = 0 + * } + */ + public static int cudaAccessPropertyNormal() { + return cudaAccessPropertyNormal; + } + private static final int cudaAccessPropertyStreaming = (int)1L; + /** + * {@snippet lang=c : + * enum cudaAccessProperty.cudaAccessPropertyStreaming = 1 + * } + */ + public static int cudaAccessPropertyStreaming() { + return cudaAccessPropertyStreaming; + } + private static final int cudaAccessPropertyPersisting = (int)2L; + /** + * {@snippet lang=c : + * enum cudaAccessProperty.cudaAccessPropertyPersisting = 2 + * } + */ + public static int cudaAccessPropertyPersisting() { + return cudaAccessPropertyPersisting; + } + private static final int cudaStreamCaptureStatusNone = (int)0L; + /** + * {@snippet lang=c : + * enum cudaStreamCaptureStatus.cudaStreamCaptureStatusNone = 0 + * } + */ + public static int cudaStreamCaptureStatusNone() { + return cudaStreamCaptureStatusNone; + } + private static final int cudaStreamCaptureStatusActive = (int)1L; + /** + * {@snippet lang=c : + * enum cudaStreamCaptureStatus.cudaStreamCaptureStatusActive = 1 + * } + */ + public static int cudaStreamCaptureStatusActive() { + return cudaStreamCaptureStatusActive; + } + private static final int cudaStreamCaptureStatusInvalidated = (int)2L; + /** + * {@snippet lang=c : + * enum cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated = 2 + * } + */ + public static int cudaStreamCaptureStatusInvalidated() { + return cudaStreamCaptureStatusInvalidated; + } + private static final int cudaStreamCaptureModeGlobal = (int)0L; + /** + * {@snippet lang=c : + * enum cudaStreamCaptureMode.cudaStreamCaptureModeGlobal = 0 + * } + */ + public static int cudaStreamCaptureModeGlobal() { + return cudaStreamCaptureModeGlobal; + } + private static final int cudaStreamCaptureModeThreadLocal = (int)1L; + /** + * {@snippet lang=c : + * enum cudaStreamCaptureMode.cudaStreamCaptureModeThreadLocal = 1 + * } + */ + public static int cudaStreamCaptureModeThreadLocal() { + return cudaStreamCaptureModeThreadLocal; + } + private static final int cudaStreamCaptureModeRelaxed = (int)2L; + /** + * {@snippet lang=c : + * enum cudaStreamCaptureMode.cudaStreamCaptureModeRelaxed = 2 + * } + */ + public static int cudaStreamCaptureModeRelaxed() { + return cudaStreamCaptureModeRelaxed; + } + private static final int cudaSyncPolicyAuto = (int)1L; + /** + * {@snippet lang=c : + * enum cudaSynchronizationPolicy.cudaSyncPolicyAuto = 1 + * } + */ + public static int cudaSyncPolicyAuto() { + return cudaSyncPolicyAuto; + } + private static final int cudaSyncPolicySpin = (int)2L; + /** + * {@snippet lang=c : + * enum cudaSynchronizationPolicy.cudaSyncPolicySpin = 2 + * } + */ + public static int cudaSyncPolicySpin() { + return cudaSyncPolicySpin; + } + private static final int cudaSyncPolicyYield = (int)3L; + /** + * {@snippet lang=c : + * enum cudaSynchronizationPolicy.cudaSyncPolicyYield = 3 + * } + */ + public static int cudaSyncPolicyYield() { + return cudaSyncPolicyYield; + } + private static final int cudaSyncPolicyBlockingSync = (int)4L; + /** + * {@snippet lang=c : + * enum cudaSynchronizationPolicy.cudaSyncPolicyBlockingSync = 4 + * } + */ + public static int cudaSyncPolicyBlockingSync() { + return cudaSyncPolicyBlockingSync; + } + private static final int cudaClusterSchedulingPolicyDefault = (int)0L; + /** + * {@snippet lang=c : + * enum cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyDefault = 0 + * } + */ + public static int cudaClusterSchedulingPolicyDefault() { + return cudaClusterSchedulingPolicyDefault; + } + private static final int cudaClusterSchedulingPolicySpread = (int)1L; + /** + * {@snippet lang=c : + * enum cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicySpread = 1 + * } + */ + public static int cudaClusterSchedulingPolicySpread() { + return cudaClusterSchedulingPolicySpread; + } + private static final int cudaClusterSchedulingPolicyLoadBalancing = (int)2L; + /** + * {@snippet lang=c : + * enum cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyLoadBalancing = 2 + * } + */ + public static int cudaClusterSchedulingPolicyLoadBalancing() { + return cudaClusterSchedulingPolicyLoadBalancing; + } + private static final int cudaStreamAddCaptureDependencies = (int)0L; + /** + * {@snippet lang=c : + * enum cudaStreamUpdateCaptureDependenciesFlags.cudaStreamAddCaptureDependencies = 0 + * } + */ + public static int cudaStreamAddCaptureDependencies() { + return cudaStreamAddCaptureDependencies; + } + private static final int cudaStreamSetCaptureDependencies = (int)1L; + /** + * {@snippet lang=c : + * enum cudaStreamUpdateCaptureDependenciesFlags.cudaStreamSetCaptureDependencies = 1 + * } + */ + public static int cudaStreamSetCaptureDependencies() { + return cudaStreamSetCaptureDependencies; + } + private static final int cudaUserObjectNoDestructorSync = (int)1L; + /** + * {@snippet lang=c : + * enum cudaUserObjectFlags.cudaUserObjectNoDestructorSync = 1 + * } + */ + public static int cudaUserObjectNoDestructorSync() { + return cudaUserObjectNoDestructorSync; + } + private static final int cudaGraphUserObjectMove = (int)1L; + /** + * {@snippet lang=c : + * enum cudaUserObjectRetainFlags.cudaGraphUserObjectMove = 1 + * } + */ + public static int cudaGraphUserObjectMove() { + return cudaGraphUserObjectMove; + } + private static final int cudaGraphicsRegisterFlagsNone = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsNone = 0 + * } + */ + public static int cudaGraphicsRegisterFlagsNone() { + return cudaGraphicsRegisterFlagsNone; + } + private static final int cudaGraphicsRegisterFlagsReadOnly = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsReadOnly = 1 + * } + */ + public static int cudaGraphicsRegisterFlagsReadOnly() { + return cudaGraphicsRegisterFlagsReadOnly; + } + private static final int cudaGraphicsRegisterFlagsWriteDiscard = (int)2L; + /** + * {@snippet lang=c : + * enum cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard = 2 + * } + */ + public static int cudaGraphicsRegisterFlagsWriteDiscard() { + return cudaGraphicsRegisterFlagsWriteDiscard; + } + private static final int cudaGraphicsRegisterFlagsSurfaceLoadStore = (int)4L; + /** + * {@snippet lang=c : + * enum cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsSurfaceLoadStore = 4 + * } + */ + public static int cudaGraphicsRegisterFlagsSurfaceLoadStore() { + return cudaGraphicsRegisterFlagsSurfaceLoadStore; + } + private static final int cudaGraphicsRegisterFlagsTextureGather = (int)8L; + /** + * {@snippet lang=c : + * enum cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsTextureGather = 8 + * } + */ + public static int cudaGraphicsRegisterFlagsTextureGather() { + return cudaGraphicsRegisterFlagsTextureGather; + } + private static final int cudaGraphicsMapFlagsNone = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGraphicsMapFlags.cudaGraphicsMapFlagsNone = 0 + * } + */ + public static int cudaGraphicsMapFlagsNone() { + return cudaGraphicsMapFlagsNone; + } + private static final int cudaGraphicsMapFlagsReadOnly = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphicsMapFlags.cudaGraphicsMapFlagsReadOnly = 1 + * } + */ + public static int cudaGraphicsMapFlagsReadOnly() { + return cudaGraphicsMapFlagsReadOnly; + } + private static final int cudaGraphicsMapFlagsWriteDiscard = (int)2L; + /** + * {@snippet lang=c : + * enum cudaGraphicsMapFlags.cudaGraphicsMapFlagsWriteDiscard = 2 + * } + */ + public static int cudaGraphicsMapFlagsWriteDiscard() { + return cudaGraphicsMapFlagsWriteDiscard; + } + private static final int cudaGraphicsCubeFacePositiveX = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveX = 0 + * } + */ + public static int cudaGraphicsCubeFacePositiveX() { + return cudaGraphicsCubeFacePositiveX; + } + private static final int cudaGraphicsCubeFaceNegativeX = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeX = 1 + * } + */ + public static int cudaGraphicsCubeFaceNegativeX() { + return cudaGraphicsCubeFaceNegativeX; + } + private static final int cudaGraphicsCubeFacePositiveY = (int)2L; + /** + * {@snippet lang=c : + * enum cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveY = 2 + * } + */ + public static int cudaGraphicsCubeFacePositiveY() { + return cudaGraphicsCubeFacePositiveY; + } + private static final int cudaGraphicsCubeFaceNegativeY = (int)3L; + /** + * {@snippet lang=c : + * enum cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeY = 3 + * } + */ + public static int cudaGraphicsCubeFaceNegativeY() { + return cudaGraphicsCubeFaceNegativeY; + } + private static final int cudaGraphicsCubeFacePositiveZ = (int)4L; + /** + * {@snippet lang=c : + * enum cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveZ = 4 + * } + */ + public static int cudaGraphicsCubeFacePositiveZ() { + return cudaGraphicsCubeFacePositiveZ; + } + private static final int cudaGraphicsCubeFaceNegativeZ = (int)5L; + /** + * {@snippet lang=c : + * enum cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeZ = 5 + * } + */ + public static int cudaGraphicsCubeFaceNegativeZ() { + return cudaGraphicsCubeFaceNegativeZ; + } + private static final int cudaResourceTypeArray = (int)0L; + /** + * {@snippet lang=c : + * enum cudaResourceType.cudaResourceTypeArray = 0 + * } + */ + public static int cudaResourceTypeArray() { + return cudaResourceTypeArray; + } + private static final int cudaResourceTypeMipmappedArray = (int)1L; + /** + * {@snippet lang=c : + * enum cudaResourceType.cudaResourceTypeMipmappedArray = 1 + * } + */ + public static int cudaResourceTypeMipmappedArray() { + return cudaResourceTypeMipmappedArray; + } + private static final int cudaResourceTypeLinear = (int)2L; + /** + * {@snippet lang=c : + * enum cudaResourceType.cudaResourceTypeLinear = 2 + * } + */ + public static int cudaResourceTypeLinear() { + return cudaResourceTypeLinear; + } + private static final int cudaResourceTypePitch2D = (int)3L; + /** + * {@snippet lang=c : + * enum cudaResourceType.cudaResourceTypePitch2D = 3 + * } + */ + public static int cudaResourceTypePitch2D() { + return cudaResourceTypePitch2D; + } + private static final int cudaResViewFormatNone = (int)0L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatNone = 0 + * } + */ + public static int cudaResViewFormatNone() { + return cudaResViewFormatNone; + } + private static final int cudaResViewFormatUnsignedChar1 = (int)1L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedChar1 = 1 + * } + */ + public static int cudaResViewFormatUnsignedChar1() { + return cudaResViewFormatUnsignedChar1; + } + private static final int cudaResViewFormatUnsignedChar2 = (int)2L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedChar2 = 2 + * } + */ + public static int cudaResViewFormatUnsignedChar2() { + return cudaResViewFormatUnsignedChar2; + } + private static final int cudaResViewFormatUnsignedChar4 = (int)3L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedChar4 = 3 + * } + */ + public static int cudaResViewFormatUnsignedChar4() { + return cudaResViewFormatUnsignedChar4; + } + private static final int cudaResViewFormatSignedChar1 = (int)4L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedChar1 = 4 + * } + */ + public static int cudaResViewFormatSignedChar1() { + return cudaResViewFormatSignedChar1; + } + private static final int cudaResViewFormatSignedChar2 = (int)5L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedChar2 = 5 + * } + */ + public static int cudaResViewFormatSignedChar2() { + return cudaResViewFormatSignedChar2; + } + private static final int cudaResViewFormatSignedChar4 = (int)6L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedChar4 = 6 + * } + */ + public static int cudaResViewFormatSignedChar4() { + return cudaResViewFormatSignedChar4; + } + private static final int cudaResViewFormatUnsignedShort1 = (int)7L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedShort1 = 7 + * } + */ + public static int cudaResViewFormatUnsignedShort1() { + return cudaResViewFormatUnsignedShort1; + } + private static final int cudaResViewFormatUnsignedShort2 = (int)8L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedShort2 = 8 + * } + */ + public static int cudaResViewFormatUnsignedShort2() { + return cudaResViewFormatUnsignedShort2; + } + private static final int cudaResViewFormatUnsignedShort4 = (int)9L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedShort4 = 9 + * } + */ + public static int cudaResViewFormatUnsignedShort4() { + return cudaResViewFormatUnsignedShort4; + } + private static final int cudaResViewFormatSignedShort1 = (int)10L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedShort1 = 10 + * } + */ + public static int cudaResViewFormatSignedShort1() { + return cudaResViewFormatSignedShort1; + } + private static final int cudaResViewFormatSignedShort2 = (int)11L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedShort2 = 11 + * } + */ + public static int cudaResViewFormatSignedShort2() { + return cudaResViewFormatSignedShort2; + } + private static final int cudaResViewFormatSignedShort4 = (int)12L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedShort4 = 12 + * } + */ + public static int cudaResViewFormatSignedShort4() { + return cudaResViewFormatSignedShort4; + } + private static final int cudaResViewFormatUnsignedInt1 = (int)13L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedInt1 = 13 + * } + */ + public static int cudaResViewFormatUnsignedInt1() { + return cudaResViewFormatUnsignedInt1; + } + private static final int cudaResViewFormatUnsignedInt2 = (int)14L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedInt2 = 14 + * } + */ + public static int cudaResViewFormatUnsignedInt2() { + return cudaResViewFormatUnsignedInt2; + } + private static final int cudaResViewFormatUnsignedInt4 = (int)15L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedInt4 = 15 + * } + */ + public static int cudaResViewFormatUnsignedInt4() { + return cudaResViewFormatUnsignedInt4; + } + private static final int cudaResViewFormatSignedInt1 = (int)16L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedInt1 = 16 + * } + */ + public static int cudaResViewFormatSignedInt1() { + return cudaResViewFormatSignedInt1; + } + private static final int cudaResViewFormatSignedInt2 = (int)17L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedInt2 = 17 + * } + */ + public static int cudaResViewFormatSignedInt2() { + return cudaResViewFormatSignedInt2; + } + private static final int cudaResViewFormatSignedInt4 = (int)18L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedInt4 = 18 + * } + */ + public static int cudaResViewFormatSignedInt4() { + return cudaResViewFormatSignedInt4; + } + private static final int cudaResViewFormatHalf1 = (int)19L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatHalf1 = 19 + * } + */ + public static int cudaResViewFormatHalf1() { + return cudaResViewFormatHalf1; + } + private static final int cudaResViewFormatHalf2 = (int)20L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatHalf2 = 20 + * } + */ + public static int cudaResViewFormatHalf2() { + return cudaResViewFormatHalf2; + } + private static final int cudaResViewFormatHalf4 = (int)21L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatHalf4 = 21 + * } + */ + public static int cudaResViewFormatHalf4() { + return cudaResViewFormatHalf4; + } + private static final int cudaResViewFormatFloat1 = (int)22L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatFloat1 = 22 + * } + */ + public static int cudaResViewFormatFloat1() { + return cudaResViewFormatFloat1; + } + private static final int cudaResViewFormatFloat2 = (int)23L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatFloat2 = 23 + * } + */ + public static int cudaResViewFormatFloat2() { + return cudaResViewFormatFloat2; + } + private static final int cudaResViewFormatFloat4 = (int)24L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatFloat4 = 24 + * } + */ + public static int cudaResViewFormatFloat4() { + return cudaResViewFormatFloat4; + } + private static final int cudaResViewFormatUnsignedBlockCompressed1 = (int)25L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed1 = 25 + * } + */ + public static int cudaResViewFormatUnsignedBlockCompressed1() { + return cudaResViewFormatUnsignedBlockCompressed1; + } + private static final int cudaResViewFormatUnsignedBlockCompressed2 = (int)26L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed2 = 26 + * } + */ + public static int cudaResViewFormatUnsignedBlockCompressed2() { + return cudaResViewFormatUnsignedBlockCompressed2; + } + private static final int cudaResViewFormatUnsignedBlockCompressed3 = (int)27L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed3 = 27 + * } + */ + public static int cudaResViewFormatUnsignedBlockCompressed3() { + return cudaResViewFormatUnsignedBlockCompressed3; + } + private static final int cudaResViewFormatUnsignedBlockCompressed4 = (int)28L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed4 = 28 + * } + */ + public static int cudaResViewFormatUnsignedBlockCompressed4() { + return cudaResViewFormatUnsignedBlockCompressed4; + } + private static final int cudaResViewFormatSignedBlockCompressed4 = (int)29L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed4 = 29 + * } + */ + public static int cudaResViewFormatSignedBlockCompressed4() { + return cudaResViewFormatSignedBlockCompressed4; + } + private static final int cudaResViewFormatUnsignedBlockCompressed5 = (int)30L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed5 = 30 + * } + */ + public static int cudaResViewFormatUnsignedBlockCompressed5() { + return cudaResViewFormatUnsignedBlockCompressed5; + } + private static final int cudaResViewFormatSignedBlockCompressed5 = (int)31L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed5 = 31 + * } + */ + public static int cudaResViewFormatSignedBlockCompressed5() { + return cudaResViewFormatSignedBlockCompressed5; + } + private static final int cudaResViewFormatUnsignedBlockCompressed6H = (int)32L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed6H = 32 + * } + */ + public static int cudaResViewFormatUnsignedBlockCompressed6H() { + return cudaResViewFormatUnsignedBlockCompressed6H; + } + private static final int cudaResViewFormatSignedBlockCompressed6H = (int)33L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed6H = 33 + * } + */ + public static int cudaResViewFormatSignedBlockCompressed6H() { + return cudaResViewFormatSignedBlockCompressed6H; + } + private static final int cudaResViewFormatUnsignedBlockCompressed7 = (int)34L; + /** + * {@snippet lang=c : + * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed7 = 34 + * } + */ + public static int cudaResViewFormatUnsignedBlockCompressed7() { + return cudaResViewFormatUnsignedBlockCompressed7; + } + private static final int cudaFuncAttributeMaxDynamicSharedMemorySize = (int)8L; + /** + * {@snippet lang=c : + * enum cudaFuncAttribute.cudaFuncAttributeMaxDynamicSharedMemorySize = 8 + * } + */ + public static int cudaFuncAttributeMaxDynamicSharedMemorySize() { + return cudaFuncAttributeMaxDynamicSharedMemorySize; + } + private static final int cudaFuncAttributePreferredSharedMemoryCarveout = (int)9L; + /** + * {@snippet lang=c : + * enum cudaFuncAttribute.cudaFuncAttributePreferredSharedMemoryCarveout = 9 + * } + */ + public static int cudaFuncAttributePreferredSharedMemoryCarveout() { + return cudaFuncAttributePreferredSharedMemoryCarveout; + } + private static final int cudaFuncAttributeClusterDimMustBeSet = (int)10L; + /** + * {@snippet lang=c : + * enum cudaFuncAttribute.cudaFuncAttributeClusterDimMustBeSet = 10 + * } + */ + public static int cudaFuncAttributeClusterDimMustBeSet() { + return cudaFuncAttributeClusterDimMustBeSet; + } + private static final int cudaFuncAttributeRequiredClusterWidth = (int)11L; + /** + * {@snippet lang=c : + * enum cudaFuncAttribute.cudaFuncAttributeRequiredClusterWidth = 11 + * } + */ + public static int cudaFuncAttributeRequiredClusterWidth() { + return cudaFuncAttributeRequiredClusterWidth; + } + private static final int cudaFuncAttributeRequiredClusterHeight = (int)12L; + /** + * {@snippet lang=c : + * enum cudaFuncAttribute.cudaFuncAttributeRequiredClusterHeight = 12 + * } + */ + public static int cudaFuncAttributeRequiredClusterHeight() { + return cudaFuncAttributeRequiredClusterHeight; + } + private static final int cudaFuncAttributeRequiredClusterDepth = (int)13L; + /** + * {@snippet lang=c : + * enum cudaFuncAttribute.cudaFuncAttributeRequiredClusterDepth = 13 + * } + */ + public static int cudaFuncAttributeRequiredClusterDepth() { + return cudaFuncAttributeRequiredClusterDepth; + } + private static final int cudaFuncAttributeNonPortableClusterSizeAllowed = (int)14L; + /** + * {@snippet lang=c : + * enum cudaFuncAttribute.cudaFuncAttributeNonPortableClusterSizeAllowed = 14 + * } + */ + public static int cudaFuncAttributeNonPortableClusterSizeAllowed() { + return cudaFuncAttributeNonPortableClusterSizeAllowed; + } + private static final int cudaFuncAttributeClusterSchedulingPolicyPreference = (int)15L; + /** + * {@snippet lang=c : + * enum cudaFuncAttribute.cudaFuncAttributeClusterSchedulingPolicyPreference = 15 + * } + */ + public static int cudaFuncAttributeClusterSchedulingPolicyPreference() { + return cudaFuncAttributeClusterSchedulingPolicyPreference; + } + private static final int cudaFuncAttributeMax = (int)16L; + /** + * {@snippet lang=c : + * enum cudaFuncAttribute.cudaFuncAttributeMax = 16 + * } + */ + public static int cudaFuncAttributeMax() { + return cudaFuncAttributeMax; + } + private static final int cudaFuncCachePreferNone = (int)0L; + /** + * {@snippet lang=c : + * enum cudaFuncCache.cudaFuncCachePreferNone = 0 + * } + */ + public static int cudaFuncCachePreferNone() { + return cudaFuncCachePreferNone; + } + private static final int cudaFuncCachePreferShared = (int)1L; + /** + * {@snippet lang=c : + * enum cudaFuncCache.cudaFuncCachePreferShared = 1 + * } + */ + public static int cudaFuncCachePreferShared() { + return cudaFuncCachePreferShared; + } + private static final int cudaFuncCachePreferL1 = (int)2L; + /** + * {@snippet lang=c : + * enum cudaFuncCache.cudaFuncCachePreferL1 = 2 + * } + */ + public static int cudaFuncCachePreferL1() { + return cudaFuncCachePreferL1; + } + private static final int cudaFuncCachePreferEqual = (int)3L; + /** + * {@snippet lang=c : + * enum cudaFuncCache.cudaFuncCachePreferEqual = 3 + * } + */ + public static int cudaFuncCachePreferEqual() { + return cudaFuncCachePreferEqual; + } + private static final int cudaSharedMemBankSizeDefault = (int)0L; + /** + * {@snippet lang=c : + * enum cudaSharedMemConfig.cudaSharedMemBankSizeDefault = 0 + * } + */ + public static int cudaSharedMemBankSizeDefault() { + return cudaSharedMemBankSizeDefault; + } + private static final int cudaSharedMemBankSizeFourByte = (int)1L; + /** + * {@snippet lang=c : + * enum cudaSharedMemConfig.cudaSharedMemBankSizeFourByte = 1 + * } + */ + public static int cudaSharedMemBankSizeFourByte() { + return cudaSharedMemBankSizeFourByte; + } + private static final int cudaSharedMemBankSizeEightByte = (int)2L; + /** + * {@snippet lang=c : + * enum cudaSharedMemConfig.cudaSharedMemBankSizeEightByte = 2 + * } + */ + public static int cudaSharedMemBankSizeEightByte() { + return cudaSharedMemBankSizeEightByte; + } + private static final int cudaSharedmemCarveoutDefault = (int)-1L; + /** + * {@snippet lang=c : + * enum cudaSharedCarveout.cudaSharedmemCarveoutDefault = -1 + * } + */ + public static int cudaSharedmemCarveoutDefault() { + return cudaSharedmemCarveoutDefault; + } + private static final int cudaSharedmemCarveoutMaxShared = (int)100L; + /** + * {@snippet lang=c : + * enum cudaSharedCarveout.cudaSharedmemCarveoutMaxShared = 100 + * } + */ + public static int cudaSharedmemCarveoutMaxShared() { + return cudaSharedmemCarveoutMaxShared; + } + private static final int cudaSharedmemCarveoutMaxL1 = (int)0L; + /** + * {@snippet lang=c : + * enum cudaSharedCarveout.cudaSharedmemCarveoutMaxL1 = 0 + * } + */ + public static int cudaSharedmemCarveoutMaxL1() { + return cudaSharedmemCarveoutMaxL1; + } + private static final int cudaComputeModeDefault = (int)0L; + /** + * {@snippet lang=c : + * enum cudaComputeMode.cudaComputeModeDefault = 0 + * } + */ + public static int cudaComputeModeDefault() { + return cudaComputeModeDefault; + } + private static final int cudaComputeModeExclusive = (int)1L; + /** + * {@snippet lang=c : + * enum cudaComputeMode.cudaComputeModeExclusive = 1 + * } + */ + public static int cudaComputeModeExclusive() { + return cudaComputeModeExclusive; + } + private static final int cudaComputeModeProhibited = (int)2L; + /** + * {@snippet lang=c : + * enum cudaComputeMode.cudaComputeModeProhibited = 2 + * } + */ + public static int cudaComputeModeProhibited() { + return cudaComputeModeProhibited; + } + private static final int cudaComputeModeExclusiveProcess = (int)3L; + /** + * {@snippet lang=c : + * enum cudaComputeMode.cudaComputeModeExclusiveProcess = 3 + * } + */ + public static int cudaComputeModeExclusiveProcess() { + return cudaComputeModeExclusiveProcess; + } + private static final int cudaLimitStackSize = (int)0L; + /** + * {@snippet lang=c : + * enum cudaLimit.cudaLimitStackSize = 0 + * } + */ + public static int cudaLimitStackSize() { + return cudaLimitStackSize; + } + private static final int cudaLimitPrintfFifoSize = (int)1L; + /** + * {@snippet lang=c : + * enum cudaLimit.cudaLimitPrintfFifoSize = 1 + * } + */ + public static int cudaLimitPrintfFifoSize() { + return cudaLimitPrintfFifoSize; + } + private static final int cudaLimitMallocHeapSize = (int)2L; + /** + * {@snippet lang=c : + * enum cudaLimit.cudaLimitMallocHeapSize = 2 + * } + */ + public static int cudaLimitMallocHeapSize() { + return cudaLimitMallocHeapSize; + } + private static final int cudaLimitDevRuntimeSyncDepth = (int)3L; + /** + * {@snippet lang=c : + * enum cudaLimit.cudaLimitDevRuntimeSyncDepth = 3 + * } + */ + public static int cudaLimitDevRuntimeSyncDepth() { + return cudaLimitDevRuntimeSyncDepth; + } + private static final int cudaLimitDevRuntimePendingLaunchCount = (int)4L; + /** + * {@snippet lang=c : + * enum cudaLimit.cudaLimitDevRuntimePendingLaunchCount = 4 + * } + */ + public static int cudaLimitDevRuntimePendingLaunchCount() { + return cudaLimitDevRuntimePendingLaunchCount; + } + private static final int cudaLimitMaxL2FetchGranularity = (int)5L; + /** + * {@snippet lang=c : + * enum cudaLimit.cudaLimitMaxL2FetchGranularity = 5 + * } + */ + public static int cudaLimitMaxL2FetchGranularity() { + return cudaLimitMaxL2FetchGranularity; + } + private static final int cudaLimitPersistingL2CacheSize = (int)6L; + /** + * {@snippet lang=c : + * enum cudaLimit.cudaLimitPersistingL2CacheSize = 6 + * } + */ + public static int cudaLimitPersistingL2CacheSize() { + return cudaLimitPersistingL2CacheSize; + } + private static final int cudaMemAdviseSetReadMostly = (int)1L; + /** + * {@snippet lang=c : + * enum cudaMemoryAdvise.cudaMemAdviseSetReadMostly = 1 + * } + */ + public static int cudaMemAdviseSetReadMostly() { + return cudaMemAdviseSetReadMostly; + } + private static final int cudaMemAdviseUnsetReadMostly = (int)2L; + /** + * {@snippet lang=c : + * enum cudaMemoryAdvise.cudaMemAdviseUnsetReadMostly = 2 + * } + */ + public static int cudaMemAdviseUnsetReadMostly() { + return cudaMemAdviseUnsetReadMostly; + } + private static final int cudaMemAdviseSetPreferredLocation = (int)3L; + /** + * {@snippet lang=c : + * enum cudaMemoryAdvise.cudaMemAdviseSetPreferredLocation = 3 + * } + */ + public static int cudaMemAdviseSetPreferredLocation() { + return cudaMemAdviseSetPreferredLocation; + } + private static final int cudaMemAdviseUnsetPreferredLocation = (int)4L; + /** + * {@snippet lang=c : + * enum cudaMemoryAdvise.cudaMemAdviseUnsetPreferredLocation = 4 + * } + */ + public static int cudaMemAdviseUnsetPreferredLocation() { + return cudaMemAdviseUnsetPreferredLocation; + } + private static final int cudaMemAdviseSetAccessedBy = (int)5L; + /** + * {@snippet lang=c : + * enum cudaMemoryAdvise.cudaMemAdviseSetAccessedBy = 5 + * } + */ + public static int cudaMemAdviseSetAccessedBy() { + return cudaMemAdviseSetAccessedBy; + } + private static final int cudaMemAdviseUnsetAccessedBy = (int)6L; + /** + * {@snippet lang=c : + * enum cudaMemoryAdvise.cudaMemAdviseUnsetAccessedBy = 6 + * } + */ + public static int cudaMemAdviseUnsetAccessedBy() { + return cudaMemAdviseUnsetAccessedBy; + } + private static final int cudaMemRangeAttributeReadMostly = (int)1L; + /** + * {@snippet lang=c : + * enum cudaMemRangeAttribute.cudaMemRangeAttributeReadMostly = 1 + * } + */ + public static int cudaMemRangeAttributeReadMostly() { + return cudaMemRangeAttributeReadMostly; + } + private static final int cudaMemRangeAttributePreferredLocation = (int)2L; + /** + * {@snippet lang=c : + * enum cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocation = 2 + * } + */ + public static int cudaMemRangeAttributePreferredLocation() { + return cudaMemRangeAttributePreferredLocation; + } + private static final int cudaMemRangeAttributeAccessedBy = (int)3L; + /** + * {@snippet lang=c : + * enum cudaMemRangeAttribute.cudaMemRangeAttributeAccessedBy = 3 + * } + */ + public static int cudaMemRangeAttributeAccessedBy() { + return cudaMemRangeAttributeAccessedBy; + } + private static final int cudaMemRangeAttributeLastPrefetchLocation = (int)4L; + /** + * {@snippet lang=c : + * enum cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocation = 4 + * } + */ + public static int cudaMemRangeAttributeLastPrefetchLocation() { + return cudaMemRangeAttributeLastPrefetchLocation; + } + private static final int cudaMemRangeAttributePreferredLocationType = (int)5L; + /** + * {@snippet lang=c : + * enum cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationType = 5 + * } + */ + public static int cudaMemRangeAttributePreferredLocationType() { + return cudaMemRangeAttributePreferredLocationType; + } + private static final int cudaMemRangeAttributePreferredLocationId = (int)6L; + /** + * {@snippet lang=c : + * enum cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationId = 6 + * } + */ + public static int cudaMemRangeAttributePreferredLocationId() { + return cudaMemRangeAttributePreferredLocationId; + } + private static final int cudaMemRangeAttributeLastPrefetchLocationType = (int)7L; + /** + * {@snippet lang=c : + * enum cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationType = 7 + * } + */ + public static int cudaMemRangeAttributeLastPrefetchLocationType() { + return cudaMemRangeAttributeLastPrefetchLocationType; + } + private static final int cudaMemRangeAttributeLastPrefetchLocationId = (int)8L; + /** + * {@snippet lang=c : + * enum cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationId = 8 + * } + */ + public static int cudaMemRangeAttributeLastPrefetchLocationId() { + return cudaMemRangeAttributeLastPrefetchLocationId; + } + private static final int cudaFlushGPUDirectRDMAWritesOptionHost = (int)1L; + /** + * {@snippet lang=c : + * enum cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionHost = 1 + * } + */ + public static int cudaFlushGPUDirectRDMAWritesOptionHost() { + return cudaFlushGPUDirectRDMAWritesOptionHost; + } + private static final int cudaFlushGPUDirectRDMAWritesOptionMemOps = (int)2L; + /** + * {@snippet lang=c : + * enum cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionMemOps = 2 + * } + */ + public static int cudaFlushGPUDirectRDMAWritesOptionMemOps() { + return cudaFlushGPUDirectRDMAWritesOptionMemOps; + } + private static final int cudaGPUDirectRDMAWritesOrderingNone = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingNone = 0 + * } + */ + public static int cudaGPUDirectRDMAWritesOrderingNone() { + return cudaGPUDirectRDMAWritesOrderingNone; + } + private static final int cudaGPUDirectRDMAWritesOrderingOwner = (int)100L; + /** + * {@snippet lang=c : + * enum cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingOwner = 100 + * } + */ + public static int cudaGPUDirectRDMAWritesOrderingOwner() { + return cudaGPUDirectRDMAWritesOrderingOwner; + } + private static final int cudaGPUDirectRDMAWritesOrderingAllDevices = (int)200L; + /** + * {@snippet lang=c : + * enum cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingAllDevices = 200 + * } + */ + public static int cudaGPUDirectRDMAWritesOrderingAllDevices() { + return cudaGPUDirectRDMAWritesOrderingAllDevices; + } + private static final int cudaFlushGPUDirectRDMAWritesToOwner = (int)100L; + /** + * {@snippet lang=c : + * enum cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToOwner = 100 + * } + */ + public static int cudaFlushGPUDirectRDMAWritesToOwner() { + return cudaFlushGPUDirectRDMAWritesToOwner; + } + private static final int cudaFlushGPUDirectRDMAWritesToAllDevices = (int)200L; + /** + * {@snippet lang=c : + * enum cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToAllDevices = 200 + * } + */ + public static int cudaFlushGPUDirectRDMAWritesToAllDevices() { + return cudaFlushGPUDirectRDMAWritesToAllDevices; + } + private static final int cudaFlushGPUDirectRDMAWritesTargetCurrentDevice = (int)0L; + /** + * {@snippet lang=c : + * enum cudaFlushGPUDirectRDMAWritesTarget.cudaFlushGPUDirectRDMAWritesTargetCurrentDevice = 0 + * } + */ + public static int cudaFlushGPUDirectRDMAWritesTargetCurrentDevice() { + return cudaFlushGPUDirectRDMAWritesTargetCurrentDevice; + } + private static final int cudaDevAttrMaxThreadsPerBlock = (int)1L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxThreadsPerBlock = 1 + * } + */ + public static int cudaDevAttrMaxThreadsPerBlock() { + return cudaDevAttrMaxThreadsPerBlock; + } + private static final int cudaDevAttrMaxBlockDimX = (int)2L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxBlockDimX = 2 + * } + */ + public static int cudaDevAttrMaxBlockDimX() { + return cudaDevAttrMaxBlockDimX; + } + private static final int cudaDevAttrMaxBlockDimY = (int)3L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxBlockDimY = 3 + * } + */ + public static int cudaDevAttrMaxBlockDimY() { + return cudaDevAttrMaxBlockDimY; + } + private static final int cudaDevAttrMaxBlockDimZ = (int)4L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxBlockDimZ = 4 + * } + */ + public static int cudaDevAttrMaxBlockDimZ() { + return cudaDevAttrMaxBlockDimZ; + } + private static final int cudaDevAttrMaxGridDimX = (int)5L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxGridDimX = 5 + * } + */ + public static int cudaDevAttrMaxGridDimX() { + return cudaDevAttrMaxGridDimX; + } + private static final int cudaDevAttrMaxGridDimY = (int)6L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxGridDimY = 6 + * } + */ + public static int cudaDevAttrMaxGridDimY() { + return cudaDevAttrMaxGridDimY; + } + private static final int cudaDevAttrMaxGridDimZ = (int)7L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxGridDimZ = 7 + * } + */ + public static int cudaDevAttrMaxGridDimZ() { + return cudaDevAttrMaxGridDimZ; + } + private static final int cudaDevAttrMaxSharedMemoryPerBlock = (int)8L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlock = 8 + * } + */ + public static int cudaDevAttrMaxSharedMemoryPerBlock() { + return cudaDevAttrMaxSharedMemoryPerBlock; + } + private static final int cudaDevAttrTotalConstantMemory = (int)9L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrTotalConstantMemory = 9 + * } + */ + public static int cudaDevAttrTotalConstantMemory() { + return cudaDevAttrTotalConstantMemory; + } + private static final int cudaDevAttrWarpSize = (int)10L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrWarpSize = 10 + * } + */ + public static int cudaDevAttrWarpSize() { + return cudaDevAttrWarpSize; + } + private static final int cudaDevAttrMaxPitch = (int)11L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxPitch = 11 + * } + */ + public static int cudaDevAttrMaxPitch() { + return cudaDevAttrMaxPitch; + } + private static final int cudaDevAttrMaxRegistersPerBlock = (int)12L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxRegistersPerBlock = 12 + * } + */ + public static int cudaDevAttrMaxRegistersPerBlock() { + return cudaDevAttrMaxRegistersPerBlock; + } + private static final int cudaDevAttrClockRate = (int)13L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrClockRate = 13 + * } + */ + public static int cudaDevAttrClockRate() { + return cudaDevAttrClockRate; + } + private static final int cudaDevAttrTextureAlignment = (int)14L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrTextureAlignment = 14 + * } + */ + public static int cudaDevAttrTextureAlignment() { + return cudaDevAttrTextureAlignment; + } + private static final int cudaDevAttrGpuOverlap = (int)15L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrGpuOverlap = 15 + * } + */ + public static int cudaDevAttrGpuOverlap() { + return cudaDevAttrGpuOverlap; + } + private static final int cudaDevAttrMultiProcessorCount = (int)16L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMultiProcessorCount = 16 + * } + */ + public static int cudaDevAttrMultiProcessorCount() { + return cudaDevAttrMultiProcessorCount; + } + private static final int cudaDevAttrKernelExecTimeout = (int)17L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrKernelExecTimeout = 17 + * } + */ + public static int cudaDevAttrKernelExecTimeout() { + return cudaDevAttrKernelExecTimeout; + } + private static final int cudaDevAttrIntegrated = (int)18L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrIntegrated = 18 + * } + */ + public static int cudaDevAttrIntegrated() { + return cudaDevAttrIntegrated; + } + private static final int cudaDevAttrCanMapHostMemory = (int)19L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrCanMapHostMemory = 19 + * } + */ + public static int cudaDevAttrCanMapHostMemory() { + return cudaDevAttrCanMapHostMemory; + } + private static final int cudaDevAttrComputeMode = (int)20L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrComputeMode = 20 + * } + */ + public static int cudaDevAttrComputeMode() { + return cudaDevAttrComputeMode; + } + private static final int cudaDevAttrMaxTexture1DWidth = (int)21L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture1DWidth = 21 + * } + */ + public static int cudaDevAttrMaxTexture1DWidth() { + return cudaDevAttrMaxTexture1DWidth; + } + private static final int cudaDevAttrMaxTexture2DWidth = (int)22L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DWidth = 22 + * } + */ + public static int cudaDevAttrMaxTexture2DWidth() { + return cudaDevAttrMaxTexture2DWidth; + } + private static final int cudaDevAttrMaxTexture2DHeight = (int)23L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DHeight = 23 + * } + */ + public static int cudaDevAttrMaxTexture2DHeight() { + return cudaDevAttrMaxTexture2DHeight; + } + private static final int cudaDevAttrMaxTexture3DWidth = (int)24L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DWidth = 24 + * } + */ + public static int cudaDevAttrMaxTexture3DWidth() { + return cudaDevAttrMaxTexture3DWidth; + } + private static final int cudaDevAttrMaxTexture3DHeight = (int)25L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DHeight = 25 + * } + */ + public static int cudaDevAttrMaxTexture3DHeight() { + return cudaDevAttrMaxTexture3DHeight; + } + private static final int cudaDevAttrMaxTexture3DDepth = (int)26L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DDepth = 26 + * } + */ + public static int cudaDevAttrMaxTexture3DDepth() { + return cudaDevAttrMaxTexture3DDepth; + } + private static final int cudaDevAttrMaxTexture2DLayeredWidth = (int)27L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredWidth = 27 + * } + */ + public static int cudaDevAttrMaxTexture2DLayeredWidth() { + return cudaDevAttrMaxTexture2DLayeredWidth; + } + private static final int cudaDevAttrMaxTexture2DLayeredHeight = (int)28L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredHeight = 28 + * } + */ + public static int cudaDevAttrMaxTexture2DLayeredHeight() { + return cudaDevAttrMaxTexture2DLayeredHeight; + } + private static final int cudaDevAttrMaxTexture2DLayeredLayers = (int)29L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredLayers = 29 + * } + */ + public static int cudaDevAttrMaxTexture2DLayeredLayers() { + return cudaDevAttrMaxTexture2DLayeredLayers; + } + private static final int cudaDevAttrSurfaceAlignment = (int)30L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrSurfaceAlignment = 30 + * } + */ + public static int cudaDevAttrSurfaceAlignment() { + return cudaDevAttrSurfaceAlignment; + } + private static final int cudaDevAttrConcurrentKernels = (int)31L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrConcurrentKernels = 31 + * } + */ + public static int cudaDevAttrConcurrentKernels() { + return cudaDevAttrConcurrentKernels; + } + private static final int cudaDevAttrEccEnabled = (int)32L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrEccEnabled = 32 + * } + */ + public static int cudaDevAttrEccEnabled() { + return cudaDevAttrEccEnabled; + } + private static final int cudaDevAttrPciBusId = (int)33L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrPciBusId = 33 + * } + */ + public static int cudaDevAttrPciBusId() { + return cudaDevAttrPciBusId; + } + private static final int cudaDevAttrPciDeviceId = (int)34L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrPciDeviceId = 34 + * } + */ + public static int cudaDevAttrPciDeviceId() { + return cudaDevAttrPciDeviceId; + } + private static final int cudaDevAttrTccDriver = (int)35L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrTccDriver = 35 + * } + */ + public static int cudaDevAttrTccDriver() { + return cudaDevAttrTccDriver; + } + private static final int cudaDevAttrMemoryClockRate = (int)36L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMemoryClockRate = 36 + * } + */ + public static int cudaDevAttrMemoryClockRate() { + return cudaDevAttrMemoryClockRate; + } + private static final int cudaDevAttrGlobalMemoryBusWidth = (int)37L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrGlobalMemoryBusWidth = 37 + * } + */ + public static int cudaDevAttrGlobalMemoryBusWidth() { + return cudaDevAttrGlobalMemoryBusWidth; + } + private static final int cudaDevAttrL2CacheSize = (int)38L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrL2CacheSize = 38 + * } + */ + public static int cudaDevAttrL2CacheSize() { + return cudaDevAttrL2CacheSize; + } + private static final int cudaDevAttrMaxThreadsPerMultiProcessor = (int)39L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxThreadsPerMultiProcessor = 39 + * } + */ + public static int cudaDevAttrMaxThreadsPerMultiProcessor() { + return cudaDevAttrMaxThreadsPerMultiProcessor; + } + private static final int cudaDevAttrAsyncEngineCount = (int)40L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrAsyncEngineCount = 40 + * } + */ + public static int cudaDevAttrAsyncEngineCount() { + return cudaDevAttrAsyncEngineCount; + } + private static final int cudaDevAttrUnifiedAddressing = (int)41L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrUnifiedAddressing = 41 + * } + */ + public static int cudaDevAttrUnifiedAddressing() { + return cudaDevAttrUnifiedAddressing; + } + private static final int cudaDevAttrMaxTexture1DLayeredWidth = (int)42L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredWidth = 42 + * } + */ + public static int cudaDevAttrMaxTexture1DLayeredWidth() { + return cudaDevAttrMaxTexture1DLayeredWidth; + } + private static final int cudaDevAttrMaxTexture1DLayeredLayers = (int)43L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredLayers = 43 + * } + */ + public static int cudaDevAttrMaxTexture1DLayeredLayers() { + return cudaDevAttrMaxTexture1DLayeredLayers; + } + private static final int cudaDevAttrMaxTexture2DGatherWidth = (int)45L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherWidth = 45 + * } + */ + public static int cudaDevAttrMaxTexture2DGatherWidth() { + return cudaDevAttrMaxTexture2DGatherWidth; + } + private static final int cudaDevAttrMaxTexture2DGatherHeight = (int)46L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherHeight = 46 + * } + */ + public static int cudaDevAttrMaxTexture2DGatherHeight() { + return cudaDevAttrMaxTexture2DGatherHeight; + } + private static final int cudaDevAttrMaxTexture3DWidthAlt = (int)47L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DWidthAlt = 47 + * } + */ + public static int cudaDevAttrMaxTexture3DWidthAlt() { + return cudaDevAttrMaxTexture3DWidthAlt; + } + private static final int cudaDevAttrMaxTexture3DHeightAlt = (int)48L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DHeightAlt = 48 + * } + */ + public static int cudaDevAttrMaxTexture3DHeightAlt() { + return cudaDevAttrMaxTexture3DHeightAlt; + } + private static final int cudaDevAttrMaxTexture3DDepthAlt = (int)49L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DDepthAlt = 49 + * } + */ + public static int cudaDevAttrMaxTexture3DDepthAlt() { + return cudaDevAttrMaxTexture3DDepthAlt; + } + private static final int cudaDevAttrPciDomainId = (int)50L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrPciDomainId = 50 + * } + */ + public static int cudaDevAttrPciDomainId() { + return cudaDevAttrPciDomainId; + } + private static final int cudaDevAttrTexturePitchAlignment = (int)51L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrTexturePitchAlignment = 51 + * } + */ + public static int cudaDevAttrTexturePitchAlignment() { + return cudaDevAttrTexturePitchAlignment; + } + private static final int cudaDevAttrMaxTextureCubemapWidth = (int)52L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTextureCubemapWidth = 52 + * } + */ + public static int cudaDevAttrMaxTextureCubemapWidth() { + return cudaDevAttrMaxTextureCubemapWidth; + } + private static final int cudaDevAttrMaxTextureCubemapLayeredWidth = (int)53L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredWidth = 53 + * } + */ + public static int cudaDevAttrMaxTextureCubemapLayeredWidth() { + return cudaDevAttrMaxTextureCubemapLayeredWidth; + } + private static final int cudaDevAttrMaxTextureCubemapLayeredLayers = (int)54L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredLayers = 54 + * } + */ + public static int cudaDevAttrMaxTextureCubemapLayeredLayers() { + return cudaDevAttrMaxTextureCubemapLayeredLayers; + } + private static final int cudaDevAttrMaxSurface1DWidth = (int)55L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface1DWidth = 55 + * } + */ + public static int cudaDevAttrMaxSurface1DWidth() { + return cudaDevAttrMaxSurface1DWidth; + } + private static final int cudaDevAttrMaxSurface2DWidth = (int)56L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface2DWidth = 56 + * } + */ + public static int cudaDevAttrMaxSurface2DWidth() { + return cudaDevAttrMaxSurface2DWidth; + } + private static final int cudaDevAttrMaxSurface2DHeight = (int)57L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface2DHeight = 57 + * } + */ + public static int cudaDevAttrMaxSurface2DHeight() { + return cudaDevAttrMaxSurface2DHeight; + } + private static final int cudaDevAttrMaxSurface3DWidth = (int)58L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface3DWidth = 58 + * } + */ + public static int cudaDevAttrMaxSurface3DWidth() { + return cudaDevAttrMaxSurface3DWidth; + } + private static final int cudaDevAttrMaxSurface3DHeight = (int)59L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface3DHeight = 59 + * } + */ + public static int cudaDevAttrMaxSurface3DHeight() { + return cudaDevAttrMaxSurface3DHeight; + } + private static final int cudaDevAttrMaxSurface3DDepth = (int)60L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface3DDepth = 60 + * } + */ + public static int cudaDevAttrMaxSurface3DDepth() { + return cudaDevAttrMaxSurface3DDepth; + } + private static final int cudaDevAttrMaxSurface1DLayeredWidth = (int)61L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredWidth = 61 + * } + */ + public static int cudaDevAttrMaxSurface1DLayeredWidth() { + return cudaDevAttrMaxSurface1DLayeredWidth; + } + private static final int cudaDevAttrMaxSurface1DLayeredLayers = (int)62L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredLayers = 62 + * } + */ + public static int cudaDevAttrMaxSurface1DLayeredLayers() { + return cudaDevAttrMaxSurface1DLayeredLayers; + } + private static final int cudaDevAttrMaxSurface2DLayeredWidth = (int)63L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredWidth = 63 + * } + */ + public static int cudaDevAttrMaxSurface2DLayeredWidth() { + return cudaDevAttrMaxSurface2DLayeredWidth; + } + private static final int cudaDevAttrMaxSurface2DLayeredHeight = (int)64L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredHeight = 64 + * } + */ + public static int cudaDevAttrMaxSurface2DLayeredHeight() { + return cudaDevAttrMaxSurface2DLayeredHeight; + } + private static final int cudaDevAttrMaxSurface2DLayeredLayers = (int)65L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredLayers = 65 + * } + */ + public static int cudaDevAttrMaxSurface2DLayeredLayers() { + return cudaDevAttrMaxSurface2DLayeredLayers; + } + private static final int cudaDevAttrMaxSurfaceCubemapWidth = (int)66L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapWidth = 66 + * } + */ + public static int cudaDevAttrMaxSurfaceCubemapWidth() { + return cudaDevAttrMaxSurfaceCubemapWidth; + } + private static final int cudaDevAttrMaxSurfaceCubemapLayeredWidth = (int)67L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredWidth = 67 + * } + */ + public static int cudaDevAttrMaxSurfaceCubemapLayeredWidth() { + return cudaDevAttrMaxSurfaceCubemapLayeredWidth; + } + private static final int cudaDevAttrMaxSurfaceCubemapLayeredLayers = (int)68L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredLayers = 68 + * } + */ + public static int cudaDevAttrMaxSurfaceCubemapLayeredLayers() { + return cudaDevAttrMaxSurfaceCubemapLayeredLayers; + } + private static final int cudaDevAttrMaxTexture1DLinearWidth = (int)69L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture1DLinearWidth = 69 + * } + */ + public static int cudaDevAttrMaxTexture1DLinearWidth() { + return cudaDevAttrMaxTexture1DLinearWidth; + } + private static final int cudaDevAttrMaxTexture2DLinearWidth = (int)70L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearWidth = 70 + * } + */ + public static int cudaDevAttrMaxTexture2DLinearWidth() { + return cudaDevAttrMaxTexture2DLinearWidth; + } + private static final int cudaDevAttrMaxTexture2DLinearHeight = (int)71L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearHeight = 71 + * } + */ + public static int cudaDevAttrMaxTexture2DLinearHeight() { + return cudaDevAttrMaxTexture2DLinearHeight; + } + private static final int cudaDevAttrMaxTexture2DLinearPitch = (int)72L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearPitch = 72 + * } + */ + public static int cudaDevAttrMaxTexture2DLinearPitch() { + return cudaDevAttrMaxTexture2DLinearPitch; + } + private static final int cudaDevAttrMaxTexture2DMipmappedWidth = (int)73L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedWidth = 73 + * } + */ + public static int cudaDevAttrMaxTexture2DMipmappedWidth() { + return cudaDevAttrMaxTexture2DMipmappedWidth; + } + private static final int cudaDevAttrMaxTexture2DMipmappedHeight = (int)74L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedHeight = 74 + * } + */ + public static int cudaDevAttrMaxTexture2DMipmappedHeight() { + return cudaDevAttrMaxTexture2DMipmappedHeight; + } + private static final int cudaDevAttrComputeCapabilityMajor = (int)75L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor = 75 + * } + */ + public static int cudaDevAttrComputeCapabilityMajor() { + return cudaDevAttrComputeCapabilityMajor; + } + private static final int cudaDevAttrComputeCapabilityMinor = (int)76L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor = 76 + * } + */ + public static int cudaDevAttrComputeCapabilityMinor() { + return cudaDevAttrComputeCapabilityMinor; + } + private static final int cudaDevAttrMaxTexture1DMipmappedWidth = (int)77L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTexture1DMipmappedWidth = 77 + * } + */ + public static int cudaDevAttrMaxTexture1DMipmappedWidth() { + return cudaDevAttrMaxTexture1DMipmappedWidth; + } + private static final int cudaDevAttrStreamPrioritiesSupported = (int)78L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrStreamPrioritiesSupported = 78 + * } + */ + public static int cudaDevAttrStreamPrioritiesSupported() { + return cudaDevAttrStreamPrioritiesSupported; + } + private static final int cudaDevAttrGlobalL1CacheSupported = (int)79L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrGlobalL1CacheSupported = 79 + * } + */ + public static int cudaDevAttrGlobalL1CacheSupported() { + return cudaDevAttrGlobalL1CacheSupported; + } + private static final int cudaDevAttrLocalL1CacheSupported = (int)80L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrLocalL1CacheSupported = 80 + * } + */ + public static int cudaDevAttrLocalL1CacheSupported() { + return cudaDevAttrLocalL1CacheSupported; + } + private static final int cudaDevAttrMaxSharedMemoryPerMultiprocessor = (int)81L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerMultiprocessor = 81 + * } + */ + public static int cudaDevAttrMaxSharedMemoryPerMultiprocessor() { + return cudaDevAttrMaxSharedMemoryPerMultiprocessor; + } + private static final int cudaDevAttrMaxRegistersPerMultiprocessor = (int)82L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxRegistersPerMultiprocessor = 82 + * } + */ + public static int cudaDevAttrMaxRegistersPerMultiprocessor() { + return cudaDevAttrMaxRegistersPerMultiprocessor; + } + private static final int cudaDevAttrManagedMemory = (int)83L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrManagedMemory = 83 + * } + */ + public static int cudaDevAttrManagedMemory() { + return cudaDevAttrManagedMemory; + } + private static final int cudaDevAttrIsMultiGpuBoard = (int)84L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrIsMultiGpuBoard = 84 + * } + */ + public static int cudaDevAttrIsMultiGpuBoard() { + return cudaDevAttrIsMultiGpuBoard; + } + private static final int cudaDevAttrMultiGpuBoardGroupID = (int)85L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMultiGpuBoardGroupID = 85 + * } + */ + public static int cudaDevAttrMultiGpuBoardGroupID() { + return cudaDevAttrMultiGpuBoardGroupID; + } + private static final int cudaDevAttrHostNativeAtomicSupported = (int)86L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrHostNativeAtomicSupported = 86 + * } + */ + public static int cudaDevAttrHostNativeAtomicSupported() { + return cudaDevAttrHostNativeAtomicSupported; + } + private static final int cudaDevAttrSingleToDoublePrecisionPerfRatio = (int)87L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrSingleToDoublePrecisionPerfRatio = 87 + * } + */ + public static int cudaDevAttrSingleToDoublePrecisionPerfRatio() { + return cudaDevAttrSingleToDoublePrecisionPerfRatio; + } + private static final int cudaDevAttrPageableMemoryAccess = (int)88L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrPageableMemoryAccess = 88 + * } + */ + public static int cudaDevAttrPageableMemoryAccess() { + return cudaDevAttrPageableMemoryAccess; + } + private static final int cudaDevAttrConcurrentManagedAccess = (int)89L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrConcurrentManagedAccess = 89 + * } + */ + public static int cudaDevAttrConcurrentManagedAccess() { + return cudaDevAttrConcurrentManagedAccess; + } + private static final int cudaDevAttrComputePreemptionSupported = (int)90L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrComputePreemptionSupported = 90 + * } + */ + public static int cudaDevAttrComputePreemptionSupported() { + return cudaDevAttrComputePreemptionSupported; + } + private static final int cudaDevAttrCanUseHostPointerForRegisteredMem = (int)91L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrCanUseHostPointerForRegisteredMem = 91 + * } + */ + public static int cudaDevAttrCanUseHostPointerForRegisteredMem() { + return cudaDevAttrCanUseHostPointerForRegisteredMem; + } + private static final int cudaDevAttrReserved92 = (int)92L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReserved92 = 92 + * } + */ + public static int cudaDevAttrReserved92() { + return cudaDevAttrReserved92; + } + private static final int cudaDevAttrReserved93 = (int)93L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReserved93 = 93 + * } + */ + public static int cudaDevAttrReserved93() { + return cudaDevAttrReserved93; + } + private static final int cudaDevAttrReserved94 = (int)94L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReserved94 = 94 + * } + */ + public static int cudaDevAttrReserved94() { + return cudaDevAttrReserved94; + } + private static final int cudaDevAttrCooperativeLaunch = (int)95L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrCooperativeLaunch = 95 + * } + */ + public static int cudaDevAttrCooperativeLaunch() { + return cudaDevAttrCooperativeLaunch; + } + private static final int cudaDevAttrCooperativeMultiDeviceLaunch = (int)96L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrCooperativeMultiDeviceLaunch = 96 + * } + */ + public static int cudaDevAttrCooperativeMultiDeviceLaunch() { + return cudaDevAttrCooperativeMultiDeviceLaunch; + } + private static final int cudaDevAttrMaxSharedMemoryPerBlockOptin = (int)97L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlockOptin = 97 + * } + */ + public static int cudaDevAttrMaxSharedMemoryPerBlockOptin() { + return cudaDevAttrMaxSharedMemoryPerBlockOptin; + } + private static final int cudaDevAttrCanFlushRemoteWrites = (int)98L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrCanFlushRemoteWrites = 98 + * } + */ + public static int cudaDevAttrCanFlushRemoteWrites() { + return cudaDevAttrCanFlushRemoteWrites; + } + private static final int cudaDevAttrHostRegisterSupported = (int)99L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrHostRegisterSupported = 99 + * } + */ + public static int cudaDevAttrHostRegisterSupported() { + return cudaDevAttrHostRegisterSupported; + } + private static final int cudaDevAttrPageableMemoryAccessUsesHostPageTables = (int)100L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrPageableMemoryAccessUsesHostPageTables = 100 + * } + */ + public static int cudaDevAttrPageableMemoryAccessUsesHostPageTables() { + return cudaDevAttrPageableMemoryAccessUsesHostPageTables; + } + private static final int cudaDevAttrDirectManagedMemAccessFromHost = (int)101L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrDirectManagedMemAccessFromHost = 101 + * } + */ + public static int cudaDevAttrDirectManagedMemAccessFromHost() { + return cudaDevAttrDirectManagedMemAccessFromHost; + } + private static final int cudaDevAttrMaxBlocksPerMultiprocessor = (int)106L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxBlocksPerMultiprocessor = 106 + * } + */ + public static int cudaDevAttrMaxBlocksPerMultiprocessor() { + return cudaDevAttrMaxBlocksPerMultiprocessor; + } + private static final int cudaDevAttrMaxPersistingL2CacheSize = (int)108L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxPersistingL2CacheSize = 108 + * } + */ + public static int cudaDevAttrMaxPersistingL2CacheSize() { + return cudaDevAttrMaxPersistingL2CacheSize; + } + private static final int cudaDevAttrMaxAccessPolicyWindowSize = (int)109L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxAccessPolicyWindowSize = 109 + * } + */ + public static int cudaDevAttrMaxAccessPolicyWindowSize() { + return cudaDevAttrMaxAccessPolicyWindowSize; + } + private static final int cudaDevAttrReservedSharedMemoryPerBlock = (int)111L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReservedSharedMemoryPerBlock = 111 + * } + */ + public static int cudaDevAttrReservedSharedMemoryPerBlock() { + return cudaDevAttrReservedSharedMemoryPerBlock; + } + private static final int cudaDevAttrSparseCudaArraySupported = (int)112L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrSparseCudaArraySupported = 112 + * } + */ + public static int cudaDevAttrSparseCudaArraySupported() { + return cudaDevAttrSparseCudaArraySupported; + } + private static final int cudaDevAttrHostRegisterReadOnlySupported = (int)113L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrHostRegisterReadOnlySupported = 113 + * } + */ + public static int cudaDevAttrHostRegisterReadOnlySupported() { + return cudaDevAttrHostRegisterReadOnlySupported; + } + private static final int cudaDevAttrTimelineSemaphoreInteropSupported = (int)114L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrTimelineSemaphoreInteropSupported = 114 + * } + */ + public static int cudaDevAttrTimelineSemaphoreInteropSupported() { + return cudaDevAttrTimelineSemaphoreInteropSupported; + } + private static final int cudaDevAttrMaxTimelineSemaphoreInteropSupported = (int)114L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMaxTimelineSemaphoreInteropSupported = 114 + * } + */ + public static int cudaDevAttrMaxTimelineSemaphoreInteropSupported() { + return cudaDevAttrMaxTimelineSemaphoreInteropSupported; + } + private static final int cudaDevAttrMemoryPoolsSupported = (int)115L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported = 115 + * } + */ + public static int cudaDevAttrMemoryPoolsSupported() { + return cudaDevAttrMemoryPoolsSupported; + } + private static final int cudaDevAttrGPUDirectRDMASupported = (int)116L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrGPUDirectRDMASupported = 116 + * } + */ + public static int cudaDevAttrGPUDirectRDMASupported() { + return cudaDevAttrGPUDirectRDMASupported; + } + private static final int cudaDevAttrGPUDirectRDMAFlushWritesOptions = (int)117L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrGPUDirectRDMAFlushWritesOptions = 117 + * } + */ + public static int cudaDevAttrGPUDirectRDMAFlushWritesOptions() { + return cudaDevAttrGPUDirectRDMAFlushWritesOptions; + } + private static final int cudaDevAttrGPUDirectRDMAWritesOrdering = (int)118L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrGPUDirectRDMAWritesOrdering = 118 + * } + */ + public static int cudaDevAttrGPUDirectRDMAWritesOrdering() { + return cudaDevAttrGPUDirectRDMAWritesOrdering; + } + private static final int cudaDevAttrMemoryPoolSupportedHandleTypes = (int)119L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMemoryPoolSupportedHandleTypes = 119 + * } + */ + public static int cudaDevAttrMemoryPoolSupportedHandleTypes() { + return cudaDevAttrMemoryPoolSupportedHandleTypes; + } + private static final int cudaDevAttrClusterLaunch = (int)120L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrClusterLaunch = 120 + * } + */ + public static int cudaDevAttrClusterLaunch() { + return cudaDevAttrClusterLaunch; + } + private static final int cudaDevAttrDeferredMappingCudaArraySupported = (int)121L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrDeferredMappingCudaArraySupported = 121 + * } + */ + public static int cudaDevAttrDeferredMappingCudaArraySupported() { + return cudaDevAttrDeferredMappingCudaArraySupported; + } + private static final int cudaDevAttrReserved122 = (int)122L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReserved122 = 122 + * } + */ + public static int cudaDevAttrReserved122() { + return cudaDevAttrReserved122; + } + private static final int cudaDevAttrReserved123 = (int)123L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReserved123 = 123 + * } + */ + public static int cudaDevAttrReserved123() { + return cudaDevAttrReserved123; + } + private static final int cudaDevAttrReserved124 = (int)124L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReserved124 = 124 + * } + */ + public static int cudaDevAttrReserved124() { + return cudaDevAttrReserved124; + } + private static final int cudaDevAttrIpcEventSupport = (int)125L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrIpcEventSupport = 125 + * } + */ + public static int cudaDevAttrIpcEventSupport() { + return cudaDevAttrIpcEventSupport; + } + private static final int cudaDevAttrMemSyncDomainCount = (int)126L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMemSyncDomainCount = 126 + * } + */ + public static int cudaDevAttrMemSyncDomainCount() { + return cudaDevAttrMemSyncDomainCount; + } + private static final int cudaDevAttrReserved127 = (int)127L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReserved127 = 127 + * } + */ + public static int cudaDevAttrReserved127() { + return cudaDevAttrReserved127; + } + private static final int cudaDevAttrReserved128 = (int)128L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReserved128 = 128 + * } + */ + public static int cudaDevAttrReserved128() { + return cudaDevAttrReserved128; + } + private static final int cudaDevAttrReserved129 = (int)129L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReserved129 = 129 + * } + */ + public static int cudaDevAttrReserved129() { + return cudaDevAttrReserved129; + } + private static final int cudaDevAttrNumaConfig = (int)130L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrNumaConfig = 130 + * } + */ + public static int cudaDevAttrNumaConfig() { + return cudaDevAttrNumaConfig; + } + private static final int cudaDevAttrNumaId = (int)131L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrNumaId = 131 + * } + */ + public static int cudaDevAttrNumaId() { + return cudaDevAttrNumaId; + } + private static final int cudaDevAttrReserved132 = (int)132L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrReserved132 = 132 + * } + */ + public static int cudaDevAttrReserved132() { + return cudaDevAttrReserved132; + } + private static final int cudaDevAttrMpsEnabled = (int)133L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMpsEnabled = 133 + * } + */ + public static int cudaDevAttrMpsEnabled() { + return cudaDevAttrMpsEnabled; + } + private static final int cudaDevAttrHostNumaId = (int)134L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrHostNumaId = 134 + * } + */ + public static int cudaDevAttrHostNumaId() { + return cudaDevAttrHostNumaId; + } + private static final int cudaDevAttrD3D12CigSupported = (int)135L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrD3D12CigSupported = 135 + * } + */ + public static int cudaDevAttrD3D12CigSupported() { + return cudaDevAttrD3D12CigSupported; + } + private static final int cudaDevAttrMax = (int)136L; + /** + * {@snippet lang=c : + * enum cudaDeviceAttr.cudaDevAttrMax = 136 + * } + */ + public static int cudaDevAttrMax() { + return cudaDevAttrMax; + } + private static final int cudaMemPoolReuseFollowEventDependencies = (int)1L; + /** + * {@snippet lang=c : + * enum cudaMemPoolAttr.cudaMemPoolReuseFollowEventDependencies = 1 + * } + */ + public static int cudaMemPoolReuseFollowEventDependencies() { + return cudaMemPoolReuseFollowEventDependencies; + } + private static final int cudaMemPoolReuseAllowOpportunistic = (int)2L; + /** + * {@snippet lang=c : + * enum cudaMemPoolAttr.cudaMemPoolReuseAllowOpportunistic = 2 + * } + */ + public static int cudaMemPoolReuseAllowOpportunistic() { + return cudaMemPoolReuseAllowOpportunistic; + } + private static final int cudaMemPoolReuseAllowInternalDependencies = (int)3L; + /** + * {@snippet lang=c : + * enum cudaMemPoolAttr.cudaMemPoolReuseAllowInternalDependencies = 3 + * } + */ + public static int cudaMemPoolReuseAllowInternalDependencies() { + return cudaMemPoolReuseAllowInternalDependencies; + } + private static final int cudaMemPoolAttrReleaseThreshold = (int)4L; + /** + * {@snippet lang=c : + * enum cudaMemPoolAttr.cudaMemPoolAttrReleaseThreshold = 4 + * } + */ + public static int cudaMemPoolAttrReleaseThreshold() { + return cudaMemPoolAttrReleaseThreshold; + } + private static final int cudaMemPoolAttrReservedMemCurrent = (int)5L; + /** + * {@snippet lang=c : + * enum cudaMemPoolAttr.cudaMemPoolAttrReservedMemCurrent = 5 + * } + */ + public static int cudaMemPoolAttrReservedMemCurrent() { + return cudaMemPoolAttrReservedMemCurrent; + } + private static final int cudaMemPoolAttrReservedMemHigh = (int)6L; + /** + * {@snippet lang=c : + * enum cudaMemPoolAttr.cudaMemPoolAttrReservedMemHigh = 6 + * } + */ + public static int cudaMemPoolAttrReservedMemHigh() { + return cudaMemPoolAttrReservedMemHigh; + } + private static final int cudaMemPoolAttrUsedMemCurrent = (int)7L; + /** + * {@snippet lang=c : + * enum cudaMemPoolAttr.cudaMemPoolAttrUsedMemCurrent = 7 + * } + */ + public static int cudaMemPoolAttrUsedMemCurrent() { + return cudaMemPoolAttrUsedMemCurrent; + } + private static final int cudaMemPoolAttrUsedMemHigh = (int)8L; + /** + * {@snippet lang=c : + * enum cudaMemPoolAttr.cudaMemPoolAttrUsedMemHigh = 8 + * } + */ + public static int cudaMemPoolAttrUsedMemHigh() { + return cudaMemPoolAttrUsedMemHigh; + } + private static final int cudaMemLocationTypeInvalid = (int)0L; + /** + * {@snippet lang=c : + * enum cudaMemLocationType.cudaMemLocationTypeInvalid = 0 + * } + */ + public static int cudaMemLocationTypeInvalid() { + return cudaMemLocationTypeInvalid; + } + private static final int cudaMemLocationTypeDevice = (int)1L; + /** + * {@snippet lang=c : + * enum cudaMemLocationType.cudaMemLocationTypeDevice = 1 + * } + */ + public static int cudaMemLocationTypeDevice() { + return cudaMemLocationTypeDevice; + } + private static final int cudaMemLocationTypeHost = (int)2L; + /** + * {@snippet lang=c : + * enum cudaMemLocationType.cudaMemLocationTypeHost = 2 + * } + */ + public static int cudaMemLocationTypeHost() { + return cudaMemLocationTypeHost; + } + private static final int cudaMemLocationTypeHostNuma = (int)3L; + /** + * {@snippet lang=c : + * enum cudaMemLocationType.cudaMemLocationTypeHostNuma = 3 + * } + */ + public static int cudaMemLocationTypeHostNuma() { + return cudaMemLocationTypeHostNuma; + } + private static final int cudaMemLocationTypeHostNumaCurrent = (int)4L; + /** + * {@snippet lang=c : + * enum cudaMemLocationType.cudaMemLocationTypeHostNumaCurrent = 4 + * } + */ + public static int cudaMemLocationTypeHostNumaCurrent() { + return cudaMemLocationTypeHostNumaCurrent; + } + private static final int cudaMemAccessFlagsProtNone = (int)0L; + /** + * {@snippet lang=c : + * enum cudaMemAccessFlags.cudaMemAccessFlagsProtNone = 0 + * } + */ + public static int cudaMemAccessFlagsProtNone() { + return cudaMemAccessFlagsProtNone; + } + private static final int cudaMemAccessFlagsProtRead = (int)1L; + /** + * {@snippet lang=c : + * enum cudaMemAccessFlags.cudaMemAccessFlagsProtRead = 1 + * } + */ + public static int cudaMemAccessFlagsProtRead() { + return cudaMemAccessFlagsProtRead; + } + private static final int cudaMemAccessFlagsProtReadWrite = (int)3L; + /** + * {@snippet lang=c : + * enum cudaMemAccessFlags.cudaMemAccessFlagsProtReadWrite = 3 + * } + */ + public static int cudaMemAccessFlagsProtReadWrite() { + return cudaMemAccessFlagsProtReadWrite; + } + private static final int cudaMemAllocationTypeInvalid = (int)0L; + /** + * {@snippet lang=c : + * enum cudaMemAllocationType.cudaMemAllocationTypeInvalid = 0 + * } + */ + public static int cudaMemAllocationTypeInvalid() { + return cudaMemAllocationTypeInvalid; + } + private static final int cudaMemAllocationTypePinned = (int)1L; + /** + * {@snippet lang=c : + * enum cudaMemAllocationType.cudaMemAllocationTypePinned = 1 + * } + */ + public static int cudaMemAllocationTypePinned() { + return cudaMemAllocationTypePinned; + } + private static final int cudaMemAllocationTypeMax = (int)2147483647L; + /** + * {@snippet lang=c : + * enum cudaMemAllocationType.cudaMemAllocationTypeMax = 2147483647 + * } + */ + public static int cudaMemAllocationTypeMax() { + return cudaMemAllocationTypeMax; + } + private static final int cudaMemHandleTypeNone = (int)0L; + /** + * {@snippet lang=c : + * enum cudaMemAllocationHandleType.cudaMemHandleTypeNone = 0 + * } + */ + public static int cudaMemHandleTypeNone() { + return cudaMemHandleTypeNone; + } + private static final int cudaMemHandleTypePosixFileDescriptor = (int)1L; + /** + * {@snippet lang=c : + * enum cudaMemAllocationHandleType.cudaMemHandleTypePosixFileDescriptor = 1 + * } + */ + public static int cudaMemHandleTypePosixFileDescriptor() { + return cudaMemHandleTypePosixFileDescriptor; + } + private static final int cudaMemHandleTypeWin32 = (int)2L; + /** + * {@snippet lang=c : + * enum cudaMemAllocationHandleType.cudaMemHandleTypeWin32 = 2 + * } + */ + public static int cudaMemHandleTypeWin32() { + return cudaMemHandleTypeWin32; + } + private static final int cudaMemHandleTypeWin32Kmt = (int)4L; + /** + * {@snippet lang=c : + * enum cudaMemAllocationHandleType.cudaMemHandleTypeWin32Kmt = 4 + * } + */ + public static int cudaMemHandleTypeWin32Kmt() { + return cudaMemHandleTypeWin32Kmt; + } + private static final int cudaMemHandleTypeFabric = (int)8L; + /** + * {@snippet lang=c : + * enum cudaMemAllocationHandleType.cudaMemHandleTypeFabric = 8 + * } + */ + public static int cudaMemHandleTypeFabric() { + return cudaMemHandleTypeFabric; + } + private static final int cudaGraphMemAttrUsedMemCurrent = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemCurrent = 0 + * } + */ + public static int cudaGraphMemAttrUsedMemCurrent() { + return cudaGraphMemAttrUsedMemCurrent; + } + private static final int cudaGraphMemAttrUsedMemHigh = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemHigh = 1 + * } + */ + public static int cudaGraphMemAttrUsedMemHigh() { + return cudaGraphMemAttrUsedMemHigh; + } + private static final int cudaGraphMemAttrReservedMemCurrent = (int)2L; + /** + * {@snippet lang=c : + * enum cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemCurrent = 2 + * } + */ + public static int cudaGraphMemAttrReservedMemCurrent() { + return cudaGraphMemAttrReservedMemCurrent; + } + private static final int cudaGraphMemAttrReservedMemHigh = (int)3L; + /** + * {@snippet lang=c : + * enum cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemHigh = 3 + * } + */ + public static int cudaGraphMemAttrReservedMemHigh() { + return cudaGraphMemAttrReservedMemHigh; + } + private static final int cudaDevP2PAttrPerformanceRank = (int)1L; + /** + * {@snippet lang=c : + * enum cudaDeviceP2PAttr.cudaDevP2PAttrPerformanceRank = 1 + * } + */ + public static int cudaDevP2PAttrPerformanceRank() { + return cudaDevP2PAttrPerformanceRank; + } + private static final int cudaDevP2PAttrAccessSupported = (int)2L; + /** + * {@snippet lang=c : + * enum cudaDeviceP2PAttr.cudaDevP2PAttrAccessSupported = 2 + * } + */ + public static int cudaDevP2PAttrAccessSupported() { + return cudaDevP2PAttrAccessSupported; + } + private static final int cudaDevP2PAttrNativeAtomicSupported = (int)3L; + /** + * {@snippet lang=c : + * enum cudaDeviceP2PAttr.cudaDevP2PAttrNativeAtomicSupported = 3 + * } + */ + public static int cudaDevP2PAttrNativeAtomicSupported() { + return cudaDevP2PAttrNativeAtomicSupported; + } + private static final int cudaDevP2PAttrCudaArrayAccessSupported = (int)4L; + /** + * {@snippet lang=c : + * enum cudaDeviceP2PAttr.cudaDevP2PAttrCudaArrayAccessSupported = 4 + * } + */ + public static int cudaDevP2PAttrCudaArrayAccessSupported() { + return cudaDevP2PAttrCudaArrayAccessSupported; + } + private static final int cudaExternalMemoryHandleTypeOpaqueFd = (int)1L; + /** + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd = 1 + * } + */ + public static int cudaExternalMemoryHandleTypeOpaqueFd() { + return cudaExternalMemoryHandleTypeOpaqueFd; + } + private static final int cudaExternalMemoryHandleTypeOpaqueWin32 = (int)2L; + /** + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32 = 2 + * } + */ + public static int cudaExternalMemoryHandleTypeOpaqueWin32() { + return cudaExternalMemoryHandleTypeOpaqueWin32; + } + private static final int cudaExternalMemoryHandleTypeOpaqueWin32Kmt = (int)3L; + /** + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt = 3 + * } + */ + public static int cudaExternalMemoryHandleTypeOpaqueWin32Kmt() { + return cudaExternalMemoryHandleTypeOpaqueWin32Kmt; + } + private static final int cudaExternalMemoryHandleTypeD3D12Heap = (int)4L; + /** + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap = 4 + * } + */ + public static int cudaExternalMemoryHandleTypeD3D12Heap() { + return cudaExternalMemoryHandleTypeD3D12Heap; + } + private static final int cudaExternalMemoryHandleTypeD3D12Resource = (int)5L; + /** + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource = 5 + * } + */ + public static int cudaExternalMemoryHandleTypeD3D12Resource() { + return cudaExternalMemoryHandleTypeD3D12Resource; + } + private static final int cudaExternalMemoryHandleTypeD3D11Resource = (int)6L; + /** + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource = 6 + * } + */ + public static int cudaExternalMemoryHandleTypeD3D11Resource() { + return cudaExternalMemoryHandleTypeD3D11Resource; + } + private static final int cudaExternalMemoryHandleTypeD3D11ResourceKmt = (int)7L; + /** + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt = 7 + * } + */ + public static int cudaExternalMemoryHandleTypeD3D11ResourceKmt() { + return cudaExternalMemoryHandleTypeD3D11ResourceKmt; + } + private static final int cudaExternalMemoryHandleTypeNvSciBuf = (int)8L; + /** + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf = 8 + * } + */ + public static int cudaExternalMemoryHandleTypeNvSciBuf() { + return cudaExternalMemoryHandleTypeNvSciBuf; + } + private static final int cudaExternalSemaphoreHandleTypeOpaqueFd = (int)1L; + /** + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd = 1 + * } + */ + public static int cudaExternalSemaphoreHandleTypeOpaqueFd() { + return cudaExternalSemaphoreHandleTypeOpaqueFd; + } + private static final int cudaExternalSemaphoreHandleTypeOpaqueWin32 = (int)2L; + /** + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32 = 2 + * } + */ + public static int cudaExternalSemaphoreHandleTypeOpaqueWin32() { + return cudaExternalSemaphoreHandleTypeOpaqueWin32; + } + private static final int cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt = (int)3L; + /** + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt = 3 + * } + */ + public static int cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt() { + return cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt; + } + private static final int cudaExternalSemaphoreHandleTypeD3D12Fence = (int)4L; + /** + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence = 4 + * } + */ + public static int cudaExternalSemaphoreHandleTypeD3D12Fence() { + return cudaExternalSemaphoreHandleTypeD3D12Fence; + } + private static final int cudaExternalSemaphoreHandleTypeD3D11Fence = (int)5L; + /** + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence = 5 + * } + */ + public static int cudaExternalSemaphoreHandleTypeD3D11Fence() { + return cudaExternalSemaphoreHandleTypeD3D11Fence; + } + private static final int cudaExternalSemaphoreHandleTypeNvSciSync = (int)6L; + /** + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync = 6 + * } + */ + public static int cudaExternalSemaphoreHandleTypeNvSciSync() { + return cudaExternalSemaphoreHandleTypeNvSciSync; + } + private static final int cudaExternalSemaphoreHandleTypeKeyedMutex = (int)7L; + /** + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex = 7 + * } + */ + public static int cudaExternalSemaphoreHandleTypeKeyedMutex() { + return cudaExternalSemaphoreHandleTypeKeyedMutex; + } + private static final int cudaExternalSemaphoreHandleTypeKeyedMutexKmt = (int)8L; + /** + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt = 8 + * } + */ + public static int cudaExternalSemaphoreHandleTypeKeyedMutexKmt() { + return cudaExternalSemaphoreHandleTypeKeyedMutexKmt; + } + private static final int cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = (int)9L; + /** + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = 9 + * } + */ + public static int cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd() { + return cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd; + } + private static final int cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = (int)10L; + /** + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = 10 + * } + */ + public static int cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32() { + return cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32; + } + /** + * {@snippet lang=c : + * typedef struct CUstream_st *cudaStream_t + * } + */ + public static final AddressLayout cudaStream_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct CUevent_st *cudaEvent_t + * } + */ + public static final AddressLayout cudaEvent_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct cudaGraphicsResource *cudaGraphicsResource_t + * } + */ + public static final AddressLayout cudaGraphicsResource_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct CUexternalMemory_st *cudaExternalMemory_t + * } + */ + public static final AddressLayout cudaExternalMemory_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct CUexternalSemaphore_st *cudaExternalSemaphore_t + * } + */ + public static final AddressLayout cudaExternalSemaphore_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct CUgraph_st *cudaGraph_t + * } + */ + public static final AddressLayout cudaGraph_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct CUgraphNode_st *cudaGraphNode_t + * } + */ + public static final AddressLayout cudaGraphNode_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct CUuserObject_st *cudaUserObject_t + * } + */ + public static final AddressLayout cudaUserObject_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef unsigned long long cudaGraphConditionalHandle + * } + */ + public static final OfLong cudaGraphConditionalHandle = PanamaFFMAPI.C_LONG_LONG; + /** + * {@snippet lang=c : + * typedef struct CUfunc_st *cudaFunction_t + * } + */ + public static final AddressLayout cudaFunction_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct CUkern_st *cudaKernel_t + * } + */ + public static final AddressLayout cudaKernel_t = PanamaFFMAPI.C_POINTER; + /** + * {@snippet lang=c : + * typedef struct CUmemPoolHandle_st *cudaMemPool_t + * } + */ + public static final AddressLayout cudaMemPool_t = PanamaFFMAPI.C_POINTER; + private static final int cudaCGScopeInvalid = (int)0L; + /** + * {@snippet lang=c : + * enum cudaCGScope.cudaCGScopeInvalid = 0 + * } + */ + public static int cudaCGScopeInvalid() { + return cudaCGScopeInvalid; + } + private static final int cudaCGScopeGrid = (int)1L; + /** + * {@snippet lang=c : + * enum cudaCGScope.cudaCGScopeGrid = 1 + * } + */ + public static int cudaCGScopeGrid() { + return cudaCGScopeGrid; + } + private static final int cudaCGScopeMultiGrid = (int)2L; + /** + * {@snippet lang=c : + * enum cudaCGScope.cudaCGScopeMultiGrid = 2 + * } + */ + public static int cudaCGScopeMultiGrid() { + return cudaCGScopeMultiGrid; + } + private static final int cudaGraphCondAssignDefault = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphConditionalHandleFlags.cudaGraphCondAssignDefault = 1 + * } + */ + public static int cudaGraphCondAssignDefault() { + return cudaGraphCondAssignDefault; + } + private static final int cudaGraphCondTypeIf = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGraphConditionalNodeType.cudaGraphCondTypeIf = 0 + * } + */ + public static int cudaGraphCondTypeIf() { + return cudaGraphCondTypeIf; + } + private static final int cudaGraphCondTypeWhile = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphConditionalNodeType.cudaGraphCondTypeWhile = 1 + * } + */ + public static int cudaGraphCondTypeWhile() { + return cudaGraphCondTypeWhile; + } + private static final int cudaGraphNodeTypeKernel = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeKernel = 0 + * } + */ + public static int cudaGraphNodeTypeKernel() { + return cudaGraphNodeTypeKernel; + } + private static final int cudaGraphNodeTypeMemcpy = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeMemcpy = 1 + * } + */ + public static int cudaGraphNodeTypeMemcpy() { + return cudaGraphNodeTypeMemcpy; + } + private static final int cudaGraphNodeTypeMemset = (int)2L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeMemset = 2 + * } + */ + public static int cudaGraphNodeTypeMemset() { + return cudaGraphNodeTypeMemset; + } + private static final int cudaGraphNodeTypeHost = (int)3L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeHost = 3 + * } + */ + public static int cudaGraphNodeTypeHost() { + return cudaGraphNodeTypeHost; + } + private static final int cudaGraphNodeTypeGraph = (int)4L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeGraph = 4 + * } + */ + public static int cudaGraphNodeTypeGraph() { + return cudaGraphNodeTypeGraph; + } + private static final int cudaGraphNodeTypeEmpty = (int)5L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeEmpty = 5 + * } + */ + public static int cudaGraphNodeTypeEmpty() { + return cudaGraphNodeTypeEmpty; + } + private static final int cudaGraphNodeTypeWaitEvent = (int)6L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeWaitEvent = 6 + * } + */ + public static int cudaGraphNodeTypeWaitEvent() { + return cudaGraphNodeTypeWaitEvent; + } + private static final int cudaGraphNodeTypeEventRecord = (int)7L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeEventRecord = 7 + * } + */ + public static int cudaGraphNodeTypeEventRecord() { + return cudaGraphNodeTypeEventRecord; + } + private static final int cudaGraphNodeTypeExtSemaphoreSignal = (int)8L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal = 8 + * } + */ + public static int cudaGraphNodeTypeExtSemaphoreSignal() { + return cudaGraphNodeTypeExtSemaphoreSignal; + } + private static final int cudaGraphNodeTypeExtSemaphoreWait = (int)9L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait = 9 + * } + */ + public static int cudaGraphNodeTypeExtSemaphoreWait() { + return cudaGraphNodeTypeExtSemaphoreWait; + } + private static final int cudaGraphNodeTypeMemAlloc = (int)10L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeMemAlloc = 10 + * } + */ + public static int cudaGraphNodeTypeMemAlloc() { + return cudaGraphNodeTypeMemAlloc; + } + private static final int cudaGraphNodeTypeMemFree = (int)11L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeMemFree = 11 + * } + */ + public static int cudaGraphNodeTypeMemFree() { + return cudaGraphNodeTypeMemFree; + } + private static final int cudaGraphNodeTypeConditional = (int)13L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeConditional = 13 + * } + */ + public static int cudaGraphNodeTypeConditional() { + return cudaGraphNodeTypeConditional; + } + private static final int cudaGraphNodeTypeCount = (int)14L; + /** + * {@snippet lang=c : + * enum cudaGraphNodeType.cudaGraphNodeTypeCount = 14 + * } + */ + public static int cudaGraphNodeTypeCount() { + return cudaGraphNodeTypeCount; + } + private static final int cudaGraphDependencyTypeDefault = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGraphDependencyType_enum.cudaGraphDependencyTypeDefault = 0 + * } + */ + public static int cudaGraphDependencyTypeDefault() { + return cudaGraphDependencyTypeDefault; + } + private static final int cudaGraphDependencyTypeProgrammatic = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphDependencyType_enum.cudaGraphDependencyTypeProgrammatic = 1 + * } + */ + public static int cudaGraphDependencyTypeProgrammatic() { + return cudaGraphDependencyTypeProgrammatic; + } + /** + * {@snippet lang=c : + * typedef struct CUgraphExec_st *cudaGraphExec_t + * } + */ + public static final AddressLayout cudaGraphExec_t = PanamaFFMAPI.C_POINTER; + private static final int cudaGraphExecUpdateSuccess = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateSuccess = 0 + * } + */ + public static int cudaGraphExecUpdateSuccess() { + return cudaGraphExecUpdateSuccess; + } + private static final int cudaGraphExecUpdateError = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateError = 1 + * } + */ + public static int cudaGraphExecUpdateError() { + return cudaGraphExecUpdateError; + } + private static final int cudaGraphExecUpdateErrorTopologyChanged = (int)2L; + /** + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorTopologyChanged = 2 + * } + */ + public static int cudaGraphExecUpdateErrorTopologyChanged() { + return cudaGraphExecUpdateErrorTopologyChanged; + } + private static final int cudaGraphExecUpdateErrorNodeTypeChanged = (int)3L; + /** + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNodeTypeChanged = 3 + * } + */ + public static int cudaGraphExecUpdateErrorNodeTypeChanged() { + return cudaGraphExecUpdateErrorNodeTypeChanged; + } + private static final int cudaGraphExecUpdateErrorFunctionChanged = (int)4L; + /** + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorFunctionChanged = 4 + * } + */ + public static int cudaGraphExecUpdateErrorFunctionChanged() { + return cudaGraphExecUpdateErrorFunctionChanged; + } + private static final int cudaGraphExecUpdateErrorParametersChanged = (int)5L; + /** + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorParametersChanged = 5 + * } + */ + public static int cudaGraphExecUpdateErrorParametersChanged() { + return cudaGraphExecUpdateErrorParametersChanged; + } + private static final int cudaGraphExecUpdateErrorNotSupported = (int)6L; + /** + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNotSupported = 6 + * } + */ + public static int cudaGraphExecUpdateErrorNotSupported() { + return cudaGraphExecUpdateErrorNotSupported; + } + private static final int cudaGraphExecUpdateErrorUnsupportedFunctionChange = (int)7L; + /** + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorUnsupportedFunctionChange = 7 + * } + */ + public static int cudaGraphExecUpdateErrorUnsupportedFunctionChange() { + return cudaGraphExecUpdateErrorUnsupportedFunctionChange; + } + private static final int cudaGraphExecUpdateErrorAttributesChanged = (int)8L; + /** + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorAttributesChanged = 8 + * } + */ + public static int cudaGraphExecUpdateErrorAttributesChanged() { + return cudaGraphExecUpdateErrorAttributesChanged; + } + private static final int cudaGraphInstantiateSuccess = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGraphInstantiateResult.cudaGraphInstantiateSuccess = 0 + * } + */ + public static int cudaGraphInstantiateSuccess() { + return cudaGraphInstantiateSuccess; + } + private static final int cudaGraphInstantiateError = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphInstantiateResult.cudaGraphInstantiateError = 1 + * } + */ + public static int cudaGraphInstantiateError() { + return cudaGraphInstantiateError; + } + private static final int cudaGraphInstantiateInvalidStructure = (int)2L; + /** + * {@snippet lang=c : + * enum cudaGraphInstantiateResult.cudaGraphInstantiateInvalidStructure = 2 + * } + */ + public static int cudaGraphInstantiateInvalidStructure() { + return cudaGraphInstantiateInvalidStructure; + } + private static final int cudaGraphInstantiateNodeOperationNotSupported = (int)3L; + /** + * {@snippet lang=c : + * enum cudaGraphInstantiateResult.cudaGraphInstantiateNodeOperationNotSupported = 3 + * } + */ + public static int cudaGraphInstantiateNodeOperationNotSupported() { + return cudaGraphInstantiateNodeOperationNotSupported; + } + private static final int cudaGraphInstantiateMultipleDevicesNotSupported = (int)4L; + /** + * {@snippet lang=c : + * enum cudaGraphInstantiateResult.cudaGraphInstantiateMultipleDevicesNotSupported = 4 + * } + */ + public static int cudaGraphInstantiateMultipleDevicesNotSupported() { + return cudaGraphInstantiateMultipleDevicesNotSupported; + } + /** + * {@snippet lang=c : + * typedef struct CUgraphDeviceUpdatableNode_st *cudaGraphDeviceNode_t + * } + */ + public static final AddressLayout cudaGraphDeviceNode_t = PanamaFFMAPI.C_POINTER; + private static final int cudaGraphKernelNodeFieldInvalid = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGraphKernelNodeField.cudaGraphKernelNodeFieldInvalid = 0 + * } + */ + public static int cudaGraphKernelNodeFieldInvalid() { + return cudaGraphKernelNodeFieldInvalid; + } + private static final int cudaGraphKernelNodeFieldGridDim = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphKernelNodeField.cudaGraphKernelNodeFieldGridDim = 1 + * } + */ + public static int cudaGraphKernelNodeFieldGridDim() { + return cudaGraphKernelNodeFieldGridDim; + } + private static final int cudaGraphKernelNodeFieldParam = (int)2L; + /** + * {@snippet lang=c : + * enum cudaGraphKernelNodeField.cudaGraphKernelNodeFieldParam = 2 + * } + */ + public static int cudaGraphKernelNodeFieldParam() { + return cudaGraphKernelNodeFieldParam; + } + private static final int cudaGraphKernelNodeFieldEnabled = (int)3L; + /** + * {@snippet lang=c : + * enum cudaGraphKernelNodeField.cudaGraphKernelNodeFieldEnabled = 3 + * } + */ + public static int cudaGraphKernelNodeFieldEnabled() { + return cudaGraphKernelNodeFieldEnabled; + } + private static final int cudaEnableDefault = (int)0L; + /** + * {@snippet lang=c : + * enum cudaGetDriverEntryPointFlags.cudaEnableDefault = 0 + * } + */ + public static int cudaEnableDefault() { + return cudaEnableDefault; + } + private static final int cudaEnableLegacyStream = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGetDriverEntryPointFlags.cudaEnableLegacyStream = 1 + * } + */ + public static int cudaEnableLegacyStream() { + return cudaEnableLegacyStream; + } + private static final int cudaEnablePerThreadDefaultStream = (int)2L; + /** + * {@snippet lang=c : + * enum cudaGetDriverEntryPointFlags.cudaEnablePerThreadDefaultStream = 2 + * } + */ + public static int cudaEnablePerThreadDefaultStream() { + return cudaEnablePerThreadDefaultStream; + } + private static final int cudaDriverEntryPointSuccess = (int)0L; + /** + * {@snippet lang=c : + * enum cudaDriverEntryPointQueryResult.cudaDriverEntryPointSuccess = 0 + * } + */ + public static int cudaDriverEntryPointSuccess() { + return cudaDriverEntryPointSuccess; + } + private static final int cudaDriverEntryPointSymbolNotFound = (int)1L; + /** + * {@snippet lang=c : + * enum cudaDriverEntryPointQueryResult.cudaDriverEntryPointSymbolNotFound = 1 + * } + */ + public static int cudaDriverEntryPointSymbolNotFound() { + return cudaDriverEntryPointSymbolNotFound; + } + private static final int cudaDriverEntryPointVersionNotSufficent = (int)2L; + /** + * {@snippet lang=c : + * enum cudaDriverEntryPointQueryResult.cudaDriverEntryPointVersionNotSufficent = 2 + * } + */ + public static int cudaDriverEntryPointVersionNotSufficent() { + return cudaDriverEntryPointVersionNotSufficent; + } + private static final int cudaGraphDebugDotFlagsVerbose = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsVerbose = 1 + * } + */ + public static int cudaGraphDebugDotFlagsVerbose() { + return cudaGraphDebugDotFlagsVerbose; + } + private static final int cudaGraphDebugDotFlagsKernelNodeParams = (int)4L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeParams = 4 + * } + */ + public static int cudaGraphDebugDotFlagsKernelNodeParams() { + return cudaGraphDebugDotFlagsKernelNodeParams; + } + private static final int cudaGraphDebugDotFlagsMemcpyNodeParams = (int)8L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemcpyNodeParams = 8 + * } + */ + public static int cudaGraphDebugDotFlagsMemcpyNodeParams() { + return cudaGraphDebugDotFlagsMemcpyNodeParams; + } + private static final int cudaGraphDebugDotFlagsMemsetNodeParams = (int)16L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemsetNodeParams = 16 + * } + */ + public static int cudaGraphDebugDotFlagsMemsetNodeParams() { + return cudaGraphDebugDotFlagsMemsetNodeParams; + } + private static final int cudaGraphDebugDotFlagsHostNodeParams = (int)32L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHostNodeParams = 32 + * } + */ + public static int cudaGraphDebugDotFlagsHostNodeParams() { + return cudaGraphDebugDotFlagsHostNodeParams; + } + private static final int cudaGraphDebugDotFlagsEventNodeParams = (int)64L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsEventNodeParams = 64 + * } + */ + public static int cudaGraphDebugDotFlagsEventNodeParams() { + return cudaGraphDebugDotFlagsEventNodeParams; + } + private static final int cudaGraphDebugDotFlagsExtSemasSignalNodeParams = (int)128L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasSignalNodeParams = 128 + * } + */ + public static int cudaGraphDebugDotFlagsExtSemasSignalNodeParams() { + return cudaGraphDebugDotFlagsExtSemasSignalNodeParams; + } + private static final int cudaGraphDebugDotFlagsExtSemasWaitNodeParams = (int)256L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasWaitNodeParams = 256 + * } + */ + public static int cudaGraphDebugDotFlagsExtSemasWaitNodeParams() { + return cudaGraphDebugDotFlagsExtSemasWaitNodeParams; + } + private static final int cudaGraphDebugDotFlagsKernelNodeAttributes = (int)512L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeAttributes = 512 + * } + */ + public static int cudaGraphDebugDotFlagsKernelNodeAttributes() { + return cudaGraphDebugDotFlagsKernelNodeAttributes; + } + private static final int cudaGraphDebugDotFlagsHandles = (int)1024L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHandles = 1024 + * } + */ + public static int cudaGraphDebugDotFlagsHandles() { + return cudaGraphDebugDotFlagsHandles; + } + private static final int cudaGraphDebugDotFlagsConditionalNodeParams = (int)32768L; + /** + * {@snippet lang=c : + * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsConditionalNodeParams = 32768 + * } + */ + public static int cudaGraphDebugDotFlagsConditionalNodeParams() { + return cudaGraphDebugDotFlagsConditionalNodeParams; + } + private static final int cudaGraphInstantiateFlagAutoFreeOnLaunch = (int)1L; + /** + * {@snippet lang=c : + * enum cudaGraphInstantiateFlags.cudaGraphInstantiateFlagAutoFreeOnLaunch = 1 + * } + */ + public static int cudaGraphInstantiateFlagAutoFreeOnLaunch() { + return cudaGraphInstantiateFlagAutoFreeOnLaunch; + } + private static final int cudaGraphInstantiateFlagUpload = (int)2L; + /** + * {@snippet lang=c : + * enum cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUpload = 2 + * } + */ + public static int cudaGraphInstantiateFlagUpload() { + return cudaGraphInstantiateFlagUpload; + } + private static final int cudaGraphInstantiateFlagDeviceLaunch = (int)4L; + /** + * {@snippet lang=c : + * enum cudaGraphInstantiateFlags.cudaGraphInstantiateFlagDeviceLaunch = 4 + * } + */ + public static int cudaGraphInstantiateFlagDeviceLaunch() { + return cudaGraphInstantiateFlagDeviceLaunch; + } + private static final int cudaGraphInstantiateFlagUseNodePriority = (int)8L; + /** + * {@snippet lang=c : + * enum cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUseNodePriority = 8 + * } + */ + public static int cudaGraphInstantiateFlagUseNodePriority() { + return cudaGraphInstantiateFlagUseNodePriority; + } + private static final int cudaLaunchMemSyncDomainDefault = (int)0L; + /** + * {@snippet lang=c : + * enum cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainDefault = 0 + * } + */ + public static int cudaLaunchMemSyncDomainDefault() { + return cudaLaunchMemSyncDomainDefault; + } + private static final int cudaLaunchMemSyncDomainRemote = (int)1L; + /** + * {@snippet lang=c : + * enum cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainRemote = 1 + * } + */ + public static int cudaLaunchMemSyncDomainRemote() { + return cudaLaunchMemSyncDomainRemote; + } + private static final int cudaLaunchAttributeIgnore = (int)0L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeIgnore = 0 + * } + */ + public static int cudaLaunchAttributeIgnore() { + return cudaLaunchAttributeIgnore; + } + private static final int cudaLaunchAttributeAccessPolicyWindow = (int)1L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeAccessPolicyWindow = 1 + * } + */ + public static int cudaLaunchAttributeAccessPolicyWindow() { + return cudaLaunchAttributeAccessPolicyWindow; + } + private static final int cudaLaunchAttributeCooperative = (int)2L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeCooperative = 2 + * } + */ + public static int cudaLaunchAttributeCooperative() { + return cudaLaunchAttributeCooperative; + } + private static final int cudaLaunchAttributeSynchronizationPolicy = (int)3L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeSynchronizationPolicy = 3 + * } + */ + public static int cudaLaunchAttributeSynchronizationPolicy() { + return cudaLaunchAttributeSynchronizationPolicy; + } + private static final int cudaLaunchAttributeClusterDimension = (int)4L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeClusterDimension = 4 + * } + */ + public static int cudaLaunchAttributeClusterDimension() { + return cudaLaunchAttributeClusterDimension; + } + private static final int cudaLaunchAttributeClusterSchedulingPolicyPreference = (int)5L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeClusterSchedulingPolicyPreference = 5 + * } + */ + public static int cudaLaunchAttributeClusterSchedulingPolicyPreference() { + return cudaLaunchAttributeClusterSchedulingPolicyPreference; + } + private static final int cudaLaunchAttributeProgrammaticStreamSerialization = (int)6L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticStreamSerialization = 6 + * } + */ + public static int cudaLaunchAttributeProgrammaticStreamSerialization() { + return cudaLaunchAttributeProgrammaticStreamSerialization; + } + private static final int cudaLaunchAttributeProgrammaticEvent = (int)7L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticEvent = 7 + * } + */ + public static int cudaLaunchAttributeProgrammaticEvent() { + return cudaLaunchAttributeProgrammaticEvent; + } + private static final int cudaLaunchAttributePriority = (int)8L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributePriority = 8 + * } + */ + public static int cudaLaunchAttributePriority() { + return cudaLaunchAttributePriority; + } + private static final int cudaLaunchAttributeMemSyncDomainMap = (int)9L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomainMap = 9 + * } + */ + public static int cudaLaunchAttributeMemSyncDomainMap() { + return cudaLaunchAttributeMemSyncDomainMap; + } + private static final int cudaLaunchAttributeMemSyncDomain = (int)10L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomain = 10 + * } + */ + public static int cudaLaunchAttributeMemSyncDomain() { + return cudaLaunchAttributeMemSyncDomain; + } + private static final int cudaLaunchAttributeLaunchCompletionEvent = (int)12L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeLaunchCompletionEvent = 12 + * } + */ + public static int cudaLaunchAttributeLaunchCompletionEvent() { + return cudaLaunchAttributeLaunchCompletionEvent; + } + private static final int cudaLaunchAttributeDeviceUpdatableKernelNode = (int)13L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributeDeviceUpdatableKernelNode = 13 + * } + */ + public static int cudaLaunchAttributeDeviceUpdatableKernelNode() { + return cudaLaunchAttributeDeviceUpdatableKernelNode; + } + private static final int cudaLaunchAttributePreferredSharedMemoryCarveout = (int)14L; + /** + * {@snippet lang=c : + * enum cudaLaunchAttributeID.cudaLaunchAttributePreferredSharedMemoryCarveout = 14 + * } + */ + public static int cudaLaunchAttributePreferredSharedMemoryCarveout() { + return cudaLaunchAttributePreferredSharedMemoryCarveout; + } + private static final int cudaDeviceNumaConfigNone = (int)0L; + /** + * {@snippet lang=c : + * enum cudaDeviceNumaConfig.cudaDeviceNumaConfigNone = 0 + * } + */ + public static int cudaDeviceNumaConfigNone() { + return cudaDeviceNumaConfigNone; + } + private static final int cudaDeviceNumaConfigNumaNode = (int)1L; + /** + * {@snippet lang=c : + * enum cudaDeviceNumaConfig.cudaDeviceNumaConfigNumaNode = 1 + * } + */ + public static int cudaDeviceNumaConfigNumaNode() { + return cudaDeviceNumaConfigNumaNode; + } + /** + * {@snippet lang=c : + * typedef struct cudaAsyncCallbackEntry *cudaAsyncCallbackHandle_t + * } + */ + public static final AddressLayout cudaAsyncCallbackHandle_t = PanamaFFMAPI.C_POINTER; + private static final int cudaAsyncNotificationTypeOverBudget = (int)1L; + /** + * {@snippet lang=c : + * enum cudaAsyncNotificationType_enum.cudaAsyncNotificationTypeOverBudget = 1 + * } + */ + public static int cudaAsyncNotificationTypeOverBudget() { + return cudaAsyncNotificationTypeOverBudget; + } + private static final int cudaBoundaryModeZero = (int)0L; + /** + * {@snippet lang=c : + * enum cudaSurfaceBoundaryMode.cudaBoundaryModeZero = 0 + * } + */ + public static int cudaBoundaryModeZero() { + return cudaBoundaryModeZero; + } + private static final int cudaBoundaryModeClamp = (int)1L; + /** + * {@snippet lang=c : + * enum cudaSurfaceBoundaryMode.cudaBoundaryModeClamp = 1 + * } + */ + public static int cudaBoundaryModeClamp() { + return cudaBoundaryModeClamp; + } + private static final int cudaBoundaryModeTrap = (int)2L; + /** + * {@snippet lang=c : + * enum cudaSurfaceBoundaryMode.cudaBoundaryModeTrap = 2 + * } + */ + public static int cudaBoundaryModeTrap() { + return cudaBoundaryModeTrap; + } + private static final int cudaFormatModeForced = (int)0L; + /** + * {@snippet lang=c : + * enum cudaSurfaceFormatMode.cudaFormatModeForced = 0 + * } + */ + public static int cudaFormatModeForced() { + return cudaFormatModeForced; + } + private static final int cudaFormatModeAuto = (int)1L; + /** + * {@snippet lang=c : + * enum cudaSurfaceFormatMode.cudaFormatModeAuto = 1 + * } + */ + public static int cudaFormatModeAuto() { + return cudaFormatModeAuto; + } + /** + * {@snippet lang=c : + * typedef unsigned long long cudaSurfaceObject_t + * } + */ + public static final OfLong cudaSurfaceObject_t = PanamaFFMAPI.C_LONG_LONG; + private static final int cudaAddressModeWrap = (int)0L; + /** + * {@snippet lang=c : + * enum cudaTextureAddressMode.cudaAddressModeWrap = 0 + * } + */ + public static int cudaAddressModeWrap() { + return cudaAddressModeWrap; + } + private static final int cudaAddressModeClamp = (int)1L; + /** + * {@snippet lang=c : + * enum cudaTextureAddressMode.cudaAddressModeClamp = 1 + * } + */ + public static int cudaAddressModeClamp() { + return cudaAddressModeClamp; + } + private static final int cudaAddressModeMirror = (int)2L; + /** + * {@snippet lang=c : + * enum cudaTextureAddressMode.cudaAddressModeMirror = 2 + * } + */ + public static int cudaAddressModeMirror() { + return cudaAddressModeMirror; + } + private static final int cudaAddressModeBorder = (int)3L; + /** + * {@snippet lang=c : + * enum cudaTextureAddressMode.cudaAddressModeBorder = 3 + * } + */ + public static int cudaAddressModeBorder() { + return cudaAddressModeBorder; + } + private static final int cudaFilterModePoint = (int)0L; + /** + * {@snippet lang=c : + * enum cudaTextureFilterMode.cudaFilterModePoint = 0 + * } + */ + public static int cudaFilterModePoint() { + return cudaFilterModePoint; + } + private static final int cudaFilterModeLinear = (int)1L; + /** + * {@snippet lang=c : + * enum cudaTextureFilterMode.cudaFilterModeLinear = 1 + * } + */ + public static int cudaFilterModeLinear() { + return cudaFilterModeLinear; + } + private static final int cudaReadModeElementType = (int)0L; + /** + * {@snippet lang=c : + * enum cudaTextureReadMode.cudaReadModeElementType = 0 + * } + */ + public static int cudaReadModeElementType() { + return cudaReadModeElementType; + } + private static final int cudaReadModeNormalizedFloat = (int)1L; + /** + * {@snippet lang=c : + * enum cudaTextureReadMode.cudaReadModeNormalizedFloat = 1 + * } + */ + public static int cudaReadModeNormalizedFloat() { + return cudaReadModeNormalizedFloat; + } + /** + * {@snippet lang=c : + * typedef unsigned long long cudaTextureObject_t + * } + */ + public static final OfLong cudaTextureObject_t = PanamaFFMAPI.C_LONG_LONG; + private static final int CUDA_R_16F = (int)2L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_16F = 2 + * } + */ + public static int CUDA_R_16F() { + return CUDA_R_16F; + } + private static final int CUDA_C_16F = (int)6L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_16F = 6 + * } + */ + public static int CUDA_C_16F() { + return CUDA_C_16F; + } + private static final int CUDA_R_16BF = (int)14L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_16BF = 14 + * } + */ + public static int CUDA_R_16BF() { + return CUDA_R_16BF; + } + private static final int CUDA_C_16BF = (int)15L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_16BF = 15 + * } + */ + public static int CUDA_C_16BF() { + return CUDA_C_16BF; + } + private static final int CUDA_R_32F = (int)0L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_32F = 0 + * } + */ + public static int CUDA_R_32F() { + return CUDA_R_32F; + } + private static final int CUDA_C_32F = (int)4L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_32F = 4 + * } + */ + public static int CUDA_C_32F() { + return CUDA_C_32F; + } + private static final int CUDA_R_64F = (int)1L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_64F = 1 + * } + */ + public static int CUDA_R_64F() { + return CUDA_R_64F; + } + private static final int CUDA_C_64F = (int)5L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_64F = 5 + * } + */ + public static int CUDA_C_64F() { + return CUDA_C_64F; + } + private static final int CUDA_R_4I = (int)16L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_4I = 16 + * } + */ + public static int CUDA_R_4I() { + return CUDA_R_4I; + } + private static final int CUDA_C_4I = (int)17L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_4I = 17 + * } + */ + public static int CUDA_C_4I() { + return CUDA_C_4I; + } + private static final int CUDA_R_4U = (int)18L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_4U = 18 + * } + */ + public static int CUDA_R_4U() { + return CUDA_R_4U; + } + private static final int CUDA_C_4U = (int)19L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_4U = 19 + * } + */ + public static int CUDA_C_4U() { + return CUDA_C_4U; + } + private static final int CUDA_R_8I = (int)3L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_8I = 3 + * } + */ + public static int CUDA_R_8I() { + return CUDA_R_8I; + } + private static final int CUDA_C_8I = (int)7L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_8I = 7 + * } + */ + public static int CUDA_C_8I() { + return CUDA_C_8I; + } + private static final int CUDA_R_8U = (int)8L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_8U = 8 + * } + */ + public static int CUDA_R_8U() { + return CUDA_R_8U; + } + private static final int CUDA_C_8U = (int)9L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_8U = 9 + * } + */ + public static int CUDA_C_8U() { + return CUDA_C_8U; + } + private static final int CUDA_R_16I = (int)20L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_16I = 20 + * } + */ + public static int CUDA_R_16I() { + return CUDA_R_16I; + } + private static final int CUDA_C_16I = (int)21L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_16I = 21 + * } + */ + public static int CUDA_C_16I() { + return CUDA_C_16I; + } + private static final int CUDA_R_16U = (int)22L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_16U = 22 + * } + */ + public static int CUDA_R_16U() { + return CUDA_R_16U; + } + private static final int CUDA_C_16U = (int)23L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_16U = 23 + * } + */ + public static int CUDA_C_16U() { + return CUDA_C_16U; + } + private static final int CUDA_R_32I = (int)10L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_32I = 10 + * } + */ + public static int CUDA_R_32I() { + return CUDA_R_32I; + } + private static final int CUDA_C_32I = (int)11L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_32I = 11 + * } + */ + public static int CUDA_C_32I() { + return CUDA_C_32I; + } + private static final int CUDA_R_32U = (int)12L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_32U = 12 + * } + */ + public static int CUDA_R_32U() { + return CUDA_R_32U; + } + private static final int CUDA_C_32U = (int)13L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_32U = 13 + * } + */ + public static int CUDA_C_32U() { + return CUDA_C_32U; + } + private static final int CUDA_R_64I = (int)24L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_64I = 24 + * } + */ + public static int CUDA_R_64I() { + return CUDA_R_64I; + } + private static final int CUDA_C_64I = (int)25L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_64I = 25 + * } + */ + public static int CUDA_C_64I() { + return CUDA_C_64I; + } + private static final int CUDA_R_64U = (int)26L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_64U = 26 + * } + */ + public static int CUDA_R_64U() { + return CUDA_R_64U; + } + private static final int CUDA_C_64U = (int)27L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_C_64U = 27 + * } + */ + public static int CUDA_C_64U() { + return CUDA_C_64U; + } + private static final int CUDA_R_8F_E4M3 = (int)28L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_8F_E4M3 = 28 + * } + */ + public static int CUDA_R_8F_E4M3() { + return CUDA_R_8F_E4M3; + } + private static final int CUDA_R_8F_E5M2 = (int)29L; + /** + * {@snippet lang=c : + * enum cudaDataType_t.CUDA_R_8F_E5M2 = 29 + * } + */ + public static int CUDA_R_8F_E5M2() { + return CUDA_R_8F_E5M2; + } + private static final int MAJOR_VERSION = (int)0L; + /** + * {@snippet lang=c : + * enum libraryPropertyType_t.MAJOR_VERSION = 0 + * } + */ + public static int MAJOR_VERSION() { + return MAJOR_VERSION; + } + private static final int MINOR_VERSION = (int)1L; + /** + * {@snippet lang=c : + * enum libraryPropertyType_t.MINOR_VERSION = 1 + * } + */ + public static int MINOR_VERSION() { + return MINOR_VERSION; + } + private static final int PATCH_LEVEL = (int)2L; + /** + * {@snippet lang=c : + * enum libraryPropertyType_t.PATCH_LEVEL = 2 + * } + */ + public static int PATCH_LEVEL() { + return PATCH_LEVEL; + } + + private static class cudaDeviceReset { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceReset"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceReset() + * } + */ + public static FunctionDescriptor cudaDeviceReset$descriptor() { + return cudaDeviceReset.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceReset() + * } + */ + public static MethodHandle cudaDeviceReset$handle() { + return cudaDeviceReset.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceReset() + * } + */ + public static MemorySegment cudaDeviceReset$address() { + return cudaDeviceReset.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceReset() + * } + */ + public static int cudaDeviceReset() { + var mh$ = cudaDeviceReset.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceReset"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceSynchronize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSynchronize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSynchronize() + * } + */ + public static FunctionDescriptor cudaDeviceSynchronize$descriptor() { + return cudaDeviceSynchronize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSynchronize() + * } + */ + public static MethodHandle cudaDeviceSynchronize$handle() { + return cudaDeviceSynchronize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSynchronize() + * } + */ + public static MemorySegment cudaDeviceSynchronize$address() { + return cudaDeviceSynchronize.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSynchronize() + * } + */ + public static int cudaDeviceSynchronize() { + var mh$ = cudaDeviceSynchronize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceSynchronize"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceSetLimit { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSetLimit"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetLimit(enum cudaLimit limit, size_t value) + * } + */ + public static FunctionDescriptor cudaDeviceSetLimit$descriptor() { + return cudaDeviceSetLimit.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetLimit(enum cudaLimit limit, size_t value) + * } + */ + public static MethodHandle cudaDeviceSetLimit$handle() { + return cudaDeviceSetLimit.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetLimit(enum cudaLimit limit, size_t value) + * } + */ + public static MemorySegment cudaDeviceSetLimit$address() { + return cudaDeviceSetLimit.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetLimit(enum cudaLimit limit, size_t value) + * } + */ + public static int cudaDeviceSetLimit(int limit, long value) { + var mh$ = cudaDeviceSetLimit.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceSetLimit", limit, value); + } + return (int)mh$.invokeExact(limit, value); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetLimit { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetLimit"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetLimit(size_t *pValue, enum cudaLimit limit) + * } + */ + public static FunctionDescriptor cudaDeviceGetLimit$descriptor() { + return cudaDeviceGetLimit.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetLimit(size_t *pValue, enum cudaLimit limit) + * } + */ + public static MethodHandle cudaDeviceGetLimit$handle() { + return cudaDeviceGetLimit.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetLimit(size_t *pValue, enum cudaLimit limit) + * } + */ + public static MemorySegment cudaDeviceGetLimit$address() { + return cudaDeviceGetLimit.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetLimit(size_t *pValue, enum cudaLimit limit) + * } + */ + public static int cudaDeviceGetLimit(MemorySegment pValue, int limit) { + var mh$ = cudaDeviceGetLimit.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetLimit", pValue, limit); + } + return (int)mh$.invokeExact(pValue, limit); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetTexture1DLinearMaxWidth { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetTexture1DLinearMaxWidth"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t *maxWidthInElements, const struct cudaChannelFormatDesc *fmtDesc, int device) + * } + */ + public static FunctionDescriptor cudaDeviceGetTexture1DLinearMaxWidth$descriptor() { + return cudaDeviceGetTexture1DLinearMaxWidth.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t *maxWidthInElements, const struct cudaChannelFormatDesc *fmtDesc, int device) + * } + */ + public static MethodHandle cudaDeviceGetTexture1DLinearMaxWidth$handle() { + return cudaDeviceGetTexture1DLinearMaxWidth.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t *maxWidthInElements, const struct cudaChannelFormatDesc *fmtDesc, int device) + * } + */ + public static MemorySegment cudaDeviceGetTexture1DLinearMaxWidth$address() { + return cudaDeviceGetTexture1DLinearMaxWidth.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t *maxWidthInElements, const struct cudaChannelFormatDesc *fmtDesc, int device) + * } + */ + public static int cudaDeviceGetTexture1DLinearMaxWidth(MemorySegment maxWidthInElements, MemorySegment fmtDesc, int device) { + var mh$ = cudaDeviceGetTexture1DLinearMaxWidth.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetTexture1DLinearMaxWidth", maxWidthInElements, fmtDesc, device); + } + return (int)mh$.invokeExact(maxWidthInElements, fmtDesc, device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetCacheConfig { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetCacheConfig"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetCacheConfig(enum cudaFuncCache *pCacheConfig) + * } + */ + public static FunctionDescriptor cudaDeviceGetCacheConfig$descriptor() { + return cudaDeviceGetCacheConfig.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetCacheConfig(enum cudaFuncCache *pCacheConfig) + * } + */ + public static MethodHandle cudaDeviceGetCacheConfig$handle() { + return cudaDeviceGetCacheConfig.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetCacheConfig(enum cudaFuncCache *pCacheConfig) + * } + */ + public static MemorySegment cudaDeviceGetCacheConfig$address() { + return cudaDeviceGetCacheConfig.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetCacheConfig(enum cudaFuncCache *pCacheConfig) + * } + */ + public static int cudaDeviceGetCacheConfig(MemorySegment pCacheConfig) { + var mh$ = cudaDeviceGetCacheConfig.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetCacheConfig", pCacheConfig); + } + return (int)mh$.invokeExact(pCacheConfig); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetStreamPriorityRange { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetStreamPriorityRange"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority) + * } + */ + public static FunctionDescriptor cudaDeviceGetStreamPriorityRange$descriptor() { + return cudaDeviceGetStreamPriorityRange.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority) + * } + */ + public static MethodHandle cudaDeviceGetStreamPriorityRange$handle() { + return cudaDeviceGetStreamPriorityRange.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority) + * } + */ + public static MemorySegment cudaDeviceGetStreamPriorityRange$address() { + return cudaDeviceGetStreamPriorityRange.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority) + * } + */ + public static int cudaDeviceGetStreamPriorityRange(MemorySegment leastPriority, MemorySegment greatestPriority) { + var mh$ = cudaDeviceGetStreamPriorityRange.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetStreamPriorityRange", leastPriority, greatestPriority); + } + return (int)mh$.invokeExact(leastPriority, greatestPriority); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceSetCacheConfig { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSetCacheConfig"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetCacheConfig(enum cudaFuncCache cacheConfig) + * } + */ + public static FunctionDescriptor cudaDeviceSetCacheConfig$descriptor() { + return cudaDeviceSetCacheConfig.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetCacheConfig(enum cudaFuncCache cacheConfig) + * } + */ + public static MethodHandle cudaDeviceSetCacheConfig$handle() { + return cudaDeviceSetCacheConfig.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetCacheConfig(enum cudaFuncCache cacheConfig) + * } + */ + public static MemorySegment cudaDeviceSetCacheConfig$address() { + return cudaDeviceSetCacheConfig.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetCacheConfig(enum cudaFuncCache cacheConfig) + * } + */ + public static int cudaDeviceSetCacheConfig(int cacheConfig) { + var mh$ = cudaDeviceSetCacheConfig.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceSetCacheConfig", cacheConfig); + } + return (int)mh$.invokeExact(cacheConfig); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetByPCIBusId { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetByPCIBusId"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetByPCIBusId(int *device, const char *pciBusId) + * } + */ + public static FunctionDescriptor cudaDeviceGetByPCIBusId$descriptor() { + return cudaDeviceGetByPCIBusId.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetByPCIBusId(int *device, const char *pciBusId) + * } + */ + public static MethodHandle cudaDeviceGetByPCIBusId$handle() { + return cudaDeviceGetByPCIBusId.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetByPCIBusId(int *device, const char *pciBusId) + * } + */ + public static MemorySegment cudaDeviceGetByPCIBusId$address() { + return cudaDeviceGetByPCIBusId.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetByPCIBusId(int *device, const char *pciBusId) + * } + */ + public static int cudaDeviceGetByPCIBusId(MemorySegment device, MemorySegment pciBusId) { + var mh$ = cudaDeviceGetByPCIBusId.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetByPCIBusId", device, pciBusId); + } + return (int)mh$.invokeExact(device, pciBusId); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetPCIBusId { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetPCIBusId"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetPCIBusId(char *pciBusId, int len, int device) + * } + */ + public static FunctionDescriptor cudaDeviceGetPCIBusId$descriptor() { + return cudaDeviceGetPCIBusId.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetPCIBusId(char *pciBusId, int len, int device) + * } + */ + public static MethodHandle cudaDeviceGetPCIBusId$handle() { + return cudaDeviceGetPCIBusId.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetPCIBusId(char *pciBusId, int len, int device) + * } + */ + public static MemorySegment cudaDeviceGetPCIBusId$address() { + return cudaDeviceGetPCIBusId.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetPCIBusId(char *pciBusId, int len, int device) + * } + */ + public static int cudaDeviceGetPCIBusId(MemorySegment pciBusId, int len, int device) { + var mh$ = cudaDeviceGetPCIBusId.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetPCIBusId", pciBusId, len, device); + } + return (int)mh$.invokeExact(pciBusId, len, device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaIpcGetEventHandle { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaIpcGetEventHandle"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t *handle, cudaEvent_t event) + * } + */ + public static FunctionDescriptor cudaIpcGetEventHandle$descriptor() { + return cudaIpcGetEventHandle.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t *handle, cudaEvent_t event) + * } + */ + public static MethodHandle cudaIpcGetEventHandle$handle() { + return cudaIpcGetEventHandle.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t *handle, cudaEvent_t event) + * } + */ + public static MemorySegment cudaIpcGetEventHandle$address() { + return cudaIpcGetEventHandle.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t *handle, cudaEvent_t event) + * } + */ + public static int cudaIpcGetEventHandle(MemorySegment handle, MemorySegment event) { + var mh$ = cudaIpcGetEventHandle.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaIpcGetEventHandle", handle, event); + } + return (int)mh$.invokeExact(handle, event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaIpcOpenEventHandle { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + cudaIpcEventHandle_st.layout() + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaIpcOpenEventHandle"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcOpenEventHandle(cudaEvent_t *event, cudaIpcEventHandle_t handle) + * } + */ + public static FunctionDescriptor cudaIpcOpenEventHandle$descriptor() { + return cudaIpcOpenEventHandle.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcOpenEventHandle(cudaEvent_t *event, cudaIpcEventHandle_t handle) + * } + */ + public static MethodHandle cudaIpcOpenEventHandle$handle() { + return cudaIpcOpenEventHandle.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcOpenEventHandle(cudaEvent_t *event, cudaIpcEventHandle_t handle) + * } + */ + public static MemorySegment cudaIpcOpenEventHandle$address() { + return cudaIpcOpenEventHandle.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaIpcOpenEventHandle(cudaEvent_t *event, cudaIpcEventHandle_t handle) + * } + */ + public static int cudaIpcOpenEventHandle(MemorySegment event, MemorySegment handle) { + var mh$ = cudaIpcOpenEventHandle.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaIpcOpenEventHandle", event, handle); + } + return (int)mh$.invokeExact(event, handle); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaIpcGetMemHandle { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaIpcGetMemHandle"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t *handle, void *devPtr) + * } + */ + public static FunctionDescriptor cudaIpcGetMemHandle$descriptor() { + return cudaIpcGetMemHandle.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t *handle, void *devPtr) + * } + */ + public static MethodHandle cudaIpcGetMemHandle$handle() { + return cudaIpcGetMemHandle.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t *handle, void *devPtr) + * } + */ + public static MemorySegment cudaIpcGetMemHandle$address() { + return cudaIpcGetMemHandle.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t *handle, void *devPtr) + * } + */ + public static int cudaIpcGetMemHandle(MemorySegment handle, MemorySegment devPtr) { + var mh$ = cudaIpcGetMemHandle.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaIpcGetMemHandle", handle, devPtr); + } + return (int)mh$.invokeExact(handle, devPtr); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaIpcOpenMemHandle { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + cudaIpcMemHandle_st.layout(), + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaIpcOpenMemHandle"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcOpenMemHandle(void **devPtr, cudaIpcMemHandle_t handle, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaIpcOpenMemHandle$descriptor() { + return cudaIpcOpenMemHandle.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcOpenMemHandle(void **devPtr, cudaIpcMemHandle_t handle, unsigned int flags) + * } + */ + public static MethodHandle cudaIpcOpenMemHandle$handle() { + return cudaIpcOpenMemHandle.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcOpenMemHandle(void **devPtr, cudaIpcMemHandle_t handle, unsigned int flags) + * } + */ + public static MemorySegment cudaIpcOpenMemHandle$address() { + return cudaIpcOpenMemHandle.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaIpcOpenMemHandle(void **devPtr, cudaIpcMemHandle_t handle, unsigned int flags) + * } + */ + public static int cudaIpcOpenMemHandle(MemorySegment devPtr, MemorySegment handle, int flags) { + var mh$ = cudaIpcOpenMemHandle.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaIpcOpenMemHandle", devPtr, handle, flags); + } + return (int)mh$.invokeExact(devPtr, handle, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaIpcCloseMemHandle { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaIpcCloseMemHandle"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcCloseMemHandle(void *devPtr) + * } + */ + public static FunctionDescriptor cudaIpcCloseMemHandle$descriptor() { + return cudaIpcCloseMemHandle.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcCloseMemHandle(void *devPtr) + * } + */ + public static MethodHandle cudaIpcCloseMemHandle$handle() { + return cudaIpcCloseMemHandle.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaIpcCloseMemHandle(void *devPtr) + * } + */ + public static MemorySegment cudaIpcCloseMemHandle$address() { + return cudaIpcCloseMemHandle.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaIpcCloseMemHandle(void *devPtr) + * } + */ + public static int cudaIpcCloseMemHandle(MemorySegment devPtr) { + var mh$ = cudaIpcCloseMemHandle.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaIpcCloseMemHandle", devPtr); + } + return (int)mh$.invokeExact(devPtr); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceFlushGPUDirectRDMAWrites { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceFlushGPUDirectRDMAWrites"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(enum cudaFlushGPUDirectRDMAWritesTarget target, enum cudaFlushGPUDirectRDMAWritesScope scope) + * } + */ + public static FunctionDescriptor cudaDeviceFlushGPUDirectRDMAWrites$descriptor() { + return cudaDeviceFlushGPUDirectRDMAWrites.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(enum cudaFlushGPUDirectRDMAWritesTarget target, enum cudaFlushGPUDirectRDMAWritesScope scope) + * } + */ + public static MethodHandle cudaDeviceFlushGPUDirectRDMAWrites$handle() { + return cudaDeviceFlushGPUDirectRDMAWrites.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(enum cudaFlushGPUDirectRDMAWritesTarget target, enum cudaFlushGPUDirectRDMAWritesScope scope) + * } + */ + public static MemorySegment cudaDeviceFlushGPUDirectRDMAWrites$address() { + return cudaDeviceFlushGPUDirectRDMAWrites.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(enum cudaFlushGPUDirectRDMAWritesTarget target, enum cudaFlushGPUDirectRDMAWritesScope scope) + * } + */ + public static int cudaDeviceFlushGPUDirectRDMAWrites(int target, int scope) { + var mh$ = cudaDeviceFlushGPUDirectRDMAWrites.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceFlushGPUDirectRDMAWrites", target, scope); + } + return (int)mh$.invokeExact(target, scope); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceRegisterAsyncNotification { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceRegisterAsyncNotification"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void *userData, cudaAsyncCallbackHandle_t *callback) + * } + */ + public static FunctionDescriptor cudaDeviceRegisterAsyncNotification$descriptor() { + return cudaDeviceRegisterAsyncNotification.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void *userData, cudaAsyncCallbackHandle_t *callback) + * } + */ + public static MethodHandle cudaDeviceRegisterAsyncNotification$handle() { + return cudaDeviceRegisterAsyncNotification.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void *userData, cudaAsyncCallbackHandle_t *callback) + * } + */ + public static MemorySegment cudaDeviceRegisterAsyncNotification$address() { + return cudaDeviceRegisterAsyncNotification.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void *userData, cudaAsyncCallbackHandle_t *callback) + * } + */ + public static int cudaDeviceRegisterAsyncNotification(int device, MemorySegment callbackFunc, MemorySegment userData, MemorySegment callback) { + var mh$ = cudaDeviceRegisterAsyncNotification.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceRegisterAsyncNotification", device, callbackFunc, userData, callback); + } + return (int)mh$.invokeExact(device, callbackFunc, userData, callback); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceUnregisterAsyncNotification { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceUnregisterAsyncNotification"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) + * } + */ + public static FunctionDescriptor cudaDeviceUnregisterAsyncNotification$descriptor() { + return cudaDeviceUnregisterAsyncNotification.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) + * } + */ + public static MethodHandle cudaDeviceUnregisterAsyncNotification$handle() { + return cudaDeviceUnregisterAsyncNotification.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) + * } + */ + public static MemorySegment cudaDeviceUnregisterAsyncNotification$address() { + return cudaDeviceUnregisterAsyncNotification.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) + * } + */ + public static int cudaDeviceUnregisterAsyncNotification(int device, MemorySegment callback) { + var mh$ = cudaDeviceUnregisterAsyncNotification.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceUnregisterAsyncNotification", device, callback); + } + return (int)mh$.invokeExact(device, callback); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetSharedMemConfig { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetSharedMemConfig"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetSharedMemConfig(enum cudaSharedMemConfig *pConfig) + * } + */ + public static FunctionDescriptor cudaDeviceGetSharedMemConfig$descriptor() { + return cudaDeviceGetSharedMemConfig.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetSharedMemConfig(enum cudaSharedMemConfig *pConfig) + * } + */ + public static MethodHandle cudaDeviceGetSharedMemConfig$handle() { + return cudaDeviceGetSharedMemConfig.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetSharedMemConfig(enum cudaSharedMemConfig *pConfig) + * } + */ + public static MemorySegment cudaDeviceGetSharedMemConfig$address() { + return cudaDeviceGetSharedMemConfig.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetSharedMemConfig(enum cudaSharedMemConfig *pConfig) + * } + */ + public static int cudaDeviceGetSharedMemConfig(MemorySegment pConfig) { + var mh$ = cudaDeviceGetSharedMemConfig.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetSharedMemConfig", pConfig); + } + return (int)mh$.invokeExact(pConfig); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceSetSharedMemConfig { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSetSharedMemConfig"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetSharedMemConfig(enum cudaSharedMemConfig config) + * } + */ + public static FunctionDescriptor cudaDeviceSetSharedMemConfig$descriptor() { + return cudaDeviceSetSharedMemConfig.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetSharedMemConfig(enum cudaSharedMemConfig config) + * } + */ + public static MethodHandle cudaDeviceSetSharedMemConfig$handle() { + return cudaDeviceSetSharedMemConfig.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetSharedMemConfig(enum cudaSharedMemConfig config) + * } + */ + public static MemorySegment cudaDeviceSetSharedMemConfig$address() { + return cudaDeviceSetSharedMemConfig.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetSharedMemConfig(enum cudaSharedMemConfig config) + * } + */ + public static int cudaDeviceSetSharedMemConfig(int config) { + var mh$ = cudaDeviceSetSharedMemConfig.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceSetSharedMemConfig", config); + } + return (int)mh$.invokeExact(config); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaThreadExit { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadExit"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadExit() + * } + */ + public static FunctionDescriptor cudaThreadExit$descriptor() { + return cudaThreadExit.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadExit() + * } + */ + public static MethodHandle cudaThreadExit$handle() { + return cudaThreadExit.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadExit() + * } + */ + public static MemorySegment cudaThreadExit$address() { + return cudaThreadExit.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaThreadExit() + * } + */ + public static int cudaThreadExit() { + var mh$ = cudaThreadExit.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaThreadExit"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaThreadSynchronize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadSynchronize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadSynchronize() + * } + */ + public static FunctionDescriptor cudaThreadSynchronize$descriptor() { + return cudaThreadSynchronize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadSynchronize() + * } + */ + public static MethodHandle cudaThreadSynchronize$handle() { + return cudaThreadSynchronize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadSynchronize() + * } + */ + public static MemorySegment cudaThreadSynchronize$address() { + return cudaThreadSynchronize.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaThreadSynchronize() + * } + */ + public static int cudaThreadSynchronize() { + var mh$ = cudaThreadSynchronize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaThreadSynchronize"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaThreadSetLimit { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadSetLimit"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadSetLimit(enum cudaLimit limit, size_t value) + * } + */ + public static FunctionDescriptor cudaThreadSetLimit$descriptor() { + return cudaThreadSetLimit.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadSetLimit(enum cudaLimit limit, size_t value) + * } + */ + public static MethodHandle cudaThreadSetLimit$handle() { + return cudaThreadSetLimit.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadSetLimit(enum cudaLimit limit, size_t value) + * } + */ + public static MemorySegment cudaThreadSetLimit$address() { + return cudaThreadSetLimit.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaThreadSetLimit(enum cudaLimit limit, size_t value) + * } + */ + public static int cudaThreadSetLimit(int limit, long value) { + var mh$ = cudaThreadSetLimit.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaThreadSetLimit", limit, value); + } + return (int)mh$.invokeExact(limit, value); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaThreadGetLimit { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadGetLimit"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadGetLimit(size_t *pValue, enum cudaLimit limit) + * } + */ + public static FunctionDescriptor cudaThreadGetLimit$descriptor() { + return cudaThreadGetLimit.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadGetLimit(size_t *pValue, enum cudaLimit limit) + * } + */ + public static MethodHandle cudaThreadGetLimit$handle() { + return cudaThreadGetLimit.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadGetLimit(size_t *pValue, enum cudaLimit limit) + * } + */ + public static MemorySegment cudaThreadGetLimit$address() { + return cudaThreadGetLimit.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaThreadGetLimit(size_t *pValue, enum cudaLimit limit) + * } + */ + public static int cudaThreadGetLimit(MemorySegment pValue, int limit) { + var mh$ = cudaThreadGetLimit.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaThreadGetLimit", pValue, limit); + } + return (int)mh$.invokeExact(pValue, limit); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaThreadGetCacheConfig { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadGetCacheConfig"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadGetCacheConfig(enum cudaFuncCache *pCacheConfig) + * } + */ + public static FunctionDescriptor cudaThreadGetCacheConfig$descriptor() { + return cudaThreadGetCacheConfig.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadGetCacheConfig(enum cudaFuncCache *pCacheConfig) + * } + */ + public static MethodHandle cudaThreadGetCacheConfig$handle() { + return cudaThreadGetCacheConfig.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadGetCacheConfig(enum cudaFuncCache *pCacheConfig) + * } + */ + public static MemorySegment cudaThreadGetCacheConfig$address() { + return cudaThreadGetCacheConfig.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaThreadGetCacheConfig(enum cudaFuncCache *pCacheConfig) + * } + */ + public static int cudaThreadGetCacheConfig(MemorySegment pCacheConfig) { + var mh$ = cudaThreadGetCacheConfig.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaThreadGetCacheConfig", pCacheConfig); + } + return (int)mh$.invokeExact(pCacheConfig); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaThreadSetCacheConfig { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadSetCacheConfig"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadSetCacheConfig(enum cudaFuncCache cacheConfig) + * } + */ + public static FunctionDescriptor cudaThreadSetCacheConfig$descriptor() { + return cudaThreadSetCacheConfig.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadSetCacheConfig(enum cudaFuncCache cacheConfig) + * } + */ + public static MethodHandle cudaThreadSetCacheConfig$handle() { + return cudaThreadSetCacheConfig.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadSetCacheConfig(enum cudaFuncCache cacheConfig) + * } + */ + public static MemorySegment cudaThreadSetCacheConfig$address() { + return cudaThreadSetCacheConfig.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaThreadSetCacheConfig(enum cudaFuncCache cacheConfig) + * } + */ + public static int cudaThreadSetCacheConfig(int cacheConfig) { + var mh$ = cudaThreadSetCacheConfig.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaThreadSetCacheConfig", cacheConfig); + } + return (int)mh$.invokeExact(cacheConfig); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetLastError { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetLastError"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetLastError() + * } + */ + public static FunctionDescriptor cudaGetLastError$descriptor() { + return cudaGetLastError.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetLastError() + * } + */ + public static MethodHandle cudaGetLastError$handle() { + return cudaGetLastError.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetLastError() + * } + */ + public static MemorySegment cudaGetLastError$address() { + return cudaGetLastError.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetLastError() + * } + */ + public static int cudaGetLastError() { + var mh$ = cudaGetLastError.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetLastError"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaPeekAtLastError { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaPeekAtLastError"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaPeekAtLastError() + * } + */ + public static FunctionDescriptor cudaPeekAtLastError$descriptor() { + return cudaPeekAtLastError.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaPeekAtLastError() + * } + */ + public static MethodHandle cudaPeekAtLastError$handle() { + return cudaPeekAtLastError.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaPeekAtLastError() + * } + */ + public static MemorySegment cudaPeekAtLastError$address() { + return cudaPeekAtLastError.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaPeekAtLastError() + * } + */ + public static int cudaPeekAtLastError() { + var mh$ = cudaPeekAtLastError.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaPeekAtLastError"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetErrorName { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetErrorName"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern const char *cudaGetErrorName(cudaError_t error) + * } + */ + public static FunctionDescriptor cudaGetErrorName$descriptor() { + return cudaGetErrorName.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern const char *cudaGetErrorName(cudaError_t error) + * } + */ + public static MethodHandle cudaGetErrorName$handle() { + return cudaGetErrorName.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern const char *cudaGetErrorName(cudaError_t error) + * } + */ + public static MemorySegment cudaGetErrorName$address() { + return cudaGetErrorName.ADDR; + } + + /** + * {@snippet lang=c : + * extern const char *cudaGetErrorName(cudaError_t error) + * } + */ + public static MemorySegment cudaGetErrorName(int error) { + var mh$ = cudaGetErrorName.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetErrorName", error); + } + return (MemorySegment)mh$.invokeExact(error); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetErrorString { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetErrorString"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern const char *cudaGetErrorString(cudaError_t error) + * } + */ + public static FunctionDescriptor cudaGetErrorString$descriptor() { + return cudaGetErrorString.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern const char *cudaGetErrorString(cudaError_t error) + * } + */ + public static MethodHandle cudaGetErrorString$handle() { + return cudaGetErrorString.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern const char *cudaGetErrorString(cudaError_t error) + * } + */ + public static MemorySegment cudaGetErrorString$address() { + return cudaGetErrorString.ADDR; + } + + /** + * {@snippet lang=c : + * extern const char *cudaGetErrorString(cudaError_t error) + * } + */ + public static MemorySegment cudaGetErrorString(int error) { + var mh$ = cudaGetErrorString.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetErrorString", error); + } + return (MemorySegment)mh$.invokeExact(error); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetDeviceCount { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDeviceCount"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceCount(int *count) + * } + */ + public static FunctionDescriptor cudaGetDeviceCount$descriptor() { + return cudaGetDeviceCount.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceCount(int *count) + * } + */ + public static MethodHandle cudaGetDeviceCount$handle() { + return cudaGetDeviceCount.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceCount(int *count) + * } + */ + public static MemorySegment cudaGetDeviceCount$address() { + return cudaGetDeviceCount.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceCount(int *count) + * } + */ + public static int cudaGetDeviceCount(MemorySegment count) { + var mh$ = cudaGetDeviceCount.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetDeviceCount", count); + } + return (int)mh$.invokeExact(count); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetDeviceProperties_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDeviceProperties_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceProperties_v2(struct cudaDeviceProp *prop, int device) + * } + */ + public static FunctionDescriptor cudaGetDeviceProperties_v2$descriptor() { + return cudaGetDeviceProperties_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceProperties_v2(struct cudaDeviceProp *prop, int device) + * } + */ + public static MethodHandle cudaGetDeviceProperties_v2$handle() { + return cudaGetDeviceProperties_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceProperties_v2(struct cudaDeviceProp *prop, int device) + * } + */ + public static MemorySegment cudaGetDeviceProperties_v2$address() { + return cudaGetDeviceProperties_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceProperties_v2(struct cudaDeviceProp *prop, int device) + * } + */ + public static int cudaGetDeviceProperties_v2(MemorySegment prop, int device) { + var mh$ = cudaGetDeviceProperties_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetDeviceProperties_v2", prop, device); + } + return (int)mh$.invokeExact(prop, device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device) + * } + */ + public static FunctionDescriptor cudaDeviceGetAttribute$descriptor() { + return cudaDeviceGetAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device) + * } + */ + public static MethodHandle cudaDeviceGetAttribute$handle() { + return cudaDeviceGetAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device) + * } + */ + public static MemorySegment cudaDeviceGetAttribute$address() { + return cudaDeviceGetAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device) + * } + */ + public static int cudaDeviceGetAttribute(MemorySegment value, int attr, int device) { + var mh$ = cudaDeviceGetAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetAttribute", value, attr, device); + } + return (int)mh$.invokeExact(value, attr, device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetDefaultMemPool { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetDefaultMemPool"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t *memPool, int device) + * } + */ + public static FunctionDescriptor cudaDeviceGetDefaultMemPool$descriptor() { + return cudaDeviceGetDefaultMemPool.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t *memPool, int device) + * } + */ + public static MethodHandle cudaDeviceGetDefaultMemPool$handle() { + return cudaDeviceGetDefaultMemPool.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t *memPool, int device) + * } + */ + public static MemorySegment cudaDeviceGetDefaultMemPool$address() { + return cudaDeviceGetDefaultMemPool.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t *memPool, int device) + * } + */ + public static int cudaDeviceGetDefaultMemPool(MemorySegment memPool, int device) { + var mh$ = cudaDeviceGetDefaultMemPool.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetDefaultMemPool", memPool, device); + } + return (int)mh$.invokeExact(memPool, device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceSetMemPool { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSetMemPool"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) + * } + */ + public static FunctionDescriptor cudaDeviceSetMemPool$descriptor() { + return cudaDeviceSetMemPool.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) + * } + */ + public static MethodHandle cudaDeviceSetMemPool$handle() { + return cudaDeviceSetMemPool.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) + * } + */ + public static MemorySegment cudaDeviceSetMemPool$address() { + return cudaDeviceSetMemPool.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) + * } + */ + public static int cudaDeviceSetMemPool(int device, MemorySegment memPool) { + var mh$ = cudaDeviceSetMemPool.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceSetMemPool", device, memPool); + } + return (int)mh$.invokeExact(device, memPool); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetMemPool { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetMemPool"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetMemPool(cudaMemPool_t *memPool, int device) + * } + */ + public static FunctionDescriptor cudaDeviceGetMemPool$descriptor() { + return cudaDeviceGetMemPool.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetMemPool(cudaMemPool_t *memPool, int device) + * } + */ + public static MethodHandle cudaDeviceGetMemPool$handle() { + return cudaDeviceGetMemPool.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetMemPool(cudaMemPool_t *memPool, int device) + * } + */ + public static MemorySegment cudaDeviceGetMemPool$address() { + return cudaDeviceGetMemPool.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetMemPool(cudaMemPool_t *memPool, int device) + * } + */ + public static int cudaDeviceGetMemPool(MemorySegment memPool, int device) { + var mh$ = cudaDeviceGetMemPool.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetMemPool", memPool, device); + } + return (int)mh$.invokeExact(memPool, device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetNvSciSyncAttributes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetNvSciSyncAttributes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetNvSciSyncAttributes(void *nvSciSyncAttrList, int device, int flags) + * } + */ + public static FunctionDescriptor cudaDeviceGetNvSciSyncAttributes$descriptor() { + return cudaDeviceGetNvSciSyncAttributes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetNvSciSyncAttributes(void *nvSciSyncAttrList, int device, int flags) + * } + */ + public static MethodHandle cudaDeviceGetNvSciSyncAttributes$handle() { + return cudaDeviceGetNvSciSyncAttributes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetNvSciSyncAttributes(void *nvSciSyncAttrList, int device, int flags) + * } + */ + public static MemorySegment cudaDeviceGetNvSciSyncAttributes$address() { + return cudaDeviceGetNvSciSyncAttributes.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetNvSciSyncAttributes(void *nvSciSyncAttrList, int device, int flags) + * } + */ + public static int cudaDeviceGetNvSciSyncAttributes(MemorySegment nvSciSyncAttrList, int device, int flags) { + var mh$ = cudaDeviceGetNvSciSyncAttributes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetNvSciSyncAttributes", nvSciSyncAttrList, device, flags); + } + return (int)mh$.invokeExact(nvSciSyncAttrList, device, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDeviceGetP2PAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetP2PAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetP2PAttribute(int *value, enum cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) + * } + */ + public static FunctionDescriptor cudaDeviceGetP2PAttribute$descriptor() { + return cudaDeviceGetP2PAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetP2PAttribute(int *value, enum cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) + * } + */ + public static MethodHandle cudaDeviceGetP2PAttribute$handle() { + return cudaDeviceGetP2PAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetP2PAttribute(int *value, enum cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) + * } + */ + public static MemorySegment cudaDeviceGetP2PAttribute$address() { + return cudaDeviceGetP2PAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDeviceGetP2PAttribute(int *value, enum cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) + * } + */ + public static int cudaDeviceGetP2PAttribute(MemorySegment value, int attr, int srcDevice, int dstDevice) { + var mh$ = cudaDeviceGetP2PAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDeviceGetP2PAttribute", value, attr, srcDevice, dstDevice); + } + return (int)mh$.invokeExact(value, attr, srcDevice, dstDevice); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaChooseDevice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaChooseDevice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaChooseDevice(int *device, const struct cudaDeviceProp *prop) + * } + */ + public static FunctionDescriptor cudaChooseDevice$descriptor() { + return cudaChooseDevice.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaChooseDevice(int *device, const struct cudaDeviceProp *prop) + * } + */ + public static MethodHandle cudaChooseDevice$handle() { + return cudaChooseDevice.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaChooseDevice(int *device, const struct cudaDeviceProp *prop) + * } + */ + public static MemorySegment cudaChooseDevice$address() { + return cudaChooseDevice.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaChooseDevice(int *device, const struct cudaDeviceProp *prop) + * } + */ + public static int cudaChooseDevice(MemorySegment device, MemorySegment prop) { + var mh$ = cudaChooseDevice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaChooseDevice", device, prop); + } + return (int)mh$.invokeExact(device, prop); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaInitDevice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaInitDevice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaInitDevice$descriptor() { + return cudaInitDevice.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) + * } + */ + public static MethodHandle cudaInitDevice$handle() { + return cudaInitDevice.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) + * } + */ + public static MemorySegment cudaInitDevice$address() { + return cudaInitDevice.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) + * } + */ + public static int cudaInitDevice(int device, int deviceFlags, int flags) { + var mh$ = cudaInitDevice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaInitDevice", device, deviceFlags, flags); + } + return (int)mh$.invokeExact(device, deviceFlags, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaSetDevice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSetDevice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDevice(int device) + * } + */ + public static FunctionDescriptor cudaSetDevice$descriptor() { + return cudaSetDevice.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDevice(int device) + * } + */ + public static MethodHandle cudaSetDevice$handle() { + return cudaSetDevice.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDevice(int device) + * } + */ + public static MemorySegment cudaSetDevice$address() { + return cudaSetDevice.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaSetDevice(int device) + * } + */ + public static int cudaSetDevice(int device) { + var mh$ = cudaSetDevice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaSetDevice", device); + } + return (int)mh$.invokeExact(device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetDevice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDevice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDevice(int *device) + * } + */ + public static FunctionDescriptor cudaGetDevice$descriptor() { + return cudaGetDevice.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDevice(int *device) + * } + */ + public static MethodHandle cudaGetDevice$handle() { + return cudaGetDevice.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDevice(int *device) + * } + */ + public static MemorySegment cudaGetDevice$address() { + return cudaGetDevice.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetDevice(int *device) + * } + */ + public static int cudaGetDevice(MemorySegment device) { + var mh$ = cudaGetDevice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetDevice", device); + } + return (int)mh$.invokeExact(device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaSetValidDevices { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSetValidDevices"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaSetValidDevices(int *device_arr, int len) + * } + */ + public static FunctionDescriptor cudaSetValidDevices$descriptor() { + return cudaSetValidDevices.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaSetValidDevices(int *device_arr, int len) + * } + */ + public static MethodHandle cudaSetValidDevices$handle() { + return cudaSetValidDevices.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaSetValidDevices(int *device_arr, int len) + * } + */ + public static MemorySegment cudaSetValidDevices$address() { + return cudaSetValidDevices.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaSetValidDevices(int *device_arr, int len) + * } + */ + public static int cudaSetValidDevices(MemorySegment device_arr, int len) { + var mh$ = cudaSetValidDevices.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaSetValidDevices", device_arr, len); + } + return (int)mh$.invokeExact(device_arr, len); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaSetDeviceFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSetDeviceFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDeviceFlags(unsigned int flags) + * } + */ + public static FunctionDescriptor cudaSetDeviceFlags$descriptor() { + return cudaSetDeviceFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDeviceFlags(unsigned int flags) + * } + */ + public static MethodHandle cudaSetDeviceFlags$handle() { + return cudaSetDeviceFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDeviceFlags(unsigned int flags) + * } + */ + public static MemorySegment cudaSetDeviceFlags$address() { + return cudaSetDeviceFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaSetDeviceFlags(unsigned int flags) + * } + */ + public static int cudaSetDeviceFlags(int flags) { + var mh$ = cudaSetDeviceFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaSetDeviceFlags", flags); + } + return (int)mh$.invokeExact(flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetDeviceFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDeviceFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceFlags(unsigned int *flags) + * } + */ + public static FunctionDescriptor cudaGetDeviceFlags$descriptor() { + return cudaGetDeviceFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceFlags(unsigned int *flags) + * } + */ + public static MethodHandle cudaGetDeviceFlags$handle() { + return cudaGetDeviceFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceFlags(unsigned int *flags) + * } + */ + public static MemorySegment cudaGetDeviceFlags$address() { + return cudaGetDeviceFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetDeviceFlags(unsigned int *flags) + * } + */ + public static int cudaGetDeviceFlags(MemorySegment flags) { + var mh$ = cudaGetDeviceFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetDeviceFlags", flags); + } + return (int)mh$.invokeExact(flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreate(cudaStream_t *pStream) + * } + */ + public static FunctionDescriptor cudaStreamCreate$descriptor() { + return cudaStreamCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreate(cudaStream_t *pStream) + * } + */ + public static MethodHandle cudaStreamCreate$handle() { + return cudaStreamCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreate(cudaStream_t *pStream) + * } + */ + public static MemorySegment cudaStreamCreate$address() { + return cudaStreamCreate.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreate(cudaStream_t *pStream) + * } + */ + public static int cudaStreamCreate(MemorySegment pStream) { + var mh$ = cudaStreamCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamCreate", pStream); + } + return (int)mh$.invokeExact(pStream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamCreateWithFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamCreateWithFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t *pStream, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaStreamCreateWithFlags$descriptor() { + return cudaStreamCreateWithFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t *pStream, unsigned int flags) + * } + */ + public static MethodHandle cudaStreamCreateWithFlags$handle() { + return cudaStreamCreateWithFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t *pStream, unsigned int flags) + * } + */ + public static MemorySegment cudaStreamCreateWithFlags$address() { + return cudaStreamCreateWithFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t *pStream, unsigned int flags) + * } + */ + public static int cudaStreamCreateWithFlags(MemorySegment pStream, int flags) { + var mh$ = cudaStreamCreateWithFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamCreateWithFlags", pStream, flags); + } + return (int)mh$.invokeExact(pStream, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamCreateWithPriority { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamCreateWithPriority"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreateWithPriority(cudaStream_t *pStream, unsigned int flags, int priority) + * } + */ + public static FunctionDescriptor cudaStreamCreateWithPriority$descriptor() { + return cudaStreamCreateWithPriority.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreateWithPriority(cudaStream_t *pStream, unsigned int flags, int priority) + * } + */ + public static MethodHandle cudaStreamCreateWithPriority$handle() { + return cudaStreamCreateWithPriority.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreateWithPriority(cudaStream_t *pStream, unsigned int flags, int priority) + * } + */ + public static MemorySegment cudaStreamCreateWithPriority$address() { + return cudaStreamCreateWithPriority.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamCreateWithPriority(cudaStream_t *pStream, unsigned int flags, int priority) + * } + */ + public static int cudaStreamCreateWithPriority(MemorySegment pStream, int flags, int priority) { + var mh$ = cudaStreamCreateWithPriority.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamCreateWithPriority", pStream, flags, priority); + } + return (int)mh$.invokeExact(pStream, flags, priority); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamGetPriority { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetPriority"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int *priority) + * } + */ + public static FunctionDescriptor cudaStreamGetPriority$descriptor() { + return cudaStreamGetPriority.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int *priority) + * } + */ + public static MethodHandle cudaStreamGetPriority$handle() { + return cudaStreamGetPriority.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int *priority) + * } + */ + public static MemorySegment cudaStreamGetPriority$address() { + return cudaStreamGetPriority.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int *priority) + * } + */ + public static int cudaStreamGetPriority(MemorySegment hStream, MemorySegment priority) { + var mh$ = cudaStreamGetPriority.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamGetPriority", hStream, priority); + } + return (int)mh$.invokeExact(hStream, priority); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamGetFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int *flags) + * } + */ + public static FunctionDescriptor cudaStreamGetFlags$descriptor() { + return cudaStreamGetFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int *flags) + * } + */ + public static MethodHandle cudaStreamGetFlags$handle() { + return cudaStreamGetFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int *flags) + * } + */ + public static MemorySegment cudaStreamGetFlags$address() { + return cudaStreamGetFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int *flags) + * } + */ + public static int cudaStreamGetFlags(MemorySegment hStream, MemorySegment flags) { + var mh$ = cudaStreamGetFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamGetFlags", hStream, flags); + } + return (int)mh$.invokeExact(hStream, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamGetId { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetId"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long *streamId) + * } + */ + public static FunctionDescriptor cudaStreamGetId$descriptor() { + return cudaStreamGetId.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long *streamId) + * } + */ + public static MethodHandle cudaStreamGetId$handle() { + return cudaStreamGetId.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long *streamId) + * } + */ + public static MemorySegment cudaStreamGetId$address() { + return cudaStreamGetId.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long *streamId) + * } + */ + public static int cudaStreamGetId(MemorySegment hStream, MemorySegment streamId) { + var mh$ = cudaStreamGetId.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamGetId", hStream, streamId); + } + return (int)mh$.invokeExact(hStream, streamId); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaCtxResetPersistingL2Cache { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaCtxResetPersistingL2Cache"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaCtxResetPersistingL2Cache() + * } + */ + public static FunctionDescriptor cudaCtxResetPersistingL2Cache$descriptor() { + return cudaCtxResetPersistingL2Cache.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaCtxResetPersistingL2Cache() + * } + */ + public static MethodHandle cudaCtxResetPersistingL2Cache$handle() { + return cudaCtxResetPersistingL2Cache.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaCtxResetPersistingL2Cache() + * } + */ + public static MemorySegment cudaCtxResetPersistingL2Cache$address() { + return cudaCtxResetPersistingL2Cache.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaCtxResetPersistingL2Cache() + * } + */ + public static int cudaCtxResetPersistingL2Cache() { + var mh$ = cudaCtxResetPersistingL2Cache.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaCtxResetPersistingL2Cache"); + } + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamCopyAttributes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamCopyAttributes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) + * } + */ + public static FunctionDescriptor cudaStreamCopyAttributes$descriptor() { + return cudaStreamCopyAttributes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) + * } + */ + public static MethodHandle cudaStreamCopyAttributes$handle() { + return cudaStreamCopyAttributes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) + * } + */ + public static MemorySegment cudaStreamCopyAttributes$address() { + return cudaStreamCopyAttributes.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) + * } + */ + public static int cudaStreamCopyAttributes(MemorySegment dst, MemorySegment src) { + var mh$ = cudaStreamCopyAttributes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamCopyAttributes", dst, src); + } + return (int)mh$.invokeExact(dst, src); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamGetAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) + * } + */ + public static FunctionDescriptor cudaStreamGetAttribute$descriptor() { + return cudaStreamGetAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) + * } + */ + public static MethodHandle cudaStreamGetAttribute$handle() { + return cudaStreamGetAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) + * } + */ + public static MemorySegment cudaStreamGetAttribute$address() { + return cudaStreamGetAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) + * } + */ + public static int cudaStreamGetAttribute(MemorySegment hStream, int attr, MemorySegment value_out) { + var mh$ = cudaStreamGetAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamGetAttribute", hStream, attr, value_out); + } + return (int)mh$.invokeExact(hStream, attr, value_out); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamSetAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamSetAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) + * } + */ + public static FunctionDescriptor cudaStreamSetAttribute$descriptor() { + return cudaStreamSetAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) + * } + */ + public static MethodHandle cudaStreamSetAttribute$handle() { + return cudaStreamSetAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) + * } + */ + public static MemorySegment cudaStreamSetAttribute$address() { + return cudaStreamSetAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) + * } + */ + public static int cudaStreamSetAttribute(MemorySegment hStream, int attr, MemorySegment value) { + var mh$ = cudaStreamSetAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamSetAttribute", hStream, attr, value); + } + return (int)mh$.invokeExact(hStream, attr, value); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamDestroy(cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaStreamDestroy$descriptor() { + return cudaStreamDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamDestroy(cudaStream_t stream) + * } + */ + public static MethodHandle cudaStreamDestroy$handle() { + return cudaStreamDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamDestroy(cudaStream_t stream) + * } + */ + public static MemorySegment cudaStreamDestroy$address() { + return cudaStreamDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamDestroy(cudaStream_t stream) + * } + */ + public static int cudaStreamDestroy(MemorySegment stream) { + var mh$ = cudaStreamDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamDestroy", stream); + } + return (int)mh$.invokeExact(stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamWaitEvent { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamWaitEvent"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaStreamWaitEvent$descriptor() { + return cudaStreamWaitEvent.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) + * } + */ + public static MethodHandle cudaStreamWaitEvent$handle() { + return cudaStreamWaitEvent.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) + * } + */ + public static MemorySegment cudaStreamWaitEvent$address() { + return cudaStreamWaitEvent.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) + * } + */ + public static int cudaStreamWaitEvent(MemorySegment stream, MemorySegment event, int flags) { + var mh$ = cudaStreamWaitEvent.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamWaitEvent", stream, event, flags); + } + return (int)mh$.invokeExact(stream, event, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamAddCallback { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamAddCallback"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void *userData, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaStreamAddCallback$descriptor() { + return cudaStreamAddCallback.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void *userData, unsigned int flags) + * } + */ + public static MethodHandle cudaStreamAddCallback$handle() { + return cudaStreamAddCallback.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void *userData, unsigned int flags) + * } + */ + public static MemorySegment cudaStreamAddCallback$address() { + return cudaStreamAddCallback.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void *userData, unsigned int flags) + * } + */ + public static int cudaStreamAddCallback(MemorySegment stream, MemorySegment callback, MemorySegment userData, int flags) { + var mh$ = cudaStreamAddCallback.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamAddCallback", stream, callback, userData, flags); + } + return (int)mh$.invokeExact(stream, callback, userData, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamSynchronize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamSynchronize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamSynchronize(cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaStreamSynchronize$descriptor() { + return cudaStreamSynchronize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamSynchronize(cudaStream_t stream) + * } + */ + public static MethodHandle cudaStreamSynchronize$handle() { + return cudaStreamSynchronize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamSynchronize(cudaStream_t stream) + * } + */ + public static MemorySegment cudaStreamSynchronize$address() { + return cudaStreamSynchronize.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamSynchronize(cudaStream_t stream) + * } + */ + public static int cudaStreamSynchronize(MemorySegment stream) { + var mh$ = cudaStreamSynchronize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamSynchronize", stream); + } + return (int)mh$.invokeExact(stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamQuery { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamQuery"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamQuery(cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaStreamQuery$descriptor() { + return cudaStreamQuery.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamQuery(cudaStream_t stream) + * } + */ + public static MethodHandle cudaStreamQuery$handle() { + return cudaStreamQuery.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamQuery(cudaStream_t stream) + * } + */ + public static MemorySegment cudaStreamQuery$address() { + return cudaStreamQuery.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamQuery(cudaStream_t stream) + * } + */ + public static int cudaStreamQuery(MemorySegment stream) { + var mh$ = cudaStreamQuery.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamQuery", stream); + } + return (int)mh$.invokeExact(stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamAttachMemAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamAttachMemAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void *devPtr, size_t length, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaStreamAttachMemAsync$descriptor() { + return cudaStreamAttachMemAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void *devPtr, size_t length, unsigned int flags) + * } + */ + public static MethodHandle cudaStreamAttachMemAsync$handle() { + return cudaStreamAttachMemAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void *devPtr, size_t length, unsigned int flags) + * } + */ + public static MemorySegment cudaStreamAttachMemAsync$address() { + return cudaStreamAttachMemAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void *devPtr, size_t length, unsigned int flags) + * } + */ + public static int cudaStreamAttachMemAsync(MemorySegment stream, MemorySegment devPtr, long length, int flags) { + var mh$ = cudaStreamAttachMemAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamAttachMemAsync", stream, devPtr, length, flags); + } + return (int)mh$.invokeExact(stream, devPtr, length, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamBeginCapture { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamBeginCapture"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamBeginCapture(cudaStream_t stream, enum cudaStreamCaptureMode mode) + * } + */ + public static FunctionDescriptor cudaStreamBeginCapture$descriptor() { + return cudaStreamBeginCapture.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamBeginCapture(cudaStream_t stream, enum cudaStreamCaptureMode mode) + * } + */ + public static MethodHandle cudaStreamBeginCapture$handle() { + return cudaStreamBeginCapture.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamBeginCapture(cudaStream_t stream, enum cudaStreamCaptureMode mode) + * } + */ + public static MemorySegment cudaStreamBeginCapture$address() { + return cudaStreamBeginCapture.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamBeginCapture(cudaStream_t stream, enum cudaStreamCaptureMode mode) + * } + */ + public static int cudaStreamBeginCapture(MemorySegment stream, int mode) { + var mh$ = cudaStreamBeginCapture.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamBeginCapture", stream, mode); + } + return (int)mh$.invokeExact(stream, mode); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamBeginCaptureToGraph { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamBeginCaptureToGraph"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, enum cudaStreamCaptureMode mode) + * } + */ + public static FunctionDescriptor cudaStreamBeginCaptureToGraph$descriptor() { + return cudaStreamBeginCaptureToGraph.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, enum cudaStreamCaptureMode mode) + * } + */ + public static MethodHandle cudaStreamBeginCaptureToGraph$handle() { + return cudaStreamBeginCaptureToGraph.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, enum cudaStreamCaptureMode mode) + * } + */ + public static MemorySegment cudaStreamBeginCaptureToGraph$address() { + return cudaStreamBeginCaptureToGraph.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, enum cudaStreamCaptureMode mode) + * } + */ + public static int cudaStreamBeginCaptureToGraph(MemorySegment stream, MemorySegment graph, MemorySegment dependencies, MemorySegment dependencyData, long numDependencies, int mode) { + var mh$ = cudaStreamBeginCaptureToGraph.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamBeginCaptureToGraph", stream, graph, dependencies, dependencyData, numDependencies, mode); + } + return (int)mh$.invokeExact(stream, graph, dependencies, dependencyData, numDependencies, mode); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaThreadExchangeStreamCaptureMode { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadExchangeStreamCaptureMode"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadExchangeStreamCaptureMode(enum cudaStreamCaptureMode *mode) + * } + */ + public static FunctionDescriptor cudaThreadExchangeStreamCaptureMode$descriptor() { + return cudaThreadExchangeStreamCaptureMode.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadExchangeStreamCaptureMode(enum cudaStreamCaptureMode *mode) + * } + */ + public static MethodHandle cudaThreadExchangeStreamCaptureMode$handle() { + return cudaThreadExchangeStreamCaptureMode.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaThreadExchangeStreamCaptureMode(enum cudaStreamCaptureMode *mode) + * } + */ + public static MemorySegment cudaThreadExchangeStreamCaptureMode$address() { + return cudaThreadExchangeStreamCaptureMode.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaThreadExchangeStreamCaptureMode(enum cudaStreamCaptureMode *mode) + * } + */ + public static int cudaThreadExchangeStreamCaptureMode(MemorySegment mode) { + var mh$ = cudaThreadExchangeStreamCaptureMode.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaThreadExchangeStreamCaptureMode", mode); + } + return (int)mh$.invokeExact(mode); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamEndCapture { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamEndCapture"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t *pGraph) + * } + */ + public static FunctionDescriptor cudaStreamEndCapture$descriptor() { + return cudaStreamEndCapture.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t *pGraph) + * } + */ + public static MethodHandle cudaStreamEndCapture$handle() { + return cudaStreamEndCapture.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t *pGraph) + * } + */ + public static MemorySegment cudaStreamEndCapture$address() { + return cudaStreamEndCapture.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t *pGraph) + * } + */ + public static int cudaStreamEndCapture(MemorySegment stream, MemorySegment pGraph) { + var mh$ = cudaStreamEndCapture.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamEndCapture", stream, pGraph); + } + return (int)mh$.invokeExact(stream, pGraph); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamIsCapturing { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamIsCapturing"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamIsCapturing(cudaStream_t stream, enum cudaStreamCaptureStatus *pCaptureStatus) + * } + */ + public static FunctionDescriptor cudaStreamIsCapturing$descriptor() { + return cudaStreamIsCapturing.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamIsCapturing(cudaStream_t stream, enum cudaStreamCaptureStatus *pCaptureStatus) + * } + */ + public static MethodHandle cudaStreamIsCapturing$handle() { + return cudaStreamIsCapturing.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamIsCapturing(cudaStream_t stream, enum cudaStreamCaptureStatus *pCaptureStatus) + * } + */ + public static MemorySegment cudaStreamIsCapturing$address() { + return cudaStreamIsCapturing.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamIsCapturing(cudaStream_t stream, enum cudaStreamCaptureStatus *pCaptureStatus) + * } + */ + public static int cudaStreamIsCapturing(MemorySegment stream, MemorySegment pCaptureStatus) { + var mh$ = cudaStreamIsCapturing.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamIsCapturing", stream, pCaptureStatus); + } + return (int)mh$.invokeExact(stream, pCaptureStatus); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamGetCaptureInfo_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetCaptureInfo_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetCaptureInfo_v2(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, size_t *numDependencies_out) + * } + */ + public static FunctionDescriptor cudaStreamGetCaptureInfo_v2$descriptor() { + return cudaStreamGetCaptureInfo_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetCaptureInfo_v2(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, size_t *numDependencies_out) + * } + */ + public static MethodHandle cudaStreamGetCaptureInfo_v2$handle() { + return cudaStreamGetCaptureInfo_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetCaptureInfo_v2(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, size_t *numDependencies_out) + * } + */ + public static MemorySegment cudaStreamGetCaptureInfo_v2$address() { + return cudaStreamGetCaptureInfo_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetCaptureInfo_v2(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, size_t *numDependencies_out) + * } + */ + public static int cudaStreamGetCaptureInfo_v2(MemorySegment stream, MemorySegment captureStatus_out, MemorySegment id_out, MemorySegment graph_out, MemorySegment dependencies_out, MemorySegment numDependencies_out) { + var mh$ = cudaStreamGetCaptureInfo_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamGetCaptureInfo_v2", stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out); + } + return (int)mh$.invokeExact(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamGetCaptureInfo_v3 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetCaptureInfo_v3"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, const cudaGraphEdgeData **edgeData_out, size_t *numDependencies_out) + * } + */ + public static FunctionDescriptor cudaStreamGetCaptureInfo_v3$descriptor() { + return cudaStreamGetCaptureInfo_v3.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, const cudaGraphEdgeData **edgeData_out, size_t *numDependencies_out) + * } + */ + public static MethodHandle cudaStreamGetCaptureInfo_v3$handle() { + return cudaStreamGetCaptureInfo_v3.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, const cudaGraphEdgeData **edgeData_out, size_t *numDependencies_out) + * } + */ + public static MemorySegment cudaStreamGetCaptureInfo_v3$address() { + return cudaStreamGetCaptureInfo_v3.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, const cudaGraphEdgeData **edgeData_out, size_t *numDependencies_out) + * } + */ + public static int cudaStreamGetCaptureInfo_v3(MemorySegment stream, MemorySegment captureStatus_out, MemorySegment id_out, MemorySegment graph_out, MemorySegment dependencies_out, MemorySegment edgeData_out, MemorySegment numDependencies_out) { + var mh$ = cudaStreamGetCaptureInfo_v3.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamGetCaptureInfo_v3", stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out); + } + return (int)mh$.invokeExact(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamUpdateCaptureDependencies { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamUpdateCaptureDependencies"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t *dependencies, size_t numDependencies, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaStreamUpdateCaptureDependencies$descriptor() { + return cudaStreamUpdateCaptureDependencies.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t *dependencies, size_t numDependencies, unsigned int flags) + * } + */ + public static MethodHandle cudaStreamUpdateCaptureDependencies$handle() { + return cudaStreamUpdateCaptureDependencies.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t *dependencies, size_t numDependencies, unsigned int flags) + * } + */ + public static MemorySegment cudaStreamUpdateCaptureDependencies$address() { + return cudaStreamUpdateCaptureDependencies.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t *dependencies, size_t numDependencies, unsigned int flags) + * } + */ + public static int cudaStreamUpdateCaptureDependencies(MemorySegment stream, MemorySegment dependencies, long numDependencies, int flags) { + var mh$ = cudaStreamUpdateCaptureDependencies.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamUpdateCaptureDependencies", stream, dependencies, numDependencies, flags); + } + return (int)mh$.invokeExact(stream, dependencies, numDependencies, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaStreamUpdateCaptureDependencies_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamUpdateCaptureDependencies_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaStreamUpdateCaptureDependencies_v2$descriptor() { + return cudaStreamUpdateCaptureDependencies_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, unsigned int flags) + * } + */ + public static MethodHandle cudaStreamUpdateCaptureDependencies_v2$handle() { + return cudaStreamUpdateCaptureDependencies_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, unsigned int flags) + * } + */ + public static MemorySegment cudaStreamUpdateCaptureDependencies_v2$address() { + return cudaStreamUpdateCaptureDependencies_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, unsigned int flags) + * } + */ + public static int cudaStreamUpdateCaptureDependencies_v2(MemorySegment stream, MemorySegment dependencies, MemorySegment dependencyData, long numDependencies, int flags) { + var mh$ = cudaStreamUpdateCaptureDependencies_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaStreamUpdateCaptureDependencies_v2", stream, dependencies, dependencyData, numDependencies, flags); + } + return (int)mh$.invokeExact(stream, dependencies, dependencyData, numDependencies, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaEventCreate { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventCreate"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaEventCreate(cudaEvent_t *event) + * } + */ + public static FunctionDescriptor cudaEventCreate$descriptor() { + return cudaEventCreate.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaEventCreate(cudaEvent_t *event) + * } + */ + public static MethodHandle cudaEventCreate$handle() { + return cudaEventCreate.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaEventCreate(cudaEvent_t *event) + * } + */ + public static MemorySegment cudaEventCreate$address() { + return cudaEventCreate.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaEventCreate(cudaEvent_t *event) + * } + */ + public static int cudaEventCreate(MemorySegment event) { + var mh$ = cudaEventCreate.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaEventCreate", event); + } + return (int)mh$.invokeExact(event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaEventCreateWithFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventCreateWithFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t *event, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaEventCreateWithFlags$descriptor() { + return cudaEventCreateWithFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t *event, unsigned int flags) + * } + */ + public static MethodHandle cudaEventCreateWithFlags$handle() { + return cudaEventCreateWithFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t *event, unsigned int flags) + * } + */ + public static MemorySegment cudaEventCreateWithFlags$address() { + return cudaEventCreateWithFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t *event, unsigned int flags) + * } + */ + public static int cudaEventCreateWithFlags(MemorySegment event, int flags) { + var mh$ = cudaEventCreateWithFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaEventCreateWithFlags", event, flags); + } + return (int)mh$.invokeExact(event, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaEventRecord { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventRecord"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaEventRecord$descriptor() { + return cudaEventRecord.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) + * } + */ + public static MethodHandle cudaEventRecord$handle() { + return cudaEventRecord.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) + * } + */ + public static MemorySegment cudaEventRecord$address() { + return cudaEventRecord.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) + * } + */ + public static int cudaEventRecord(MemorySegment event, MemorySegment stream) { + var mh$ = cudaEventRecord.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaEventRecord", event, stream); + } + return (int)mh$.invokeExact(event, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaEventRecordWithFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventRecordWithFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaEventRecordWithFlags$descriptor() { + return cudaEventRecordWithFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) + * } + */ + public static MethodHandle cudaEventRecordWithFlags$handle() { + return cudaEventRecordWithFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) + * } + */ + public static MemorySegment cudaEventRecordWithFlags$address() { + return cudaEventRecordWithFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) + * } + */ + public static int cudaEventRecordWithFlags(MemorySegment event, MemorySegment stream, int flags) { + var mh$ = cudaEventRecordWithFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaEventRecordWithFlags", event, stream, flags); + } + return (int)mh$.invokeExact(event, stream, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaEventQuery { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventQuery"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaEventQuery(cudaEvent_t event) + * } + */ + public static FunctionDescriptor cudaEventQuery$descriptor() { + return cudaEventQuery.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaEventQuery(cudaEvent_t event) + * } + */ + public static MethodHandle cudaEventQuery$handle() { + return cudaEventQuery.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaEventQuery(cudaEvent_t event) + * } + */ + public static MemorySegment cudaEventQuery$address() { + return cudaEventQuery.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaEventQuery(cudaEvent_t event) + * } + */ + public static int cudaEventQuery(MemorySegment event) { + var mh$ = cudaEventQuery.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaEventQuery", event); + } + return (int)mh$.invokeExact(event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaEventSynchronize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventSynchronize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaEventSynchronize(cudaEvent_t event) + * } + */ + public static FunctionDescriptor cudaEventSynchronize$descriptor() { + return cudaEventSynchronize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaEventSynchronize(cudaEvent_t event) + * } + */ + public static MethodHandle cudaEventSynchronize$handle() { + return cudaEventSynchronize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaEventSynchronize(cudaEvent_t event) + * } + */ + public static MemorySegment cudaEventSynchronize$address() { + return cudaEventSynchronize.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaEventSynchronize(cudaEvent_t event) + * } + */ + public static int cudaEventSynchronize(MemorySegment event) { + var mh$ = cudaEventSynchronize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaEventSynchronize", event); + } + return (int)mh$.invokeExact(event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaEventDestroy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventDestroy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaEventDestroy(cudaEvent_t event) + * } + */ + public static FunctionDescriptor cudaEventDestroy$descriptor() { + return cudaEventDestroy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaEventDestroy(cudaEvent_t event) + * } + */ + public static MethodHandle cudaEventDestroy$handle() { + return cudaEventDestroy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaEventDestroy(cudaEvent_t event) + * } + */ + public static MemorySegment cudaEventDestroy$address() { + return cudaEventDestroy.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaEventDestroy(cudaEvent_t event) + * } + */ + public static int cudaEventDestroy(MemorySegment event) { + var mh$ = cudaEventDestroy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaEventDestroy", event); + } + return (int)mh$.invokeExact(event); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaEventElapsedTime { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventElapsedTime"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end) + * } + */ + public static FunctionDescriptor cudaEventElapsedTime$descriptor() { + return cudaEventElapsedTime.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end) + * } + */ + public static MethodHandle cudaEventElapsedTime$handle() { + return cudaEventElapsedTime.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end) + * } + */ + public static MemorySegment cudaEventElapsedTime$address() { + return cudaEventElapsedTime.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end) + * } + */ + public static int cudaEventElapsedTime(MemorySegment ms, MemorySegment start, MemorySegment end) { + var mh$ = cudaEventElapsedTime.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaEventElapsedTime", ms, start, end); + } + return (int)mh$.invokeExact(ms, start, end); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaImportExternalMemory { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaImportExternalMemory"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaImportExternalMemory(cudaExternalMemory_t *extMem_out, const struct cudaExternalMemoryHandleDesc *memHandleDesc) + * } + */ + public static FunctionDescriptor cudaImportExternalMemory$descriptor() { + return cudaImportExternalMemory.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaImportExternalMemory(cudaExternalMemory_t *extMem_out, const struct cudaExternalMemoryHandleDesc *memHandleDesc) + * } + */ + public static MethodHandle cudaImportExternalMemory$handle() { + return cudaImportExternalMemory.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaImportExternalMemory(cudaExternalMemory_t *extMem_out, const struct cudaExternalMemoryHandleDesc *memHandleDesc) + * } + */ + public static MemorySegment cudaImportExternalMemory$address() { + return cudaImportExternalMemory.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaImportExternalMemory(cudaExternalMemory_t *extMem_out, const struct cudaExternalMemoryHandleDesc *memHandleDesc) + * } + */ + public static int cudaImportExternalMemory(MemorySegment extMem_out, MemorySegment memHandleDesc) { + var mh$ = cudaImportExternalMemory.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaImportExternalMemory", extMem_out, memHandleDesc); + } + return (int)mh$.invokeExact(extMem_out, memHandleDesc); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaExternalMemoryGetMappedBuffer { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaExternalMemoryGetMappedBuffer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaExternalMemoryGetMappedBuffer(void **devPtr, cudaExternalMemory_t extMem, const struct cudaExternalMemoryBufferDesc *bufferDesc) + * } + */ + public static FunctionDescriptor cudaExternalMemoryGetMappedBuffer$descriptor() { + return cudaExternalMemoryGetMappedBuffer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaExternalMemoryGetMappedBuffer(void **devPtr, cudaExternalMemory_t extMem, const struct cudaExternalMemoryBufferDesc *bufferDesc) + * } + */ + public static MethodHandle cudaExternalMemoryGetMappedBuffer$handle() { + return cudaExternalMemoryGetMappedBuffer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaExternalMemoryGetMappedBuffer(void **devPtr, cudaExternalMemory_t extMem, const struct cudaExternalMemoryBufferDesc *bufferDesc) + * } + */ + public static MemorySegment cudaExternalMemoryGetMappedBuffer$address() { + return cudaExternalMemoryGetMappedBuffer.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaExternalMemoryGetMappedBuffer(void **devPtr, cudaExternalMemory_t extMem, const struct cudaExternalMemoryBufferDesc *bufferDesc) + * } + */ + public static int cudaExternalMemoryGetMappedBuffer(MemorySegment devPtr, MemorySegment extMem, MemorySegment bufferDesc) { + var mh$ = cudaExternalMemoryGetMappedBuffer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaExternalMemoryGetMappedBuffer", devPtr, extMem, bufferDesc); + } + return (int)mh$.invokeExact(devPtr, extMem, bufferDesc); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaExternalMemoryGetMappedMipmappedArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaExternalMemoryGetMappedMipmappedArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t *mipmap, cudaExternalMemory_t extMem, const struct cudaExternalMemoryMipmappedArrayDesc *mipmapDesc) + * } + */ + public static FunctionDescriptor cudaExternalMemoryGetMappedMipmappedArray$descriptor() { + return cudaExternalMemoryGetMappedMipmappedArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t *mipmap, cudaExternalMemory_t extMem, const struct cudaExternalMemoryMipmappedArrayDesc *mipmapDesc) + * } + */ + public static MethodHandle cudaExternalMemoryGetMappedMipmappedArray$handle() { + return cudaExternalMemoryGetMappedMipmappedArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t *mipmap, cudaExternalMemory_t extMem, const struct cudaExternalMemoryMipmappedArrayDesc *mipmapDesc) + * } + */ + public static MemorySegment cudaExternalMemoryGetMappedMipmappedArray$address() { + return cudaExternalMemoryGetMappedMipmappedArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t *mipmap, cudaExternalMemory_t extMem, const struct cudaExternalMemoryMipmappedArrayDesc *mipmapDesc) + * } + */ + public static int cudaExternalMemoryGetMappedMipmappedArray(MemorySegment mipmap, MemorySegment extMem, MemorySegment mipmapDesc) { + var mh$ = cudaExternalMemoryGetMappedMipmappedArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaExternalMemoryGetMappedMipmappedArray", mipmap, extMem, mipmapDesc); + } + return (int)mh$.invokeExact(mipmap, extMem, mipmapDesc); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDestroyExternalMemory { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDestroyExternalMemory"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) + * } + */ + public static FunctionDescriptor cudaDestroyExternalMemory$descriptor() { + return cudaDestroyExternalMemory.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) + * } + */ + public static MethodHandle cudaDestroyExternalMemory$handle() { + return cudaDestroyExternalMemory.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) + * } + */ + public static MemorySegment cudaDestroyExternalMemory$address() { + return cudaDestroyExternalMemory.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) + * } + */ + public static int cudaDestroyExternalMemory(MemorySegment extMem) { + var mh$ = cudaDestroyExternalMemory.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDestroyExternalMemory", extMem); + } + return (int)mh$.invokeExact(extMem); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaImportExternalSemaphore { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaImportExternalSemaphore"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t *extSem_out, const struct cudaExternalSemaphoreHandleDesc *semHandleDesc) + * } + */ + public static FunctionDescriptor cudaImportExternalSemaphore$descriptor() { + return cudaImportExternalSemaphore.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t *extSem_out, const struct cudaExternalSemaphoreHandleDesc *semHandleDesc) + * } + */ + public static MethodHandle cudaImportExternalSemaphore$handle() { + return cudaImportExternalSemaphore.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t *extSem_out, const struct cudaExternalSemaphoreHandleDesc *semHandleDesc) + * } + */ + public static MemorySegment cudaImportExternalSemaphore$address() { + return cudaImportExternalSemaphore.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t *extSem_out, const struct cudaExternalSemaphoreHandleDesc *semHandleDesc) + * } + */ + public static int cudaImportExternalSemaphore(MemorySegment extSem_out, MemorySegment semHandleDesc) { + var mh$ = cudaImportExternalSemaphore.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaImportExternalSemaphore", extSem_out, semHandleDesc); + } + return (int)mh$.invokeExact(extSem_out, semHandleDesc); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaSignalExternalSemaphoresAsync_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSignalExternalSemaphoresAsync_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreSignalParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaSignalExternalSemaphoresAsync_v2$descriptor() { + return cudaSignalExternalSemaphoresAsync_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreSignalParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) + * } + */ + public static MethodHandle cudaSignalExternalSemaphoresAsync_v2$handle() { + return cudaSignalExternalSemaphoresAsync_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreSignalParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) + * } + */ + public static MemorySegment cudaSignalExternalSemaphoresAsync_v2$address() { + return cudaSignalExternalSemaphoresAsync_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreSignalParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) + * } + */ + public static int cudaSignalExternalSemaphoresAsync_v2(MemorySegment extSemArray, MemorySegment paramsArray, int numExtSems, MemorySegment stream) { + var mh$ = cudaSignalExternalSemaphoresAsync_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaSignalExternalSemaphoresAsync_v2", extSemArray, paramsArray, numExtSems, stream); + } + return (int)mh$.invokeExact(extSemArray, paramsArray, numExtSems, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaWaitExternalSemaphoresAsync_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaWaitExternalSemaphoresAsync_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreWaitParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaWaitExternalSemaphoresAsync_v2$descriptor() { + return cudaWaitExternalSemaphoresAsync_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreWaitParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) + * } + */ + public static MethodHandle cudaWaitExternalSemaphoresAsync_v2$handle() { + return cudaWaitExternalSemaphoresAsync_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreWaitParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) + * } + */ + public static MemorySegment cudaWaitExternalSemaphoresAsync_v2$address() { + return cudaWaitExternalSemaphoresAsync_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreWaitParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) + * } + */ + public static int cudaWaitExternalSemaphoresAsync_v2(MemorySegment extSemArray, MemorySegment paramsArray, int numExtSems, MemorySegment stream) { + var mh$ = cudaWaitExternalSemaphoresAsync_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaWaitExternalSemaphoresAsync_v2", extSemArray, paramsArray, numExtSems, stream); + } + return (int)mh$.invokeExact(extSemArray, paramsArray, numExtSems, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaDestroyExternalSemaphore { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDestroyExternalSemaphore"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) + * } + */ + public static FunctionDescriptor cudaDestroyExternalSemaphore$descriptor() { + return cudaDestroyExternalSemaphore.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) + * } + */ + public static MethodHandle cudaDestroyExternalSemaphore$handle() { + return cudaDestroyExternalSemaphore.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) + * } + */ + public static MemorySegment cudaDestroyExternalSemaphore$address() { + return cudaDestroyExternalSemaphore.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) + * } + */ + public static int cudaDestroyExternalSemaphore(MemorySegment extSem) { + var mh$ = cudaDestroyExternalSemaphore.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaDestroyExternalSemaphore", extSem); + } + return (int)mh$.invokeExact(extSem); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaLaunchKernel { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + dim3.layout(), + dim3.layout(), + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaLaunchKernel"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaLaunchKernel$descriptor() { + return cudaLaunchKernel.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) + * } + */ + public static MethodHandle cudaLaunchKernel$handle() { + return cudaLaunchKernel.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) + * } + */ + public static MemorySegment cudaLaunchKernel$address() { + return cudaLaunchKernel.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaLaunchKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) + * } + */ + public static int cudaLaunchKernel(MemorySegment func, MemorySegment gridDim, MemorySegment blockDim, MemorySegment args, long sharedMem, MemorySegment stream) { + var mh$ = cudaLaunchKernel.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaLaunchKernel", func, gridDim, blockDim, args, sharedMem, stream); + } + return (int)mh$.invokeExact(func, gridDim, blockDim, args, sharedMem, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaLaunchKernelExC { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaLaunchKernelExC"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchKernelExC(const cudaLaunchConfig_t *config, const void *func, void **args) + * } + */ + public static FunctionDescriptor cudaLaunchKernelExC$descriptor() { + return cudaLaunchKernelExC.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchKernelExC(const cudaLaunchConfig_t *config, const void *func, void **args) + * } + */ + public static MethodHandle cudaLaunchKernelExC$handle() { + return cudaLaunchKernelExC.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchKernelExC(const cudaLaunchConfig_t *config, const void *func, void **args) + * } + */ + public static MemorySegment cudaLaunchKernelExC$address() { + return cudaLaunchKernelExC.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaLaunchKernelExC(const cudaLaunchConfig_t *config, const void *func, void **args) + * } + */ + public static int cudaLaunchKernelExC(MemorySegment config, MemorySegment func, MemorySegment args) { + var mh$ = cudaLaunchKernelExC.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaLaunchKernelExC", config, func, args); + } + return (int)mh$.invokeExact(config, func, args); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaLaunchCooperativeKernel { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + dim3.layout(), + dim3.layout(), + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaLaunchCooperativeKernel"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchCooperativeKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaLaunchCooperativeKernel$descriptor() { + return cudaLaunchCooperativeKernel.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchCooperativeKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) + * } + */ + public static MethodHandle cudaLaunchCooperativeKernel$handle() { + return cudaLaunchCooperativeKernel.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchCooperativeKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) + * } + */ + public static MemorySegment cudaLaunchCooperativeKernel$address() { + return cudaLaunchCooperativeKernel.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaLaunchCooperativeKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) + * } + */ + public static int cudaLaunchCooperativeKernel(MemorySegment func, MemorySegment gridDim, MemorySegment blockDim, MemorySegment args, long sharedMem, MemorySegment stream) { + var mh$ = cudaLaunchCooperativeKernel.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaLaunchCooperativeKernel", func, gridDim, blockDim, args, sharedMem, stream); + } + return (int)mh$.invokeExact(func, gridDim, blockDim, args, sharedMem, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaLaunchCooperativeKernelMultiDevice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaLaunchCooperativeKernelMultiDevice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchCooperativeKernelMultiDevice(struct cudaLaunchParams *launchParamsList, unsigned int numDevices, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaLaunchCooperativeKernelMultiDevice$descriptor() { + return cudaLaunchCooperativeKernelMultiDevice.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchCooperativeKernelMultiDevice(struct cudaLaunchParams *launchParamsList, unsigned int numDevices, unsigned int flags) + * } + */ + public static MethodHandle cudaLaunchCooperativeKernelMultiDevice$handle() { + return cudaLaunchCooperativeKernelMultiDevice.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchCooperativeKernelMultiDevice(struct cudaLaunchParams *launchParamsList, unsigned int numDevices, unsigned int flags) + * } + */ + public static MemorySegment cudaLaunchCooperativeKernelMultiDevice$address() { + return cudaLaunchCooperativeKernelMultiDevice.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaLaunchCooperativeKernelMultiDevice(struct cudaLaunchParams *launchParamsList, unsigned int numDevices, unsigned int flags) + * } + */ + public static int cudaLaunchCooperativeKernelMultiDevice(MemorySegment launchParamsList, int numDevices, int flags) { + var mh$ = cudaLaunchCooperativeKernelMultiDevice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaLaunchCooperativeKernelMultiDevice", launchParamsList, numDevices, flags); + } + return (int)mh$.invokeExact(launchParamsList, numDevices, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFuncSetCacheConfig { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncSetCacheConfig"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetCacheConfig(const void *func, enum cudaFuncCache cacheConfig) + * } + */ + public static FunctionDescriptor cudaFuncSetCacheConfig$descriptor() { + return cudaFuncSetCacheConfig.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetCacheConfig(const void *func, enum cudaFuncCache cacheConfig) + * } + */ + public static MethodHandle cudaFuncSetCacheConfig$handle() { + return cudaFuncSetCacheConfig.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetCacheConfig(const void *func, enum cudaFuncCache cacheConfig) + * } + */ + public static MemorySegment cudaFuncSetCacheConfig$address() { + return cudaFuncSetCacheConfig.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetCacheConfig(const void *func, enum cudaFuncCache cacheConfig) + * } + */ + public static int cudaFuncSetCacheConfig(MemorySegment func, int cacheConfig) { + var mh$ = cudaFuncSetCacheConfig.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFuncSetCacheConfig", func, cacheConfig); + } + return (int)mh$.invokeExact(func, cacheConfig); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFuncGetAttributes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncGetAttributes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetAttributes(struct cudaFuncAttributes *attr, const void *func) + * } + */ + public static FunctionDescriptor cudaFuncGetAttributes$descriptor() { + return cudaFuncGetAttributes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetAttributes(struct cudaFuncAttributes *attr, const void *func) + * } + */ + public static MethodHandle cudaFuncGetAttributes$handle() { + return cudaFuncGetAttributes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetAttributes(struct cudaFuncAttributes *attr, const void *func) + * } + */ + public static MemorySegment cudaFuncGetAttributes$address() { + return cudaFuncGetAttributes.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetAttributes(struct cudaFuncAttributes *attr, const void *func) + * } + */ + public static int cudaFuncGetAttributes(MemorySegment attr, MemorySegment func) { + var mh$ = cudaFuncGetAttributes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFuncGetAttributes", attr, func); + } + return (int)mh$.invokeExact(attr, func); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFuncSetAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncSetAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetAttribute(const void *func, enum cudaFuncAttribute attr, int value) + * } + */ + public static FunctionDescriptor cudaFuncSetAttribute$descriptor() { + return cudaFuncSetAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetAttribute(const void *func, enum cudaFuncAttribute attr, int value) + * } + */ + public static MethodHandle cudaFuncSetAttribute$handle() { + return cudaFuncSetAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetAttribute(const void *func, enum cudaFuncAttribute attr, int value) + * } + */ + public static MemorySegment cudaFuncSetAttribute$address() { + return cudaFuncSetAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetAttribute(const void *func, enum cudaFuncAttribute attr, int value) + * } + */ + public static int cudaFuncSetAttribute(MemorySegment func, int attr, int value) { + var mh$ = cudaFuncSetAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFuncSetAttribute", func, attr, value); + } + return (int)mh$.invokeExact(func, attr, value); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFuncGetName { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncGetName"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetName(const char **name, const void *func) + * } + */ + public static FunctionDescriptor cudaFuncGetName$descriptor() { + return cudaFuncGetName.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetName(const char **name, const void *func) + * } + */ + public static MethodHandle cudaFuncGetName$handle() { + return cudaFuncGetName.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetName(const char **name, const void *func) + * } + */ + public static MemorySegment cudaFuncGetName$address() { + return cudaFuncGetName.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetName(const char **name, const void *func) + * } + */ + public static int cudaFuncGetName(MemorySegment name, MemorySegment func) { + var mh$ = cudaFuncGetName.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFuncGetName", name, func); + } + return (int)mh$.invokeExact(name, func); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFuncGetParamInfo { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncGetParamInfo"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetParamInfo(const void *func, size_t paramIndex, size_t *paramOffset, size_t *paramSize) + * } + */ + public static FunctionDescriptor cudaFuncGetParamInfo$descriptor() { + return cudaFuncGetParamInfo.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetParamInfo(const void *func, size_t paramIndex, size_t *paramOffset, size_t *paramSize) + * } + */ + public static MethodHandle cudaFuncGetParamInfo$handle() { + return cudaFuncGetParamInfo.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetParamInfo(const void *func, size_t paramIndex, size_t *paramOffset, size_t *paramSize) + * } + */ + public static MemorySegment cudaFuncGetParamInfo$address() { + return cudaFuncGetParamInfo.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFuncGetParamInfo(const void *func, size_t paramIndex, size_t *paramOffset, size_t *paramSize) + * } + */ + public static int cudaFuncGetParamInfo(MemorySegment func, long paramIndex, MemorySegment paramOffset, MemorySegment paramSize) { + var mh$ = cudaFuncGetParamInfo.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFuncGetParamInfo", func, paramIndex, paramOffset, paramSize); + } + return (int)mh$.invokeExact(func, paramIndex, paramOffset, paramSize); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaSetDoubleForDevice { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSetDoubleForDevice"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDoubleForDevice(double *d) + * } + */ + public static FunctionDescriptor cudaSetDoubleForDevice$descriptor() { + return cudaSetDoubleForDevice.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDoubleForDevice(double *d) + * } + */ + public static MethodHandle cudaSetDoubleForDevice$handle() { + return cudaSetDoubleForDevice.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDoubleForDevice(double *d) + * } + */ + public static MemorySegment cudaSetDoubleForDevice$address() { + return cudaSetDoubleForDevice.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaSetDoubleForDevice(double *d) + * } + */ + public static int cudaSetDoubleForDevice(MemorySegment d) { + var mh$ = cudaSetDoubleForDevice.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaSetDoubleForDevice", d); + } + return (int)mh$.invokeExact(d); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaSetDoubleForHost { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSetDoubleForHost"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDoubleForHost(double *d) + * } + */ + public static FunctionDescriptor cudaSetDoubleForHost$descriptor() { + return cudaSetDoubleForHost.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDoubleForHost(double *d) + * } + */ + public static MethodHandle cudaSetDoubleForHost$handle() { + return cudaSetDoubleForHost.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaSetDoubleForHost(double *d) + * } + */ + public static MemorySegment cudaSetDoubleForHost$address() { + return cudaSetDoubleForHost.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaSetDoubleForHost(double *d) + * } + */ + public static int cudaSetDoubleForHost(MemorySegment d) { + var mh$ = cudaSetDoubleForHost.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaSetDoubleForHost", d); + } + return (int)mh$.invokeExact(d); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaLaunchHostFunc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaLaunchHostFunc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void *userData) + * } + */ + public static FunctionDescriptor cudaLaunchHostFunc$descriptor() { + return cudaLaunchHostFunc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void *userData) + * } + */ + public static MethodHandle cudaLaunchHostFunc$handle() { + return cudaLaunchHostFunc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void *userData) + * } + */ + public static MemorySegment cudaLaunchHostFunc$address() { + return cudaLaunchHostFunc.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void *userData) + * } + */ + public static int cudaLaunchHostFunc(MemorySegment stream, MemorySegment fn, MemorySegment userData) { + var mh$ = cudaLaunchHostFunc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaLaunchHostFunc", stream, fn, userData); + } + return (int)mh$.invokeExact(stream, fn, userData); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFuncSetSharedMemConfig { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncSetSharedMemConfig"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetSharedMemConfig(const void *func, enum cudaSharedMemConfig config) + * } + */ + public static FunctionDescriptor cudaFuncSetSharedMemConfig$descriptor() { + return cudaFuncSetSharedMemConfig.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetSharedMemConfig(const void *func, enum cudaSharedMemConfig config) + * } + */ + public static MethodHandle cudaFuncSetSharedMemConfig$handle() { + return cudaFuncSetSharedMemConfig.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetSharedMemConfig(const void *func, enum cudaSharedMemConfig config) + * } + */ + public static MemorySegment cudaFuncSetSharedMemConfig$address() { + return cudaFuncSetSharedMemConfig.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFuncSetSharedMemConfig(const void *func, enum cudaSharedMemConfig config) + * } + */ + public static int cudaFuncSetSharedMemConfig(MemorySegment func, int config) { + var mh$ = cudaFuncSetSharedMemConfig.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFuncSetSharedMemConfig", func, config); + } + return (int)mh$.invokeExact(func, config); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaOccupancyMaxActiveBlocksPerMultiprocessor { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaOccupancyMaxActiveBlocksPerMultiprocessor"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize) + * } + */ + public static FunctionDescriptor cudaOccupancyMaxActiveBlocksPerMultiprocessor$descriptor() { + return cudaOccupancyMaxActiveBlocksPerMultiprocessor.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize) + * } + */ + public static MethodHandle cudaOccupancyMaxActiveBlocksPerMultiprocessor$handle() { + return cudaOccupancyMaxActiveBlocksPerMultiprocessor.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize) + * } + */ + public static MemorySegment cudaOccupancyMaxActiveBlocksPerMultiprocessor$address() { + return cudaOccupancyMaxActiveBlocksPerMultiprocessor.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize) + * } + */ + public static int cudaOccupancyMaxActiveBlocksPerMultiprocessor(MemorySegment numBlocks, MemorySegment func, int blockSize, long dynamicSMemSize) { + var mh$ = cudaOccupancyMaxActiveBlocksPerMultiprocessor.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaOccupancyMaxActiveBlocksPerMultiprocessor", numBlocks, func, blockSize, dynamicSMemSize); + } + return (int)mh$.invokeExact(numBlocks, func, blockSize, dynamicSMemSize); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaOccupancyAvailableDynamicSMemPerBlock { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaOccupancyAvailableDynamicSMemPerBlock"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t *dynamicSmemSize, const void *func, int numBlocks, int blockSize) + * } + */ + public static FunctionDescriptor cudaOccupancyAvailableDynamicSMemPerBlock$descriptor() { + return cudaOccupancyAvailableDynamicSMemPerBlock.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t *dynamicSmemSize, const void *func, int numBlocks, int blockSize) + * } + */ + public static MethodHandle cudaOccupancyAvailableDynamicSMemPerBlock$handle() { + return cudaOccupancyAvailableDynamicSMemPerBlock.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t *dynamicSmemSize, const void *func, int numBlocks, int blockSize) + * } + */ + public static MemorySegment cudaOccupancyAvailableDynamicSMemPerBlock$address() { + return cudaOccupancyAvailableDynamicSMemPerBlock.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t *dynamicSmemSize, const void *func, int numBlocks, int blockSize) + * } + */ + public static int cudaOccupancyAvailableDynamicSMemPerBlock(MemorySegment dynamicSmemSize, MemorySegment func, int numBlocks, int blockSize) { + var mh$ = cudaOccupancyAvailableDynamicSMemPerBlock.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaOccupancyAvailableDynamicSMemPerBlock", dynamicSmemSize, func, numBlocks, blockSize); + } + return (int)mh$.invokeExact(dynamicSmemSize, func, numBlocks, blockSize); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags$descriptor() { + return cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize, unsigned int flags) + * } + */ + public static MethodHandle cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags$handle() { + return cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize, unsigned int flags) + * } + */ + public static MemorySegment cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags$address() { + return cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize, unsigned int flags) + * } + */ + public static int cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(MemorySegment numBlocks, MemorySegment func, int blockSize, long dynamicSMemSize, int flags) { + var mh$ = cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", numBlocks, func, blockSize, dynamicSMemSize, flags); + } + return (int)mh$.invokeExact(numBlocks, func, blockSize, dynamicSMemSize, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaOccupancyMaxPotentialClusterSize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaOccupancyMaxPotentialClusterSize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxPotentialClusterSize(int *clusterSize, const void *func, const cudaLaunchConfig_t *launchConfig) + * } + */ + public static FunctionDescriptor cudaOccupancyMaxPotentialClusterSize$descriptor() { + return cudaOccupancyMaxPotentialClusterSize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxPotentialClusterSize(int *clusterSize, const void *func, const cudaLaunchConfig_t *launchConfig) + * } + */ + public static MethodHandle cudaOccupancyMaxPotentialClusterSize$handle() { + return cudaOccupancyMaxPotentialClusterSize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxPotentialClusterSize(int *clusterSize, const void *func, const cudaLaunchConfig_t *launchConfig) + * } + */ + public static MemorySegment cudaOccupancyMaxPotentialClusterSize$address() { + return cudaOccupancyMaxPotentialClusterSize.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxPotentialClusterSize(int *clusterSize, const void *func, const cudaLaunchConfig_t *launchConfig) + * } + */ + public static int cudaOccupancyMaxPotentialClusterSize(MemorySegment clusterSize, MemorySegment func, MemorySegment launchConfig) { + var mh$ = cudaOccupancyMaxPotentialClusterSize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaOccupancyMaxPotentialClusterSize", clusterSize, func, launchConfig); + } + return (int)mh$.invokeExact(clusterSize, func, launchConfig); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaOccupancyMaxActiveClusters { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaOccupancyMaxActiveClusters"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveClusters(int *numClusters, const void *func, const cudaLaunchConfig_t *launchConfig) + * } + */ + public static FunctionDescriptor cudaOccupancyMaxActiveClusters$descriptor() { + return cudaOccupancyMaxActiveClusters.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveClusters(int *numClusters, const void *func, const cudaLaunchConfig_t *launchConfig) + * } + */ + public static MethodHandle cudaOccupancyMaxActiveClusters$handle() { + return cudaOccupancyMaxActiveClusters.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveClusters(int *numClusters, const void *func, const cudaLaunchConfig_t *launchConfig) + * } + */ + public static MemorySegment cudaOccupancyMaxActiveClusters$address() { + return cudaOccupancyMaxActiveClusters.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaOccupancyMaxActiveClusters(int *numClusters, const void *func, const cudaLaunchConfig_t *launchConfig) + * } + */ + public static int cudaOccupancyMaxActiveClusters(MemorySegment numClusters, MemorySegment func, MemorySegment launchConfig) { + var mh$ = cudaOccupancyMaxActiveClusters.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaOccupancyMaxActiveClusters", numClusters, func, launchConfig); + } + return (int)mh$.invokeExact(numClusters, func, launchConfig); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMallocManaged { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocManaged"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocManaged(void **devPtr, size_t size, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaMallocManaged$descriptor() { + return cudaMallocManaged.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocManaged(void **devPtr, size_t size, unsigned int flags) + * } + */ + public static MethodHandle cudaMallocManaged$handle() { + return cudaMallocManaged.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocManaged(void **devPtr, size_t size, unsigned int flags) + * } + */ + public static MemorySegment cudaMallocManaged$address() { + return cudaMallocManaged.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMallocManaged(void **devPtr, size_t size, unsigned int flags) + * } + */ + public static int cudaMallocManaged(MemorySegment devPtr, long size, int flags) { + var mh$ = cudaMallocManaged.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMallocManaged", devPtr, size, flags); + } + return (int)mh$.invokeExact(devPtr, size, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMalloc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMalloc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMalloc(void **devPtr, size_t size) + * } + */ + public static FunctionDescriptor cudaMalloc$descriptor() { + return cudaMalloc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMalloc(void **devPtr, size_t size) + * } + */ + public static MethodHandle cudaMalloc$handle() { + return cudaMalloc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMalloc(void **devPtr, size_t size) + * } + */ + public static MemorySegment cudaMalloc$address() { + return cudaMalloc.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMalloc(void **devPtr, size_t size) + * } + */ + public static int cudaMalloc(MemorySegment devPtr, long size) { + var mh$ = cudaMalloc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMalloc", devPtr, size); + } + return (int)mh$.invokeExact(devPtr, size); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMallocHost { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocHost"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocHost(void **ptr, size_t size) + * } + */ + public static FunctionDescriptor cudaMallocHost$descriptor() { + return cudaMallocHost.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocHost(void **ptr, size_t size) + * } + */ + public static MethodHandle cudaMallocHost$handle() { + return cudaMallocHost.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocHost(void **ptr, size_t size) + * } + */ + public static MemorySegment cudaMallocHost$address() { + return cudaMallocHost.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMallocHost(void **ptr, size_t size) + * } + */ + public static int cudaMallocHost(MemorySegment ptr, long size) { + var mh$ = cudaMallocHost.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMallocHost", ptr, size); + } + return (int)mh$.invokeExact(ptr, size); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMallocPitch { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocPitch"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height) + * } + */ + public static FunctionDescriptor cudaMallocPitch$descriptor() { + return cudaMallocPitch.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height) + * } + */ + public static MethodHandle cudaMallocPitch$handle() { + return cudaMallocPitch.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height) + * } + */ + public static MemorySegment cudaMallocPitch$address() { + return cudaMallocPitch.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height) + * } + */ + public static int cudaMallocPitch(MemorySegment devPtr, MemorySegment pitch, long width, long height) { + var mh$ = cudaMallocPitch.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMallocPitch", devPtr, pitch, width, height); + } + return (int)mh$.invokeExact(devPtr, pitch, width, height); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMallocArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, size_t width, size_t height, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaMallocArray$descriptor() { + return cudaMallocArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, size_t width, size_t height, unsigned int flags) + * } + */ + public static MethodHandle cudaMallocArray$handle() { + return cudaMallocArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, size_t width, size_t height, unsigned int flags) + * } + */ + public static MemorySegment cudaMallocArray$address() { + return cudaMallocArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMallocArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, size_t width, size_t height, unsigned int flags) + * } + */ + public static int cudaMallocArray(MemorySegment array, MemorySegment desc, long width, long height, int flags) { + var mh$ = cudaMallocArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMallocArray", array, desc, width, height, flags); + } + return (int)mh$.invokeExact(array, desc, width, height, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFree { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFree"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFree(void *devPtr) + * } + */ + public static FunctionDescriptor cudaFree$descriptor() { + return cudaFree.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFree(void *devPtr) + * } + */ + public static MethodHandle cudaFree$handle() { + return cudaFree.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFree(void *devPtr) + * } + */ + public static MemorySegment cudaFree$address() { + return cudaFree.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFree(void *devPtr) + * } + */ + public static int cudaFree(MemorySegment devPtr) { + var mh$ = cudaFree.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFree", devPtr); + } + return (int)mh$.invokeExact(devPtr); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFreeHost { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFreeHost"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeHost(void *ptr) + * } + */ + public static FunctionDescriptor cudaFreeHost$descriptor() { + return cudaFreeHost.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeHost(void *ptr) + * } + */ + public static MethodHandle cudaFreeHost$handle() { + return cudaFreeHost.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeHost(void *ptr) + * } + */ + public static MemorySegment cudaFreeHost$address() { + return cudaFreeHost.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFreeHost(void *ptr) + * } + */ + public static int cudaFreeHost(MemorySegment ptr) { + var mh$ = cudaFreeHost.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFreeHost", ptr); + } + return (int)mh$.invokeExact(ptr); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFreeArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFreeArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeArray(cudaArray_t array) + * } + */ + public static FunctionDescriptor cudaFreeArray$descriptor() { + return cudaFreeArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeArray(cudaArray_t array) + * } + */ + public static MethodHandle cudaFreeArray$handle() { + return cudaFreeArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeArray(cudaArray_t array) + * } + */ + public static MemorySegment cudaFreeArray$address() { + return cudaFreeArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFreeArray(cudaArray_t array) + * } + */ + public static int cudaFreeArray(MemorySegment array) { + var mh$ = cudaFreeArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFreeArray", array); + } + return (int)mh$.invokeExact(array); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFreeMipmappedArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFreeMipmappedArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) + * } + */ + public static FunctionDescriptor cudaFreeMipmappedArray$descriptor() { + return cudaFreeMipmappedArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) + * } + */ + public static MethodHandle cudaFreeMipmappedArray$handle() { + return cudaFreeMipmappedArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) + * } + */ + public static MemorySegment cudaFreeMipmappedArray$address() { + return cudaFreeMipmappedArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) + * } + */ + public static int cudaFreeMipmappedArray(MemorySegment mipmappedArray) { + var mh$ = cudaFreeMipmappedArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFreeMipmappedArray", mipmappedArray); + } + return (int)mh$.invokeExact(mipmappedArray); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaHostAlloc { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaHostAlloc"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaHostAlloc(void **pHost, size_t size, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaHostAlloc$descriptor() { + return cudaHostAlloc.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaHostAlloc(void **pHost, size_t size, unsigned int flags) + * } + */ + public static MethodHandle cudaHostAlloc$handle() { + return cudaHostAlloc.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaHostAlloc(void **pHost, size_t size, unsigned int flags) + * } + */ + public static MemorySegment cudaHostAlloc$address() { + return cudaHostAlloc.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaHostAlloc(void **pHost, size_t size, unsigned int flags) + * } + */ + public static int cudaHostAlloc(MemorySegment pHost, long size, int flags) { + var mh$ = cudaHostAlloc.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaHostAlloc", pHost, size, flags); + } + return (int)mh$.invokeExact(pHost, size, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaHostRegister { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaHostRegister"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaHostRegister(void *ptr, size_t size, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaHostRegister$descriptor() { + return cudaHostRegister.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaHostRegister(void *ptr, size_t size, unsigned int flags) + * } + */ + public static MethodHandle cudaHostRegister$handle() { + return cudaHostRegister.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaHostRegister(void *ptr, size_t size, unsigned int flags) + * } + */ + public static MemorySegment cudaHostRegister$address() { + return cudaHostRegister.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaHostRegister(void *ptr, size_t size, unsigned int flags) + * } + */ + public static int cudaHostRegister(MemorySegment ptr, long size, int flags) { + var mh$ = cudaHostRegister.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaHostRegister", ptr, size, flags); + } + return (int)mh$.invokeExact(ptr, size, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaHostUnregister { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaHostUnregister"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaHostUnregister(void *ptr) + * } + */ + public static FunctionDescriptor cudaHostUnregister$descriptor() { + return cudaHostUnregister.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaHostUnregister(void *ptr) + * } + */ + public static MethodHandle cudaHostUnregister$handle() { + return cudaHostUnregister.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaHostUnregister(void *ptr) + * } + */ + public static MemorySegment cudaHostUnregister$address() { + return cudaHostUnregister.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaHostUnregister(void *ptr) + * } + */ + public static int cudaHostUnregister(MemorySegment ptr) { + var mh$ = cudaHostUnregister.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaHostUnregister", ptr); + } + return (int)mh$.invokeExact(ptr); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaHostGetDevicePointer { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaHostGetDevicePointer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaHostGetDevicePointer(void **pDevice, void *pHost, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaHostGetDevicePointer$descriptor() { + return cudaHostGetDevicePointer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaHostGetDevicePointer(void **pDevice, void *pHost, unsigned int flags) + * } + */ + public static MethodHandle cudaHostGetDevicePointer$handle() { + return cudaHostGetDevicePointer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaHostGetDevicePointer(void **pDevice, void *pHost, unsigned int flags) + * } + */ + public static MemorySegment cudaHostGetDevicePointer$address() { + return cudaHostGetDevicePointer.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaHostGetDevicePointer(void **pDevice, void *pHost, unsigned int flags) + * } + */ + public static int cudaHostGetDevicePointer(MemorySegment pDevice, MemorySegment pHost, int flags) { + var mh$ = cudaHostGetDevicePointer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaHostGetDevicePointer", pDevice, pHost, flags); + } + return (int)mh$.invokeExact(pDevice, pHost, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaHostGetFlags { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaHostGetFlags"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaHostGetFlags(unsigned int *pFlags, void *pHost) + * } + */ + public static FunctionDescriptor cudaHostGetFlags$descriptor() { + return cudaHostGetFlags.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaHostGetFlags(unsigned int *pFlags, void *pHost) + * } + */ + public static MethodHandle cudaHostGetFlags$handle() { + return cudaHostGetFlags.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaHostGetFlags(unsigned int *pFlags, void *pHost) + * } + */ + public static MemorySegment cudaHostGetFlags$address() { + return cudaHostGetFlags.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaHostGetFlags(unsigned int *pFlags, void *pHost) + * } + */ + public static int cudaHostGetFlags(MemorySegment pFlags, MemorySegment pHost) { + var mh$ = cudaHostGetFlags.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaHostGetFlags", pFlags, pHost); + } + return (int)mh$.invokeExact(pFlags, pHost); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMalloc3D { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + cudaExtent.layout() + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMalloc3D"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMalloc3D(struct cudaPitchedPtr *pitchedDevPtr, struct cudaExtent extent) + * } + */ + public static FunctionDescriptor cudaMalloc3D$descriptor() { + return cudaMalloc3D.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMalloc3D(struct cudaPitchedPtr *pitchedDevPtr, struct cudaExtent extent) + * } + */ + public static MethodHandle cudaMalloc3D$handle() { + return cudaMalloc3D.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMalloc3D(struct cudaPitchedPtr *pitchedDevPtr, struct cudaExtent extent) + * } + */ + public static MemorySegment cudaMalloc3D$address() { + return cudaMalloc3D.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMalloc3D(struct cudaPitchedPtr *pitchedDevPtr, struct cudaExtent extent) + * } + */ + public static int cudaMalloc3D(MemorySegment pitchedDevPtr, MemorySegment extent) { + var mh$ = cudaMalloc3D.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMalloc3D", pitchedDevPtr, extent); + } + return (int)mh$.invokeExact(pitchedDevPtr, extent); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMalloc3DArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + cudaExtent.layout(), + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMalloc3DArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMalloc3DArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaMalloc3DArray$descriptor() { + return cudaMalloc3DArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMalloc3DArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int flags) + * } + */ + public static MethodHandle cudaMalloc3DArray$handle() { + return cudaMalloc3DArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMalloc3DArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int flags) + * } + */ + public static MemorySegment cudaMalloc3DArray$address() { + return cudaMalloc3DArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMalloc3DArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int flags) + * } + */ + public static int cudaMalloc3DArray(MemorySegment array, MemorySegment desc, MemorySegment extent, int flags) { + var mh$ = cudaMalloc3DArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMalloc3DArray", array, desc, extent, flags); + } + return (int)mh$.invokeExact(array, desc, extent, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMallocMipmappedArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + cudaExtent.layout(), + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocMipmappedArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int numLevels, unsigned int flags) + * } + */ + public static FunctionDescriptor cudaMallocMipmappedArray$descriptor() { + return cudaMallocMipmappedArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int numLevels, unsigned int flags) + * } + */ + public static MethodHandle cudaMallocMipmappedArray$handle() { + return cudaMallocMipmappedArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int numLevels, unsigned int flags) + * } + */ + public static MemorySegment cudaMallocMipmappedArray$address() { + return cudaMallocMipmappedArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int numLevels, unsigned int flags) + * } + */ + public static int cudaMallocMipmappedArray(MemorySegment mipmappedArray, MemorySegment desc, MemorySegment extent, int numLevels, int flags) { + var mh$ = cudaMallocMipmappedArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMallocMipmappedArray", mipmappedArray, desc, extent, numLevels, flags); + } + return (int)mh$.invokeExact(mipmappedArray, desc, extent, numLevels, flags); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetMipmappedArrayLevel { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetMipmappedArrayLevel"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t *levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) + * } + */ + public static FunctionDescriptor cudaGetMipmappedArrayLevel$descriptor() { + return cudaGetMipmappedArrayLevel.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t *levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) + * } + */ + public static MethodHandle cudaGetMipmappedArrayLevel$handle() { + return cudaGetMipmappedArrayLevel.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t *levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) + * } + */ + public static MemorySegment cudaGetMipmappedArrayLevel$address() { + return cudaGetMipmappedArrayLevel.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t *levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) + * } + */ + public static int cudaGetMipmappedArrayLevel(MemorySegment levelArray, MemorySegment mipmappedArray, int level) { + var mh$ = cudaGetMipmappedArrayLevel.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetMipmappedArrayLevel", levelArray, mipmappedArray, level); + } + return (int)mh$.invokeExact(levelArray, mipmappedArray, level); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy3D { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy3D"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3D(const struct cudaMemcpy3DParms *p) + * } + */ + public static FunctionDescriptor cudaMemcpy3D$descriptor() { + return cudaMemcpy3D.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3D(const struct cudaMemcpy3DParms *p) + * } + */ + public static MethodHandle cudaMemcpy3D$handle() { + return cudaMemcpy3D.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3D(const struct cudaMemcpy3DParms *p) + * } + */ + public static MemorySegment cudaMemcpy3D$address() { + return cudaMemcpy3D.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3D(const struct cudaMemcpy3DParms *p) + * } + */ + public static int cudaMemcpy3D(MemorySegment p) { + var mh$ = cudaMemcpy3D.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy3D", p); + } + return (int)mh$.invokeExact(p); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy3DPeer { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy3DPeer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DPeer(const struct cudaMemcpy3DPeerParms *p) + * } + */ + public static FunctionDescriptor cudaMemcpy3DPeer$descriptor() { + return cudaMemcpy3DPeer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DPeer(const struct cudaMemcpy3DPeerParms *p) + * } + */ + public static MethodHandle cudaMemcpy3DPeer$handle() { + return cudaMemcpy3DPeer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DPeer(const struct cudaMemcpy3DPeerParms *p) + * } + */ + public static MemorySegment cudaMemcpy3DPeer$address() { + return cudaMemcpy3DPeer.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DPeer(const struct cudaMemcpy3DPeerParms *p) + * } + */ + public static int cudaMemcpy3DPeer(MemorySegment p) { + var mh$ = cudaMemcpy3DPeer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy3DPeer", p); + } + return (int)mh$.invokeExact(p); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy3DAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy3DAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DAsync(const struct cudaMemcpy3DParms *p, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpy3DAsync$descriptor() { + return cudaMemcpy3DAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DAsync(const struct cudaMemcpy3DParms *p, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpy3DAsync$handle() { + return cudaMemcpy3DAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DAsync(const struct cudaMemcpy3DParms *p, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpy3DAsync$address() { + return cudaMemcpy3DAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DAsync(const struct cudaMemcpy3DParms *p, cudaStream_t stream) + * } + */ + public static int cudaMemcpy3DAsync(MemorySegment p, MemorySegment stream) { + var mh$ = cudaMemcpy3DAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy3DAsync", p, stream); + } + return (int)mh$.invokeExact(p, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy3DPeerAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy3DPeerAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DPeerAsync(const struct cudaMemcpy3DPeerParms *p, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpy3DPeerAsync$descriptor() { + return cudaMemcpy3DPeerAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DPeerAsync(const struct cudaMemcpy3DPeerParms *p, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpy3DPeerAsync$handle() { + return cudaMemcpy3DPeerAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DPeerAsync(const struct cudaMemcpy3DPeerParms *p, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpy3DPeerAsync$address() { + return cudaMemcpy3DPeerAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy3DPeerAsync(const struct cudaMemcpy3DPeerParms *p, cudaStream_t stream) + * } + */ + public static int cudaMemcpy3DPeerAsync(MemorySegment p, MemorySegment stream) { + var mh$ = cudaMemcpy3DPeerAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy3DPeerAsync", p, stream); + } + return (int)mh$.invokeExact(p, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemGetInfo { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemGetInfo"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemGetInfo(size_t *free, size_t *total) + * } + */ + public static FunctionDescriptor cudaMemGetInfo$descriptor() { + return cudaMemGetInfo.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemGetInfo(size_t *free, size_t *total) + * } + */ + public static MethodHandle cudaMemGetInfo$handle() { + return cudaMemGetInfo.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemGetInfo(size_t *free, size_t *total) + * } + */ + public static MemorySegment cudaMemGetInfo$address() { + return cudaMemGetInfo.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemGetInfo(size_t *free, size_t *total) + * } + */ + public static int cudaMemGetInfo(MemorySegment free, MemorySegment total) { + var mh$ = cudaMemGetInfo.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemGetInfo", free, total); + } + return (int)mh$.invokeExact(free, total); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaArrayGetInfo { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaArrayGetInfo"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetInfo(struct cudaChannelFormatDesc *desc, struct cudaExtent *extent, unsigned int *flags, cudaArray_t array) + * } + */ + public static FunctionDescriptor cudaArrayGetInfo$descriptor() { + return cudaArrayGetInfo.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetInfo(struct cudaChannelFormatDesc *desc, struct cudaExtent *extent, unsigned int *flags, cudaArray_t array) + * } + */ + public static MethodHandle cudaArrayGetInfo$handle() { + return cudaArrayGetInfo.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetInfo(struct cudaChannelFormatDesc *desc, struct cudaExtent *extent, unsigned int *flags, cudaArray_t array) + * } + */ + public static MemorySegment cudaArrayGetInfo$address() { + return cudaArrayGetInfo.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetInfo(struct cudaChannelFormatDesc *desc, struct cudaExtent *extent, unsigned int *flags, cudaArray_t array) + * } + */ + public static int cudaArrayGetInfo(MemorySegment desc, MemorySegment extent, MemorySegment flags, MemorySegment array) { + var mh$ = cudaArrayGetInfo.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaArrayGetInfo", desc, extent, flags, array); + } + return (int)mh$.invokeExact(desc, extent, flags, array); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaArrayGetPlane { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaArrayGetPlane"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetPlane(cudaArray_t *pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) + * } + */ + public static FunctionDescriptor cudaArrayGetPlane$descriptor() { + return cudaArrayGetPlane.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetPlane(cudaArray_t *pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) + * } + */ + public static MethodHandle cudaArrayGetPlane$handle() { + return cudaArrayGetPlane.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetPlane(cudaArray_t *pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) + * } + */ + public static MemorySegment cudaArrayGetPlane$address() { + return cudaArrayGetPlane.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetPlane(cudaArray_t *pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) + * } + */ + public static int cudaArrayGetPlane(MemorySegment pPlaneArray, MemorySegment hArray, int planeIdx) { + var mh$ = cudaArrayGetPlane.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaArrayGetPlane", pPlaneArray, hArray, planeIdx); + } + return (int)mh$.invokeExact(pPlaneArray, hArray, planeIdx); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaArrayGetMemoryRequirements { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaArrayGetMemoryRequirements"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaArray_t array, int device) + * } + */ + public static FunctionDescriptor cudaArrayGetMemoryRequirements$descriptor() { + return cudaArrayGetMemoryRequirements.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaArray_t array, int device) + * } + */ + public static MethodHandle cudaArrayGetMemoryRequirements$handle() { + return cudaArrayGetMemoryRequirements.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaArray_t array, int device) + * } + */ + public static MemorySegment cudaArrayGetMemoryRequirements$address() { + return cudaArrayGetMemoryRequirements.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaArray_t array, int device) + * } + */ + public static int cudaArrayGetMemoryRequirements(MemorySegment memoryRequirements, MemorySegment array, int device) { + var mh$ = cudaArrayGetMemoryRequirements.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaArrayGetMemoryRequirements", memoryRequirements, array, device); + } + return (int)mh$.invokeExact(memoryRequirements, array, device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMipmappedArrayGetMemoryRequirements { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMipmappedArrayGetMemoryRequirements"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMipmappedArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaMipmappedArray_t mipmap, int device) + * } + */ + public static FunctionDescriptor cudaMipmappedArrayGetMemoryRequirements$descriptor() { + return cudaMipmappedArrayGetMemoryRequirements.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMipmappedArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaMipmappedArray_t mipmap, int device) + * } + */ + public static MethodHandle cudaMipmappedArrayGetMemoryRequirements$handle() { + return cudaMipmappedArrayGetMemoryRequirements.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMipmappedArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaMipmappedArray_t mipmap, int device) + * } + */ + public static MemorySegment cudaMipmappedArrayGetMemoryRequirements$address() { + return cudaMipmappedArrayGetMemoryRequirements.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMipmappedArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaMipmappedArray_t mipmap, int device) + * } + */ + public static int cudaMipmappedArrayGetMemoryRequirements(MemorySegment memoryRequirements, MemorySegment mipmap, int device) { + var mh$ = cudaMipmappedArrayGetMemoryRequirements.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMipmappedArrayGetMemoryRequirements", memoryRequirements, mipmap, device); + } + return (int)mh$.invokeExact(memoryRequirements, mipmap, device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaArrayGetSparseProperties { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaArrayGetSparseProperties"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaArray_t array) + * } + */ + public static FunctionDescriptor cudaArrayGetSparseProperties$descriptor() { + return cudaArrayGetSparseProperties.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaArray_t array) + * } + */ + public static MethodHandle cudaArrayGetSparseProperties$handle() { + return cudaArrayGetSparseProperties.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaArray_t array) + * } + */ + public static MemorySegment cudaArrayGetSparseProperties$address() { + return cudaArrayGetSparseProperties.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaArray_t array) + * } + */ + public static int cudaArrayGetSparseProperties(MemorySegment sparseProperties, MemorySegment array) { + var mh$ = cudaArrayGetSparseProperties.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaArrayGetSparseProperties", sparseProperties, array); + } + return (int)mh$.invokeExact(sparseProperties, array); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMipmappedArrayGetSparseProperties { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMipmappedArrayGetSparseProperties"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMipmappedArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaMipmappedArray_t mipmap) + * } + */ + public static FunctionDescriptor cudaMipmappedArrayGetSparseProperties$descriptor() { + return cudaMipmappedArrayGetSparseProperties.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMipmappedArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaMipmappedArray_t mipmap) + * } + */ + public static MethodHandle cudaMipmappedArrayGetSparseProperties$handle() { + return cudaMipmappedArrayGetSparseProperties.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMipmappedArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaMipmappedArray_t mipmap) + * } + */ + public static MemorySegment cudaMipmappedArrayGetSparseProperties$address() { + return cudaMipmappedArrayGetSparseProperties.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMipmappedArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaMipmappedArray_t mipmap) + * } + */ + public static int cudaMipmappedArrayGetSparseProperties(MemorySegment sparseProperties, MemorySegment mipmap) { + var mh$ = cudaMipmappedArrayGetSparseProperties.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMipmappedArrayGetSparseProperties", sparseProperties, mipmap); + } + return (int)mh$.invokeExact(sparseProperties, mipmap); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaMemcpy$descriptor() { + return cudaMemcpy.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaMemcpy$handle() { + return cudaMemcpy.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaMemcpy$address() { + return cudaMemcpy.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static int cudaMemcpy(MemorySegment dst, MemorySegment src, long count, int kind) { + var mh$ = cudaMemcpy.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy", dst, src, count, kind); + } + return (int)mh$.invokeExact(dst, src, count, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyPeer { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyPeer"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyPeer(void *dst, int dstDevice, const void *src, int srcDevice, size_t count) + * } + */ + public static FunctionDescriptor cudaMemcpyPeer$descriptor() { + return cudaMemcpyPeer.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyPeer(void *dst, int dstDevice, const void *src, int srcDevice, size_t count) + * } + */ + public static MethodHandle cudaMemcpyPeer$handle() { + return cudaMemcpyPeer.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyPeer(void *dst, int dstDevice, const void *src, int srcDevice, size_t count) + * } + */ + public static MemorySegment cudaMemcpyPeer$address() { + return cudaMemcpyPeer.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyPeer(void *dst, int dstDevice, const void *src, int srcDevice, size_t count) + * } + */ + public static int cudaMemcpyPeer(MemorySegment dst, int dstDevice, MemorySegment src, int srcDevice, long count) { + var mh$ = cudaMemcpyPeer.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyPeer", dst, dstDevice, src, srcDevice, count); + } + return (int)mh$.invokeExact(dst, dstDevice, src, srcDevice, count); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy2D { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2D"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaMemcpy2D$descriptor() { + return cudaMemcpy2D.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaMemcpy2D$handle() { + return cudaMemcpy2D.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaMemcpy2D$address() { + return cudaMemcpy2D.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static int cudaMemcpy2D(MemorySegment dst, long dpitch, MemorySegment src, long spitch, long width, long height, int kind) { + var mh$ = cudaMemcpy2D.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy2D", dst, dpitch, src, spitch, width, height, kind); + } + return (int)mh$.invokeExact(dst, dpitch, src, spitch, width, height, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy2DToArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DToArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaMemcpy2DToArray$descriptor() { + return cudaMemcpy2DToArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaMemcpy2DToArray$handle() { + return cudaMemcpy2DToArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaMemcpy2DToArray$address() { + return cudaMemcpy2DToArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static int cudaMemcpy2DToArray(MemorySegment dst, long wOffset, long hOffset, MemorySegment src, long spitch, long width, long height, int kind) { + var mh$ = cudaMemcpy2DToArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy2DToArray", dst, wOffset, hOffset, src, spitch, width, height, kind); + } + return (int)mh$.invokeExact(dst, wOffset, hOffset, src, spitch, width, height, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy2DFromArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DFromArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DFromArray(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaMemcpy2DFromArray$descriptor() { + return cudaMemcpy2DFromArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DFromArray(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaMemcpy2DFromArray$handle() { + return cudaMemcpy2DFromArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DFromArray(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaMemcpy2DFromArray$address() { + return cudaMemcpy2DFromArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DFromArray(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static int cudaMemcpy2DFromArray(MemorySegment dst, long dpitch, MemorySegment src, long wOffset, long hOffset, long width, long height, int kind) { + var mh$ = cudaMemcpy2DFromArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy2DFromArray", dst, dpitch, src, wOffset, hOffset, width, height, kind); + } + return (int)mh$.invokeExact(dst, dpitch, src, wOffset, hOffset, width, height, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy2DArrayToArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DArrayToArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaMemcpy2DArrayToArray$descriptor() { + return cudaMemcpy2DArrayToArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaMemcpy2DArrayToArray$handle() { + return cudaMemcpy2DArrayToArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaMemcpy2DArrayToArray$address() { + return cudaMemcpy2DArrayToArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, enum cudaMemcpyKind kind) + * } + */ + public static int cudaMemcpy2DArrayToArray(MemorySegment dst, long wOffsetDst, long hOffsetDst, MemorySegment src, long wOffsetSrc, long hOffsetSrc, long width, long height, int kind) { + var mh$ = cudaMemcpy2DArrayToArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy2DArrayToArray", dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind); + } + return (int)mh$.invokeExact(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyToSymbol { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyToSymbol"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToSymbol(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaMemcpyToSymbol$descriptor() { + return cudaMemcpyToSymbol.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToSymbol(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaMemcpyToSymbol$handle() { + return cudaMemcpyToSymbol.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToSymbol(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaMemcpyToSymbol$address() { + return cudaMemcpyToSymbol.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToSymbol(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static int cudaMemcpyToSymbol(MemorySegment symbol, MemorySegment src, long count, long offset, int kind) { + var mh$ = cudaMemcpyToSymbol.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyToSymbol", symbol, src, count, offset, kind); + } + return (int)mh$.invokeExact(symbol, src, count, offset, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyFromSymbol { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyFromSymbol"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromSymbol(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaMemcpyFromSymbol$descriptor() { + return cudaMemcpyFromSymbol.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromSymbol(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaMemcpyFromSymbol$handle() { + return cudaMemcpyFromSymbol.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromSymbol(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaMemcpyFromSymbol$address() { + return cudaMemcpyFromSymbol.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromSymbol(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) + * } + */ + public static int cudaMemcpyFromSymbol(MemorySegment dst, MemorySegment symbol, long count, long offset, int kind) { + var mh$ = cudaMemcpyFromSymbol.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyFromSymbol", dst, symbol, count, offset, kind); + } + return (int)mh$.invokeExact(dst, symbol, count, offset, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyAsync(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpyAsync$descriptor() { + return cudaMemcpyAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyAsync(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpyAsync$handle() { + return cudaMemcpyAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyAsync(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpyAsync$address() { + return cudaMemcpyAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyAsync(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static int cudaMemcpyAsync(MemorySegment dst, MemorySegment src, long count, int kind, MemorySegment stream) { + var mh$ = cudaMemcpyAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyAsync", dst, src, count, kind, stream); + } + return (int)mh$.invokeExact(dst, src, count, kind, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyPeerAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyPeerAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyPeerAsync(void *dst, int dstDevice, const void *src, int srcDevice, size_t count, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpyPeerAsync$descriptor() { + return cudaMemcpyPeerAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyPeerAsync(void *dst, int dstDevice, const void *src, int srcDevice, size_t count, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpyPeerAsync$handle() { + return cudaMemcpyPeerAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyPeerAsync(void *dst, int dstDevice, const void *src, int srcDevice, size_t count, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpyPeerAsync$address() { + return cudaMemcpyPeerAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyPeerAsync(void *dst, int dstDevice, const void *src, int srcDevice, size_t count, cudaStream_t stream) + * } + */ + public static int cudaMemcpyPeerAsync(MemorySegment dst, int dstDevice, MemorySegment src, int srcDevice, long count, MemorySegment stream) { + var mh$ = cudaMemcpyPeerAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyPeerAsync", dst, dstDevice, src, srcDevice, count, stream); + } + return (int)mh$.invokeExact(dst, dstDevice, src, srcDevice, count, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy2DAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpy2DAsync$descriptor() { + return cudaMemcpy2DAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpy2DAsync$handle() { + return cudaMemcpy2DAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpy2DAsync$address() { + return cudaMemcpy2DAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static int cudaMemcpy2DAsync(MemorySegment dst, long dpitch, MemorySegment src, long spitch, long width, long height, int kind, MemorySegment stream) { + var mh$ = cudaMemcpy2DAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy2DAsync", dst, dpitch, src, spitch, width, height, kind, stream); + } + return (int)mh$.invokeExact(dst, dpitch, src, spitch, width, height, kind, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy2DToArrayAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DToArrayAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpy2DToArrayAsync$descriptor() { + return cudaMemcpy2DToArrayAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpy2DToArrayAsync$handle() { + return cudaMemcpy2DToArrayAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpy2DToArrayAsync$address() { + return cudaMemcpy2DToArrayAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static int cudaMemcpy2DToArrayAsync(MemorySegment dst, long wOffset, long hOffset, MemorySegment src, long spitch, long width, long height, int kind, MemorySegment stream) { + var mh$ = cudaMemcpy2DToArrayAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy2DToArrayAsync", dst, wOffset, hOffset, src, spitch, width, height, kind, stream); + } + return (int)mh$.invokeExact(dst, wOffset, hOffset, src, spitch, width, height, kind, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpy2DFromArrayAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DFromArrayAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DFromArrayAsync(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpy2DFromArrayAsync$descriptor() { + return cudaMemcpy2DFromArrayAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DFromArrayAsync(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpy2DFromArrayAsync$handle() { + return cudaMemcpy2DFromArrayAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DFromArrayAsync(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpy2DFromArrayAsync$address() { + return cudaMemcpy2DFromArrayAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpy2DFromArrayAsync(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static int cudaMemcpy2DFromArrayAsync(MemorySegment dst, long dpitch, MemorySegment src, long wOffset, long hOffset, long width, long height, int kind, MemorySegment stream) { + var mh$ = cudaMemcpy2DFromArrayAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpy2DFromArrayAsync", dst, dpitch, src, wOffset, hOffset, width, height, kind, stream); + } + return (int)mh$.invokeExact(dst, dpitch, src, wOffset, hOffset, width, height, kind, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyToSymbolAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyToSymbolAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToSymbolAsync(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpyToSymbolAsync$descriptor() { + return cudaMemcpyToSymbolAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToSymbolAsync(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpyToSymbolAsync$handle() { + return cudaMemcpyToSymbolAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToSymbolAsync(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpyToSymbolAsync$address() { + return cudaMemcpyToSymbolAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToSymbolAsync(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static int cudaMemcpyToSymbolAsync(MemorySegment symbol, MemorySegment src, long count, long offset, int kind, MemorySegment stream) { + var mh$ = cudaMemcpyToSymbolAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyToSymbolAsync", symbol, src, count, offset, kind, stream); + } + return (int)mh$.invokeExact(symbol, src, count, offset, kind, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyFromSymbolAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyFromSymbolAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromSymbolAsync(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpyFromSymbolAsync$descriptor() { + return cudaMemcpyFromSymbolAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromSymbolAsync(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpyFromSymbolAsync$handle() { + return cudaMemcpyFromSymbolAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromSymbolAsync(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpyFromSymbolAsync$address() { + return cudaMemcpyFromSymbolAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromSymbolAsync(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static int cudaMemcpyFromSymbolAsync(MemorySegment dst, MemorySegment symbol, long count, long offset, int kind, MemorySegment stream) { + var mh$ = cudaMemcpyFromSymbolAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyFromSymbolAsync", dst, symbol, count, offset, kind, stream); + } + return (int)mh$.invokeExact(dst, symbol, count, offset, kind, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemset { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemset"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset(void *devPtr, int value, size_t count) + * } + */ + public static FunctionDescriptor cudaMemset$descriptor() { + return cudaMemset.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset(void *devPtr, int value, size_t count) + * } + */ + public static MethodHandle cudaMemset$handle() { + return cudaMemset.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset(void *devPtr, int value, size_t count) + * } + */ + public static MemorySegment cudaMemset$address() { + return cudaMemset.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemset(void *devPtr, int value, size_t count) + * } + */ + public static int cudaMemset(MemorySegment devPtr, int value, long count) { + var mh$ = cudaMemset.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemset", devPtr, value, count); + } + return (int)mh$.invokeExact(devPtr, value, count); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemset2D { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemset2D"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset2D(void *devPtr, size_t pitch, int value, size_t width, size_t height) + * } + */ + public static FunctionDescriptor cudaMemset2D$descriptor() { + return cudaMemset2D.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset2D(void *devPtr, size_t pitch, int value, size_t width, size_t height) + * } + */ + public static MethodHandle cudaMemset2D$handle() { + return cudaMemset2D.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset2D(void *devPtr, size_t pitch, int value, size_t width, size_t height) + * } + */ + public static MemorySegment cudaMemset2D$address() { + return cudaMemset2D.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemset2D(void *devPtr, size_t pitch, int value, size_t width, size_t height) + * } + */ + public static int cudaMemset2D(MemorySegment devPtr, long pitch, int value, long width, long height) { + var mh$ = cudaMemset2D.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemset2D", devPtr, pitch, value, width, height); + } + return (int)mh$.invokeExact(devPtr, pitch, value, width, height); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemset3D { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + cudaPitchedPtr.layout(), + PanamaFFMAPI.C_INT, + cudaExtent.layout() + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemset3D"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset3D(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent) + * } + */ + public static FunctionDescriptor cudaMemset3D$descriptor() { + return cudaMemset3D.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset3D(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent) + * } + */ + public static MethodHandle cudaMemset3D$handle() { + return cudaMemset3D.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset3D(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent) + * } + */ + public static MemorySegment cudaMemset3D$address() { + return cudaMemset3D.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemset3D(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent) + * } + */ + public static int cudaMemset3D(MemorySegment pitchedDevPtr, int value, MemorySegment extent) { + var mh$ = cudaMemset3D.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemset3D", pitchedDevPtr, value, extent); + } + return (int)mh$.invokeExact(pitchedDevPtr, value, extent); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemsetAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemsetAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemsetAsync(void *devPtr, int value, size_t count, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemsetAsync$descriptor() { + return cudaMemsetAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemsetAsync(void *devPtr, int value, size_t count, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemsetAsync$handle() { + return cudaMemsetAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemsetAsync(void *devPtr, int value, size_t count, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemsetAsync$address() { + return cudaMemsetAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemsetAsync(void *devPtr, int value, size_t count, cudaStream_t stream) + * } + */ + public static int cudaMemsetAsync(MemorySegment devPtr, int value, long count, MemorySegment stream) { + var mh$ = cudaMemsetAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemsetAsync", devPtr, value, count, stream); + } + return (int)mh$.invokeExact(devPtr, value, count, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemset2DAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemset2DAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset2DAsync(void *devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemset2DAsync$descriptor() { + return cudaMemset2DAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset2DAsync(void *devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemset2DAsync$handle() { + return cudaMemset2DAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset2DAsync(void *devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemset2DAsync$address() { + return cudaMemset2DAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemset2DAsync(void *devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) + * } + */ + public static int cudaMemset2DAsync(MemorySegment devPtr, long pitch, int value, long width, long height, MemorySegment stream) { + var mh$ = cudaMemset2DAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemset2DAsync", devPtr, pitch, value, width, height, stream); + } + return (int)mh$.invokeExact(devPtr, pitch, value, width, height, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemset3DAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + cudaPitchedPtr.layout(), + PanamaFFMAPI.C_INT, + cudaExtent.layout(), + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemset3DAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset3DAsync(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemset3DAsync$descriptor() { + return cudaMemset3DAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset3DAsync(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemset3DAsync$handle() { + return cudaMemset3DAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemset3DAsync(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemset3DAsync$address() { + return cudaMemset3DAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemset3DAsync(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent, cudaStream_t stream) + * } + */ + public static int cudaMemset3DAsync(MemorySegment pitchedDevPtr, int value, MemorySegment extent, MemorySegment stream) { + var mh$ = cudaMemset3DAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemset3DAsync", pitchedDevPtr, value, extent, stream); + } + return (int)mh$.invokeExact(pitchedDevPtr, value, extent, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetSymbolAddress { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetSymbolAddress"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetSymbolAddress(void **devPtr, const void *symbol) + * } + */ + public static FunctionDescriptor cudaGetSymbolAddress$descriptor() { + return cudaGetSymbolAddress.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetSymbolAddress(void **devPtr, const void *symbol) + * } + */ + public static MethodHandle cudaGetSymbolAddress$handle() { + return cudaGetSymbolAddress.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetSymbolAddress(void **devPtr, const void *symbol) + * } + */ + public static MemorySegment cudaGetSymbolAddress$address() { + return cudaGetSymbolAddress.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetSymbolAddress(void **devPtr, const void *symbol) + * } + */ + public static int cudaGetSymbolAddress(MemorySegment devPtr, MemorySegment symbol) { + var mh$ = cudaGetSymbolAddress.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetSymbolAddress", devPtr, symbol); + } + return (int)mh$.invokeExact(devPtr, symbol); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaGetSymbolSize { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetSymbolSize"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaGetSymbolSize(size_t *size, const void *symbol) + * } + */ + public static FunctionDescriptor cudaGetSymbolSize$descriptor() { + return cudaGetSymbolSize.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaGetSymbolSize(size_t *size, const void *symbol) + * } + */ + public static MethodHandle cudaGetSymbolSize$handle() { + return cudaGetSymbolSize.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaGetSymbolSize(size_t *size, const void *symbol) + * } + */ + public static MemorySegment cudaGetSymbolSize$address() { + return cudaGetSymbolSize.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaGetSymbolSize(size_t *size, const void *symbol) + * } + */ + public static int cudaGetSymbolSize(MemorySegment size, MemorySegment symbol) { + var mh$ = cudaGetSymbolSize.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaGetSymbolSize", size, symbol); + } + return (int)mh$.invokeExact(size, symbol); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPrefetchAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPrefetchAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPrefetchAsync(const void *devPtr, size_t count, int dstDevice, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemPrefetchAsync$descriptor() { + return cudaMemPrefetchAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPrefetchAsync(const void *devPtr, size_t count, int dstDevice, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemPrefetchAsync$handle() { + return cudaMemPrefetchAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPrefetchAsync(const void *devPtr, size_t count, int dstDevice, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemPrefetchAsync$address() { + return cudaMemPrefetchAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPrefetchAsync(const void *devPtr, size_t count, int dstDevice, cudaStream_t stream) + * } + */ + public static int cudaMemPrefetchAsync(MemorySegment devPtr, long count, int dstDevice, MemorySegment stream) { + var mh$ = cudaMemPrefetchAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPrefetchAsync", devPtr, count, dstDevice, stream); + } + return (int)mh$.invokeExact(devPtr, count, dstDevice, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPrefetchAsync_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + cudaMemLocation.layout(), + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPrefetchAsync_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPrefetchAsync_v2(const void *devPtr, size_t count, struct cudaMemLocation location, unsigned int flags, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemPrefetchAsync_v2$descriptor() { + return cudaMemPrefetchAsync_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPrefetchAsync_v2(const void *devPtr, size_t count, struct cudaMemLocation location, unsigned int flags, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemPrefetchAsync_v2$handle() { + return cudaMemPrefetchAsync_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPrefetchAsync_v2(const void *devPtr, size_t count, struct cudaMemLocation location, unsigned int flags, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemPrefetchAsync_v2$address() { + return cudaMemPrefetchAsync_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPrefetchAsync_v2(const void *devPtr, size_t count, struct cudaMemLocation location, unsigned int flags, cudaStream_t stream) + * } + */ + public static int cudaMemPrefetchAsync_v2(MemorySegment devPtr, long count, MemorySegment location, int flags, MemorySegment stream) { + var mh$ = cudaMemPrefetchAsync_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPrefetchAsync_v2", devPtr, count, location, flags, stream); + } + return (int)mh$.invokeExact(devPtr, count, location, flags, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemAdvise { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemAdvise"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemAdvise(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, int device) + * } + */ + public static FunctionDescriptor cudaMemAdvise$descriptor() { + return cudaMemAdvise.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemAdvise(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, int device) + * } + */ + public static MethodHandle cudaMemAdvise$handle() { + return cudaMemAdvise.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemAdvise(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, int device) + * } + */ + public static MemorySegment cudaMemAdvise$address() { + return cudaMemAdvise.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemAdvise(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, int device) + * } + */ + public static int cudaMemAdvise(MemorySegment devPtr, long count, int advice, int device) { + var mh$ = cudaMemAdvise.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemAdvise", devPtr, count, advice, device); + } + return (int)mh$.invokeExact(devPtr, count, advice, device); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemAdvise_v2 { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + cudaMemLocation.layout() + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemAdvise_v2"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemAdvise_v2(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, struct cudaMemLocation location) + * } + */ + public static FunctionDescriptor cudaMemAdvise_v2$descriptor() { + return cudaMemAdvise_v2.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemAdvise_v2(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, struct cudaMemLocation location) + * } + */ + public static MethodHandle cudaMemAdvise_v2$handle() { + return cudaMemAdvise_v2.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemAdvise_v2(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, struct cudaMemLocation location) + * } + */ + public static MemorySegment cudaMemAdvise_v2$address() { + return cudaMemAdvise_v2.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemAdvise_v2(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, struct cudaMemLocation location) + * } + */ + public static int cudaMemAdvise_v2(MemorySegment devPtr, long count, int advice, MemorySegment location) { + var mh$ = cudaMemAdvise_v2.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemAdvise_v2", devPtr, count, advice, location); + } + return (int)mh$.invokeExact(devPtr, count, advice, location); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemRangeGetAttribute { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemRangeGetAttribute"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemRangeGetAttribute(void *data, size_t dataSize, enum cudaMemRangeAttribute attribute, const void *devPtr, size_t count) + * } + */ + public static FunctionDescriptor cudaMemRangeGetAttribute$descriptor() { + return cudaMemRangeGetAttribute.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemRangeGetAttribute(void *data, size_t dataSize, enum cudaMemRangeAttribute attribute, const void *devPtr, size_t count) + * } + */ + public static MethodHandle cudaMemRangeGetAttribute$handle() { + return cudaMemRangeGetAttribute.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemRangeGetAttribute(void *data, size_t dataSize, enum cudaMemRangeAttribute attribute, const void *devPtr, size_t count) + * } + */ + public static MemorySegment cudaMemRangeGetAttribute$address() { + return cudaMemRangeGetAttribute.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemRangeGetAttribute(void *data, size_t dataSize, enum cudaMemRangeAttribute attribute, const void *devPtr, size_t count) + * } + */ + public static int cudaMemRangeGetAttribute(MemorySegment data, long dataSize, int attribute, MemorySegment devPtr, long count) { + var mh$ = cudaMemRangeGetAttribute.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemRangeGetAttribute", data, dataSize, attribute, devPtr, count); + } + return (int)mh$.invokeExact(data, dataSize, attribute, devPtr, count); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemRangeGetAttributes { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemRangeGetAttributes"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemRangeGetAttributes(void **data, size_t *dataSizes, enum cudaMemRangeAttribute *attributes, size_t numAttributes, const void *devPtr, size_t count) + * } + */ + public static FunctionDescriptor cudaMemRangeGetAttributes$descriptor() { + return cudaMemRangeGetAttributes.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemRangeGetAttributes(void **data, size_t *dataSizes, enum cudaMemRangeAttribute *attributes, size_t numAttributes, const void *devPtr, size_t count) + * } + */ + public static MethodHandle cudaMemRangeGetAttributes$handle() { + return cudaMemRangeGetAttributes.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemRangeGetAttributes(void **data, size_t *dataSizes, enum cudaMemRangeAttribute *attributes, size_t numAttributes, const void *devPtr, size_t count) + * } + */ + public static MemorySegment cudaMemRangeGetAttributes$address() { + return cudaMemRangeGetAttributes.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemRangeGetAttributes(void **data, size_t *dataSizes, enum cudaMemRangeAttribute *attributes, size_t numAttributes, const void *devPtr, size_t count) + * } + */ + public static int cudaMemRangeGetAttributes(MemorySegment data, MemorySegment dataSizes, MemorySegment attributes, long numAttributes, MemorySegment devPtr, long count) { + var mh$ = cudaMemRangeGetAttributes.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemRangeGetAttributes", data, dataSizes, attributes, numAttributes, devPtr, count); + } + return (int)mh$.invokeExact(data, dataSizes, attributes, numAttributes, devPtr, count); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyToArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyToArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaMemcpyToArray$descriptor() { + return cudaMemcpyToArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaMemcpyToArray$handle() { + return cudaMemcpyToArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaMemcpyToArray$address() { + return cudaMemcpyToArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static int cudaMemcpyToArray(MemorySegment dst, long wOffset, long hOffset, MemorySegment src, long count, int kind) { + var mh$ = cudaMemcpyToArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyToArray", dst, wOffset, hOffset, src, count, kind); + } + return (int)mh$.invokeExact(dst, wOffset, hOffset, src, count, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyFromArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyFromArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromArray(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaMemcpyFromArray$descriptor() { + return cudaMemcpyFromArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromArray(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaMemcpyFromArray$handle() { + return cudaMemcpyFromArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromArray(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaMemcpyFromArray$address() { + return cudaMemcpyFromArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromArray(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static int cudaMemcpyFromArray(MemorySegment dst, MemorySegment src, long wOffset, long hOffset, long count, int kind) { + var mh$ = cudaMemcpyFromArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyFromArray", dst, src, wOffset, hOffset, count, kind); + } + return (int)mh$.invokeExact(dst, src, wOffset, hOffset, count, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyArrayToArray { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyArrayToArray"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static FunctionDescriptor cudaMemcpyArrayToArray$descriptor() { + return cudaMemcpyArrayToArray.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MethodHandle cudaMemcpyArrayToArray$handle() { + return cudaMemcpyArrayToArray.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static MemorySegment cudaMemcpyArrayToArray$address() { + return cudaMemcpyArrayToArray.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, enum cudaMemcpyKind kind) + * } + */ + public static int cudaMemcpyArrayToArray(MemorySegment dst, long wOffsetDst, long hOffsetDst, MemorySegment src, long wOffsetSrc, long hOffsetSrc, long count, int kind) { + var mh$ = cudaMemcpyArrayToArray.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyArrayToArray", dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind); + } + return (int)mh$.invokeExact(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyToArrayAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyToArrayAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpyToArrayAsync$descriptor() { + return cudaMemcpyToArrayAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpyToArrayAsync$handle() { + return cudaMemcpyToArrayAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpyToArrayAsync$address() { + return cudaMemcpyToArrayAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static int cudaMemcpyToArrayAsync(MemorySegment dst, long wOffset, long hOffset, MemorySegment src, long count, int kind, MemorySegment stream) { + var mh$ = cudaMemcpyToArrayAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyToArrayAsync", dst, wOffset, hOffset, src, count, kind, stream); + } + return (int)mh$.invokeExact(dst, wOffset, hOffset, src, count, kind, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemcpyFromArrayAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyFromArrayAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromArrayAsync(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static FunctionDescriptor cudaMemcpyFromArrayAsync$descriptor() { + return cudaMemcpyFromArrayAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromArrayAsync(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MethodHandle cudaMemcpyFromArrayAsync$handle() { + return cudaMemcpyFromArrayAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromArrayAsync(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static MemorySegment cudaMemcpyFromArrayAsync$address() { + return cudaMemcpyFromArrayAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemcpyFromArrayAsync(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) + * } + */ + public static int cudaMemcpyFromArrayAsync(MemorySegment dst, MemorySegment src, long wOffset, long hOffset, long count, int kind, MemorySegment stream) { + var mh$ = cudaMemcpyFromArrayAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemcpyFromArrayAsync", dst, src, wOffset, hOffset, count, kind, stream); + } + return (int)mh$.invokeExact(dst, src, wOffset, hOffset, count, kind, stream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMallocAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocAsync(void **devPtr, size_t size, cudaStream_t hStream) + * } + */ + public static FunctionDescriptor cudaMallocAsync$descriptor() { + return cudaMallocAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocAsync(void **devPtr, size_t size, cudaStream_t hStream) + * } + */ + public static MethodHandle cudaMallocAsync$handle() { + return cudaMallocAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMallocAsync(void **devPtr, size_t size, cudaStream_t hStream) + * } + */ + public static MemorySegment cudaMallocAsync$address() { + return cudaMallocAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMallocAsync(void **devPtr, size_t size, cudaStream_t hStream) + * } + */ + public static int cudaMallocAsync(MemorySegment devPtr, long size, MemorySegment hStream) { + var mh$ = cudaMallocAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMallocAsync", devPtr, size, hStream); + } + return (int)mh$.invokeExact(devPtr, size, hStream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaFreeAsync { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFreeAsync"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeAsync(void *devPtr, cudaStream_t hStream) + * } + */ + public static FunctionDescriptor cudaFreeAsync$descriptor() { + return cudaFreeAsync.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeAsync(void *devPtr, cudaStream_t hStream) + * } + */ + public static MethodHandle cudaFreeAsync$handle() { + return cudaFreeAsync.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaFreeAsync(void *devPtr, cudaStream_t hStream) + * } + */ + public static MemorySegment cudaFreeAsync$address() { + return cudaFreeAsync.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaFreeAsync(void *devPtr, cudaStream_t hStream) + * } + */ + public static int cudaFreeAsync(MemorySegment devPtr, MemorySegment hStream) { + var mh$ = cudaFreeAsync.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaFreeAsync", devPtr, hStream); + } + return (int)mh$.invokeExact(devPtr, hStream); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + private static class cudaMemPoolTrimTo { + public static final FunctionDescriptor DESC = FunctionDescriptor.of( + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_LONG + ); + + public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolTrimTo"); + + public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); + } + + /** + * Function descriptor for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) + * } + */ + public static FunctionDescriptor cudaMemPoolTrimTo$descriptor() { + return cudaMemPoolTrimTo.DESC; + } + + /** + * Downcall method handle for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) + * } + */ + public static MethodHandle cudaMemPoolTrimTo$handle() { + return cudaMemPoolTrimTo.HANDLE; + } + + /** + * Address for: + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) + * } + */ + public static MemorySegment cudaMemPoolTrimTo$address() { + return cudaMemPoolTrimTo.ADDR; + } + + /** + * {@snippet lang=c : + * extern cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) + * } + */ + public static int cudaMemPoolTrimTo(MemorySegment memPool, long minBytesToKeep) { + var mh$ = cudaMemPoolTrimTo.HANDLE; + try { + if (TRACE_DOWNCALLS) { + traceDowncall("cudaMemPoolTrimTo", memPool, minBytesToKeep); + } + return (int)mh$.invokeExact(memPool, minBytesToKeep); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/__fsid_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/__fsid_t.java new file mode 100644 index 0000000000..c435ed24e1 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/__fsid_t.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct { + * int __val[2]; + * } + * } + */ +public class __fsid_t { + + __fsid_t() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("__val") + ).withName("$anon$155:12"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout __val$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__val")); + + /** + * Layout for field: + * {@snippet lang=c : + * int __val[2] + * } + */ + public static final SequenceLayout __val$layout() { + return __val$LAYOUT; + } + + private static final long __val$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int __val[2] + * } + */ + public static final long __val$offset() { + return __val$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int __val[2] + * } + */ + public static MemorySegment __val(MemorySegment struct) { + return struct.asSlice(__val$OFFSET, __val$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int __val[2] + * } + */ + public static void __val(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, __val$OFFSET, __val$LAYOUT.byteSize()); + } + + private static long[] __val$DIMS = { 2 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int __val[2] + * } + */ + public static long[] __val$dimensions() { + return __val$DIMS; + } + private static final VarHandle __val$ELEM_HANDLE = __val$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int __val[2] + * } + */ + public static int __val(MemorySegment struct, long index0) { + return (int)__val$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int __val[2] + * } + */ + public static void __val(MemorySegment struct, long index0, int fieldValue) { + __val$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char1.java new file mode 100644 index 0000000000..f1ea3f8848 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct char1 { + * signed char x; + * } + * } + */ +public class char1 { + + char1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_CHAR.withName("x") + ).withName("char1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static final OfByte x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static byte x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static void x(MemorySegment struct, byte fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLPackVersion.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char2.java similarity index 65% rename from java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLPackVersion.java rename to java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char2.java index c65fdd8871..2874a9e9c9 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLPackVersion.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char2.java @@ -14,36 +14,39 @@ * limitations under the License. */ +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + package com.nvidia.cuvs.internal.panama; -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfInt; -import java.util.function.Consumer; +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; /** * {@snippet lang=c : - * struct { - * uint32_t major; - * uint32_t minor; + * struct char2 { + * signed char x; + * signed char y; * } * } */ -public class DLPackVersion { +public class char2 { - DLPackVersion() { + char2() { // Should not be called directly } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - DlpackH.C_INT.withName("major"), - DlpackH.C_INT.withName("minor") - ).withName("$anon$61:9"); + PanamaFFMAPI.C_CHAR.withName("x"), + PanamaFFMAPI.C_CHAR.withName("y") + ).withName("char2"); /** * The layout of this struct @@ -52,92 +55,92 @@ public static final GroupLayout layout() { return $LAYOUT; } - private static final OfInt major$LAYOUT = (OfInt)$LAYOUT.select(groupElement("major")); + private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); /** * Layout for field: * {@snippet lang=c : - * uint32_t major + * signed char x * } */ - public static final OfInt major$layout() { - return major$LAYOUT; + public static final OfByte x$layout() { + return x$LAYOUT; } - private static final long major$OFFSET = 0; + private static final long x$OFFSET = 0; /** * Offset for field: * {@snippet lang=c : - * uint32_t major + * signed char x * } */ - public static final long major$offset() { - return major$OFFSET; + public static final long x$offset() { + return x$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * uint32_t major + * signed char x * } */ - public static int major(MemorySegment struct) { - return struct.get(major$LAYOUT, major$OFFSET); + public static byte x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * uint32_t major + * signed char x * } */ - public static void major(MemorySegment struct, int fieldValue) { - struct.set(major$LAYOUT, major$OFFSET, fieldValue); + public static void x(MemorySegment struct, byte fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); } - private static final OfInt minor$LAYOUT = (OfInt)$LAYOUT.select(groupElement("minor")); + private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); /** * Layout for field: * {@snippet lang=c : - * uint32_t minor + * signed char y * } */ - public static final OfInt minor$layout() { - return minor$LAYOUT; + public static final OfByte y$layout() { + return y$LAYOUT; } - private static final long minor$OFFSET = 4; + private static final long y$OFFSET = 1; /** * Offset for field: * {@snippet lang=c : - * uint32_t minor + * signed char y * } */ - public static final long minor$offset() { - return minor$OFFSET; + public static final long y$offset() { + return y$OFFSET; } /** * Getter for field: * {@snippet lang=c : - * uint32_t minor + * signed char y * } */ - public static int minor(MemorySegment struct) { - return struct.get(minor$LAYOUT, minor$OFFSET); + public static byte y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); } /** * Setter for field: * {@snippet lang=c : - * uint32_t minor + * signed char y * } */ - public static void minor(MemorySegment struct, int fieldValue) { - struct.set(minor$LAYOUT, minor$OFFSET, fieldValue); + public static void y(MemorySegment struct, byte fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); } /** diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char3.java new file mode 100644 index 0000000000..dea37ee6a5 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct char3 { + * signed char x; + * signed char y; + * signed char z; + * } + * } + */ +public class char3 { + + char3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_CHAR.withName("x"), + PanamaFFMAPI.C_CHAR.withName("y"), + PanamaFFMAPI.C_CHAR.withName("z") + ).withName("char3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static final OfByte x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static byte x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static void x(MemorySegment struct, byte fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * signed char y + * } + */ + public static final OfByte y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * signed char y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * signed char y + * } + */ + public static byte y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * signed char y + * } + */ + public static void y(MemorySegment struct, byte fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfByte z$LAYOUT = (OfByte)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * signed char z + * } + */ + public static final OfByte z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * signed char z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * signed char z + * } + */ + public static byte z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * signed char z + * } + */ + public static void z(MemorySegment struct, byte fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char4.java new file mode 100644 index 0000000000..e32312dd9c --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct char4 { + * signed char x; + * signed char y; + * signed char z; + * signed char w; + * } + * } + */ +public class char4 { + + char4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_CHAR.withName("x"), + PanamaFFMAPI.C_CHAR.withName("y"), + PanamaFFMAPI.C_CHAR.withName("z"), + PanamaFFMAPI.C_CHAR.withName("w") + ).withName("char4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static final OfByte x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static byte x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * signed char x + * } + */ + public static void x(MemorySegment struct, byte fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * signed char y + * } + */ + public static final OfByte y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * signed char y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * signed char y + * } + */ + public static byte y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * signed char y + * } + */ + public static void y(MemorySegment struct, byte fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfByte z$LAYOUT = (OfByte)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * signed char z + * } + */ + public static final OfByte z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * signed char z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * signed char z + * } + */ + public static byte z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * signed char z + * } + */ + public static void z(MemorySegment struct, byte fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfByte w$LAYOUT = (OfByte)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * signed char w + * } + */ + public static final OfByte w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 3; + + /** + * Offset for field: + * {@snippet lang=c : + * signed char w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * signed char w + * } + */ + public static byte w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * signed char w + * } + */ + public static void w(MemorySegment struct, byte fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAccessPolicyWindow.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAccessPolicyWindow.java new file mode 100644 index 0000000000..6a83ffe5c4 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAccessPolicyWindow.java @@ -0,0 +1,328 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaAccessPolicyWindow { + * void *base_ptr; + * size_t num_bytes; + * float hitRatio; + * enum cudaAccessProperty hitProp; + * enum cudaAccessProperty missProp; + * } + * } + */ +public class cudaAccessPolicyWindow { + + cudaAccessPolicyWindow() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("base_ptr"), + PanamaFFMAPI.C_LONG.withName("num_bytes"), + PanamaFFMAPI.C_FLOAT.withName("hitRatio"), + PanamaFFMAPI.C_INT.withName("hitProp"), + PanamaFFMAPI.C_INT.withName("missProp"), + MemoryLayout.paddingLayout(4) + ).withName("cudaAccessPolicyWindow"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout base_ptr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("base_ptr")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *base_ptr + * } + */ + public static final AddressLayout base_ptr$layout() { + return base_ptr$LAYOUT; + } + + private static final long base_ptr$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *base_ptr + * } + */ + public static final long base_ptr$offset() { + return base_ptr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *base_ptr + * } + */ + public static MemorySegment base_ptr(MemorySegment struct) { + return struct.get(base_ptr$LAYOUT, base_ptr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *base_ptr + * } + */ + public static void base_ptr(MemorySegment struct, MemorySegment fieldValue) { + struct.set(base_ptr$LAYOUT, base_ptr$OFFSET, fieldValue); + } + + private static final OfLong num_bytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("num_bytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t num_bytes + * } + */ + public static final OfLong num_bytes$layout() { + return num_bytes$LAYOUT; + } + + private static final long num_bytes$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t num_bytes + * } + */ + public static final long num_bytes$offset() { + return num_bytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t num_bytes + * } + */ + public static long num_bytes(MemorySegment struct) { + return struct.get(num_bytes$LAYOUT, num_bytes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t num_bytes + * } + */ + public static void num_bytes(MemorySegment struct, long fieldValue) { + struct.set(num_bytes$LAYOUT, num_bytes$OFFSET, fieldValue); + } + + private static final OfFloat hitRatio$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("hitRatio")); + + /** + * Layout for field: + * {@snippet lang=c : + * float hitRatio + * } + */ + public static final OfFloat hitRatio$layout() { + return hitRatio$LAYOUT; + } + + private static final long hitRatio$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * float hitRatio + * } + */ + public static final long hitRatio$offset() { + return hitRatio$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float hitRatio + * } + */ + public static float hitRatio(MemorySegment struct) { + return struct.get(hitRatio$LAYOUT, hitRatio$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float hitRatio + * } + */ + public static void hitRatio(MemorySegment struct, float fieldValue) { + struct.set(hitRatio$LAYOUT, hitRatio$OFFSET, fieldValue); + } + + private static final OfInt hitProp$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hitProp")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaAccessProperty hitProp + * } + */ + public static final OfInt hitProp$layout() { + return hitProp$LAYOUT; + } + + private static final long hitProp$OFFSET = 20; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaAccessProperty hitProp + * } + */ + public static final long hitProp$offset() { + return hitProp$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaAccessProperty hitProp + * } + */ + public static int hitProp(MemorySegment struct) { + return struct.get(hitProp$LAYOUT, hitProp$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaAccessProperty hitProp + * } + */ + public static void hitProp(MemorySegment struct, int fieldValue) { + struct.set(hitProp$LAYOUT, hitProp$OFFSET, fieldValue); + } + + private static final OfInt missProp$LAYOUT = (OfInt)$LAYOUT.select(groupElement("missProp")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaAccessProperty missProp + * } + */ + public static final OfInt missProp$layout() { + return missProp$LAYOUT; + } + + private static final long missProp$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaAccessProperty missProp + * } + */ + public static final long missProp$offset() { + return missProp$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaAccessProperty missProp + * } + */ + public static int missProp(MemorySegment struct) { + return struct.get(missProp$LAYOUT, missProp$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaAccessProperty missProp + * } + */ + public static void missProp(MemorySegment struct, int fieldValue) { + struct.set(missProp$LAYOUT, missProp$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArrayMemoryRequirements.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArrayMemoryRequirements.java new file mode 100644 index 0000000000..b69a98e5f7 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArrayMemoryRequirements.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaArrayMemoryRequirements { + * size_t size; + * size_t alignment; + * unsigned int reserved[4]; + * } + * } + */ +public class cudaArrayMemoryRequirements { + + cudaArrayMemoryRequirements() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("size"), + PanamaFFMAPI.C_LONG.withName("alignment"), + MemoryLayout.sequenceLayout(4, PanamaFFMAPI.C_INT).withName("reserved") + ).withName("cudaArrayMemoryRequirements"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("size")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t size + * } + */ + public static final OfLong size$layout() { + return size$LAYOUT; + } + + private static final long size$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t size + * } + */ + public static final long size$offset() { + return size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t size + * } + */ + public static long size(MemorySegment struct) { + return struct.get(size$LAYOUT, size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t size + * } + */ + public static void size(MemorySegment struct, long fieldValue) { + struct.set(size$LAYOUT, size$OFFSET, fieldValue); + } + + private static final OfLong alignment$LAYOUT = (OfLong)$LAYOUT.select(groupElement("alignment")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t alignment + * } + */ + public static final OfLong alignment$layout() { + return alignment$LAYOUT; + } + + private static final long alignment$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t alignment + * } + */ + public static final long alignment$offset() { + return alignment$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t alignment + * } + */ + public static long alignment(MemorySegment struct) { + return struct.get(alignment$LAYOUT, alignment$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t alignment + * } + */ + public static void alignment(MemorySegment struct, long fieldValue) { + struct.set(alignment$LAYOUT, alignment$OFFSET, fieldValue); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 4 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static int reserved(MemorySegment struct, long index0) { + return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static void reserved(MemorySegment struct, long index0, int fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArraySparseProperties.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArraySparseProperties.java new file mode 100644 index 0000000000..0a917cf49a --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArraySparseProperties.java @@ -0,0 +1,586 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaArraySparseProperties { + * struct { + * unsigned int width; + * unsigned int height; + * unsigned int depth; + * } tileExtent; + * unsigned int miptailFirstLevel; + * unsigned long long miptailSize; + * unsigned int flags; + * unsigned int reserved[4]; + * } + * } + */ +public class cudaArraySparseProperties { + + cudaArraySparseProperties() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaArraySparseProperties.tileExtent.layout().withName("tileExtent"), + PanamaFFMAPI.C_INT.withName("miptailFirstLevel"), + PanamaFFMAPI.C_LONG_LONG.withName("miptailSize"), + PanamaFFMAPI.C_INT.withName("flags"), + MemoryLayout.sequenceLayout(4, PanamaFFMAPI.C_INT).withName("reserved"), + MemoryLayout.paddingLayout(4) + ).withName("cudaArraySparseProperties"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * unsigned int width; + * unsigned int height; + * unsigned int depth; + * } + * } + */ + public static class tileExtent { + + tileExtent() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("width"), + PanamaFFMAPI.C_INT.withName("height"), + PanamaFFMAPI.C_INT.withName("depth") + ).withName("$anon$1203:5"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt width$LAYOUT = (OfInt)$LAYOUT.select(groupElement("width")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int width + * } + */ + public static final OfInt width$layout() { + return width$LAYOUT; + } + + private static final long width$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int width + * } + */ + public static final long width$offset() { + return width$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int width + * } + */ + public static int width(MemorySegment struct) { + return struct.get(width$LAYOUT, width$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int width + * } + */ + public static void width(MemorySegment struct, int fieldValue) { + struct.set(width$LAYOUT, width$OFFSET, fieldValue); + } + + private static final OfInt height$LAYOUT = (OfInt)$LAYOUT.select(groupElement("height")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int height + * } + */ + public static final OfInt height$layout() { + return height$LAYOUT; + } + + private static final long height$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int height + * } + */ + public static final long height$offset() { + return height$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int height + * } + */ + public static int height(MemorySegment struct) { + return struct.get(height$LAYOUT, height$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int height + * } + */ + public static void height(MemorySegment struct, int fieldValue) { + struct.set(height$LAYOUT, height$OFFSET, fieldValue); + } + + private static final OfInt depth$LAYOUT = (OfInt)$LAYOUT.select(groupElement("depth")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int depth + * } + */ + public static final OfInt depth$layout() { + return depth$LAYOUT; + } + + private static final long depth$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int depth + * } + */ + public static final long depth$offset() { + return depth$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int depth + * } + */ + public static int depth(MemorySegment struct) { + return struct.get(depth$LAYOUT, depth$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int depth + * } + */ + public static void depth(MemorySegment struct, int fieldValue) { + struct.set(depth$LAYOUT, depth$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout tileExtent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("tileExtent")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned int width; + * unsigned int height; + * unsigned int depth; + * } tileExtent + * } + */ + public static final GroupLayout tileExtent$layout() { + return tileExtent$LAYOUT; + } + + private static final long tileExtent$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned int width; + * unsigned int height; + * unsigned int depth; + * } tileExtent + * } + */ + public static final long tileExtent$offset() { + return tileExtent$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned int width; + * unsigned int height; + * unsigned int depth; + * } tileExtent + * } + */ + public static MemorySegment tileExtent(MemorySegment struct) { + return struct.asSlice(tileExtent$OFFSET, tileExtent$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned int width; + * unsigned int height; + * unsigned int depth; + * } tileExtent + * } + */ + public static void tileExtent(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, tileExtent$OFFSET, tileExtent$LAYOUT.byteSize()); + } + + private static final OfInt miptailFirstLevel$LAYOUT = (OfInt)$LAYOUT.select(groupElement("miptailFirstLevel")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int miptailFirstLevel + * } + */ + public static final OfInt miptailFirstLevel$layout() { + return miptailFirstLevel$LAYOUT; + } + + private static final long miptailFirstLevel$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int miptailFirstLevel + * } + */ + public static final long miptailFirstLevel$offset() { + return miptailFirstLevel$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int miptailFirstLevel + * } + */ + public static int miptailFirstLevel(MemorySegment struct) { + return struct.get(miptailFirstLevel$LAYOUT, miptailFirstLevel$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int miptailFirstLevel + * } + */ + public static void miptailFirstLevel(MemorySegment struct, int fieldValue) { + struct.set(miptailFirstLevel$LAYOUT, miptailFirstLevel$OFFSET, fieldValue); + } + + private static final OfLong miptailSize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("miptailSize")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long miptailSize + * } + */ + public static final OfLong miptailSize$layout() { + return miptailSize$LAYOUT; + } + + private static final long miptailSize$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long miptailSize + * } + */ + public static final long miptailSize$offset() { + return miptailSize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long miptailSize + * } + */ + public static long miptailSize(MemorySegment struct) { + return struct.get(miptailSize$LAYOUT, miptailSize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long miptailSize + * } + */ + public static void miptailSize(MemorySegment struct, long fieldValue) { + struct.set(miptailSize$LAYOUT, miptailSize$OFFSET, fieldValue); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 28; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 4 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static int reserved(MemorySegment struct, long index0) { + return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned int reserved[4] + * } + */ + public static void reserved(MemorySegment struct, long index0, int fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncCallback.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncCallback.java new file mode 100644 index 0000000000..83972463e5 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncCallback.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef void (*cudaAsyncCallback)(cudaAsyncNotificationInfo_t *, void *, cudaAsyncCallbackHandle_t) + * } + */ +public class cudaAsyncCallback { + + cudaAsyncCallback() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + void apply(MemorySegment _x0, MemorySegment _x1, MemorySegment _x2); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = PanamaFFMAPI.upcallHandle(cudaAsyncCallback.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(cudaAsyncCallback.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, MemorySegment _x2) { + try { + DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo.java new file mode 100644 index 0000000000..f2e84182bf --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo.java @@ -0,0 +1,446 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaAsyncNotificationInfo { + * cudaAsyncNotificationType type; + * union { + * struct { + * unsigned long long bytesOverBudget; + * } overBudget; + * } info; + * } + * } + */ +public class cudaAsyncNotificationInfo { + + cudaAsyncNotificationInfo() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("type"), + MemoryLayout.paddingLayout(4), + cudaAsyncNotificationInfo.info.layout().withName("info") + ).withName("cudaAsyncNotificationInfo"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaAsyncNotificationType type + * } + */ + public static final OfInt type$layout() { + return type$LAYOUT; + } + + private static final long type$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaAsyncNotificationType type + * } + */ + public static final long type$offset() { + return type$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaAsyncNotificationType type + * } + */ + public static int type(MemorySegment struct) { + return struct.get(type$LAYOUT, type$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaAsyncNotificationType type + * } + */ + public static void type(MemorySegment struct, int fieldValue) { + struct.set(type$LAYOUT, type$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * union { + * struct { + * unsigned long long bytesOverBudget; + * } overBudget; + * } + * } + */ + public static class info { + + info() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + cudaAsyncNotificationInfo.info.overBudget.layout().withName("overBudget") + ).withName("$anon$3670:5"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * unsigned long long bytesOverBudget; + * } + * } + */ + public static class overBudget { + + overBudget() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("bytesOverBudget") + ).withName("$anon$3671:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong bytesOverBudget$LAYOUT = (OfLong)$LAYOUT.select(groupElement("bytesOverBudget")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long bytesOverBudget + * } + */ + public static final OfLong bytesOverBudget$layout() { + return bytesOverBudget$LAYOUT; + } + + private static final long bytesOverBudget$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long bytesOverBudget + * } + */ + public static final long bytesOverBudget$offset() { + return bytesOverBudget$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long bytesOverBudget + * } + */ + public static long bytesOverBudget(MemorySegment struct) { + return struct.get(bytesOverBudget$LAYOUT, bytesOverBudget$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long bytesOverBudget + * } + */ + public static void bytesOverBudget(MemorySegment struct, long fieldValue) { + struct.set(bytesOverBudget$LAYOUT, bytesOverBudget$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout overBudget$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("overBudget")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned long long bytesOverBudget; + * } overBudget + * } + */ + public static final GroupLayout overBudget$layout() { + return overBudget$LAYOUT; + } + + private static final long overBudget$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned long long bytesOverBudget; + * } overBudget + * } + */ + public static final long overBudget$offset() { + return overBudget$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned long long bytesOverBudget; + * } overBudget + * } + */ + public static MemorySegment overBudget(MemorySegment union) { + return union.asSlice(overBudget$OFFSET, overBudget$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned long long bytesOverBudget; + * } overBudget + * } + */ + public static void overBudget(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, overBudget$OFFSET, overBudget$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout info$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("info")); + + /** + * Layout for field: + * {@snippet lang=c : + * union { + * struct { + * unsigned long long bytesOverBudget; + * } overBudget; + * } info + * } + */ + public static final GroupLayout info$layout() { + return info$LAYOUT; + } + + private static final long info$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * union { + * struct { + * unsigned long long bytesOverBudget; + * } overBudget; + * } info + * } + */ + public static final long info$offset() { + return info$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * union { + * struct { + * unsigned long long bytesOverBudget; + * } overBudget; + * } info + * } + */ + public static MemorySegment info(MemorySegment struct) { + return struct.asSlice(info$OFFSET, info$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * union { + * struct { + * unsigned long long bytesOverBudget; + * } overBudget; + * } info + * } + */ + public static void info(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, info$OFFSET, info$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo_t.java new file mode 100644 index 0000000000..5d503e7a0e --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo_t.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct cudaAsyncNotificationInfo { + * cudaAsyncNotificationType type; + * union { + * struct { + * unsigned long long bytesOverBudget; + * } overBudget; + * } info; + * } cudaAsyncNotificationInfo_t + * } + */ +public class cudaAsyncNotificationInfo_t extends cudaAsyncNotificationInfo { + + cudaAsyncNotificationInfo_t() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChannelFormatDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChannelFormatDesc.java new file mode 100644 index 0000000000..3ea884c120 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChannelFormatDesc.java @@ -0,0 +1,327 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaChannelFormatDesc { + * int x; + * int y; + * int z; + * int w; + * enum cudaChannelFormatKind f; + * } + * } + */ +public class cudaChannelFormatDesc { + + cudaChannelFormatDesc() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x"), + PanamaFFMAPI.C_INT.withName("y"), + PanamaFFMAPI.C_INT.withName("z"), + PanamaFFMAPI.C_INT.withName("w"), + PanamaFFMAPI.C_INT.withName("f") + ).withName("cudaChannelFormatDesc"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * int y + * } + */ + public static final OfInt y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int y + * } + */ + public static int y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int y + * } + */ + public static void y(MemorySegment struct, int fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * int z + * } + */ + public static final OfInt z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * int z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int z + * } + */ + public static int z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int z + * } + */ + public static void z(MemorySegment struct, int fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfInt w$LAYOUT = (OfInt)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * int w + * } + */ + public static final OfInt w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * int w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int w + * } + */ + public static int w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int w + * } + */ + public static void w(MemorySegment struct, int fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + private static final OfInt f$LAYOUT = (OfInt)$LAYOUT.select(groupElement("f")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaChannelFormatKind f + * } + */ + public static final OfInt f$layout() { + return f$LAYOUT; + } + + private static final long f$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaChannelFormatKind f + * } + */ + public static final long f$offset() { + return f$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaChannelFormatKind f + * } + */ + public static int f(MemorySegment struct) { + return struct.get(f$LAYOUT, f$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaChannelFormatKind f + * } + */ + public static void f(MemorySegment struct, int fieldValue) { + struct.set(f$LAYOUT, f$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChildGraphNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChildGraphNodeParams.java new file mode 100644 index 0000000000..08ad90110d --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChildGraphNodeParams.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaChildGraphNodeParams { + * cudaGraph_t graph; + * } + * } + */ +public class cudaChildGraphNodeParams { + + cudaChildGraphNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("graph") + ).withName("cudaChildGraphNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout graph$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("graph")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaGraph_t graph + * } + */ + public static final AddressLayout graph$layout() { + return graph$LAYOUT; + } + + private static final long graph$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaGraph_t graph + * } + */ + public static final long graph$offset() { + return graph$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaGraph_t graph + * } + */ + public static MemorySegment graph(MemorySegment struct) { + return struct.get(graph$LAYOUT, graph$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaGraph_t graph + * } + */ + public static void graph(MemorySegment struct, MemorySegment fieldValue) { + struct.set(graph$LAYOUT, graph$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaConditionalNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaConditionalNodeParams.java new file mode 100644 index 0000000000..595a5173e2 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaConditionalNodeParams.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaConditionalNodeParams { + * cudaGraphConditionalHandle handle; + * enum cudaGraphConditionalNodeType type; + * unsigned int size; + * cudaGraph_t *phGraph_out; + * } + * } + */ +public class cudaConditionalNodeParams { + + cudaConditionalNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("handle"), + PanamaFFMAPI.C_INT.withName("type"), + PanamaFFMAPI.C_INT.withName("size"), + PanamaFFMAPI.C_POINTER.withName("phGraph_out") + ).withName("cudaConditionalNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong handle$LAYOUT = (OfLong)$LAYOUT.select(groupElement("handle")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaGraphConditionalHandle handle + * } + */ + public static final OfLong handle$layout() { + return handle$LAYOUT; + } + + private static final long handle$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaGraphConditionalHandle handle + * } + */ + public static final long handle$offset() { + return handle$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaGraphConditionalHandle handle + * } + */ + public static long handle(MemorySegment struct) { + return struct.get(handle$LAYOUT, handle$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaGraphConditionalHandle handle + * } + */ + public static void handle(MemorySegment struct, long fieldValue) { + struct.set(handle$LAYOUT, handle$OFFSET, fieldValue); + } + + private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaGraphConditionalNodeType type + * } + */ + public static final OfInt type$layout() { + return type$LAYOUT; + } + + private static final long type$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaGraphConditionalNodeType type + * } + */ + public static final long type$offset() { + return type$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaGraphConditionalNodeType type + * } + */ + public static int type(MemorySegment struct) { + return struct.get(type$LAYOUT, type$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaGraphConditionalNodeType type + * } + */ + public static void type(MemorySegment struct, int fieldValue) { + struct.set(type$LAYOUT, type$OFFSET, fieldValue); + } + + private static final OfInt size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("size")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int size + * } + */ + public static final OfInt size$layout() { + return size$LAYOUT; + } + + private static final long size$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int size + * } + */ + public static final long size$offset() { + return size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int size + * } + */ + public static int size(MemorySegment struct) { + return struct.get(size$LAYOUT, size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int size + * } + */ + public static void size(MemorySegment struct, int fieldValue) { + struct.set(size$LAYOUT, size$OFFSET, fieldValue); + } + + private static final AddressLayout phGraph_out$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("phGraph_out")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaGraph_t *phGraph_out + * } + */ + public static final AddressLayout phGraph_out$layout() { + return phGraph_out$LAYOUT; + } + + private static final long phGraph_out$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaGraph_t *phGraph_out + * } + */ + public static final long phGraph_out$offset() { + return phGraph_out$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaGraph_t *phGraph_out + * } + */ + public static MemorySegment phGraph_out(MemorySegment struct) { + return struct.get(phGraph_out$LAYOUT, phGraph_out$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaGraph_t *phGraph_out + * } + */ + public static void phGraph_out(MemorySegment struct, MemorySegment fieldValue) { + struct.set(phGraph_out$LAYOUT, phGraph_out$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaDeviceProp.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaDeviceProp.java new file mode 100644 index 0000000000..7259c9d8e5 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaDeviceProp.java @@ -0,0 +1,5207 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaDeviceProp { + * char name[256]; + * cudaUUID_t uuid; + * char luid[8]; + * unsigned int luidDeviceNodeMask; + * size_t totalGlobalMem; + * size_t sharedMemPerBlock; + * int regsPerBlock; + * int warpSize; + * size_t memPitch; + * int maxThreadsPerBlock; + * int maxThreadsDim[3]; + * int maxGridSize[3]; + * int clockRate; + * size_t totalConstMem; + * int major; + * int minor; + * size_t textureAlignment; + * size_t texturePitchAlignment; + * int deviceOverlap; + * int multiProcessorCount; + * int kernelExecTimeoutEnabled; + * int integrated; + * int canMapHostMemory; + * int computeMode; + * int maxTexture1D; + * int maxTexture1DMipmap; + * int maxTexture1DLinear; + * int maxTexture2D[2]; + * int maxTexture2DMipmap[2]; + * int maxTexture2DLinear[3]; + * int maxTexture2DGather[2]; + * int maxTexture3D[3]; + * int maxTexture3DAlt[3]; + * int maxTextureCubemap; + * int maxTexture1DLayered[2]; + * int maxTexture2DLayered[3]; + * int maxTextureCubemapLayered[2]; + * int maxSurface1D; + * int maxSurface2D[2]; + * int maxSurface3D[3]; + * int maxSurface1DLayered[2]; + * int maxSurface2DLayered[3]; + * int maxSurfaceCubemap; + * int maxSurfaceCubemapLayered[2]; + * size_t surfaceAlignment; + * int concurrentKernels; + * int ECCEnabled; + * int pciBusID; + * int pciDeviceID; + * int pciDomainID; + * int tccDriver; + * int asyncEngineCount; + * int unifiedAddressing; + * int memoryClockRate; + * int memoryBusWidth; + * int l2CacheSize; + * int persistingL2CacheMaxSize; + * int maxThreadsPerMultiProcessor; + * int streamPrioritiesSupported; + * int globalL1CacheSupported; + * int localL1CacheSupported; + * size_t sharedMemPerMultiprocessor; + * int regsPerMultiprocessor; + * int managedMemory; + * int isMultiGpuBoard; + * int multiGpuBoardGroupID; + * int hostNativeAtomicSupported; + * int singleToDoublePrecisionPerfRatio; + * int pageableMemoryAccess; + * int concurrentManagedAccess; + * int computePreemptionSupported; + * int canUseHostPointerForRegisteredMem; + * int cooperativeLaunch; + * int cooperativeMultiDeviceLaunch; + * size_t sharedMemPerBlockOptin; + * int pageableMemoryAccessUsesHostPageTables; + * int directManagedMemAccessFromHost; + * int maxBlocksPerMultiProcessor; + * int accessPolicyMaxWindowSize; + * size_t reservedSharedMemPerBlock; + * int hostRegisterSupported; + * int sparseCudaArraySupported; + * int hostRegisterReadOnlySupported; + * int timelineSemaphoreInteropSupported; + * int memoryPoolsSupported; + * int gpuDirectRDMASupported; + * unsigned int gpuDirectRDMAFlushWritesOptions; + * int gpuDirectRDMAWritesOrdering; + * unsigned int memoryPoolSupportedHandleTypes; + * int deferredMappingCudaArraySupported; + * int ipcEventSupported; + * int clusterLaunch; + * int unifiedFunctionPointers; + * int reserved2[2]; + * int reserved1[1]; + * int reserved[60]; + * } + * } + */ +public class cudaDeviceProp { + + cudaDeviceProp() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(256, PanamaFFMAPI.C_CHAR).withName("name"), + CUuuid_st.layout().withName("uuid"), + MemoryLayout.sequenceLayout(8, PanamaFFMAPI.C_CHAR).withName("luid"), + PanamaFFMAPI.C_INT.withName("luidDeviceNodeMask"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_LONG.withName("totalGlobalMem"), + PanamaFFMAPI.C_LONG.withName("sharedMemPerBlock"), + PanamaFFMAPI.C_INT.withName("regsPerBlock"), + PanamaFFMAPI.C_INT.withName("warpSize"), + PanamaFFMAPI.C_LONG.withName("memPitch"), + PanamaFFMAPI.C_INT.withName("maxThreadsPerBlock"), + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxThreadsDim"), + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxGridSize"), + PanamaFFMAPI.C_INT.withName("clockRate"), + PanamaFFMAPI.C_LONG.withName("totalConstMem"), + PanamaFFMAPI.C_INT.withName("major"), + PanamaFFMAPI.C_INT.withName("minor"), + PanamaFFMAPI.C_LONG.withName("textureAlignment"), + PanamaFFMAPI.C_LONG.withName("texturePitchAlignment"), + PanamaFFMAPI.C_INT.withName("deviceOverlap"), + PanamaFFMAPI.C_INT.withName("multiProcessorCount"), + PanamaFFMAPI.C_INT.withName("kernelExecTimeoutEnabled"), + PanamaFFMAPI.C_INT.withName("integrated"), + PanamaFFMAPI.C_INT.withName("canMapHostMemory"), + PanamaFFMAPI.C_INT.withName("computeMode"), + PanamaFFMAPI.C_INT.withName("maxTexture1D"), + PanamaFFMAPI.C_INT.withName("maxTexture1DMipmap"), + PanamaFFMAPI.C_INT.withName("maxTexture1DLinear"), + MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxTexture2D"), + MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxTexture2DMipmap"), + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxTexture2DLinear"), + MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxTexture2DGather"), + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxTexture3D"), + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxTexture3DAlt"), + PanamaFFMAPI.C_INT.withName("maxTextureCubemap"), + MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxTexture1DLayered"), + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxTexture2DLayered"), + MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxTextureCubemapLayered"), + PanamaFFMAPI.C_INT.withName("maxSurface1D"), + MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxSurface2D"), + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxSurface3D"), + MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxSurface1DLayered"), + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxSurface2DLayered"), + PanamaFFMAPI.C_INT.withName("maxSurfaceCubemap"), + MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxSurfaceCubemapLayered"), + PanamaFFMAPI.C_LONG.withName("surfaceAlignment"), + PanamaFFMAPI.C_INT.withName("concurrentKernels"), + PanamaFFMAPI.C_INT.withName("ECCEnabled"), + PanamaFFMAPI.C_INT.withName("pciBusID"), + PanamaFFMAPI.C_INT.withName("pciDeviceID"), + PanamaFFMAPI.C_INT.withName("pciDomainID"), + PanamaFFMAPI.C_INT.withName("tccDriver"), + PanamaFFMAPI.C_INT.withName("asyncEngineCount"), + PanamaFFMAPI.C_INT.withName("unifiedAddressing"), + PanamaFFMAPI.C_INT.withName("memoryClockRate"), + PanamaFFMAPI.C_INT.withName("memoryBusWidth"), + PanamaFFMAPI.C_INT.withName("l2CacheSize"), + PanamaFFMAPI.C_INT.withName("persistingL2CacheMaxSize"), + PanamaFFMAPI.C_INT.withName("maxThreadsPerMultiProcessor"), + PanamaFFMAPI.C_INT.withName("streamPrioritiesSupported"), + PanamaFFMAPI.C_INT.withName("globalL1CacheSupported"), + PanamaFFMAPI.C_INT.withName("localL1CacheSupported"), + PanamaFFMAPI.C_LONG.withName("sharedMemPerMultiprocessor"), + PanamaFFMAPI.C_INT.withName("regsPerMultiprocessor"), + PanamaFFMAPI.C_INT.withName("managedMemory"), + PanamaFFMAPI.C_INT.withName("isMultiGpuBoard"), + PanamaFFMAPI.C_INT.withName("multiGpuBoardGroupID"), + PanamaFFMAPI.C_INT.withName("hostNativeAtomicSupported"), + PanamaFFMAPI.C_INT.withName("singleToDoublePrecisionPerfRatio"), + PanamaFFMAPI.C_INT.withName("pageableMemoryAccess"), + PanamaFFMAPI.C_INT.withName("concurrentManagedAccess"), + PanamaFFMAPI.C_INT.withName("computePreemptionSupported"), + PanamaFFMAPI.C_INT.withName("canUseHostPointerForRegisteredMem"), + PanamaFFMAPI.C_INT.withName("cooperativeLaunch"), + PanamaFFMAPI.C_INT.withName("cooperativeMultiDeviceLaunch"), + PanamaFFMAPI.C_LONG.withName("sharedMemPerBlockOptin"), + PanamaFFMAPI.C_INT.withName("pageableMemoryAccessUsesHostPageTables"), + PanamaFFMAPI.C_INT.withName("directManagedMemAccessFromHost"), + PanamaFFMAPI.C_INT.withName("maxBlocksPerMultiProcessor"), + PanamaFFMAPI.C_INT.withName("accessPolicyMaxWindowSize"), + PanamaFFMAPI.C_LONG.withName("reservedSharedMemPerBlock"), + PanamaFFMAPI.C_INT.withName("hostRegisterSupported"), + PanamaFFMAPI.C_INT.withName("sparseCudaArraySupported"), + PanamaFFMAPI.C_INT.withName("hostRegisterReadOnlySupported"), + PanamaFFMAPI.C_INT.withName("timelineSemaphoreInteropSupported"), + PanamaFFMAPI.C_INT.withName("memoryPoolsSupported"), + PanamaFFMAPI.C_INT.withName("gpuDirectRDMASupported"), + PanamaFFMAPI.C_INT.withName("gpuDirectRDMAFlushWritesOptions"), + PanamaFFMAPI.C_INT.withName("gpuDirectRDMAWritesOrdering"), + PanamaFFMAPI.C_INT.withName("memoryPoolSupportedHandleTypes"), + PanamaFFMAPI.C_INT.withName("deferredMappingCudaArraySupported"), + PanamaFFMAPI.C_INT.withName("ipcEventSupported"), + PanamaFFMAPI.C_INT.withName("clusterLaunch"), + PanamaFFMAPI.C_INT.withName("unifiedFunctionPointers"), + MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("reserved2"), + MemoryLayout.sequenceLayout(1, PanamaFFMAPI.C_INT).withName("reserved1"), + MemoryLayout.sequenceLayout(60, PanamaFFMAPI.C_INT).withName("reserved") + ).withName("cudaDeviceProp"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout name$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("name")); + + /** + * Layout for field: + * {@snippet lang=c : + * char name[256] + * } + */ + public static final SequenceLayout name$layout() { + return name$LAYOUT; + } + + private static final long name$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char name[256] + * } + */ + public static final long name$offset() { + return name$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char name[256] + * } + */ + public static MemorySegment name(MemorySegment struct) { + return struct.asSlice(name$OFFSET, name$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char name[256] + * } + */ + public static void name(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, name$OFFSET, name$LAYOUT.byteSize()); + } + + private static long[] name$DIMS = { 256 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char name[256] + * } + */ + public static long[] name$dimensions() { + return name$DIMS; + } + private static final VarHandle name$ELEM_HANDLE = name$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char name[256] + * } + */ + public static byte name(MemorySegment struct, long index0) { + return (byte)name$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char name[256] + * } + */ + public static void name(MemorySegment struct, long index0, byte fieldValue) { + name$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final GroupLayout uuid$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("uuid")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaUUID_t uuid + * } + */ + public static final GroupLayout uuid$layout() { + return uuid$LAYOUT; + } + + private static final long uuid$OFFSET = 256; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaUUID_t uuid + * } + */ + public static final long uuid$offset() { + return uuid$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaUUID_t uuid + * } + */ + public static MemorySegment uuid(MemorySegment struct) { + return struct.asSlice(uuid$OFFSET, uuid$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaUUID_t uuid + * } + */ + public static void uuid(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, uuid$OFFSET, uuid$LAYOUT.byteSize()); + } + + private static final SequenceLayout luid$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("luid")); + + /** + * Layout for field: + * {@snippet lang=c : + * char luid[8] + * } + */ + public static final SequenceLayout luid$layout() { + return luid$LAYOUT; + } + + private static final long luid$OFFSET = 272; + + /** + * Offset for field: + * {@snippet lang=c : + * char luid[8] + * } + */ + public static final long luid$offset() { + return luid$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char luid[8] + * } + */ + public static MemorySegment luid(MemorySegment struct) { + return struct.asSlice(luid$OFFSET, luid$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char luid[8] + * } + */ + public static void luid(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, luid$OFFSET, luid$LAYOUT.byteSize()); + } + + private static long[] luid$DIMS = { 8 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char luid[8] + * } + */ + public static long[] luid$dimensions() { + return luid$DIMS; + } + private static final VarHandle luid$ELEM_HANDLE = luid$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char luid[8] + * } + */ + public static byte luid(MemorySegment struct, long index0) { + return (byte)luid$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char luid[8] + * } + */ + public static void luid(MemorySegment struct, long index0, byte fieldValue) { + luid$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final OfInt luidDeviceNodeMask$LAYOUT = (OfInt)$LAYOUT.select(groupElement("luidDeviceNodeMask")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int luidDeviceNodeMask + * } + */ + public static final OfInt luidDeviceNodeMask$layout() { + return luidDeviceNodeMask$LAYOUT; + } + + private static final long luidDeviceNodeMask$OFFSET = 280; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int luidDeviceNodeMask + * } + */ + public static final long luidDeviceNodeMask$offset() { + return luidDeviceNodeMask$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int luidDeviceNodeMask + * } + */ + public static int luidDeviceNodeMask(MemorySegment struct) { + return struct.get(luidDeviceNodeMask$LAYOUT, luidDeviceNodeMask$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int luidDeviceNodeMask + * } + */ + public static void luidDeviceNodeMask(MemorySegment struct, int fieldValue) { + struct.set(luidDeviceNodeMask$LAYOUT, luidDeviceNodeMask$OFFSET, fieldValue); + } + + private static final OfLong totalGlobalMem$LAYOUT = (OfLong)$LAYOUT.select(groupElement("totalGlobalMem")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t totalGlobalMem + * } + */ + public static final OfLong totalGlobalMem$layout() { + return totalGlobalMem$LAYOUT; + } + + private static final long totalGlobalMem$OFFSET = 288; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t totalGlobalMem + * } + */ + public static final long totalGlobalMem$offset() { + return totalGlobalMem$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t totalGlobalMem + * } + */ + public static long totalGlobalMem(MemorySegment struct) { + return struct.get(totalGlobalMem$LAYOUT, totalGlobalMem$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t totalGlobalMem + * } + */ + public static void totalGlobalMem(MemorySegment struct, long fieldValue) { + struct.set(totalGlobalMem$LAYOUT, totalGlobalMem$OFFSET, fieldValue); + } + + private static final OfLong sharedMemPerBlock$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sharedMemPerBlock")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t sharedMemPerBlock + * } + */ + public static final OfLong sharedMemPerBlock$layout() { + return sharedMemPerBlock$LAYOUT; + } + + private static final long sharedMemPerBlock$OFFSET = 296; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t sharedMemPerBlock + * } + */ + public static final long sharedMemPerBlock$offset() { + return sharedMemPerBlock$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t sharedMemPerBlock + * } + */ + public static long sharedMemPerBlock(MemorySegment struct) { + return struct.get(sharedMemPerBlock$LAYOUT, sharedMemPerBlock$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t sharedMemPerBlock + * } + */ + public static void sharedMemPerBlock(MemorySegment struct, long fieldValue) { + struct.set(sharedMemPerBlock$LAYOUT, sharedMemPerBlock$OFFSET, fieldValue); + } + + private static final OfInt regsPerBlock$LAYOUT = (OfInt)$LAYOUT.select(groupElement("regsPerBlock")); + + /** + * Layout for field: + * {@snippet lang=c : + * int regsPerBlock + * } + */ + public static final OfInt regsPerBlock$layout() { + return regsPerBlock$LAYOUT; + } + + private static final long regsPerBlock$OFFSET = 304; + + /** + * Offset for field: + * {@snippet lang=c : + * int regsPerBlock + * } + */ + public static final long regsPerBlock$offset() { + return regsPerBlock$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int regsPerBlock + * } + */ + public static int regsPerBlock(MemorySegment struct) { + return struct.get(regsPerBlock$LAYOUT, regsPerBlock$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int regsPerBlock + * } + */ + public static void regsPerBlock(MemorySegment struct, int fieldValue) { + struct.set(regsPerBlock$LAYOUT, regsPerBlock$OFFSET, fieldValue); + } + + private static final OfInt warpSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("warpSize")); + + /** + * Layout for field: + * {@snippet lang=c : + * int warpSize + * } + */ + public static final OfInt warpSize$layout() { + return warpSize$LAYOUT; + } + + private static final long warpSize$OFFSET = 308; + + /** + * Offset for field: + * {@snippet lang=c : + * int warpSize + * } + */ + public static final long warpSize$offset() { + return warpSize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int warpSize + * } + */ + public static int warpSize(MemorySegment struct) { + return struct.get(warpSize$LAYOUT, warpSize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int warpSize + * } + */ + public static void warpSize(MemorySegment struct, int fieldValue) { + struct.set(warpSize$LAYOUT, warpSize$OFFSET, fieldValue); + } + + private static final OfLong memPitch$LAYOUT = (OfLong)$LAYOUT.select(groupElement("memPitch")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t memPitch + * } + */ + public static final OfLong memPitch$layout() { + return memPitch$LAYOUT; + } + + private static final long memPitch$OFFSET = 312; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t memPitch + * } + */ + public static final long memPitch$offset() { + return memPitch$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t memPitch + * } + */ + public static long memPitch(MemorySegment struct) { + return struct.get(memPitch$LAYOUT, memPitch$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t memPitch + * } + */ + public static void memPitch(MemorySegment struct, long fieldValue) { + struct.set(memPitch$LAYOUT, memPitch$OFFSET, fieldValue); + } + + private static final OfInt maxThreadsPerBlock$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxThreadsPerBlock")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxThreadsPerBlock + * } + */ + public static final OfInt maxThreadsPerBlock$layout() { + return maxThreadsPerBlock$LAYOUT; + } + + private static final long maxThreadsPerBlock$OFFSET = 320; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxThreadsPerBlock + * } + */ + public static final long maxThreadsPerBlock$offset() { + return maxThreadsPerBlock$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxThreadsPerBlock + * } + */ + public static int maxThreadsPerBlock(MemorySegment struct) { + return struct.get(maxThreadsPerBlock$LAYOUT, maxThreadsPerBlock$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxThreadsPerBlock + * } + */ + public static void maxThreadsPerBlock(MemorySegment struct, int fieldValue) { + struct.set(maxThreadsPerBlock$LAYOUT, maxThreadsPerBlock$OFFSET, fieldValue); + } + + private static final SequenceLayout maxThreadsDim$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxThreadsDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxThreadsDim[3] + * } + */ + public static final SequenceLayout maxThreadsDim$layout() { + return maxThreadsDim$LAYOUT; + } + + private static final long maxThreadsDim$OFFSET = 324; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxThreadsDim[3] + * } + */ + public static final long maxThreadsDim$offset() { + return maxThreadsDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxThreadsDim[3] + * } + */ + public static MemorySegment maxThreadsDim(MemorySegment struct) { + return struct.asSlice(maxThreadsDim$OFFSET, maxThreadsDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxThreadsDim[3] + * } + */ + public static void maxThreadsDim(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxThreadsDim$OFFSET, maxThreadsDim$LAYOUT.byteSize()); + } + + private static long[] maxThreadsDim$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxThreadsDim[3] + * } + */ + public static long[] maxThreadsDim$dimensions() { + return maxThreadsDim$DIMS; + } + private static final VarHandle maxThreadsDim$ELEM_HANDLE = maxThreadsDim$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxThreadsDim[3] + * } + */ + public static int maxThreadsDim(MemorySegment struct, long index0) { + return (int)maxThreadsDim$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxThreadsDim[3] + * } + */ + public static void maxThreadsDim(MemorySegment struct, long index0, int fieldValue) { + maxThreadsDim$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxGridSize$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxGridSize")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxGridSize[3] + * } + */ + public static final SequenceLayout maxGridSize$layout() { + return maxGridSize$LAYOUT; + } + + private static final long maxGridSize$OFFSET = 336; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxGridSize[3] + * } + */ + public static final long maxGridSize$offset() { + return maxGridSize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxGridSize[3] + * } + */ + public static MemorySegment maxGridSize(MemorySegment struct) { + return struct.asSlice(maxGridSize$OFFSET, maxGridSize$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxGridSize[3] + * } + */ + public static void maxGridSize(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxGridSize$OFFSET, maxGridSize$LAYOUT.byteSize()); + } + + private static long[] maxGridSize$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxGridSize[3] + * } + */ + public static long[] maxGridSize$dimensions() { + return maxGridSize$DIMS; + } + private static final VarHandle maxGridSize$ELEM_HANDLE = maxGridSize$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxGridSize[3] + * } + */ + public static int maxGridSize(MemorySegment struct, long index0) { + return (int)maxGridSize$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxGridSize[3] + * } + */ + public static void maxGridSize(MemorySegment struct, long index0, int fieldValue) { + maxGridSize$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final OfInt clockRate$LAYOUT = (OfInt)$LAYOUT.select(groupElement("clockRate")); + + /** + * Layout for field: + * {@snippet lang=c : + * int clockRate + * } + */ + public static final OfInt clockRate$layout() { + return clockRate$LAYOUT; + } + + private static final long clockRate$OFFSET = 348; + + /** + * Offset for field: + * {@snippet lang=c : + * int clockRate + * } + */ + public static final long clockRate$offset() { + return clockRate$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int clockRate + * } + */ + public static int clockRate(MemorySegment struct) { + return struct.get(clockRate$LAYOUT, clockRate$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int clockRate + * } + */ + public static void clockRate(MemorySegment struct, int fieldValue) { + struct.set(clockRate$LAYOUT, clockRate$OFFSET, fieldValue); + } + + private static final OfLong totalConstMem$LAYOUT = (OfLong)$LAYOUT.select(groupElement("totalConstMem")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t totalConstMem + * } + */ + public static final OfLong totalConstMem$layout() { + return totalConstMem$LAYOUT; + } + + private static final long totalConstMem$OFFSET = 352; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t totalConstMem + * } + */ + public static final long totalConstMem$offset() { + return totalConstMem$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t totalConstMem + * } + */ + public static long totalConstMem(MemorySegment struct) { + return struct.get(totalConstMem$LAYOUT, totalConstMem$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t totalConstMem + * } + */ + public static void totalConstMem(MemorySegment struct, long fieldValue) { + struct.set(totalConstMem$LAYOUT, totalConstMem$OFFSET, fieldValue); + } + + private static final OfInt major$LAYOUT = (OfInt)$LAYOUT.select(groupElement("major")); + + /** + * Layout for field: + * {@snippet lang=c : + * int major + * } + */ + public static final OfInt major$layout() { + return major$LAYOUT; + } + + private static final long major$OFFSET = 360; + + /** + * Offset for field: + * {@snippet lang=c : + * int major + * } + */ + public static final long major$offset() { + return major$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int major + * } + */ + public static int major(MemorySegment struct) { + return struct.get(major$LAYOUT, major$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int major + * } + */ + public static void major(MemorySegment struct, int fieldValue) { + struct.set(major$LAYOUT, major$OFFSET, fieldValue); + } + + private static final OfInt minor$LAYOUT = (OfInt)$LAYOUT.select(groupElement("minor")); + + /** + * Layout for field: + * {@snippet lang=c : + * int minor + * } + */ + public static final OfInt minor$layout() { + return minor$LAYOUT; + } + + private static final long minor$OFFSET = 364; + + /** + * Offset for field: + * {@snippet lang=c : + * int minor + * } + */ + public static final long minor$offset() { + return minor$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int minor + * } + */ + public static int minor(MemorySegment struct) { + return struct.get(minor$LAYOUT, minor$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int minor + * } + */ + public static void minor(MemorySegment struct, int fieldValue) { + struct.set(minor$LAYOUT, minor$OFFSET, fieldValue); + } + + private static final OfLong textureAlignment$LAYOUT = (OfLong)$LAYOUT.select(groupElement("textureAlignment")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t textureAlignment + * } + */ + public static final OfLong textureAlignment$layout() { + return textureAlignment$LAYOUT; + } + + private static final long textureAlignment$OFFSET = 368; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t textureAlignment + * } + */ + public static final long textureAlignment$offset() { + return textureAlignment$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t textureAlignment + * } + */ + public static long textureAlignment(MemorySegment struct) { + return struct.get(textureAlignment$LAYOUT, textureAlignment$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t textureAlignment + * } + */ + public static void textureAlignment(MemorySegment struct, long fieldValue) { + struct.set(textureAlignment$LAYOUT, textureAlignment$OFFSET, fieldValue); + } + + private static final OfLong texturePitchAlignment$LAYOUT = (OfLong)$LAYOUT.select(groupElement("texturePitchAlignment")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t texturePitchAlignment + * } + */ + public static final OfLong texturePitchAlignment$layout() { + return texturePitchAlignment$LAYOUT; + } + + private static final long texturePitchAlignment$OFFSET = 376; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t texturePitchAlignment + * } + */ + public static final long texturePitchAlignment$offset() { + return texturePitchAlignment$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t texturePitchAlignment + * } + */ + public static long texturePitchAlignment(MemorySegment struct) { + return struct.get(texturePitchAlignment$LAYOUT, texturePitchAlignment$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t texturePitchAlignment + * } + */ + public static void texturePitchAlignment(MemorySegment struct, long fieldValue) { + struct.set(texturePitchAlignment$LAYOUT, texturePitchAlignment$OFFSET, fieldValue); + } + + private static final OfInt deviceOverlap$LAYOUT = (OfInt)$LAYOUT.select(groupElement("deviceOverlap")); + + /** + * Layout for field: + * {@snippet lang=c : + * int deviceOverlap + * } + */ + public static final OfInt deviceOverlap$layout() { + return deviceOverlap$LAYOUT; + } + + private static final long deviceOverlap$OFFSET = 384; + + /** + * Offset for field: + * {@snippet lang=c : + * int deviceOverlap + * } + */ + public static final long deviceOverlap$offset() { + return deviceOverlap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int deviceOverlap + * } + */ + public static int deviceOverlap(MemorySegment struct) { + return struct.get(deviceOverlap$LAYOUT, deviceOverlap$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int deviceOverlap + * } + */ + public static void deviceOverlap(MemorySegment struct, int fieldValue) { + struct.set(deviceOverlap$LAYOUT, deviceOverlap$OFFSET, fieldValue); + } + + private static final OfInt multiProcessorCount$LAYOUT = (OfInt)$LAYOUT.select(groupElement("multiProcessorCount")); + + /** + * Layout for field: + * {@snippet lang=c : + * int multiProcessorCount + * } + */ + public static final OfInt multiProcessorCount$layout() { + return multiProcessorCount$LAYOUT; + } + + private static final long multiProcessorCount$OFFSET = 388; + + /** + * Offset for field: + * {@snippet lang=c : + * int multiProcessorCount + * } + */ + public static final long multiProcessorCount$offset() { + return multiProcessorCount$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int multiProcessorCount + * } + */ + public static int multiProcessorCount(MemorySegment struct) { + return struct.get(multiProcessorCount$LAYOUT, multiProcessorCount$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int multiProcessorCount + * } + */ + public static void multiProcessorCount(MemorySegment struct, int fieldValue) { + struct.set(multiProcessorCount$LAYOUT, multiProcessorCount$OFFSET, fieldValue); + } + + private static final OfInt kernelExecTimeoutEnabled$LAYOUT = (OfInt)$LAYOUT.select(groupElement("kernelExecTimeoutEnabled")); + + /** + * Layout for field: + * {@snippet lang=c : + * int kernelExecTimeoutEnabled + * } + */ + public static final OfInt kernelExecTimeoutEnabled$layout() { + return kernelExecTimeoutEnabled$LAYOUT; + } + + private static final long kernelExecTimeoutEnabled$OFFSET = 392; + + /** + * Offset for field: + * {@snippet lang=c : + * int kernelExecTimeoutEnabled + * } + */ + public static final long kernelExecTimeoutEnabled$offset() { + return kernelExecTimeoutEnabled$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int kernelExecTimeoutEnabled + * } + */ + public static int kernelExecTimeoutEnabled(MemorySegment struct) { + return struct.get(kernelExecTimeoutEnabled$LAYOUT, kernelExecTimeoutEnabled$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int kernelExecTimeoutEnabled + * } + */ + public static void kernelExecTimeoutEnabled(MemorySegment struct, int fieldValue) { + struct.set(kernelExecTimeoutEnabled$LAYOUT, kernelExecTimeoutEnabled$OFFSET, fieldValue); + } + + private static final OfInt integrated$LAYOUT = (OfInt)$LAYOUT.select(groupElement("integrated")); + + /** + * Layout for field: + * {@snippet lang=c : + * int integrated + * } + */ + public static final OfInt integrated$layout() { + return integrated$LAYOUT; + } + + private static final long integrated$OFFSET = 396; + + /** + * Offset for field: + * {@snippet lang=c : + * int integrated + * } + */ + public static final long integrated$offset() { + return integrated$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int integrated + * } + */ + public static int integrated(MemorySegment struct) { + return struct.get(integrated$LAYOUT, integrated$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int integrated + * } + */ + public static void integrated(MemorySegment struct, int fieldValue) { + struct.set(integrated$LAYOUT, integrated$OFFSET, fieldValue); + } + + private static final OfInt canMapHostMemory$LAYOUT = (OfInt)$LAYOUT.select(groupElement("canMapHostMemory")); + + /** + * Layout for field: + * {@snippet lang=c : + * int canMapHostMemory + * } + */ + public static final OfInt canMapHostMemory$layout() { + return canMapHostMemory$LAYOUT; + } + + private static final long canMapHostMemory$OFFSET = 400; + + /** + * Offset for field: + * {@snippet lang=c : + * int canMapHostMemory + * } + */ + public static final long canMapHostMemory$offset() { + return canMapHostMemory$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int canMapHostMemory + * } + */ + public static int canMapHostMemory(MemorySegment struct) { + return struct.get(canMapHostMemory$LAYOUT, canMapHostMemory$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int canMapHostMemory + * } + */ + public static void canMapHostMemory(MemorySegment struct, int fieldValue) { + struct.set(canMapHostMemory$LAYOUT, canMapHostMemory$OFFSET, fieldValue); + } + + private static final OfInt computeMode$LAYOUT = (OfInt)$LAYOUT.select(groupElement("computeMode")); + + /** + * Layout for field: + * {@snippet lang=c : + * int computeMode + * } + */ + public static final OfInt computeMode$layout() { + return computeMode$LAYOUT; + } + + private static final long computeMode$OFFSET = 404; + + /** + * Offset for field: + * {@snippet lang=c : + * int computeMode + * } + */ + public static final long computeMode$offset() { + return computeMode$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int computeMode + * } + */ + public static int computeMode(MemorySegment struct) { + return struct.get(computeMode$LAYOUT, computeMode$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int computeMode + * } + */ + public static void computeMode(MemorySegment struct, int fieldValue) { + struct.set(computeMode$LAYOUT, computeMode$OFFSET, fieldValue); + } + + private static final OfInt maxTexture1D$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxTexture1D")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture1D + * } + */ + public static final OfInt maxTexture1D$layout() { + return maxTexture1D$LAYOUT; + } + + private static final long maxTexture1D$OFFSET = 408; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture1D + * } + */ + public static final long maxTexture1D$offset() { + return maxTexture1D$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture1D + * } + */ + public static int maxTexture1D(MemorySegment struct) { + return struct.get(maxTexture1D$LAYOUT, maxTexture1D$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture1D + * } + */ + public static void maxTexture1D(MemorySegment struct, int fieldValue) { + struct.set(maxTexture1D$LAYOUT, maxTexture1D$OFFSET, fieldValue); + } + + private static final OfInt maxTexture1DMipmap$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxTexture1DMipmap")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture1DMipmap + * } + */ + public static final OfInt maxTexture1DMipmap$layout() { + return maxTexture1DMipmap$LAYOUT; + } + + private static final long maxTexture1DMipmap$OFFSET = 412; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture1DMipmap + * } + */ + public static final long maxTexture1DMipmap$offset() { + return maxTexture1DMipmap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture1DMipmap + * } + */ + public static int maxTexture1DMipmap(MemorySegment struct) { + return struct.get(maxTexture1DMipmap$LAYOUT, maxTexture1DMipmap$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture1DMipmap + * } + */ + public static void maxTexture1DMipmap(MemorySegment struct, int fieldValue) { + struct.set(maxTexture1DMipmap$LAYOUT, maxTexture1DMipmap$OFFSET, fieldValue); + } + + private static final OfInt maxTexture1DLinear$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxTexture1DLinear")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture1DLinear + * } + */ + public static final OfInt maxTexture1DLinear$layout() { + return maxTexture1DLinear$LAYOUT; + } + + private static final long maxTexture1DLinear$OFFSET = 416; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture1DLinear + * } + */ + public static final long maxTexture1DLinear$offset() { + return maxTexture1DLinear$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture1DLinear + * } + */ + public static int maxTexture1DLinear(MemorySegment struct) { + return struct.get(maxTexture1DLinear$LAYOUT, maxTexture1DLinear$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture1DLinear + * } + */ + public static void maxTexture1DLinear(MemorySegment struct, int fieldValue) { + struct.set(maxTexture1DLinear$LAYOUT, maxTexture1DLinear$OFFSET, fieldValue); + } + + private static final SequenceLayout maxTexture2D$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture2D")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture2D[2] + * } + */ + public static final SequenceLayout maxTexture2D$layout() { + return maxTexture2D$LAYOUT; + } + + private static final long maxTexture2D$OFFSET = 420; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture2D[2] + * } + */ + public static final long maxTexture2D$offset() { + return maxTexture2D$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture2D[2] + * } + */ + public static MemorySegment maxTexture2D(MemorySegment struct) { + return struct.asSlice(maxTexture2D$OFFSET, maxTexture2D$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture2D[2] + * } + */ + public static void maxTexture2D(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxTexture2D$OFFSET, maxTexture2D$LAYOUT.byteSize()); + } + + private static long[] maxTexture2D$DIMS = { 2 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxTexture2D[2] + * } + */ + public static long[] maxTexture2D$dimensions() { + return maxTexture2D$DIMS; + } + private static final VarHandle maxTexture2D$ELEM_HANDLE = maxTexture2D$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxTexture2D[2] + * } + */ + public static int maxTexture2D(MemorySegment struct, long index0) { + return (int)maxTexture2D$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxTexture2D[2] + * } + */ + public static void maxTexture2D(MemorySegment struct, long index0, int fieldValue) { + maxTexture2D$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxTexture2DMipmap$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture2DMipmap")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture2DMipmap[2] + * } + */ + public static final SequenceLayout maxTexture2DMipmap$layout() { + return maxTexture2DMipmap$LAYOUT; + } + + private static final long maxTexture2DMipmap$OFFSET = 428; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture2DMipmap[2] + * } + */ + public static final long maxTexture2DMipmap$offset() { + return maxTexture2DMipmap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture2DMipmap[2] + * } + */ + public static MemorySegment maxTexture2DMipmap(MemorySegment struct) { + return struct.asSlice(maxTexture2DMipmap$OFFSET, maxTexture2DMipmap$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture2DMipmap[2] + * } + */ + public static void maxTexture2DMipmap(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxTexture2DMipmap$OFFSET, maxTexture2DMipmap$LAYOUT.byteSize()); + } + + private static long[] maxTexture2DMipmap$DIMS = { 2 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxTexture2DMipmap[2] + * } + */ + public static long[] maxTexture2DMipmap$dimensions() { + return maxTexture2DMipmap$DIMS; + } + private static final VarHandle maxTexture2DMipmap$ELEM_HANDLE = maxTexture2DMipmap$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxTexture2DMipmap[2] + * } + */ + public static int maxTexture2DMipmap(MemorySegment struct, long index0) { + return (int)maxTexture2DMipmap$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxTexture2DMipmap[2] + * } + */ + public static void maxTexture2DMipmap(MemorySegment struct, long index0, int fieldValue) { + maxTexture2DMipmap$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxTexture2DLinear$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture2DLinear")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture2DLinear[3] + * } + */ + public static final SequenceLayout maxTexture2DLinear$layout() { + return maxTexture2DLinear$LAYOUT; + } + + private static final long maxTexture2DLinear$OFFSET = 436; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture2DLinear[3] + * } + */ + public static final long maxTexture2DLinear$offset() { + return maxTexture2DLinear$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture2DLinear[3] + * } + */ + public static MemorySegment maxTexture2DLinear(MemorySegment struct) { + return struct.asSlice(maxTexture2DLinear$OFFSET, maxTexture2DLinear$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture2DLinear[3] + * } + */ + public static void maxTexture2DLinear(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxTexture2DLinear$OFFSET, maxTexture2DLinear$LAYOUT.byteSize()); + } + + private static long[] maxTexture2DLinear$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxTexture2DLinear[3] + * } + */ + public static long[] maxTexture2DLinear$dimensions() { + return maxTexture2DLinear$DIMS; + } + private static final VarHandle maxTexture2DLinear$ELEM_HANDLE = maxTexture2DLinear$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxTexture2DLinear[3] + * } + */ + public static int maxTexture2DLinear(MemorySegment struct, long index0) { + return (int)maxTexture2DLinear$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxTexture2DLinear[3] + * } + */ + public static void maxTexture2DLinear(MemorySegment struct, long index0, int fieldValue) { + maxTexture2DLinear$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxTexture2DGather$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture2DGather")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture2DGather[2] + * } + */ + public static final SequenceLayout maxTexture2DGather$layout() { + return maxTexture2DGather$LAYOUT; + } + + private static final long maxTexture2DGather$OFFSET = 448; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture2DGather[2] + * } + */ + public static final long maxTexture2DGather$offset() { + return maxTexture2DGather$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture2DGather[2] + * } + */ + public static MemorySegment maxTexture2DGather(MemorySegment struct) { + return struct.asSlice(maxTexture2DGather$OFFSET, maxTexture2DGather$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture2DGather[2] + * } + */ + public static void maxTexture2DGather(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxTexture2DGather$OFFSET, maxTexture2DGather$LAYOUT.byteSize()); + } + + private static long[] maxTexture2DGather$DIMS = { 2 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxTexture2DGather[2] + * } + */ + public static long[] maxTexture2DGather$dimensions() { + return maxTexture2DGather$DIMS; + } + private static final VarHandle maxTexture2DGather$ELEM_HANDLE = maxTexture2DGather$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxTexture2DGather[2] + * } + */ + public static int maxTexture2DGather(MemorySegment struct, long index0) { + return (int)maxTexture2DGather$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxTexture2DGather[2] + * } + */ + public static void maxTexture2DGather(MemorySegment struct, long index0, int fieldValue) { + maxTexture2DGather$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxTexture3D$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture3D")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture3D[3] + * } + */ + public static final SequenceLayout maxTexture3D$layout() { + return maxTexture3D$LAYOUT; + } + + private static final long maxTexture3D$OFFSET = 456; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture3D[3] + * } + */ + public static final long maxTexture3D$offset() { + return maxTexture3D$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture3D[3] + * } + */ + public static MemorySegment maxTexture3D(MemorySegment struct) { + return struct.asSlice(maxTexture3D$OFFSET, maxTexture3D$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture3D[3] + * } + */ + public static void maxTexture3D(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxTexture3D$OFFSET, maxTexture3D$LAYOUT.byteSize()); + } + + private static long[] maxTexture3D$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxTexture3D[3] + * } + */ + public static long[] maxTexture3D$dimensions() { + return maxTexture3D$DIMS; + } + private static final VarHandle maxTexture3D$ELEM_HANDLE = maxTexture3D$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxTexture3D[3] + * } + */ + public static int maxTexture3D(MemorySegment struct, long index0) { + return (int)maxTexture3D$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxTexture3D[3] + * } + */ + public static void maxTexture3D(MemorySegment struct, long index0, int fieldValue) { + maxTexture3D$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxTexture3DAlt$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture3DAlt")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture3DAlt[3] + * } + */ + public static final SequenceLayout maxTexture3DAlt$layout() { + return maxTexture3DAlt$LAYOUT; + } + + private static final long maxTexture3DAlt$OFFSET = 468; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture3DAlt[3] + * } + */ + public static final long maxTexture3DAlt$offset() { + return maxTexture3DAlt$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture3DAlt[3] + * } + */ + public static MemorySegment maxTexture3DAlt(MemorySegment struct) { + return struct.asSlice(maxTexture3DAlt$OFFSET, maxTexture3DAlt$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture3DAlt[3] + * } + */ + public static void maxTexture3DAlt(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxTexture3DAlt$OFFSET, maxTexture3DAlt$LAYOUT.byteSize()); + } + + private static long[] maxTexture3DAlt$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxTexture3DAlt[3] + * } + */ + public static long[] maxTexture3DAlt$dimensions() { + return maxTexture3DAlt$DIMS; + } + private static final VarHandle maxTexture3DAlt$ELEM_HANDLE = maxTexture3DAlt$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxTexture3DAlt[3] + * } + */ + public static int maxTexture3DAlt(MemorySegment struct, long index0) { + return (int)maxTexture3DAlt$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxTexture3DAlt[3] + * } + */ + public static void maxTexture3DAlt(MemorySegment struct, long index0, int fieldValue) { + maxTexture3DAlt$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final OfInt maxTextureCubemap$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxTextureCubemap")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTextureCubemap + * } + */ + public static final OfInt maxTextureCubemap$layout() { + return maxTextureCubemap$LAYOUT; + } + + private static final long maxTextureCubemap$OFFSET = 480; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTextureCubemap + * } + */ + public static final long maxTextureCubemap$offset() { + return maxTextureCubemap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTextureCubemap + * } + */ + public static int maxTextureCubemap(MemorySegment struct) { + return struct.get(maxTextureCubemap$LAYOUT, maxTextureCubemap$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTextureCubemap + * } + */ + public static void maxTextureCubemap(MemorySegment struct, int fieldValue) { + struct.set(maxTextureCubemap$LAYOUT, maxTextureCubemap$OFFSET, fieldValue); + } + + private static final SequenceLayout maxTexture1DLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture1DLayered")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture1DLayered[2] + * } + */ + public static final SequenceLayout maxTexture1DLayered$layout() { + return maxTexture1DLayered$LAYOUT; + } + + private static final long maxTexture1DLayered$OFFSET = 484; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture1DLayered[2] + * } + */ + public static final long maxTexture1DLayered$offset() { + return maxTexture1DLayered$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture1DLayered[2] + * } + */ + public static MemorySegment maxTexture1DLayered(MemorySegment struct) { + return struct.asSlice(maxTexture1DLayered$OFFSET, maxTexture1DLayered$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture1DLayered[2] + * } + */ + public static void maxTexture1DLayered(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxTexture1DLayered$OFFSET, maxTexture1DLayered$LAYOUT.byteSize()); + } + + private static long[] maxTexture1DLayered$DIMS = { 2 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxTexture1DLayered[2] + * } + */ + public static long[] maxTexture1DLayered$dimensions() { + return maxTexture1DLayered$DIMS; + } + private static final VarHandle maxTexture1DLayered$ELEM_HANDLE = maxTexture1DLayered$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxTexture1DLayered[2] + * } + */ + public static int maxTexture1DLayered(MemorySegment struct, long index0) { + return (int)maxTexture1DLayered$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxTexture1DLayered[2] + * } + */ + public static void maxTexture1DLayered(MemorySegment struct, long index0, int fieldValue) { + maxTexture1DLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxTexture2DLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture2DLayered")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTexture2DLayered[3] + * } + */ + public static final SequenceLayout maxTexture2DLayered$layout() { + return maxTexture2DLayered$LAYOUT; + } + + private static final long maxTexture2DLayered$OFFSET = 492; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTexture2DLayered[3] + * } + */ + public static final long maxTexture2DLayered$offset() { + return maxTexture2DLayered$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTexture2DLayered[3] + * } + */ + public static MemorySegment maxTexture2DLayered(MemorySegment struct) { + return struct.asSlice(maxTexture2DLayered$OFFSET, maxTexture2DLayered$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTexture2DLayered[3] + * } + */ + public static void maxTexture2DLayered(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxTexture2DLayered$OFFSET, maxTexture2DLayered$LAYOUT.byteSize()); + } + + private static long[] maxTexture2DLayered$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxTexture2DLayered[3] + * } + */ + public static long[] maxTexture2DLayered$dimensions() { + return maxTexture2DLayered$DIMS; + } + private static final VarHandle maxTexture2DLayered$ELEM_HANDLE = maxTexture2DLayered$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxTexture2DLayered[3] + * } + */ + public static int maxTexture2DLayered(MemorySegment struct, long index0) { + return (int)maxTexture2DLayered$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxTexture2DLayered[3] + * } + */ + public static void maxTexture2DLayered(MemorySegment struct, long index0, int fieldValue) { + maxTexture2DLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxTextureCubemapLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTextureCubemapLayered")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxTextureCubemapLayered[2] + * } + */ + public static final SequenceLayout maxTextureCubemapLayered$layout() { + return maxTextureCubemapLayered$LAYOUT; + } + + private static final long maxTextureCubemapLayered$OFFSET = 504; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxTextureCubemapLayered[2] + * } + */ + public static final long maxTextureCubemapLayered$offset() { + return maxTextureCubemapLayered$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxTextureCubemapLayered[2] + * } + */ + public static MemorySegment maxTextureCubemapLayered(MemorySegment struct) { + return struct.asSlice(maxTextureCubemapLayered$OFFSET, maxTextureCubemapLayered$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxTextureCubemapLayered[2] + * } + */ + public static void maxTextureCubemapLayered(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxTextureCubemapLayered$OFFSET, maxTextureCubemapLayered$LAYOUT.byteSize()); + } + + private static long[] maxTextureCubemapLayered$DIMS = { 2 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxTextureCubemapLayered[2] + * } + */ + public static long[] maxTextureCubemapLayered$dimensions() { + return maxTextureCubemapLayered$DIMS; + } + private static final VarHandle maxTextureCubemapLayered$ELEM_HANDLE = maxTextureCubemapLayered$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxTextureCubemapLayered[2] + * } + */ + public static int maxTextureCubemapLayered(MemorySegment struct, long index0) { + return (int)maxTextureCubemapLayered$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxTextureCubemapLayered[2] + * } + */ + public static void maxTextureCubemapLayered(MemorySegment struct, long index0, int fieldValue) { + maxTextureCubemapLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final OfInt maxSurface1D$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxSurface1D")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxSurface1D + * } + */ + public static final OfInt maxSurface1D$layout() { + return maxSurface1D$LAYOUT; + } + + private static final long maxSurface1D$OFFSET = 512; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxSurface1D + * } + */ + public static final long maxSurface1D$offset() { + return maxSurface1D$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxSurface1D + * } + */ + public static int maxSurface1D(MemorySegment struct) { + return struct.get(maxSurface1D$LAYOUT, maxSurface1D$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxSurface1D + * } + */ + public static void maxSurface1D(MemorySegment struct, int fieldValue) { + struct.set(maxSurface1D$LAYOUT, maxSurface1D$OFFSET, fieldValue); + } + + private static final SequenceLayout maxSurface2D$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxSurface2D")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxSurface2D[2] + * } + */ + public static final SequenceLayout maxSurface2D$layout() { + return maxSurface2D$LAYOUT; + } + + private static final long maxSurface2D$OFFSET = 516; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxSurface2D[2] + * } + */ + public static final long maxSurface2D$offset() { + return maxSurface2D$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxSurface2D[2] + * } + */ + public static MemorySegment maxSurface2D(MemorySegment struct) { + return struct.asSlice(maxSurface2D$OFFSET, maxSurface2D$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxSurface2D[2] + * } + */ + public static void maxSurface2D(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxSurface2D$OFFSET, maxSurface2D$LAYOUT.byteSize()); + } + + private static long[] maxSurface2D$DIMS = { 2 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxSurface2D[2] + * } + */ + public static long[] maxSurface2D$dimensions() { + return maxSurface2D$DIMS; + } + private static final VarHandle maxSurface2D$ELEM_HANDLE = maxSurface2D$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxSurface2D[2] + * } + */ + public static int maxSurface2D(MemorySegment struct, long index0) { + return (int)maxSurface2D$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxSurface2D[2] + * } + */ + public static void maxSurface2D(MemorySegment struct, long index0, int fieldValue) { + maxSurface2D$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxSurface3D$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxSurface3D")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxSurface3D[3] + * } + */ + public static final SequenceLayout maxSurface3D$layout() { + return maxSurface3D$LAYOUT; + } + + private static final long maxSurface3D$OFFSET = 524; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxSurface3D[3] + * } + */ + public static final long maxSurface3D$offset() { + return maxSurface3D$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxSurface3D[3] + * } + */ + public static MemorySegment maxSurface3D(MemorySegment struct) { + return struct.asSlice(maxSurface3D$OFFSET, maxSurface3D$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxSurface3D[3] + * } + */ + public static void maxSurface3D(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxSurface3D$OFFSET, maxSurface3D$LAYOUT.byteSize()); + } + + private static long[] maxSurface3D$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxSurface3D[3] + * } + */ + public static long[] maxSurface3D$dimensions() { + return maxSurface3D$DIMS; + } + private static final VarHandle maxSurface3D$ELEM_HANDLE = maxSurface3D$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxSurface3D[3] + * } + */ + public static int maxSurface3D(MemorySegment struct, long index0) { + return (int)maxSurface3D$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxSurface3D[3] + * } + */ + public static void maxSurface3D(MemorySegment struct, long index0, int fieldValue) { + maxSurface3D$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxSurface1DLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxSurface1DLayered")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxSurface1DLayered[2] + * } + */ + public static final SequenceLayout maxSurface1DLayered$layout() { + return maxSurface1DLayered$LAYOUT; + } + + private static final long maxSurface1DLayered$OFFSET = 536; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxSurface1DLayered[2] + * } + */ + public static final long maxSurface1DLayered$offset() { + return maxSurface1DLayered$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxSurface1DLayered[2] + * } + */ + public static MemorySegment maxSurface1DLayered(MemorySegment struct) { + return struct.asSlice(maxSurface1DLayered$OFFSET, maxSurface1DLayered$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxSurface1DLayered[2] + * } + */ + public static void maxSurface1DLayered(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxSurface1DLayered$OFFSET, maxSurface1DLayered$LAYOUT.byteSize()); + } + + private static long[] maxSurface1DLayered$DIMS = { 2 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxSurface1DLayered[2] + * } + */ + public static long[] maxSurface1DLayered$dimensions() { + return maxSurface1DLayered$DIMS; + } + private static final VarHandle maxSurface1DLayered$ELEM_HANDLE = maxSurface1DLayered$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxSurface1DLayered[2] + * } + */ + public static int maxSurface1DLayered(MemorySegment struct, long index0) { + return (int)maxSurface1DLayered$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxSurface1DLayered[2] + * } + */ + public static void maxSurface1DLayered(MemorySegment struct, long index0, int fieldValue) { + maxSurface1DLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout maxSurface2DLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxSurface2DLayered")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxSurface2DLayered[3] + * } + */ + public static final SequenceLayout maxSurface2DLayered$layout() { + return maxSurface2DLayered$LAYOUT; + } + + private static final long maxSurface2DLayered$OFFSET = 544; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxSurface2DLayered[3] + * } + */ + public static final long maxSurface2DLayered$offset() { + return maxSurface2DLayered$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxSurface2DLayered[3] + * } + */ + public static MemorySegment maxSurface2DLayered(MemorySegment struct) { + return struct.asSlice(maxSurface2DLayered$OFFSET, maxSurface2DLayered$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxSurface2DLayered[3] + * } + */ + public static void maxSurface2DLayered(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxSurface2DLayered$OFFSET, maxSurface2DLayered$LAYOUT.byteSize()); + } + + private static long[] maxSurface2DLayered$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxSurface2DLayered[3] + * } + */ + public static long[] maxSurface2DLayered$dimensions() { + return maxSurface2DLayered$DIMS; + } + private static final VarHandle maxSurface2DLayered$ELEM_HANDLE = maxSurface2DLayered$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxSurface2DLayered[3] + * } + */ + public static int maxSurface2DLayered(MemorySegment struct, long index0) { + return (int)maxSurface2DLayered$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxSurface2DLayered[3] + * } + */ + public static void maxSurface2DLayered(MemorySegment struct, long index0, int fieldValue) { + maxSurface2DLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final OfInt maxSurfaceCubemap$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxSurfaceCubemap")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxSurfaceCubemap + * } + */ + public static final OfInt maxSurfaceCubemap$layout() { + return maxSurfaceCubemap$LAYOUT; + } + + private static final long maxSurfaceCubemap$OFFSET = 556; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxSurfaceCubemap + * } + */ + public static final long maxSurfaceCubemap$offset() { + return maxSurfaceCubemap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxSurfaceCubemap + * } + */ + public static int maxSurfaceCubemap(MemorySegment struct) { + return struct.get(maxSurfaceCubemap$LAYOUT, maxSurfaceCubemap$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxSurfaceCubemap + * } + */ + public static void maxSurfaceCubemap(MemorySegment struct, int fieldValue) { + struct.set(maxSurfaceCubemap$LAYOUT, maxSurfaceCubemap$OFFSET, fieldValue); + } + + private static final SequenceLayout maxSurfaceCubemapLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxSurfaceCubemapLayered")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxSurfaceCubemapLayered[2] + * } + */ + public static final SequenceLayout maxSurfaceCubemapLayered$layout() { + return maxSurfaceCubemapLayered$LAYOUT; + } + + private static final long maxSurfaceCubemapLayered$OFFSET = 560; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxSurfaceCubemapLayered[2] + * } + */ + public static final long maxSurfaceCubemapLayered$offset() { + return maxSurfaceCubemapLayered$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxSurfaceCubemapLayered[2] + * } + */ + public static MemorySegment maxSurfaceCubemapLayered(MemorySegment struct) { + return struct.asSlice(maxSurfaceCubemapLayered$OFFSET, maxSurfaceCubemapLayered$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxSurfaceCubemapLayered[2] + * } + */ + public static void maxSurfaceCubemapLayered(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, maxSurfaceCubemapLayered$OFFSET, maxSurfaceCubemapLayered$LAYOUT.byteSize()); + } + + private static long[] maxSurfaceCubemapLayered$DIMS = { 2 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int maxSurfaceCubemapLayered[2] + * } + */ + public static long[] maxSurfaceCubemapLayered$dimensions() { + return maxSurfaceCubemapLayered$DIMS; + } + private static final VarHandle maxSurfaceCubemapLayered$ELEM_HANDLE = maxSurfaceCubemapLayered$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int maxSurfaceCubemapLayered[2] + * } + */ + public static int maxSurfaceCubemapLayered(MemorySegment struct, long index0) { + return (int)maxSurfaceCubemapLayered$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int maxSurfaceCubemapLayered[2] + * } + */ + public static void maxSurfaceCubemapLayered(MemorySegment struct, long index0, int fieldValue) { + maxSurfaceCubemapLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final OfLong surfaceAlignment$LAYOUT = (OfLong)$LAYOUT.select(groupElement("surfaceAlignment")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t surfaceAlignment + * } + */ + public static final OfLong surfaceAlignment$layout() { + return surfaceAlignment$LAYOUT; + } + + private static final long surfaceAlignment$OFFSET = 568; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t surfaceAlignment + * } + */ + public static final long surfaceAlignment$offset() { + return surfaceAlignment$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t surfaceAlignment + * } + */ + public static long surfaceAlignment(MemorySegment struct) { + return struct.get(surfaceAlignment$LAYOUT, surfaceAlignment$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t surfaceAlignment + * } + */ + public static void surfaceAlignment(MemorySegment struct, long fieldValue) { + struct.set(surfaceAlignment$LAYOUT, surfaceAlignment$OFFSET, fieldValue); + } + + private static final OfInt concurrentKernels$LAYOUT = (OfInt)$LAYOUT.select(groupElement("concurrentKernels")); + + /** + * Layout for field: + * {@snippet lang=c : + * int concurrentKernels + * } + */ + public static final OfInt concurrentKernels$layout() { + return concurrentKernels$LAYOUT; + } + + private static final long concurrentKernels$OFFSET = 576; + + /** + * Offset for field: + * {@snippet lang=c : + * int concurrentKernels + * } + */ + public static final long concurrentKernels$offset() { + return concurrentKernels$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int concurrentKernels + * } + */ + public static int concurrentKernels(MemorySegment struct) { + return struct.get(concurrentKernels$LAYOUT, concurrentKernels$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int concurrentKernels + * } + */ + public static void concurrentKernels(MemorySegment struct, int fieldValue) { + struct.set(concurrentKernels$LAYOUT, concurrentKernels$OFFSET, fieldValue); + } + + private static final OfInt ECCEnabled$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ECCEnabled")); + + /** + * Layout for field: + * {@snippet lang=c : + * int ECCEnabled + * } + */ + public static final OfInt ECCEnabled$layout() { + return ECCEnabled$LAYOUT; + } + + private static final long ECCEnabled$OFFSET = 580; + + /** + * Offset for field: + * {@snippet lang=c : + * int ECCEnabled + * } + */ + public static final long ECCEnabled$offset() { + return ECCEnabled$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int ECCEnabled + * } + */ + public static int ECCEnabled(MemorySegment struct) { + return struct.get(ECCEnabled$LAYOUT, ECCEnabled$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int ECCEnabled + * } + */ + public static void ECCEnabled(MemorySegment struct, int fieldValue) { + struct.set(ECCEnabled$LAYOUT, ECCEnabled$OFFSET, fieldValue); + } + + private static final OfInt pciBusID$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pciBusID")); + + /** + * Layout for field: + * {@snippet lang=c : + * int pciBusID + * } + */ + public static final OfInt pciBusID$layout() { + return pciBusID$LAYOUT; + } + + private static final long pciBusID$OFFSET = 584; + + /** + * Offset for field: + * {@snippet lang=c : + * int pciBusID + * } + */ + public static final long pciBusID$offset() { + return pciBusID$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int pciBusID + * } + */ + public static int pciBusID(MemorySegment struct) { + return struct.get(pciBusID$LAYOUT, pciBusID$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int pciBusID + * } + */ + public static void pciBusID(MemorySegment struct, int fieldValue) { + struct.set(pciBusID$LAYOUT, pciBusID$OFFSET, fieldValue); + } + + private static final OfInt pciDeviceID$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pciDeviceID")); + + /** + * Layout for field: + * {@snippet lang=c : + * int pciDeviceID + * } + */ + public static final OfInt pciDeviceID$layout() { + return pciDeviceID$LAYOUT; + } + + private static final long pciDeviceID$OFFSET = 588; + + /** + * Offset for field: + * {@snippet lang=c : + * int pciDeviceID + * } + */ + public static final long pciDeviceID$offset() { + return pciDeviceID$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int pciDeviceID + * } + */ + public static int pciDeviceID(MemorySegment struct) { + return struct.get(pciDeviceID$LAYOUT, pciDeviceID$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int pciDeviceID + * } + */ + public static void pciDeviceID(MemorySegment struct, int fieldValue) { + struct.set(pciDeviceID$LAYOUT, pciDeviceID$OFFSET, fieldValue); + } + + private static final OfInt pciDomainID$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pciDomainID")); + + /** + * Layout for field: + * {@snippet lang=c : + * int pciDomainID + * } + */ + public static final OfInt pciDomainID$layout() { + return pciDomainID$LAYOUT; + } + + private static final long pciDomainID$OFFSET = 592; + + /** + * Offset for field: + * {@snippet lang=c : + * int pciDomainID + * } + */ + public static final long pciDomainID$offset() { + return pciDomainID$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int pciDomainID + * } + */ + public static int pciDomainID(MemorySegment struct) { + return struct.get(pciDomainID$LAYOUT, pciDomainID$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int pciDomainID + * } + */ + public static void pciDomainID(MemorySegment struct, int fieldValue) { + struct.set(pciDomainID$LAYOUT, pciDomainID$OFFSET, fieldValue); + } + + private static final OfInt tccDriver$LAYOUT = (OfInt)$LAYOUT.select(groupElement("tccDriver")); + + /** + * Layout for field: + * {@snippet lang=c : + * int tccDriver + * } + */ + public static final OfInt tccDriver$layout() { + return tccDriver$LAYOUT; + } + + private static final long tccDriver$OFFSET = 596; + + /** + * Offset for field: + * {@snippet lang=c : + * int tccDriver + * } + */ + public static final long tccDriver$offset() { + return tccDriver$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int tccDriver + * } + */ + public static int tccDriver(MemorySegment struct) { + return struct.get(tccDriver$LAYOUT, tccDriver$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int tccDriver + * } + */ + public static void tccDriver(MemorySegment struct, int fieldValue) { + struct.set(tccDriver$LAYOUT, tccDriver$OFFSET, fieldValue); + } + + private static final OfInt asyncEngineCount$LAYOUT = (OfInt)$LAYOUT.select(groupElement("asyncEngineCount")); + + /** + * Layout for field: + * {@snippet lang=c : + * int asyncEngineCount + * } + */ + public static final OfInt asyncEngineCount$layout() { + return asyncEngineCount$LAYOUT; + } + + private static final long asyncEngineCount$OFFSET = 600; + + /** + * Offset for field: + * {@snippet lang=c : + * int asyncEngineCount + * } + */ + public static final long asyncEngineCount$offset() { + return asyncEngineCount$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int asyncEngineCount + * } + */ + public static int asyncEngineCount(MemorySegment struct) { + return struct.get(asyncEngineCount$LAYOUT, asyncEngineCount$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int asyncEngineCount + * } + */ + public static void asyncEngineCount(MemorySegment struct, int fieldValue) { + struct.set(asyncEngineCount$LAYOUT, asyncEngineCount$OFFSET, fieldValue); + } + + private static final OfInt unifiedAddressing$LAYOUT = (OfInt)$LAYOUT.select(groupElement("unifiedAddressing")); + + /** + * Layout for field: + * {@snippet lang=c : + * int unifiedAddressing + * } + */ + public static final OfInt unifiedAddressing$layout() { + return unifiedAddressing$LAYOUT; + } + + private static final long unifiedAddressing$OFFSET = 604; + + /** + * Offset for field: + * {@snippet lang=c : + * int unifiedAddressing + * } + */ + public static final long unifiedAddressing$offset() { + return unifiedAddressing$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int unifiedAddressing + * } + */ + public static int unifiedAddressing(MemorySegment struct) { + return struct.get(unifiedAddressing$LAYOUT, unifiedAddressing$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int unifiedAddressing + * } + */ + public static void unifiedAddressing(MemorySegment struct, int fieldValue) { + struct.set(unifiedAddressing$LAYOUT, unifiedAddressing$OFFSET, fieldValue); + } + + private static final OfInt memoryClockRate$LAYOUT = (OfInt)$LAYOUT.select(groupElement("memoryClockRate")); + + /** + * Layout for field: + * {@snippet lang=c : + * int memoryClockRate + * } + */ + public static final OfInt memoryClockRate$layout() { + return memoryClockRate$LAYOUT; + } + + private static final long memoryClockRate$OFFSET = 608; + + /** + * Offset for field: + * {@snippet lang=c : + * int memoryClockRate + * } + */ + public static final long memoryClockRate$offset() { + return memoryClockRate$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int memoryClockRate + * } + */ + public static int memoryClockRate(MemorySegment struct) { + return struct.get(memoryClockRate$LAYOUT, memoryClockRate$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int memoryClockRate + * } + */ + public static void memoryClockRate(MemorySegment struct, int fieldValue) { + struct.set(memoryClockRate$LAYOUT, memoryClockRate$OFFSET, fieldValue); + } + + private static final OfInt memoryBusWidth$LAYOUT = (OfInt)$LAYOUT.select(groupElement("memoryBusWidth")); + + /** + * Layout for field: + * {@snippet lang=c : + * int memoryBusWidth + * } + */ + public static final OfInt memoryBusWidth$layout() { + return memoryBusWidth$LAYOUT; + } + + private static final long memoryBusWidth$OFFSET = 612; + + /** + * Offset for field: + * {@snippet lang=c : + * int memoryBusWidth + * } + */ + public static final long memoryBusWidth$offset() { + return memoryBusWidth$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int memoryBusWidth + * } + */ + public static int memoryBusWidth(MemorySegment struct) { + return struct.get(memoryBusWidth$LAYOUT, memoryBusWidth$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int memoryBusWidth + * } + */ + public static void memoryBusWidth(MemorySegment struct, int fieldValue) { + struct.set(memoryBusWidth$LAYOUT, memoryBusWidth$OFFSET, fieldValue); + } + + private static final OfInt l2CacheSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("l2CacheSize")); + + /** + * Layout for field: + * {@snippet lang=c : + * int l2CacheSize + * } + */ + public static final OfInt l2CacheSize$layout() { + return l2CacheSize$LAYOUT; + } + + private static final long l2CacheSize$OFFSET = 616; + + /** + * Offset for field: + * {@snippet lang=c : + * int l2CacheSize + * } + */ + public static final long l2CacheSize$offset() { + return l2CacheSize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int l2CacheSize + * } + */ + public static int l2CacheSize(MemorySegment struct) { + return struct.get(l2CacheSize$LAYOUT, l2CacheSize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int l2CacheSize + * } + */ + public static void l2CacheSize(MemorySegment struct, int fieldValue) { + struct.set(l2CacheSize$LAYOUT, l2CacheSize$OFFSET, fieldValue); + } + + private static final OfInt persistingL2CacheMaxSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("persistingL2CacheMaxSize")); + + /** + * Layout for field: + * {@snippet lang=c : + * int persistingL2CacheMaxSize + * } + */ + public static final OfInt persistingL2CacheMaxSize$layout() { + return persistingL2CacheMaxSize$LAYOUT; + } + + private static final long persistingL2CacheMaxSize$OFFSET = 620; + + /** + * Offset for field: + * {@snippet lang=c : + * int persistingL2CacheMaxSize + * } + */ + public static final long persistingL2CacheMaxSize$offset() { + return persistingL2CacheMaxSize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int persistingL2CacheMaxSize + * } + */ + public static int persistingL2CacheMaxSize(MemorySegment struct) { + return struct.get(persistingL2CacheMaxSize$LAYOUT, persistingL2CacheMaxSize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int persistingL2CacheMaxSize + * } + */ + public static void persistingL2CacheMaxSize(MemorySegment struct, int fieldValue) { + struct.set(persistingL2CacheMaxSize$LAYOUT, persistingL2CacheMaxSize$OFFSET, fieldValue); + } + + private static final OfInt maxThreadsPerMultiProcessor$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxThreadsPerMultiProcessor")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxThreadsPerMultiProcessor + * } + */ + public static final OfInt maxThreadsPerMultiProcessor$layout() { + return maxThreadsPerMultiProcessor$LAYOUT; + } + + private static final long maxThreadsPerMultiProcessor$OFFSET = 624; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxThreadsPerMultiProcessor + * } + */ + public static final long maxThreadsPerMultiProcessor$offset() { + return maxThreadsPerMultiProcessor$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxThreadsPerMultiProcessor + * } + */ + public static int maxThreadsPerMultiProcessor(MemorySegment struct) { + return struct.get(maxThreadsPerMultiProcessor$LAYOUT, maxThreadsPerMultiProcessor$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxThreadsPerMultiProcessor + * } + */ + public static void maxThreadsPerMultiProcessor(MemorySegment struct, int fieldValue) { + struct.set(maxThreadsPerMultiProcessor$LAYOUT, maxThreadsPerMultiProcessor$OFFSET, fieldValue); + } + + private static final OfInt streamPrioritiesSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("streamPrioritiesSupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int streamPrioritiesSupported + * } + */ + public static final OfInt streamPrioritiesSupported$layout() { + return streamPrioritiesSupported$LAYOUT; + } + + private static final long streamPrioritiesSupported$OFFSET = 628; + + /** + * Offset for field: + * {@snippet lang=c : + * int streamPrioritiesSupported + * } + */ + public static final long streamPrioritiesSupported$offset() { + return streamPrioritiesSupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int streamPrioritiesSupported + * } + */ + public static int streamPrioritiesSupported(MemorySegment struct) { + return struct.get(streamPrioritiesSupported$LAYOUT, streamPrioritiesSupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int streamPrioritiesSupported + * } + */ + public static void streamPrioritiesSupported(MemorySegment struct, int fieldValue) { + struct.set(streamPrioritiesSupported$LAYOUT, streamPrioritiesSupported$OFFSET, fieldValue); + } + + private static final OfInt globalL1CacheSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("globalL1CacheSupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int globalL1CacheSupported + * } + */ + public static final OfInt globalL1CacheSupported$layout() { + return globalL1CacheSupported$LAYOUT; + } + + private static final long globalL1CacheSupported$OFFSET = 632; + + /** + * Offset for field: + * {@snippet lang=c : + * int globalL1CacheSupported + * } + */ + public static final long globalL1CacheSupported$offset() { + return globalL1CacheSupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int globalL1CacheSupported + * } + */ + public static int globalL1CacheSupported(MemorySegment struct) { + return struct.get(globalL1CacheSupported$LAYOUT, globalL1CacheSupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int globalL1CacheSupported + * } + */ + public static void globalL1CacheSupported(MemorySegment struct, int fieldValue) { + struct.set(globalL1CacheSupported$LAYOUT, globalL1CacheSupported$OFFSET, fieldValue); + } + + private static final OfInt localL1CacheSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("localL1CacheSupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int localL1CacheSupported + * } + */ + public static final OfInt localL1CacheSupported$layout() { + return localL1CacheSupported$LAYOUT; + } + + private static final long localL1CacheSupported$OFFSET = 636; + + /** + * Offset for field: + * {@snippet lang=c : + * int localL1CacheSupported + * } + */ + public static final long localL1CacheSupported$offset() { + return localL1CacheSupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int localL1CacheSupported + * } + */ + public static int localL1CacheSupported(MemorySegment struct) { + return struct.get(localL1CacheSupported$LAYOUT, localL1CacheSupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int localL1CacheSupported + * } + */ + public static void localL1CacheSupported(MemorySegment struct, int fieldValue) { + struct.set(localL1CacheSupported$LAYOUT, localL1CacheSupported$OFFSET, fieldValue); + } + + private static final OfLong sharedMemPerMultiprocessor$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sharedMemPerMultiprocessor")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t sharedMemPerMultiprocessor + * } + */ + public static final OfLong sharedMemPerMultiprocessor$layout() { + return sharedMemPerMultiprocessor$LAYOUT; + } + + private static final long sharedMemPerMultiprocessor$OFFSET = 640; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t sharedMemPerMultiprocessor + * } + */ + public static final long sharedMemPerMultiprocessor$offset() { + return sharedMemPerMultiprocessor$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t sharedMemPerMultiprocessor + * } + */ + public static long sharedMemPerMultiprocessor(MemorySegment struct) { + return struct.get(sharedMemPerMultiprocessor$LAYOUT, sharedMemPerMultiprocessor$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t sharedMemPerMultiprocessor + * } + */ + public static void sharedMemPerMultiprocessor(MemorySegment struct, long fieldValue) { + struct.set(sharedMemPerMultiprocessor$LAYOUT, sharedMemPerMultiprocessor$OFFSET, fieldValue); + } + + private static final OfInt regsPerMultiprocessor$LAYOUT = (OfInt)$LAYOUT.select(groupElement("regsPerMultiprocessor")); + + /** + * Layout for field: + * {@snippet lang=c : + * int regsPerMultiprocessor + * } + */ + public static final OfInt regsPerMultiprocessor$layout() { + return regsPerMultiprocessor$LAYOUT; + } + + private static final long regsPerMultiprocessor$OFFSET = 648; + + /** + * Offset for field: + * {@snippet lang=c : + * int regsPerMultiprocessor + * } + */ + public static final long regsPerMultiprocessor$offset() { + return regsPerMultiprocessor$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int regsPerMultiprocessor + * } + */ + public static int regsPerMultiprocessor(MemorySegment struct) { + return struct.get(regsPerMultiprocessor$LAYOUT, regsPerMultiprocessor$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int regsPerMultiprocessor + * } + */ + public static void regsPerMultiprocessor(MemorySegment struct, int fieldValue) { + struct.set(regsPerMultiprocessor$LAYOUT, regsPerMultiprocessor$OFFSET, fieldValue); + } + + private static final OfInt managedMemory$LAYOUT = (OfInt)$LAYOUT.select(groupElement("managedMemory")); + + /** + * Layout for field: + * {@snippet lang=c : + * int managedMemory + * } + */ + public static final OfInt managedMemory$layout() { + return managedMemory$LAYOUT; + } + + private static final long managedMemory$OFFSET = 652; + + /** + * Offset for field: + * {@snippet lang=c : + * int managedMemory + * } + */ + public static final long managedMemory$offset() { + return managedMemory$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int managedMemory + * } + */ + public static int managedMemory(MemorySegment struct) { + return struct.get(managedMemory$LAYOUT, managedMemory$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int managedMemory + * } + */ + public static void managedMemory(MemorySegment struct, int fieldValue) { + struct.set(managedMemory$LAYOUT, managedMemory$OFFSET, fieldValue); + } + + private static final OfInt isMultiGpuBoard$LAYOUT = (OfInt)$LAYOUT.select(groupElement("isMultiGpuBoard")); + + /** + * Layout for field: + * {@snippet lang=c : + * int isMultiGpuBoard + * } + */ + public static final OfInt isMultiGpuBoard$layout() { + return isMultiGpuBoard$LAYOUT; + } + + private static final long isMultiGpuBoard$OFFSET = 656; + + /** + * Offset for field: + * {@snippet lang=c : + * int isMultiGpuBoard + * } + */ + public static final long isMultiGpuBoard$offset() { + return isMultiGpuBoard$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int isMultiGpuBoard + * } + */ + public static int isMultiGpuBoard(MemorySegment struct) { + return struct.get(isMultiGpuBoard$LAYOUT, isMultiGpuBoard$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int isMultiGpuBoard + * } + */ + public static void isMultiGpuBoard(MemorySegment struct, int fieldValue) { + struct.set(isMultiGpuBoard$LAYOUT, isMultiGpuBoard$OFFSET, fieldValue); + } + + private static final OfInt multiGpuBoardGroupID$LAYOUT = (OfInt)$LAYOUT.select(groupElement("multiGpuBoardGroupID")); + + /** + * Layout for field: + * {@snippet lang=c : + * int multiGpuBoardGroupID + * } + */ + public static final OfInt multiGpuBoardGroupID$layout() { + return multiGpuBoardGroupID$LAYOUT; + } + + private static final long multiGpuBoardGroupID$OFFSET = 660; + + /** + * Offset for field: + * {@snippet lang=c : + * int multiGpuBoardGroupID + * } + */ + public static final long multiGpuBoardGroupID$offset() { + return multiGpuBoardGroupID$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int multiGpuBoardGroupID + * } + */ + public static int multiGpuBoardGroupID(MemorySegment struct) { + return struct.get(multiGpuBoardGroupID$LAYOUT, multiGpuBoardGroupID$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int multiGpuBoardGroupID + * } + */ + public static void multiGpuBoardGroupID(MemorySegment struct, int fieldValue) { + struct.set(multiGpuBoardGroupID$LAYOUT, multiGpuBoardGroupID$OFFSET, fieldValue); + } + + private static final OfInt hostNativeAtomicSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hostNativeAtomicSupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int hostNativeAtomicSupported + * } + */ + public static final OfInt hostNativeAtomicSupported$layout() { + return hostNativeAtomicSupported$LAYOUT; + } + + private static final long hostNativeAtomicSupported$OFFSET = 664; + + /** + * Offset for field: + * {@snippet lang=c : + * int hostNativeAtomicSupported + * } + */ + public static final long hostNativeAtomicSupported$offset() { + return hostNativeAtomicSupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int hostNativeAtomicSupported + * } + */ + public static int hostNativeAtomicSupported(MemorySegment struct) { + return struct.get(hostNativeAtomicSupported$LAYOUT, hostNativeAtomicSupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int hostNativeAtomicSupported + * } + */ + public static void hostNativeAtomicSupported(MemorySegment struct, int fieldValue) { + struct.set(hostNativeAtomicSupported$LAYOUT, hostNativeAtomicSupported$OFFSET, fieldValue); + } + + private static final OfInt singleToDoublePrecisionPerfRatio$LAYOUT = (OfInt)$LAYOUT.select(groupElement("singleToDoublePrecisionPerfRatio")); + + /** + * Layout for field: + * {@snippet lang=c : + * int singleToDoublePrecisionPerfRatio + * } + */ + public static final OfInt singleToDoublePrecisionPerfRatio$layout() { + return singleToDoublePrecisionPerfRatio$LAYOUT; + } + + private static final long singleToDoublePrecisionPerfRatio$OFFSET = 668; + + /** + * Offset for field: + * {@snippet lang=c : + * int singleToDoublePrecisionPerfRatio + * } + */ + public static final long singleToDoublePrecisionPerfRatio$offset() { + return singleToDoublePrecisionPerfRatio$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int singleToDoublePrecisionPerfRatio + * } + */ + public static int singleToDoublePrecisionPerfRatio(MemorySegment struct) { + return struct.get(singleToDoublePrecisionPerfRatio$LAYOUT, singleToDoublePrecisionPerfRatio$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int singleToDoublePrecisionPerfRatio + * } + */ + public static void singleToDoublePrecisionPerfRatio(MemorySegment struct, int fieldValue) { + struct.set(singleToDoublePrecisionPerfRatio$LAYOUT, singleToDoublePrecisionPerfRatio$OFFSET, fieldValue); + } + + private static final OfInt pageableMemoryAccess$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pageableMemoryAccess")); + + /** + * Layout for field: + * {@snippet lang=c : + * int pageableMemoryAccess + * } + */ + public static final OfInt pageableMemoryAccess$layout() { + return pageableMemoryAccess$LAYOUT; + } + + private static final long pageableMemoryAccess$OFFSET = 672; + + /** + * Offset for field: + * {@snippet lang=c : + * int pageableMemoryAccess + * } + */ + public static final long pageableMemoryAccess$offset() { + return pageableMemoryAccess$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int pageableMemoryAccess + * } + */ + public static int pageableMemoryAccess(MemorySegment struct) { + return struct.get(pageableMemoryAccess$LAYOUT, pageableMemoryAccess$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int pageableMemoryAccess + * } + */ + public static void pageableMemoryAccess(MemorySegment struct, int fieldValue) { + struct.set(pageableMemoryAccess$LAYOUT, pageableMemoryAccess$OFFSET, fieldValue); + } + + private static final OfInt concurrentManagedAccess$LAYOUT = (OfInt)$LAYOUT.select(groupElement("concurrentManagedAccess")); + + /** + * Layout for field: + * {@snippet lang=c : + * int concurrentManagedAccess + * } + */ + public static final OfInt concurrentManagedAccess$layout() { + return concurrentManagedAccess$LAYOUT; + } + + private static final long concurrentManagedAccess$OFFSET = 676; + + /** + * Offset for field: + * {@snippet lang=c : + * int concurrentManagedAccess + * } + */ + public static final long concurrentManagedAccess$offset() { + return concurrentManagedAccess$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int concurrentManagedAccess + * } + */ + public static int concurrentManagedAccess(MemorySegment struct) { + return struct.get(concurrentManagedAccess$LAYOUT, concurrentManagedAccess$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int concurrentManagedAccess + * } + */ + public static void concurrentManagedAccess(MemorySegment struct, int fieldValue) { + struct.set(concurrentManagedAccess$LAYOUT, concurrentManagedAccess$OFFSET, fieldValue); + } + + private static final OfInt computePreemptionSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("computePreemptionSupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int computePreemptionSupported + * } + */ + public static final OfInt computePreemptionSupported$layout() { + return computePreemptionSupported$LAYOUT; + } + + private static final long computePreemptionSupported$OFFSET = 680; + + /** + * Offset for field: + * {@snippet lang=c : + * int computePreemptionSupported + * } + */ + public static final long computePreemptionSupported$offset() { + return computePreemptionSupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int computePreemptionSupported + * } + */ + public static int computePreemptionSupported(MemorySegment struct) { + return struct.get(computePreemptionSupported$LAYOUT, computePreemptionSupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int computePreemptionSupported + * } + */ + public static void computePreemptionSupported(MemorySegment struct, int fieldValue) { + struct.set(computePreemptionSupported$LAYOUT, computePreemptionSupported$OFFSET, fieldValue); + } + + private static final OfInt canUseHostPointerForRegisteredMem$LAYOUT = (OfInt)$LAYOUT.select(groupElement("canUseHostPointerForRegisteredMem")); + + /** + * Layout for field: + * {@snippet lang=c : + * int canUseHostPointerForRegisteredMem + * } + */ + public static final OfInt canUseHostPointerForRegisteredMem$layout() { + return canUseHostPointerForRegisteredMem$LAYOUT; + } + + private static final long canUseHostPointerForRegisteredMem$OFFSET = 684; + + /** + * Offset for field: + * {@snippet lang=c : + * int canUseHostPointerForRegisteredMem + * } + */ + public static final long canUseHostPointerForRegisteredMem$offset() { + return canUseHostPointerForRegisteredMem$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int canUseHostPointerForRegisteredMem + * } + */ + public static int canUseHostPointerForRegisteredMem(MemorySegment struct) { + return struct.get(canUseHostPointerForRegisteredMem$LAYOUT, canUseHostPointerForRegisteredMem$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int canUseHostPointerForRegisteredMem + * } + */ + public static void canUseHostPointerForRegisteredMem(MemorySegment struct, int fieldValue) { + struct.set(canUseHostPointerForRegisteredMem$LAYOUT, canUseHostPointerForRegisteredMem$OFFSET, fieldValue); + } + + private static final OfInt cooperativeLaunch$LAYOUT = (OfInt)$LAYOUT.select(groupElement("cooperativeLaunch")); + + /** + * Layout for field: + * {@snippet lang=c : + * int cooperativeLaunch + * } + */ + public static final OfInt cooperativeLaunch$layout() { + return cooperativeLaunch$LAYOUT; + } + + private static final long cooperativeLaunch$OFFSET = 688; + + /** + * Offset for field: + * {@snippet lang=c : + * int cooperativeLaunch + * } + */ + public static final long cooperativeLaunch$offset() { + return cooperativeLaunch$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int cooperativeLaunch + * } + */ + public static int cooperativeLaunch(MemorySegment struct) { + return struct.get(cooperativeLaunch$LAYOUT, cooperativeLaunch$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int cooperativeLaunch + * } + */ + public static void cooperativeLaunch(MemorySegment struct, int fieldValue) { + struct.set(cooperativeLaunch$LAYOUT, cooperativeLaunch$OFFSET, fieldValue); + } + + private static final OfInt cooperativeMultiDeviceLaunch$LAYOUT = (OfInt)$LAYOUT.select(groupElement("cooperativeMultiDeviceLaunch")); + + /** + * Layout for field: + * {@snippet lang=c : + * int cooperativeMultiDeviceLaunch + * } + */ + public static final OfInt cooperativeMultiDeviceLaunch$layout() { + return cooperativeMultiDeviceLaunch$LAYOUT; + } + + private static final long cooperativeMultiDeviceLaunch$OFFSET = 692; + + /** + * Offset for field: + * {@snippet lang=c : + * int cooperativeMultiDeviceLaunch + * } + */ + public static final long cooperativeMultiDeviceLaunch$offset() { + return cooperativeMultiDeviceLaunch$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int cooperativeMultiDeviceLaunch + * } + */ + public static int cooperativeMultiDeviceLaunch(MemorySegment struct) { + return struct.get(cooperativeMultiDeviceLaunch$LAYOUT, cooperativeMultiDeviceLaunch$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int cooperativeMultiDeviceLaunch + * } + */ + public static void cooperativeMultiDeviceLaunch(MemorySegment struct, int fieldValue) { + struct.set(cooperativeMultiDeviceLaunch$LAYOUT, cooperativeMultiDeviceLaunch$OFFSET, fieldValue); + } + + private static final OfLong sharedMemPerBlockOptin$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sharedMemPerBlockOptin")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t sharedMemPerBlockOptin + * } + */ + public static final OfLong sharedMemPerBlockOptin$layout() { + return sharedMemPerBlockOptin$LAYOUT; + } + + private static final long sharedMemPerBlockOptin$OFFSET = 696; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t sharedMemPerBlockOptin + * } + */ + public static final long sharedMemPerBlockOptin$offset() { + return sharedMemPerBlockOptin$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t sharedMemPerBlockOptin + * } + */ + public static long sharedMemPerBlockOptin(MemorySegment struct) { + return struct.get(sharedMemPerBlockOptin$LAYOUT, sharedMemPerBlockOptin$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t sharedMemPerBlockOptin + * } + */ + public static void sharedMemPerBlockOptin(MemorySegment struct, long fieldValue) { + struct.set(sharedMemPerBlockOptin$LAYOUT, sharedMemPerBlockOptin$OFFSET, fieldValue); + } + + private static final OfInt pageableMemoryAccessUsesHostPageTables$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pageableMemoryAccessUsesHostPageTables")); + + /** + * Layout for field: + * {@snippet lang=c : + * int pageableMemoryAccessUsesHostPageTables + * } + */ + public static final OfInt pageableMemoryAccessUsesHostPageTables$layout() { + return pageableMemoryAccessUsesHostPageTables$LAYOUT; + } + + private static final long pageableMemoryAccessUsesHostPageTables$OFFSET = 704; + + /** + * Offset for field: + * {@snippet lang=c : + * int pageableMemoryAccessUsesHostPageTables + * } + */ + public static final long pageableMemoryAccessUsesHostPageTables$offset() { + return pageableMemoryAccessUsesHostPageTables$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int pageableMemoryAccessUsesHostPageTables + * } + */ + public static int pageableMemoryAccessUsesHostPageTables(MemorySegment struct) { + return struct.get(pageableMemoryAccessUsesHostPageTables$LAYOUT, pageableMemoryAccessUsesHostPageTables$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int pageableMemoryAccessUsesHostPageTables + * } + */ + public static void pageableMemoryAccessUsesHostPageTables(MemorySegment struct, int fieldValue) { + struct.set(pageableMemoryAccessUsesHostPageTables$LAYOUT, pageableMemoryAccessUsesHostPageTables$OFFSET, fieldValue); + } + + private static final OfInt directManagedMemAccessFromHost$LAYOUT = (OfInt)$LAYOUT.select(groupElement("directManagedMemAccessFromHost")); + + /** + * Layout for field: + * {@snippet lang=c : + * int directManagedMemAccessFromHost + * } + */ + public static final OfInt directManagedMemAccessFromHost$layout() { + return directManagedMemAccessFromHost$LAYOUT; + } + + private static final long directManagedMemAccessFromHost$OFFSET = 708; + + /** + * Offset for field: + * {@snippet lang=c : + * int directManagedMemAccessFromHost + * } + */ + public static final long directManagedMemAccessFromHost$offset() { + return directManagedMemAccessFromHost$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int directManagedMemAccessFromHost + * } + */ + public static int directManagedMemAccessFromHost(MemorySegment struct) { + return struct.get(directManagedMemAccessFromHost$LAYOUT, directManagedMemAccessFromHost$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int directManagedMemAccessFromHost + * } + */ + public static void directManagedMemAccessFromHost(MemorySegment struct, int fieldValue) { + struct.set(directManagedMemAccessFromHost$LAYOUT, directManagedMemAccessFromHost$OFFSET, fieldValue); + } + + private static final OfInt maxBlocksPerMultiProcessor$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxBlocksPerMultiProcessor")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxBlocksPerMultiProcessor + * } + */ + public static final OfInt maxBlocksPerMultiProcessor$layout() { + return maxBlocksPerMultiProcessor$LAYOUT; + } + + private static final long maxBlocksPerMultiProcessor$OFFSET = 712; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxBlocksPerMultiProcessor + * } + */ + public static final long maxBlocksPerMultiProcessor$offset() { + return maxBlocksPerMultiProcessor$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxBlocksPerMultiProcessor + * } + */ + public static int maxBlocksPerMultiProcessor(MemorySegment struct) { + return struct.get(maxBlocksPerMultiProcessor$LAYOUT, maxBlocksPerMultiProcessor$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxBlocksPerMultiProcessor + * } + */ + public static void maxBlocksPerMultiProcessor(MemorySegment struct, int fieldValue) { + struct.set(maxBlocksPerMultiProcessor$LAYOUT, maxBlocksPerMultiProcessor$OFFSET, fieldValue); + } + + private static final OfInt accessPolicyMaxWindowSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("accessPolicyMaxWindowSize")); + + /** + * Layout for field: + * {@snippet lang=c : + * int accessPolicyMaxWindowSize + * } + */ + public static final OfInt accessPolicyMaxWindowSize$layout() { + return accessPolicyMaxWindowSize$LAYOUT; + } + + private static final long accessPolicyMaxWindowSize$OFFSET = 716; + + /** + * Offset for field: + * {@snippet lang=c : + * int accessPolicyMaxWindowSize + * } + */ + public static final long accessPolicyMaxWindowSize$offset() { + return accessPolicyMaxWindowSize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int accessPolicyMaxWindowSize + * } + */ + public static int accessPolicyMaxWindowSize(MemorySegment struct) { + return struct.get(accessPolicyMaxWindowSize$LAYOUT, accessPolicyMaxWindowSize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int accessPolicyMaxWindowSize + * } + */ + public static void accessPolicyMaxWindowSize(MemorySegment struct, int fieldValue) { + struct.set(accessPolicyMaxWindowSize$LAYOUT, accessPolicyMaxWindowSize$OFFSET, fieldValue); + } + + private static final OfLong reservedSharedMemPerBlock$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reservedSharedMemPerBlock")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t reservedSharedMemPerBlock + * } + */ + public static final OfLong reservedSharedMemPerBlock$layout() { + return reservedSharedMemPerBlock$LAYOUT; + } + + private static final long reservedSharedMemPerBlock$OFFSET = 720; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t reservedSharedMemPerBlock + * } + */ + public static final long reservedSharedMemPerBlock$offset() { + return reservedSharedMemPerBlock$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t reservedSharedMemPerBlock + * } + */ + public static long reservedSharedMemPerBlock(MemorySegment struct) { + return struct.get(reservedSharedMemPerBlock$LAYOUT, reservedSharedMemPerBlock$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t reservedSharedMemPerBlock + * } + */ + public static void reservedSharedMemPerBlock(MemorySegment struct, long fieldValue) { + struct.set(reservedSharedMemPerBlock$LAYOUT, reservedSharedMemPerBlock$OFFSET, fieldValue); + } + + private static final OfInt hostRegisterSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hostRegisterSupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int hostRegisterSupported + * } + */ + public static final OfInt hostRegisterSupported$layout() { + return hostRegisterSupported$LAYOUT; + } + + private static final long hostRegisterSupported$OFFSET = 728; + + /** + * Offset for field: + * {@snippet lang=c : + * int hostRegisterSupported + * } + */ + public static final long hostRegisterSupported$offset() { + return hostRegisterSupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int hostRegisterSupported + * } + */ + public static int hostRegisterSupported(MemorySegment struct) { + return struct.get(hostRegisterSupported$LAYOUT, hostRegisterSupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int hostRegisterSupported + * } + */ + public static void hostRegisterSupported(MemorySegment struct, int fieldValue) { + struct.set(hostRegisterSupported$LAYOUT, hostRegisterSupported$OFFSET, fieldValue); + } + + private static final OfInt sparseCudaArraySupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("sparseCudaArraySupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int sparseCudaArraySupported + * } + */ + public static final OfInt sparseCudaArraySupported$layout() { + return sparseCudaArraySupported$LAYOUT; + } + + private static final long sparseCudaArraySupported$OFFSET = 732; + + /** + * Offset for field: + * {@snippet lang=c : + * int sparseCudaArraySupported + * } + */ + public static final long sparseCudaArraySupported$offset() { + return sparseCudaArraySupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int sparseCudaArraySupported + * } + */ + public static int sparseCudaArraySupported(MemorySegment struct) { + return struct.get(sparseCudaArraySupported$LAYOUT, sparseCudaArraySupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int sparseCudaArraySupported + * } + */ + public static void sparseCudaArraySupported(MemorySegment struct, int fieldValue) { + struct.set(sparseCudaArraySupported$LAYOUT, sparseCudaArraySupported$OFFSET, fieldValue); + } + + private static final OfInt hostRegisterReadOnlySupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hostRegisterReadOnlySupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int hostRegisterReadOnlySupported + * } + */ + public static final OfInt hostRegisterReadOnlySupported$layout() { + return hostRegisterReadOnlySupported$LAYOUT; + } + + private static final long hostRegisterReadOnlySupported$OFFSET = 736; + + /** + * Offset for field: + * {@snippet lang=c : + * int hostRegisterReadOnlySupported + * } + */ + public static final long hostRegisterReadOnlySupported$offset() { + return hostRegisterReadOnlySupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int hostRegisterReadOnlySupported + * } + */ + public static int hostRegisterReadOnlySupported(MemorySegment struct) { + return struct.get(hostRegisterReadOnlySupported$LAYOUT, hostRegisterReadOnlySupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int hostRegisterReadOnlySupported + * } + */ + public static void hostRegisterReadOnlySupported(MemorySegment struct, int fieldValue) { + struct.set(hostRegisterReadOnlySupported$LAYOUT, hostRegisterReadOnlySupported$OFFSET, fieldValue); + } + + private static final OfInt timelineSemaphoreInteropSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("timelineSemaphoreInteropSupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int timelineSemaphoreInteropSupported + * } + */ + public static final OfInt timelineSemaphoreInteropSupported$layout() { + return timelineSemaphoreInteropSupported$LAYOUT; + } + + private static final long timelineSemaphoreInteropSupported$OFFSET = 740; + + /** + * Offset for field: + * {@snippet lang=c : + * int timelineSemaphoreInteropSupported + * } + */ + public static final long timelineSemaphoreInteropSupported$offset() { + return timelineSemaphoreInteropSupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int timelineSemaphoreInteropSupported + * } + */ + public static int timelineSemaphoreInteropSupported(MemorySegment struct) { + return struct.get(timelineSemaphoreInteropSupported$LAYOUT, timelineSemaphoreInteropSupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int timelineSemaphoreInteropSupported + * } + */ + public static void timelineSemaphoreInteropSupported(MemorySegment struct, int fieldValue) { + struct.set(timelineSemaphoreInteropSupported$LAYOUT, timelineSemaphoreInteropSupported$OFFSET, fieldValue); + } + + private static final OfInt memoryPoolsSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("memoryPoolsSupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int memoryPoolsSupported + * } + */ + public static final OfInt memoryPoolsSupported$layout() { + return memoryPoolsSupported$LAYOUT; + } + + private static final long memoryPoolsSupported$OFFSET = 744; + + /** + * Offset for field: + * {@snippet lang=c : + * int memoryPoolsSupported + * } + */ + public static final long memoryPoolsSupported$offset() { + return memoryPoolsSupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int memoryPoolsSupported + * } + */ + public static int memoryPoolsSupported(MemorySegment struct) { + return struct.get(memoryPoolsSupported$LAYOUT, memoryPoolsSupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int memoryPoolsSupported + * } + */ + public static void memoryPoolsSupported(MemorySegment struct, int fieldValue) { + struct.set(memoryPoolsSupported$LAYOUT, memoryPoolsSupported$OFFSET, fieldValue); + } + + private static final OfInt gpuDirectRDMASupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("gpuDirectRDMASupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int gpuDirectRDMASupported + * } + */ + public static final OfInt gpuDirectRDMASupported$layout() { + return gpuDirectRDMASupported$LAYOUT; + } + + private static final long gpuDirectRDMASupported$OFFSET = 748; + + /** + * Offset for field: + * {@snippet lang=c : + * int gpuDirectRDMASupported + * } + */ + public static final long gpuDirectRDMASupported$offset() { + return gpuDirectRDMASupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int gpuDirectRDMASupported + * } + */ + public static int gpuDirectRDMASupported(MemorySegment struct) { + return struct.get(gpuDirectRDMASupported$LAYOUT, gpuDirectRDMASupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int gpuDirectRDMASupported + * } + */ + public static void gpuDirectRDMASupported(MemorySegment struct, int fieldValue) { + struct.set(gpuDirectRDMASupported$LAYOUT, gpuDirectRDMASupported$OFFSET, fieldValue); + } + + private static final OfInt gpuDirectRDMAFlushWritesOptions$LAYOUT = (OfInt)$LAYOUT.select(groupElement("gpuDirectRDMAFlushWritesOptions")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int gpuDirectRDMAFlushWritesOptions + * } + */ + public static final OfInt gpuDirectRDMAFlushWritesOptions$layout() { + return gpuDirectRDMAFlushWritesOptions$LAYOUT; + } + + private static final long gpuDirectRDMAFlushWritesOptions$OFFSET = 752; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int gpuDirectRDMAFlushWritesOptions + * } + */ + public static final long gpuDirectRDMAFlushWritesOptions$offset() { + return gpuDirectRDMAFlushWritesOptions$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int gpuDirectRDMAFlushWritesOptions + * } + */ + public static int gpuDirectRDMAFlushWritesOptions(MemorySegment struct) { + return struct.get(gpuDirectRDMAFlushWritesOptions$LAYOUT, gpuDirectRDMAFlushWritesOptions$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int gpuDirectRDMAFlushWritesOptions + * } + */ + public static void gpuDirectRDMAFlushWritesOptions(MemorySegment struct, int fieldValue) { + struct.set(gpuDirectRDMAFlushWritesOptions$LAYOUT, gpuDirectRDMAFlushWritesOptions$OFFSET, fieldValue); + } + + private static final OfInt gpuDirectRDMAWritesOrdering$LAYOUT = (OfInt)$LAYOUT.select(groupElement("gpuDirectRDMAWritesOrdering")); + + /** + * Layout for field: + * {@snippet lang=c : + * int gpuDirectRDMAWritesOrdering + * } + */ + public static final OfInt gpuDirectRDMAWritesOrdering$layout() { + return gpuDirectRDMAWritesOrdering$LAYOUT; + } + + private static final long gpuDirectRDMAWritesOrdering$OFFSET = 756; + + /** + * Offset for field: + * {@snippet lang=c : + * int gpuDirectRDMAWritesOrdering + * } + */ + public static final long gpuDirectRDMAWritesOrdering$offset() { + return gpuDirectRDMAWritesOrdering$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int gpuDirectRDMAWritesOrdering + * } + */ + public static int gpuDirectRDMAWritesOrdering(MemorySegment struct) { + return struct.get(gpuDirectRDMAWritesOrdering$LAYOUT, gpuDirectRDMAWritesOrdering$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int gpuDirectRDMAWritesOrdering + * } + */ + public static void gpuDirectRDMAWritesOrdering(MemorySegment struct, int fieldValue) { + struct.set(gpuDirectRDMAWritesOrdering$LAYOUT, gpuDirectRDMAWritesOrdering$OFFSET, fieldValue); + } + + private static final OfInt memoryPoolSupportedHandleTypes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("memoryPoolSupportedHandleTypes")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int memoryPoolSupportedHandleTypes + * } + */ + public static final OfInt memoryPoolSupportedHandleTypes$layout() { + return memoryPoolSupportedHandleTypes$LAYOUT; + } + + private static final long memoryPoolSupportedHandleTypes$OFFSET = 760; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int memoryPoolSupportedHandleTypes + * } + */ + public static final long memoryPoolSupportedHandleTypes$offset() { + return memoryPoolSupportedHandleTypes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int memoryPoolSupportedHandleTypes + * } + */ + public static int memoryPoolSupportedHandleTypes(MemorySegment struct) { + return struct.get(memoryPoolSupportedHandleTypes$LAYOUT, memoryPoolSupportedHandleTypes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int memoryPoolSupportedHandleTypes + * } + */ + public static void memoryPoolSupportedHandleTypes(MemorySegment struct, int fieldValue) { + struct.set(memoryPoolSupportedHandleTypes$LAYOUT, memoryPoolSupportedHandleTypes$OFFSET, fieldValue); + } + + private static final OfInt deferredMappingCudaArraySupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("deferredMappingCudaArraySupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int deferredMappingCudaArraySupported + * } + */ + public static final OfInt deferredMappingCudaArraySupported$layout() { + return deferredMappingCudaArraySupported$LAYOUT; + } + + private static final long deferredMappingCudaArraySupported$OFFSET = 764; + + /** + * Offset for field: + * {@snippet lang=c : + * int deferredMappingCudaArraySupported + * } + */ + public static final long deferredMappingCudaArraySupported$offset() { + return deferredMappingCudaArraySupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int deferredMappingCudaArraySupported + * } + */ + public static int deferredMappingCudaArraySupported(MemorySegment struct) { + return struct.get(deferredMappingCudaArraySupported$LAYOUT, deferredMappingCudaArraySupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int deferredMappingCudaArraySupported + * } + */ + public static void deferredMappingCudaArraySupported(MemorySegment struct, int fieldValue) { + struct.set(deferredMappingCudaArraySupported$LAYOUT, deferredMappingCudaArraySupported$OFFSET, fieldValue); + } + + private static final OfInt ipcEventSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ipcEventSupported")); + + /** + * Layout for field: + * {@snippet lang=c : + * int ipcEventSupported + * } + */ + public static final OfInt ipcEventSupported$layout() { + return ipcEventSupported$LAYOUT; + } + + private static final long ipcEventSupported$OFFSET = 768; + + /** + * Offset for field: + * {@snippet lang=c : + * int ipcEventSupported + * } + */ + public static final long ipcEventSupported$offset() { + return ipcEventSupported$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int ipcEventSupported + * } + */ + public static int ipcEventSupported(MemorySegment struct) { + return struct.get(ipcEventSupported$LAYOUT, ipcEventSupported$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int ipcEventSupported + * } + */ + public static void ipcEventSupported(MemorySegment struct, int fieldValue) { + struct.set(ipcEventSupported$LAYOUT, ipcEventSupported$OFFSET, fieldValue); + } + + private static final OfInt clusterLaunch$LAYOUT = (OfInt)$LAYOUT.select(groupElement("clusterLaunch")); + + /** + * Layout for field: + * {@snippet lang=c : + * int clusterLaunch + * } + */ + public static final OfInt clusterLaunch$layout() { + return clusterLaunch$LAYOUT; + } + + private static final long clusterLaunch$OFFSET = 772; + + /** + * Offset for field: + * {@snippet lang=c : + * int clusterLaunch + * } + */ + public static final long clusterLaunch$offset() { + return clusterLaunch$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int clusterLaunch + * } + */ + public static int clusterLaunch(MemorySegment struct) { + return struct.get(clusterLaunch$LAYOUT, clusterLaunch$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int clusterLaunch + * } + */ + public static void clusterLaunch(MemorySegment struct, int fieldValue) { + struct.set(clusterLaunch$LAYOUT, clusterLaunch$OFFSET, fieldValue); + } + + private static final OfInt unifiedFunctionPointers$LAYOUT = (OfInt)$LAYOUT.select(groupElement("unifiedFunctionPointers")); + + /** + * Layout for field: + * {@snippet lang=c : + * int unifiedFunctionPointers + * } + */ + public static final OfInt unifiedFunctionPointers$layout() { + return unifiedFunctionPointers$LAYOUT; + } + + private static final long unifiedFunctionPointers$OFFSET = 776; + + /** + * Offset for field: + * {@snippet lang=c : + * int unifiedFunctionPointers + * } + */ + public static final long unifiedFunctionPointers$offset() { + return unifiedFunctionPointers$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int unifiedFunctionPointers + * } + */ + public static int unifiedFunctionPointers(MemorySegment struct) { + return struct.get(unifiedFunctionPointers$LAYOUT, unifiedFunctionPointers$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int unifiedFunctionPointers + * } + */ + public static void unifiedFunctionPointers(MemorySegment struct, int fieldValue) { + struct.set(unifiedFunctionPointers$LAYOUT, unifiedFunctionPointers$OFFSET, fieldValue); + } + + private static final SequenceLayout reserved2$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved2")); + + /** + * Layout for field: + * {@snippet lang=c : + * int reserved2[2] + * } + */ + public static final SequenceLayout reserved2$layout() { + return reserved2$LAYOUT; + } + + private static final long reserved2$OFFSET = 780; + + /** + * Offset for field: + * {@snippet lang=c : + * int reserved2[2] + * } + */ + public static final long reserved2$offset() { + return reserved2$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int reserved2[2] + * } + */ + public static MemorySegment reserved2(MemorySegment struct) { + return struct.asSlice(reserved2$OFFSET, reserved2$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int reserved2[2] + * } + */ + public static void reserved2(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved2$OFFSET, reserved2$LAYOUT.byteSize()); + } + + private static long[] reserved2$DIMS = { 2 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int reserved2[2] + * } + */ + public static long[] reserved2$dimensions() { + return reserved2$DIMS; + } + private static final VarHandle reserved2$ELEM_HANDLE = reserved2$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int reserved2[2] + * } + */ + public static int reserved2(MemorySegment struct, long index0) { + return (int)reserved2$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int reserved2[2] + * } + */ + public static void reserved2(MemorySegment struct, long index0, int fieldValue) { + reserved2$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout reserved1$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved1")); + + /** + * Layout for field: + * {@snippet lang=c : + * int reserved1[1] + * } + */ + public static final SequenceLayout reserved1$layout() { + return reserved1$LAYOUT; + } + + private static final long reserved1$OFFSET = 788; + + /** + * Offset for field: + * {@snippet lang=c : + * int reserved1[1] + * } + */ + public static final long reserved1$offset() { + return reserved1$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int reserved1[1] + * } + */ + public static MemorySegment reserved1(MemorySegment struct) { + return struct.asSlice(reserved1$OFFSET, reserved1$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int reserved1[1] + * } + */ + public static void reserved1(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved1$OFFSET, reserved1$LAYOUT.byteSize()); + } + + private static long[] reserved1$DIMS = { 1 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int reserved1[1] + * } + */ + public static long[] reserved1$dimensions() { + return reserved1$DIMS; + } + private static final VarHandle reserved1$ELEM_HANDLE = reserved1$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int reserved1[1] + * } + */ + public static int reserved1(MemorySegment struct, long index0) { + return (int)reserved1$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int reserved1[1] + * } + */ + public static void reserved1(MemorySegment struct, long index0, int fieldValue) { + reserved1$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * int reserved[60] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 792; + + /** + * Offset for field: + * {@snippet lang=c : + * int reserved[60] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int reserved[60] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int reserved[60] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 60 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int reserved[60] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int reserved[60] + * } + */ + public static int reserved(MemorySegment struct, long index0) { + return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int reserved[60] + * } + */ + public static void reserved(MemorySegment struct, long index0, int fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventRecordNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventRecordNodeParams.java new file mode 100644 index 0000000000..af41fbb6b8 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventRecordNodeParams.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaEventRecordNodeParams { + * cudaEvent_t event; + * } + * } + */ +public class cudaEventRecordNodeParams { + + cudaEventRecordNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("event") + ).withName("cudaEventRecordNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout event$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("event")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static final AddressLayout event$layout() { + return event$LAYOUT; + } + + private static final long event$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static final long event$offset() { + return event$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static MemorySegment event(MemorySegment struct) { + return struct.get(event$LAYOUT, event$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static void event(MemorySegment struct, MemorySegment fieldValue) { + struct.set(event$LAYOUT, event$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventWaitNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventWaitNodeParams.java new file mode 100644 index 0000000000..1c9ffc8364 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventWaitNodeParams.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaEventWaitNodeParams { + * cudaEvent_t event; + * } + * } + */ +public class cudaEventWaitNodeParams { + + cudaEventWaitNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("event") + ).withName("cudaEventWaitNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout event$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("event")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static final AddressLayout event$layout() { + return event$LAYOUT; + } + + private static final long event$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static final long event$offset() { + return event$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static MemorySegment event(MemorySegment struct) { + return struct.get(event$LAYOUT, event$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static void event(MemorySegment struct, MemorySegment fieldValue) { + struct.set(event$LAYOUT, event$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExtent.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExtent.java new file mode 100644 index 0000000000..3617632cc7 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExtent.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExtent { + * size_t width; + * size_t height; + * size_t depth; + * } + * } + */ +public class cudaExtent { + + cudaExtent() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("width"), + PanamaFFMAPI.C_LONG.withName("height"), + PanamaFFMAPI.C_LONG.withName("depth") + ).withName("cudaExtent"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("width")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static final OfLong width$layout() { + return width$LAYOUT; + } + + private static final long width$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static final long width$offset() { + return width$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static long width(MemorySegment struct) { + return struct.get(width$LAYOUT, width$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static void width(MemorySegment struct, long fieldValue) { + struct.set(width$LAYOUT, width$OFFSET, fieldValue); + } + + private static final OfLong height$LAYOUT = (OfLong)$LAYOUT.select(groupElement("height")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static final OfLong height$layout() { + return height$LAYOUT; + } + + private static final long height$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static final long height$offset() { + return height$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static long height(MemorySegment struct) { + return struct.get(height$LAYOUT, height$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static void height(MemorySegment struct, long fieldValue) { + struct.set(height$LAYOUT, height$OFFSET, fieldValue); + } + + private static final OfLong depth$LAYOUT = (OfLong)$LAYOUT.select(groupElement("depth")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t depth + * } + */ + public static final OfLong depth$layout() { + return depth$LAYOUT; + } + + private static final long depth$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t depth + * } + */ + public static final long depth$offset() { + return depth$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t depth + * } + */ + public static long depth(MemorySegment struct) { + return struct.get(depth$LAYOUT, depth$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t depth + * } + */ + public static void depth(MemorySegment struct, long fieldValue) { + struct.set(depth$LAYOUT, depth$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryBufferDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryBufferDesc.java new file mode 100644 index 0000000000..ec82b0948e --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryBufferDesc.java @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalMemoryBufferDesc { + * unsigned long long offset; + * unsigned long long size; + * unsigned int flags; + * } + * } + */ +public class cudaExternalMemoryBufferDesc { + + cudaExternalMemoryBufferDesc() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("offset"), + PanamaFFMAPI.C_LONG_LONG.withName("size"), + PanamaFFMAPI.C_INT.withName("flags"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalMemoryBufferDesc"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong offset$LAYOUT = (OfLong)$LAYOUT.select(groupElement("offset")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long offset + * } + */ + public static final OfLong offset$layout() { + return offset$LAYOUT; + } + + private static final long offset$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long offset + * } + */ + public static final long offset$offset() { + return offset$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long offset + * } + */ + public static long offset(MemorySegment struct) { + return struct.get(offset$LAYOUT, offset$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long offset + * } + */ + public static void offset(MemorySegment struct, long fieldValue) { + struct.set(offset$LAYOUT, offset$OFFSET, fieldValue); + } + + private static final OfLong size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("size")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long size + * } + */ + public static final OfLong size$layout() { + return size$LAYOUT; + } + + private static final long size$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long size + * } + */ + public static final long size$offset() { + return size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long size + * } + */ + public static long size(MemorySegment struct) { + return struct.get(size$LAYOUT, size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long size + * } + */ + public static void size(MemorySegment struct, long fieldValue) { + struct.set(size$LAYOUT, size$OFFSET, fieldValue); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryHandleDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryHandleDesc.java new file mode 100644 index 0000000000..4e04b7a773 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryHandleDesc.java @@ -0,0 +1,697 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalMemoryHandleDesc { + * enum cudaExternalMemoryHandleType type; + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciBufObject; + * } handle; + * unsigned long long size; + * unsigned int flags; + * } + * } + */ +public class cudaExternalMemoryHandleDesc { + + cudaExternalMemoryHandleDesc() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("type"), + MemoryLayout.paddingLayout(4), + cudaExternalMemoryHandleDesc.handle.layout().withName("handle"), + PanamaFFMAPI.C_LONG_LONG.withName("size"), + PanamaFFMAPI.C_INT.withName("flags"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalMemoryHandleDesc"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType type + * } + */ + public static final OfInt type$layout() { + return type$LAYOUT; + } + + private static final long type$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType type + * } + */ + public static final long type$offset() { + return type$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType type + * } + */ + public static int type(MemorySegment struct) { + return struct.get(type$LAYOUT, type$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaExternalMemoryHandleType type + * } + */ + public static void type(MemorySegment struct, int fieldValue) { + struct.set(type$LAYOUT, type$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciBufObject; + * } + * } + */ + public static class handle { + + handle() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + PanamaFFMAPI.C_INT.withName("fd"), + cudaExternalMemoryHandleDesc.handle.win32.layout().withName("win32"), + PanamaFFMAPI.C_POINTER.withName("nvSciBufObject") + ).withName("$anon$2496:5"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt fd$LAYOUT = (OfInt)$LAYOUT.select(groupElement("fd")); + + /** + * Layout for field: + * {@snippet lang=c : + * int fd + * } + */ + public static final OfInt fd$layout() { + return fd$LAYOUT; + } + + private static final long fd$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int fd + * } + */ + public static final long fd$offset() { + return fd$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int fd + * } + */ + public static int fd(MemorySegment union) { + return union.get(fd$LAYOUT, fd$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int fd + * } + */ + public static void fd(MemorySegment union, int fieldValue) { + union.set(fd$LAYOUT, fd$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * struct { + * void *handle; + * const void *name; + * } + * } + */ + public static class win32 { + + win32() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("handle"), + PanamaFFMAPI.C_POINTER.withName("name") + ).withName("$anon$2518:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout handle$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("handle")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *handle + * } + */ + public static final AddressLayout handle$layout() { + return handle$LAYOUT; + } + + private static final long handle$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *handle + * } + */ + public static final long handle$offset() { + return handle$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *handle + * } + */ + public static MemorySegment handle(MemorySegment struct) { + return struct.get(handle$LAYOUT, handle$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *handle + * } + */ + public static void handle(MemorySegment struct, MemorySegment fieldValue) { + struct.set(handle$LAYOUT, handle$OFFSET, fieldValue); + } + + private static final AddressLayout name$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("name")); + + /** + * Layout for field: + * {@snippet lang=c : + * const void *name + * } + */ + public static final AddressLayout name$layout() { + return name$LAYOUT; + } + + private static final long name$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * const void *name + * } + */ + public static final long name$offset() { + return name$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const void *name + * } + */ + public static MemorySegment name(MemorySegment struct) { + return struct.get(name$LAYOUT, name$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const void *name + * } + */ + public static void name(MemorySegment struct, MemorySegment fieldValue) { + struct.set(name$LAYOUT, name$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout win32$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("win32")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * void *handle; + * const void *name; + * } win32 + * } + */ + public static final GroupLayout win32$layout() { + return win32$LAYOUT; + } + + private static final long win32$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * void *handle; + * const void *name; + * } win32 + * } + */ + public static final long win32$offset() { + return win32$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * void *handle; + * const void *name; + * } win32 + * } + */ + public static MemorySegment win32(MemorySegment union) { + return union.asSlice(win32$OFFSET, win32$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * void *handle; + * const void *name; + * } win32 + * } + */ + public static void win32(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, win32$OFFSET, win32$LAYOUT.byteSize()); + } + + private static final AddressLayout nvSciBufObject$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("nvSciBufObject")); + + /** + * Layout for field: + * {@snippet lang=c : + * const void *nvSciBufObject + * } + */ + public static final AddressLayout nvSciBufObject$layout() { + return nvSciBufObject$LAYOUT; + } + + private static final long nvSciBufObject$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const void *nvSciBufObject + * } + */ + public static final long nvSciBufObject$offset() { + return nvSciBufObject$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const void *nvSciBufObject + * } + */ + public static MemorySegment nvSciBufObject(MemorySegment union) { + return union.get(nvSciBufObject$LAYOUT, nvSciBufObject$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const void *nvSciBufObject + * } + */ + public static void nvSciBufObject(MemorySegment union, MemorySegment fieldValue) { + union.set(nvSciBufObject$LAYOUT, nvSciBufObject$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout handle$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("handle")); + + /** + * Layout for field: + * {@snippet lang=c : + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciBufObject; + * } handle + * } + */ + public static final GroupLayout handle$layout() { + return handle$LAYOUT; + } + + private static final long handle$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciBufObject; + * } handle + * } + */ + public static final long handle$offset() { + return handle$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciBufObject; + * } handle + * } + */ + public static MemorySegment handle(MemorySegment struct) { + return struct.asSlice(handle$OFFSET, handle$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciBufObject; + * } handle + * } + */ + public static void handle(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, handle$OFFSET, handle$LAYOUT.byteSize()); + } + + private static final OfLong size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("size")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long size + * } + */ + public static final OfLong size$layout() { + return size$LAYOUT; + } + + private static final long size$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long size + * } + */ + public static final long size$offset() { + return size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long size + * } + */ + public static long size(MemorySegment struct) { + return struct.get(size$LAYOUT, size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long size + * } + */ + public static void size(MemorySegment struct, long fieldValue) { + struct.set(size$LAYOUT, size$OFFSET, fieldValue); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryMipmappedArrayDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryMipmappedArrayDesc.java new file mode 100644 index 0000000000..4f567f0330 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryMipmappedArrayDesc.java @@ -0,0 +1,328 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalMemoryMipmappedArrayDesc { + * unsigned long long offset; + * struct cudaChannelFormatDesc formatDesc; + * struct cudaExtent extent; + * unsigned int flags; + * unsigned int numLevels; + * } + * } + */ +public class cudaExternalMemoryMipmappedArrayDesc { + + cudaExternalMemoryMipmappedArrayDesc() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("offset"), + cudaChannelFormatDesc.layout().withName("formatDesc"), + MemoryLayout.paddingLayout(4), + cudaExtent.layout().withName("extent"), + PanamaFFMAPI.C_INT.withName("flags"), + PanamaFFMAPI.C_INT.withName("numLevels") + ).withName("cudaExternalMemoryMipmappedArrayDesc"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong offset$LAYOUT = (OfLong)$LAYOUT.select(groupElement("offset")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long offset + * } + */ + public static final OfLong offset$layout() { + return offset$LAYOUT; + } + + private static final long offset$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long offset + * } + */ + public static final long offset$offset() { + return offset$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long offset + * } + */ + public static long offset(MemorySegment struct) { + return struct.get(offset$LAYOUT, offset$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long offset + * } + */ + public static void offset(MemorySegment struct, long fieldValue) { + struct.set(offset$LAYOUT, offset$OFFSET, fieldValue); + } + + private static final GroupLayout formatDesc$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("formatDesc")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc formatDesc + * } + */ + public static final GroupLayout formatDesc$layout() { + return formatDesc$LAYOUT; + } + + private static final long formatDesc$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc formatDesc + * } + */ + public static final long formatDesc$offset() { + return formatDesc$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc formatDesc + * } + */ + public static MemorySegment formatDesc(MemorySegment struct) { + return struct.asSlice(formatDesc$OFFSET, formatDesc$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc formatDesc + * } + */ + public static void formatDesc(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, formatDesc$OFFSET, formatDesc$LAYOUT.byteSize()); + } + + private static final GroupLayout extent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("extent")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static final GroupLayout extent$layout() { + return extent$LAYOUT; + } + + private static final long extent$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static final long extent$offset() { + return extent$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static MemorySegment extent(MemorySegment struct) { + return struct.asSlice(extent$OFFSET, extent$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static void extent(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, extent$OFFSET, extent$LAYOUT.byteSize()); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 56; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + private static final OfInt numLevels$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numLevels")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int numLevels + * } + */ + public static final OfInt numLevels$layout() { + return numLevels$LAYOUT; + } + + private static final long numLevels$OFFSET = 60; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int numLevels + * } + */ + public static final long numLevels$offset() { + return numLevels$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int numLevels + * } + */ + public static int numLevels(MemorySegment struct) { + return struct.get(numLevels$LAYOUT, numLevels$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int numLevels + * } + */ + public static void numLevels(MemorySegment struct, int fieldValue) { + struct.set(numLevels$LAYOUT, numLevels$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreHandleDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreHandleDesc.java new file mode 100644 index 0000000000..533362f0b5 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreHandleDesc.java @@ -0,0 +1,651 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalSemaphoreHandleDesc { + * enum cudaExternalSemaphoreHandleType type; + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciSyncObj; + * } handle; + * unsigned int flags; + * } + * } + */ +public class cudaExternalSemaphoreHandleDesc { + + cudaExternalSemaphoreHandleDesc() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("type"), + MemoryLayout.paddingLayout(4), + cudaExternalSemaphoreHandleDesc.handle.layout().withName("handle"), + PanamaFFMAPI.C_INT.withName("flags"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalSemaphoreHandleDesc"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType type + * } + */ + public static final OfInt type$layout() { + return type$LAYOUT; + } + + private static final long type$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType type + * } + */ + public static final long type$offset() { + return type$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType type + * } + */ + public static int type(MemorySegment struct) { + return struct.get(type$LAYOUT, type$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaExternalSemaphoreHandleType type + * } + */ + public static void type(MemorySegment struct, int fieldValue) { + struct.set(type$LAYOUT, type$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciSyncObj; + * } + * } + */ + public static class handle { + + handle() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + PanamaFFMAPI.C_INT.withName("fd"), + cudaExternalSemaphoreHandleDesc.handle.win32.layout().withName("win32"), + PanamaFFMAPI.C_POINTER.withName("nvSciSyncObj") + ).withName("$anon$2645:5"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt fd$LAYOUT = (OfInt)$LAYOUT.select(groupElement("fd")); + + /** + * Layout for field: + * {@snippet lang=c : + * int fd + * } + */ + public static final OfInt fd$layout() { + return fd$LAYOUT; + } + + private static final long fd$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int fd + * } + */ + public static final long fd$offset() { + return fd$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int fd + * } + */ + public static int fd(MemorySegment union) { + return union.get(fd$LAYOUT, fd$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int fd + * } + */ + public static void fd(MemorySegment union, int fieldValue) { + union.set(fd$LAYOUT, fd$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * struct { + * void *handle; + * const void *name; + * } + * } + */ + public static class win32 { + + win32() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("handle"), + PanamaFFMAPI.C_POINTER.withName("name") + ).withName("$anon$2668:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout handle$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("handle")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *handle + * } + */ + public static final AddressLayout handle$layout() { + return handle$LAYOUT; + } + + private static final long handle$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *handle + * } + */ + public static final long handle$offset() { + return handle$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *handle + * } + */ + public static MemorySegment handle(MemorySegment struct) { + return struct.get(handle$LAYOUT, handle$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *handle + * } + */ + public static void handle(MemorySegment struct, MemorySegment fieldValue) { + struct.set(handle$LAYOUT, handle$OFFSET, fieldValue); + } + + private static final AddressLayout name$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("name")); + + /** + * Layout for field: + * {@snippet lang=c : + * const void *name + * } + */ + public static final AddressLayout name$layout() { + return name$LAYOUT; + } + + private static final long name$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * const void *name + * } + */ + public static final long name$offset() { + return name$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const void *name + * } + */ + public static MemorySegment name(MemorySegment struct) { + return struct.get(name$LAYOUT, name$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const void *name + * } + */ + public static void name(MemorySegment struct, MemorySegment fieldValue) { + struct.set(name$LAYOUT, name$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout win32$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("win32")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * void *handle; + * const void *name; + * } win32 + * } + */ + public static final GroupLayout win32$layout() { + return win32$LAYOUT; + } + + private static final long win32$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * void *handle; + * const void *name; + * } win32 + * } + */ + public static final long win32$offset() { + return win32$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * void *handle; + * const void *name; + * } win32 + * } + */ + public static MemorySegment win32(MemorySegment union) { + return union.asSlice(win32$OFFSET, win32$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * void *handle; + * const void *name; + * } win32 + * } + */ + public static void win32(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, win32$OFFSET, win32$LAYOUT.byteSize()); + } + + private static final AddressLayout nvSciSyncObj$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("nvSciSyncObj")); + + /** + * Layout for field: + * {@snippet lang=c : + * const void *nvSciSyncObj + * } + */ + public static final AddressLayout nvSciSyncObj$layout() { + return nvSciSyncObj$LAYOUT; + } + + private static final long nvSciSyncObj$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const void *nvSciSyncObj + * } + */ + public static final long nvSciSyncObj$offset() { + return nvSciSyncObj$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const void *nvSciSyncObj + * } + */ + public static MemorySegment nvSciSyncObj(MemorySegment union) { + return union.get(nvSciSyncObj$LAYOUT, nvSciSyncObj$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const void *nvSciSyncObj + * } + */ + public static void nvSciSyncObj(MemorySegment union, MemorySegment fieldValue) { + union.set(nvSciSyncObj$LAYOUT, nvSciSyncObj$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout handle$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("handle")); + + /** + * Layout for field: + * {@snippet lang=c : + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciSyncObj; + * } handle + * } + */ + public static final GroupLayout handle$layout() { + return handle$LAYOUT; + } + + private static final long handle$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciSyncObj; + * } handle + * } + */ + public static final long handle$offset() { + return handle$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciSyncObj; + * } handle + * } + */ + public static MemorySegment handle(MemorySegment struct) { + return struct.asSlice(handle$OFFSET, handle$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * union { + * int fd; + * struct { + * void *handle; + * const void *name; + * } win32; + * const void *nvSciSyncObj; + * } handle + * } + */ + public static void handle(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, handle$OFFSET, handle$LAYOUT.byteSize()); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParams.java new file mode 100644 index 0000000000..c87b5ada28 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParams.java @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalSemaphoreSignalNodeParams { + * cudaExternalSemaphore_t *extSemArray; + * const struct cudaExternalSemaphoreSignalParams *paramsArray; + * unsigned int numExtSems; + * } + * } + */ +public class cudaExternalSemaphoreSignalNodeParams { + + cudaExternalSemaphoreSignalNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("extSemArray"), + PanamaFFMAPI.C_POINTER.withName("paramsArray"), + PanamaFFMAPI.C_INT.withName("numExtSems"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalSemaphoreSignalNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout extSemArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extSemArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static final AddressLayout extSemArray$layout() { + return extSemArray$LAYOUT; + } + + private static final long extSemArray$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static final long extSemArray$offset() { + return extSemArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static MemorySegment extSemArray(MemorySegment struct) { + return struct.get(extSemArray$LAYOUT, extSemArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static void extSemArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(extSemArray$LAYOUT, extSemArray$OFFSET, fieldValue); + } + + private static final AddressLayout paramsArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("paramsArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreSignalParams *paramsArray + * } + */ + public static final AddressLayout paramsArray$layout() { + return paramsArray$LAYOUT; + } + + private static final long paramsArray$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreSignalParams *paramsArray + * } + */ + public static final long paramsArray$offset() { + return paramsArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreSignalParams *paramsArray + * } + */ + public static MemorySegment paramsArray(MemorySegment struct) { + return struct.get(paramsArray$LAYOUT, paramsArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreSignalParams *paramsArray + * } + */ + public static void paramsArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(paramsArray$LAYOUT, paramsArray$OFFSET, fieldValue); + } + + private static final OfInt numExtSems$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numExtSems")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static final OfInt numExtSems$layout() { + return numExtSems$LAYOUT; + } + + private static final long numExtSems$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static final long numExtSems$offset() { + return numExtSems$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static int numExtSems(MemorySegment struct) { + return struct.get(numExtSems$LAYOUT, numExtSems$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static void numExtSems(MemorySegment struct, int fieldValue) { + struct.set(numExtSems$LAYOUT, numExtSems$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParamsV2.java new file mode 100644 index 0000000000..7a88b6bfa5 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParamsV2.java @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalSemaphoreSignalNodeParamsV2 { + * cudaExternalSemaphore_t *extSemArray; + * const struct cudaExternalSemaphoreSignalParams *paramsArray; + * unsigned int numExtSems; + * } + * } + */ +public class cudaExternalSemaphoreSignalNodeParamsV2 { + + cudaExternalSemaphoreSignalNodeParamsV2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("extSemArray"), + PanamaFFMAPI.C_POINTER.withName("paramsArray"), + PanamaFFMAPI.C_INT.withName("numExtSems"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalSemaphoreSignalNodeParamsV2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout extSemArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extSemArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static final AddressLayout extSemArray$layout() { + return extSemArray$LAYOUT; + } + + private static final long extSemArray$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static final long extSemArray$offset() { + return extSemArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static MemorySegment extSemArray(MemorySegment struct) { + return struct.get(extSemArray$LAYOUT, extSemArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static void extSemArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(extSemArray$LAYOUT, extSemArray$OFFSET, fieldValue); + } + + private static final AddressLayout paramsArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("paramsArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreSignalParams *paramsArray + * } + */ + public static final AddressLayout paramsArray$layout() { + return paramsArray$LAYOUT; + } + + private static final long paramsArray$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreSignalParams *paramsArray + * } + */ + public static final long paramsArray$offset() { + return paramsArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreSignalParams *paramsArray + * } + */ + public static MemorySegment paramsArray(MemorySegment struct) { + return struct.get(paramsArray$LAYOUT, paramsArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreSignalParams *paramsArray + * } + */ + public static void paramsArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(paramsArray$LAYOUT, paramsArray$OFFSET, fieldValue); + } + + private static final OfInt numExtSems$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numExtSems")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static final OfInt numExtSems$layout() { + return numExtSems$LAYOUT; + } + + private static final long numExtSems$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static final long numExtSems$offset() { + return numExtSems$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static int numExtSems(MemorySegment struct) { + return struct.get(numExtSems$LAYOUT, numExtSems$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static void numExtSems(MemorySegment struct, int fieldValue) { + struct.set(numExtSems$LAYOUT, numExtSems$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams.java new file mode 100644 index 0000000000..90b0aed802 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams.java @@ -0,0 +1,1033 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalSemaphoreSignalParams { + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * unsigned int reserved[12]; + * } params; + * unsigned int flags; + * unsigned int reserved[16]; + * } + * } + */ +public class cudaExternalSemaphoreSignalParams { + + cudaExternalSemaphoreSignalParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaExternalSemaphoreSignalParams.params.layout().withName("params"), + PanamaFFMAPI.C_INT.withName("flags"), + MemoryLayout.sequenceLayout(16, PanamaFFMAPI.C_INT).withName("reserved"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalSemaphoreSignalParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * unsigned int reserved[12]; + * } + * } + */ + public static class params { + + params() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaExternalSemaphoreSignalParams.params.fence.layout().withName("fence"), + cudaExternalSemaphoreSignalParams.params.nvSciSync.layout().withName("nvSciSync"), + cudaExternalSemaphoreSignalParams.params.keyedMutex.layout().withName("keyedMutex"), + MemoryLayout.sequenceLayout(12, PanamaFFMAPI.C_INT).withName("reserved") + ).withName("$anon$2788:5"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } + * } + */ + public static class fence { + + fence() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("value") + ).withName("$anon$2792:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong value$LAYOUT = (OfLong)$LAYOUT.select(groupElement("value")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static final OfLong value$layout() { + return value$LAYOUT; + } + + private static final long value$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static final long value$offset() { + return value$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static long value(MemorySegment struct) { + return struct.get(value$LAYOUT, value$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static void value(MemorySegment struct, long fieldValue) { + struct.set(value$LAYOUT, value$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout fence$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("fence")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static final GroupLayout fence$layout() { + return fence$LAYOUT; + } + + private static final long fence$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static final long fence$offset() { + return fence$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static MemorySegment fence(MemorySegment struct) { + return struct.asSlice(fence$OFFSET, fence$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static void fence(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, fence$OFFSET, fence$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } + * } + */ + public static class nvSciSync { + + nvSciSync() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + PanamaFFMAPI.C_POINTER.withName("fence"), + PanamaFFMAPI.C_LONG_LONG.withName("reserved") + ).withName("$anon$2798:9"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout fence$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fence")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static final AddressLayout fence$layout() { + return fence$LAYOUT; + } + + private static final long fence$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static final long fence$offset() { + return fence$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static MemorySegment fence(MemorySegment union) { + return union.get(fence$LAYOUT, fence$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static void fence(MemorySegment union, MemorySegment fieldValue) { + union.set(fence$LAYOUT, fence$OFFSET, fieldValue); + } + + private static final OfLong reserved$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static final OfLong reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static long reserved(MemorySegment union) { + return union.get(reserved$LAYOUT, reserved$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static void reserved(MemorySegment union, long fieldValue) { + union.set(reserved$LAYOUT, reserved$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout nvSciSync$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("nvSciSync")); + + /** + * Layout for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static final GroupLayout nvSciSync$layout() { + return nvSciSync$LAYOUT; + } + + private static final long nvSciSync$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static final long nvSciSync$offset() { + return nvSciSync$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static MemorySegment nvSciSync(MemorySegment struct) { + return struct.asSlice(nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static void nvSciSync(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * struct { + * unsigned long long key; + * } + * } + */ + public static class keyedMutex { + + keyedMutex() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("key") + ).withName("$anon$2809:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong key$LAYOUT = (OfLong)$LAYOUT.select(groupElement("key")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static final OfLong key$layout() { + return key$LAYOUT; + } + + private static final long key$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static final long key$offset() { + return key$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static long key(MemorySegment struct) { + return struct.get(key$LAYOUT, key$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static void key(MemorySegment struct, long fieldValue) { + struct.set(key$LAYOUT, key$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout keyedMutex$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("keyedMutex")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * } keyedMutex + * } + */ + public static final GroupLayout keyedMutex$layout() { + return keyedMutex$LAYOUT; + } + + private static final long keyedMutex$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * } keyedMutex + * } + */ + public static final long keyedMutex$offset() { + return keyedMutex$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * } keyedMutex + * } + */ + public static MemorySegment keyedMutex(MemorySegment struct) { + return struct.asSlice(keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * } keyedMutex + * } + */ + public static void keyedMutex(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int reserved[12] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int reserved[12] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int reserved[12] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int reserved[12] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 12 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned int reserved[12] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned int reserved[12] + * } + */ + public static int reserved(MemorySegment struct, long index0) { + return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned int reserved[12] + * } + */ + public static void reserved(MemorySegment struct, long index0, int fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout params$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("params")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * unsigned int reserved[12]; + * } params + * } + */ + public static final GroupLayout params$layout() { + return params$LAYOUT; + } + + private static final long params$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * unsigned int reserved[12]; + * } params + * } + */ + public static final long params$offset() { + return params$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * unsigned int reserved[12]; + * } params + * } + */ + public static MemorySegment params(MemorySegment struct) { + return struct.asSlice(params$OFFSET, params$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * unsigned int reserved[12]; + * } params + * } + */ + public static void params(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, params$OFFSET, params$LAYOUT.byteSize()); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 72; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 76; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 16 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static int reserved(MemorySegment struct, long index0) { + return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static void reserved(MemorySegment struct, long index0, int fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams_v1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams_v1.java new file mode 100644 index 0000000000..c9a8452b48 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams_v1.java @@ -0,0 +1,870 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalSemaphoreSignalParams_v1 { + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * } params; + * unsigned int flags; + * } + * } + */ +public class cudaExternalSemaphoreSignalParams_v1 { + + cudaExternalSemaphoreSignalParams_v1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaExternalSemaphoreSignalParams_v1.params.layout().withName("params"), + PanamaFFMAPI.C_INT.withName("flags"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalSemaphoreSignalParams_v1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * } + * } + */ + public static class params { + + params() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaExternalSemaphoreSignalParams_v1.params.fence.layout().withName("fence"), + cudaExternalSemaphoreSignalParams_v1.params.nvSciSync.layout().withName("nvSciSync"), + cudaExternalSemaphoreSignalParams_v1.params.keyedMutex.layout().withName("keyedMutex") + ).withName("$anon$2694:5"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } + * } + */ + public static class fence { + + fence() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("value") + ).withName("$anon$2698:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong value$LAYOUT = (OfLong)$LAYOUT.select(groupElement("value")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static final OfLong value$layout() { + return value$LAYOUT; + } + + private static final long value$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static final long value$offset() { + return value$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static long value(MemorySegment struct) { + return struct.get(value$LAYOUT, value$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static void value(MemorySegment struct, long fieldValue) { + struct.set(value$LAYOUT, value$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout fence$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("fence")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static final GroupLayout fence$layout() { + return fence$LAYOUT; + } + + private static final long fence$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static final long fence$offset() { + return fence$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static MemorySegment fence(MemorySegment struct) { + return struct.asSlice(fence$OFFSET, fence$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static void fence(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, fence$OFFSET, fence$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } + * } + */ + public static class nvSciSync { + + nvSciSync() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + PanamaFFMAPI.C_POINTER.withName("fence"), + PanamaFFMAPI.C_LONG_LONG.withName("reserved") + ).withName("$anon$2704:9"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout fence$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fence")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static final AddressLayout fence$layout() { + return fence$LAYOUT; + } + + private static final long fence$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static final long fence$offset() { + return fence$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static MemorySegment fence(MemorySegment union) { + return union.get(fence$LAYOUT, fence$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static void fence(MemorySegment union, MemorySegment fieldValue) { + union.set(fence$LAYOUT, fence$OFFSET, fieldValue); + } + + private static final OfLong reserved$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static final OfLong reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static long reserved(MemorySegment union) { + return union.get(reserved$LAYOUT, reserved$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static void reserved(MemorySegment union, long fieldValue) { + union.set(reserved$LAYOUT, reserved$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout nvSciSync$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("nvSciSync")); + + /** + * Layout for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static final GroupLayout nvSciSync$layout() { + return nvSciSync$LAYOUT; + } + + private static final long nvSciSync$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static final long nvSciSync$offset() { + return nvSciSync$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static MemorySegment nvSciSync(MemorySegment struct) { + return struct.asSlice(nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static void nvSciSync(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * struct { + * unsigned long long key; + * } + * } + */ + public static class keyedMutex { + + keyedMutex() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("key") + ).withName("$anon$2715:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong key$LAYOUT = (OfLong)$LAYOUT.select(groupElement("key")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static final OfLong key$layout() { + return key$LAYOUT; + } + + private static final long key$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static final long key$offset() { + return key$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static long key(MemorySegment struct) { + return struct.get(key$LAYOUT, key$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static void key(MemorySegment struct, long fieldValue) { + struct.set(key$LAYOUT, key$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout keyedMutex$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("keyedMutex")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * } keyedMutex + * } + */ + public static final GroupLayout keyedMutex$layout() { + return keyedMutex$LAYOUT; + } + + private static final long keyedMutex$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * } keyedMutex + * } + */ + public static final long keyedMutex$offset() { + return keyedMutex$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * } keyedMutex + * } + */ + public static MemorySegment keyedMutex(MemorySegment struct) { + return struct.asSlice(keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * } keyedMutex + * } + */ + public static void keyedMutex(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout params$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("params")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * } params + * } + */ + public static final GroupLayout params$layout() { + return params$LAYOUT; + } + + private static final long params$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * } params + * } + */ + public static final long params$offset() { + return params$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * } params + * } + */ + public static MemorySegment params(MemorySegment struct) { + return struct.asSlice(params$OFFSET, params$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * } keyedMutex; + * } params + * } + */ + public static void params(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, params$OFFSET, params$LAYOUT.byteSize()); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParams.java new file mode 100644 index 0000000000..2a2997ce19 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParams.java @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalSemaphoreWaitNodeParams { + * cudaExternalSemaphore_t *extSemArray; + * const struct cudaExternalSemaphoreWaitParams *paramsArray; + * unsigned int numExtSems; + * } + * } + */ +public class cudaExternalSemaphoreWaitNodeParams { + + cudaExternalSemaphoreWaitNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("extSemArray"), + PanamaFFMAPI.C_POINTER.withName("paramsArray"), + PanamaFFMAPI.C_INT.withName("numExtSems"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalSemaphoreWaitNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout extSemArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extSemArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static final AddressLayout extSemArray$layout() { + return extSemArray$LAYOUT; + } + + private static final long extSemArray$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static final long extSemArray$offset() { + return extSemArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static MemorySegment extSemArray(MemorySegment struct) { + return struct.get(extSemArray$LAYOUT, extSemArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static void extSemArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(extSemArray$LAYOUT, extSemArray$OFFSET, fieldValue); + } + + private static final AddressLayout paramsArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("paramsArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreWaitParams *paramsArray + * } + */ + public static final AddressLayout paramsArray$layout() { + return paramsArray$LAYOUT; + } + + private static final long paramsArray$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreWaitParams *paramsArray + * } + */ + public static final long paramsArray$offset() { + return paramsArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreWaitParams *paramsArray + * } + */ + public static MemorySegment paramsArray(MemorySegment struct) { + return struct.get(paramsArray$LAYOUT, paramsArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreWaitParams *paramsArray + * } + */ + public static void paramsArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(paramsArray$LAYOUT, paramsArray$OFFSET, fieldValue); + } + + private static final OfInt numExtSems$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numExtSems")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static final OfInt numExtSems$layout() { + return numExtSems$LAYOUT; + } + + private static final long numExtSems$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static final long numExtSems$offset() { + return numExtSems$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static int numExtSems(MemorySegment struct) { + return struct.get(numExtSems$LAYOUT, numExtSems$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static void numExtSems(MemorySegment struct, int fieldValue) { + struct.set(numExtSems$LAYOUT, numExtSems$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParamsV2.java new file mode 100644 index 0000000000..a12dd2628f --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParamsV2.java @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalSemaphoreWaitNodeParamsV2 { + * cudaExternalSemaphore_t *extSemArray; + * const struct cudaExternalSemaphoreWaitParams *paramsArray; + * unsigned int numExtSems; + * } + * } + */ +public class cudaExternalSemaphoreWaitNodeParamsV2 { + + cudaExternalSemaphoreWaitNodeParamsV2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("extSemArray"), + PanamaFFMAPI.C_POINTER.withName("paramsArray"), + PanamaFFMAPI.C_INT.withName("numExtSems"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalSemaphoreWaitNodeParamsV2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout extSemArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extSemArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static final AddressLayout extSemArray$layout() { + return extSemArray$LAYOUT; + } + + private static final long extSemArray$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static final long extSemArray$offset() { + return extSemArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static MemorySegment extSemArray(MemorySegment struct) { + return struct.get(extSemArray$LAYOUT, extSemArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaExternalSemaphore_t *extSemArray + * } + */ + public static void extSemArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(extSemArray$LAYOUT, extSemArray$OFFSET, fieldValue); + } + + private static final AddressLayout paramsArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("paramsArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreWaitParams *paramsArray + * } + */ + public static final AddressLayout paramsArray$layout() { + return paramsArray$LAYOUT; + } + + private static final long paramsArray$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreWaitParams *paramsArray + * } + */ + public static final long paramsArray$offset() { + return paramsArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreWaitParams *paramsArray + * } + */ + public static MemorySegment paramsArray(MemorySegment struct) { + return struct.get(paramsArray$LAYOUT, paramsArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const struct cudaExternalSemaphoreWaitParams *paramsArray + * } + */ + public static void paramsArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(paramsArray$LAYOUT, paramsArray$OFFSET, fieldValue); + } + + private static final OfInt numExtSems$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numExtSems")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static final OfInt numExtSems$layout() { + return numExtSems$LAYOUT; + } + + private static final long numExtSems$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static final long numExtSems$offset() { + return numExtSems$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static int numExtSems(MemorySegment struct) { + return struct.get(numExtSems$LAYOUT, numExtSems$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int numExtSems + * } + */ + public static void numExtSems(MemorySegment struct, int fieldValue) { + struct.set(numExtSems$LAYOUT, numExtSems$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams.java new file mode 100644 index 0000000000..06aea40d34 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams.java @@ -0,0 +1,1090 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalSemaphoreWaitParams { + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * unsigned int reserved[10]; + * } params; + * unsigned int flags; + * unsigned int reserved[16]; + * } + * } + */ +public class cudaExternalSemaphoreWaitParams { + + cudaExternalSemaphoreWaitParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaExternalSemaphoreWaitParams.params.layout().withName("params"), + PanamaFFMAPI.C_INT.withName("flags"), + MemoryLayout.sequenceLayout(16, PanamaFFMAPI.C_INT).withName("reserved"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalSemaphoreWaitParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * unsigned int reserved[10]; + * } + * } + */ + public static class params { + + params() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaExternalSemaphoreWaitParams.params.fence.layout().withName("fence"), + cudaExternalSemaphoreWaitParams.params.nvSciSync.layout().withName("nvSciSync"), + cudaExternalSemaphoreWaitParams.params.keyedMutex.layout().withName("keyedMutex"), + MemoryLayout.sequenceLayout(10, PanamaFFMAPI.C_INT).withName("reserved") + ).withName("$anon$2835:5"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } + * } + */ + public static class fence { + + fence() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("value") + ).withName("$anon$2839:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong value$LAYOUT = (OfLong)$LAYOUT.select(groupElement("value")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static final OfLong value$layout() { + return value$LAYOUT; + } + + private static final long value$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static final long value$offset() { + return value$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static long value(MemorySegment struct) { + return struct.get(value$LAYOUT, value$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static void value(MemorySegment struct, long fieldValue) { + struct.set(value$LAYOUT, value$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout fence$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("fence")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static final GroupLayout fence$layout() { + return fence$LAYOUT; + } + + private static final long fence$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static final long fence$offset() { + return fence$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static MemorySegment fence(MemorySegment struct) { + return struct.asSlice(fence$OFFSET, fence$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static void fence(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, fence$OFFSET, fence$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } + * } + */ + public static class nvSciSync { + + nvSciSync() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + PanamaFFMAPI.C_POINTER.withName("fence"), + PanamaFFMAPI.C_LONG_LONG.withName("reserved") + ).withName("$anon$2845:9"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout fence$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fence")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static final AddressLayout fence$layout() { + return fence$LAYOUT; + } + + private static final long fence$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static final long fence$offset() { + return fence$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static MemorySegment fence(MemorySegment union) { + return union.get(fence$LAYOUT, fence$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static void fence(MemorySegment union, MemorySegment fieldValue) { + union.set(fence$LAYOUT, fence$OFFSET, fieldValue); + } + + private static final OfLong reserved$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static final OfLong reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static long reserved(MemorySegment union) { + return union.get(reserved$LAYOUT, reserved$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static void reserved(MemorySegment union, long fieldValue) { + union.set(reserved$LAYOUT, reserved$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout nvSciSync$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("nvSciSync")); + + /** + * Layout for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static final GroupLayout nvSciSync$layout() { + return nvSciSync$LAYOUT; + } + + private static final long nvSciSync$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static final long nvSciSync$offset() { + return nvSciSync$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static MemorySegment nvSciSync(MemorySegment struct) { + return struct.asSlice(nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static void nvSciSync(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } + * } + */ + public static class keyedMutex { + + keyedMutex() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("key"), + PanamaFFMAPI.C_INT.withName("timeoutMs"), + MemoryLayout.paddingLayout(4) + ).withName("$anon$2856:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong key$LAYOUT = (OfLong)$LAYOUT.select(groupElement("key")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static final OfLong key$layout() { + return key$LAYOUT; + } + + private static final long key$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static final long key$offset() { + return key$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static long key(MemorySegment struct) { + return struct.get(key$LAYOUT, key$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static void key(MemorySegment struct, long fieldValue) { + struct.set(key$LAYOUT, key$OFFSET, fieldValue); + } + + private static final OfInt timeoutMs$LAYOUT = (OfInt)$LAYOUT.select(groupElement("timeoutMs")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int timeoutMs + * } + */ + public static final OfInt timeoutMs$layout() { + return timeoutMs$LAYOUT; + } + + private static final long timeoutMs$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int timeoutMs + * } + */ + public static final long timeoutMs$offset() { + return timeoutMs$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int timeoutMs + * } + */ + public static int timeoutMs(MemorySegment struct) { + return struct.get(timeoutMs$LAYOUT, timeoutMs$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int timeoutMs + * } + */ + public static void timeoutMs(MemorySegment struct, int fieldValue) { + struct.set(timeoutMs$LAYOUT, timeoutMs$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout keyedMutex$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("keyedMutex")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex + * } + */ + public static final GroupLayout keyedMutex$layout() { + return keyedMutex$LAYOUT; + } + + private static final long keyedMutex$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex + * } + */ + public static final long keyedMutex$offset() { + return keyedMutex$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex + * } + */ + public static MemorySegment keyedMutex(MemorySegment struct) { + return struct.asSlice(keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex + * } + */ + public static void keyedMutex(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int reserved[10] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int reserved[10] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int reserved[10] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int reserved[10] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 10 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned int reserved[10] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned int reserved[10] + * } + */ + public static int reserved(MemorySegment struct, long index0) { + return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned int reserved[10] + * } + */ + public static void reserved(MemorySegment struct, long index0, int fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout params$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("params")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * unsigned int reserved[10]; + * } params + * } + */ + public static final GroupLayout params$layout() { + return params$LAYOUT; + } + + private static final long params$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * unsigned int reserved[10]; + * } params + * } + */ + public static final long params$offset() { + return params$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * unsigned int reserved[10]; + * } params + * } + */ + public static MemorySegment params(MemorySegment struct) { + return struct.asSlice(params$OFFSET, params$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * unsigned int reserved[10]; + * } params + * } + */ + public static void params(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, params$OFFSET, params$LAYOUT.byteSize()); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 72; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 76; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 16 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static int reserved(MemorySegment struct, long index0) { + return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned int reserved[16] + * } + */ + public static void reserved(MemorySegment struct, long index0, int fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams_v1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams_v1.java new file mode 100644 index 0000000000..c48302456e --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams_v1.java @@ -0,0 +1,927 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaExternalSemaphoreWaitParams_v1 { + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * } params; + * unsigned int flags; + * } + * } + */ +public class cudaExternalSemaphoreWaitParams_v1 { + + cudaExternalSemaphoreWaitParams_v1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaExternalSemaphoreWaitParams_v1.params.layout().withName("params"), + PanamaFFMAPI.C_INT.withName("flags"), + MemoryLayout.paddingLayout(4) + ).withName("cudaExternalSemaphoreWaitParams_v1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * } + * } + */ + public static class params { + + params() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaExternalSemaphoreWaitParams_v1.params.fence.layout().withName("fence"), + cudaExternalSemaphoreWaitParams_v1.params.nvSciSync.layout().withName("nvSciSync"), + cudaExternalSemaphoreWaitParams_v1.params.keyedMutex.layout().withName("keyedMutex") + ).withName("$anon$2739:5"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } + * } + */ + public static class fence { + + fence() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("value") + ).withName("$anon$2743:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong value$LAYOUT = (OfLong)$LAYOUT.select(groupElement("value")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static final OfLong value$layout() { + return value$LAYOUT; + } + + private static final long value$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static final long value$offset() { + return value$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static long value(MemorySegment struct) { + return struct.get(value$LAYOUT, value$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long value + * } + */ + public static void value(MemorySegment struct, long fieldValue) { + struct.set(value$LAYOUT, value$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout fence$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("fence")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static final GroupLayout fence$layout() { + return fence$LAYOUT; + } + + private static final long fence$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static final long fence$offset() { + return fence$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static MemorySegment fence(MemorySegment struct) { + return struct.asSlice(fence$OFFSET, fence$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned long long value; + * } fence + * } + */ + public static void fence(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, fence$OFFSET, fence$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } + * } + */ + public static class nvSciSync { + + nvSciSync() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + PanamaFFMAPI.C_POINTER.withName("fence"), + PanamaFFMAPI.C_LONG_LONG.withName("reserved") + ).withName("$anon$2749:9"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout fence$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fence")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static final AddressLayout fence$layout() { + return fence$LAYOUT; + } + + private static final long fence$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static final long fence$offset() { + return fence$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static MemorySegment fence(MemorySegment union) { + return union.get(fence$LAYOUT, fence$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *fence + * } + */ + public static void fence(MemorySegment union, MemorySegment fieldValue) { + union.set(fence$LAYOUT, fence$OFFSET, fieldValue); + } + + private static final OfLong reserved$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static final OfLong reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static long reserved(MemorySegment union) { + return union.get(reserved$LAYOUT, reserved$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long reserved + * } + */ + public static void reserved(MemorySegment union, long fieldValue) { + union.set(reserved$LAYOUT, reserved$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout nvSciSync$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("nvSciSync")); + + /** + * Layout for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static final GroupLayout nvSciSync$layout() { + return nvSciSync$LAYOUT; + } + + private static final long nvSciSync$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static final long nvSciSync$offset() { + return nvSciSync$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static MemorySegment nvSciSync(MemorySegment struct) { + return struct.asSlice(nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync + * } + */ + public static void nvSciSync(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } + * } + */ + public static class keyedMutex { + + keyedMutex() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("key"), + PanamaFFMAPI.C_INT.withName("timeoutMs"), + MemoryLayout.paddingLayout(4) + ).withName("$anon$2760:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong key$LAYOUT = (OfLong)$LAYOUT.select(groupElement("key")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static final OfLong key$layout() { + return key$LAYOUT; + } + + private static final long key$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static final long key$offset() { + return key$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static long key(MemorySegment struct) { + return struct.get(key$LAYOUT, key$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long key + * } + */ + public static void key(MemorySegment struct, long fieldValue) { + struct.set(key$LAYOUT, key$OFFSET, fieldValue); + } + + private static final OfInt timeoutMs$LAYOUT = (OfInt)$LAYOUT.select(groupElement("timeoutMs")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int timeoutMs + * } + */ + public static final OfInt timeoutMs$layout() { + return timeoutMs$LAYOUT; + } + + private static final long timeoutMs$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int timeoutMs + * } + */ + public static final long timeoutMs$offset() { + return timeoutMs$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int timeoutMs + * } + */ + public static int timeoutMs(MemorySegment struct) { + return struct.get(timeoutMs$LAYOUT, timeoutMs$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int timeoutMs + * } + */ + public static void timeoutMs(MemorySegment struct, int fieldValue) { + struct.set(timeoutMs$LAYOUT, timeoutMs$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout keyedMutex$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("keyedMutex")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex + * } + */ + public static final GroupLayout keyedMutex$layout() { + return keyedMutex$LAYOUT; + } + + private static final long keyedMutex$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex + * } + */ + public static final long keyedMutex$offset() { + return keyedMutex$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex + * } + */ + public static MemorySegment keyedMutex(MemorySegment struct) { + return struct.asSlice(keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex + * } + */ + public static void keyedMutex(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout params$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("params")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * } params + * } + */ + public static final GroupLayout params$layout() { + return params$LAYOUT; + } + + private static final long params$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * } params + * } + */ + public static final long params$offset() { + return params$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * } params + * } + */ + public static MemorySegment params(MemorySegment struct) { + return struct.asSlice(params$OFFSET, params$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * struct { + * unsigned long long value; + * } fence; + * union { + * void *fence; + * unsigned long long reserved; + * } nvSciSync; + * struct { + * unsigned long long key; + * unsigned int timeoutMs; + * } keyedMutex; + * } params + * } + */ + public static void params(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, params$OFFSET, params$LAYOUT.byteSize()); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaFuncAttributes.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaFuncAttributes.java new file mode 100644 index 0000000000..1c0f7bcca2 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaFuncAttributes.java @@ -0,0 +1,913 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaFuncAttributes { + * size_t sharedSizeBytes; + * size_t constSizeBytes; + * size_t localSizeBytes; + * int maxThreadsPerBlock; + * int numRegs; + * int ptxVersion; + * int binaryVersion; + * int cacheModeCA; + * int maxDynamicSharedSizeBytes; + * int preferredShmemCarveout; + * int clusterDimMustBeSet; + * int requiredClusterWidth; + * int requiredClusterHeight; + * int requiredClusterDepth; + * int clusterSchedulingPolicyPreference; + * int nonPortableClusterSizeAllowed; + * int reserved[16]; + * } + * } + */ +public class cudaFuncAttributes { + + cudaFuncAttributes() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("sharedSizeBytes"), + PanamaFFMAPI.C_LONG.withName("constSizeBytes"), + PanamaFFMAPI.C_LONG.withName("localSizeBytes"), + PanamaFFMAPI.C_INT.withName("maxThreadsPerBlock"), + PanamaFFMAPI.C_INT.withName("numRegs"), + PanamaFFMAPI.C_INT.withName("ptxVersion"), + PanamaFFMAPI.C_INT.withName("binaryVersion"), + PanamaFFMAPI.C_INT.withName("cacheModeCA"), + PanamaFFMAPI.C_INT.withName("maxDynamicSharedSizeBytes"), + PanamaFFMAPI.C_INT.withName("preferredShmemCarveout"), + PanamaFFMAPI.C_INT.withName("clusterDimMustBeSet"), + PanamaFFMAPI.C_INT.withName("requiredClusterWidth"), + PanamaFFMAPI.C_INT.withName("requiredClusterHeight"), + PanamaFFMAPI.C_INT.withName("requiredClusterDepth"), + PanamaFFMAPI.C_INT.withName("clusterSchedulingPolicyPreference"), + PanamaFFMAPI.C_INT.withName("nonPortableClusterSizeAllowed"), + MemoryLayout.sequenceLayout(16, PanamaFFMAPI.C_INT).withName("reserved"), + MemoryLayout.paddingLayout(4) + ).withName("cudaFuncAttributes"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong sharedSizeBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sharedSizeBytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t sharedSizeBytes + * } + */ + public static final OfLong sharedSizeBytes$layout() { + return sharedSizeBytes$LAYOUT; + } + + private static final long sharedSizeBytes$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t sharedSizeBytes + * } + */ + public static final long sharedSizeBytes$offset() { + return sharedSizeBytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t sharedSizeBytes + * } + */ + public static long sharedSizeBytes(MemorySegment struct) { + return struct.get(sharedSizeBytes$LAYOUT, sharedSizeBytes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t sharedSizeBytes + * } + */ + public static void sharedSizeBytes(MemorySegment struct, long fieldValue) { + struct.set(sharedSizeBytes$LAYOUT, sharedSizeBytes$OFFSET, fieldValue); + } + + private static final OfLong constSizeBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("constSizeBytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t constSizeBytes + * } + */ + public static final OfLong constSizeBytes$layout() { + return constSizeBytes$LAYOUT; + } + + private static final long constSizeBytes$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t constSizeBytes + * } + */ + public static final long constSizeBytes$offset() { + return constSizeBytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t constSizeBytes + * } + */ + public static long constSizeBytes(MemorySegment struct) { + return struct.get(constSizeBytes$LAYOUT, constSizeBytes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t constSizeBytes + * } + */ + public static void constSizeBytes(MemorySegment struct, long fieldValue) { + struct.set(constSizeBytes$LAYOUT, constSizeBytes$OFFSET, fieldValue); + } + + private static final OfLong localSizeBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("localSizeBytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t localSizeBytes + * } + */ + public static final OfLong localSizeBytes$layout() { + return localSizeBytes$LAYOUT; + } + + private static final long localSizeBytes$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t localSizeBytes + * } + */ + public static final long localSizeBytes$offset() { + return localSizeBytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t localSizeBytes + * } + */ + public static long localSizeBytes(MemorySegment struct) { + return struct.get(localSizeBytes$LAYOUT, localSizeBytes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t localSizeBytes + * } + */ + public static void localSizeBytes(MemorySegment struct, long fieldValue) { + struct.set(localSizeBytes$LAYOUT, localSizeBytes$OFFSET, fieldValue); + } + + private static final OfInt maxThreadsPerBlock$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxThreadsPerBlock")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxThreadsPerBlock + * } + */ + public static final OfInt maxThreadsPerBlock$layout() { + return maxThreadsPerBlock$LAYOUT; + } + + private static final long maxThreadsPerBlock$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxThreadsPerBlock + * } + */ + public static final long maxThreadsPerBlock$offset() { + return maxThreadsPerBlock$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxThreadsPerBlock + * } + */ + public static int maxThreadsPerBlock(MemorySegment struct) { + return struct.get(maxThreadsPerBlock$LAYOUT, maxThreadsPerBlock$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxThreadsPerBlock + * } + */ + public static void maxThreadsPerBlock(MemorySegment struct, int fieldValue) { + struct.set(maxThreadsPerBlock$LAYOUT, maxThreadsPerBlock$OFFSET, fieldValue); + } + + private static final OfInt numRegs$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numRegs")); + + /** + * Layout for field: + * {@snippet lang=c : + * int numRegs + * } + */ + public static final OfInt numRegs$layout() { + return numRegs$LAYOUT; + } + + private static final long numRegs$OFFSET = 28; + + /** + * Offset for field: + * {@snippet lang=c : + * int numRegs + * } + */ + public static final long numRegs$offset() { + return numRegs$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int numRegs + * } + */ + public static int numRegs(MemorySegment struct) { + return struct.get(numRegs$LAYOUT, numRegs$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int numRegs + * } + */ + public static void numRegs(MemorySegment struct, int fieldValue) { + struct.set(numRegs$LAYOUT, numRegs$OFFSET, fieldValue); + } + + private static final OfInt ptxVersion$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ptxVersion")); + + /** + * Layout for field: + * {@snippet lang=c : + * int ptxVersion + * } + */ + public static final OfInt ptxVersion$layout() { + return ptxVersion$LAYOUT; + } + + private static final long ptxVersion$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * int ptxVersion + * } + */ + public static final long ptxVersion$offset() { + return ptxVersion$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int ptxVersion + * } + */ + public static int ptxVersion(MemorySegment struct) { + return struct.get(ptxVersion$LAYOUT, ptxVersion$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int ptxVersion + * } + */ + public static void ptxVersion(MemorySegment struct, int fieldValue) { + struct.set(ptxVersion$LAYOUT, ptxVersion$OFFSET, fieldValue); + } + + private static final OfInt binaryVersion$LAYOUT = (OfInt)$LAYOUT.select(groupElement("binaryVersion")); + + /** + * Layout for field: + * {@snippet lang=c : + * int binaryVersion + * } + */ + public static final OfInt binaryVersion$layout() { + return binaryVersion$LAYOUT; + } + + private static final long binaryVersion$OFFSET = 36; + + /** + * Offset for field: + * {@snippet lang=c : + * int binaryVersion + * } + */ + public static final long binaryVersion$offset() { + return binaryVersion$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int binaryVersion + * } + */ + public static int binaryVersion(MemorySegment struct) { + return struct.get(binaryVersion$LAYOUT, binaryVersion$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int binaryVersion + * } + */ + public static void binaryVersion(MemorySegment struct, int fieldValue) { + struct.set(binaryVersion$LAYOUT, binaryVersion$OFFSET, fieldValue); + } + + private static final OfInt cacheModeCA$LAYOUT = (OfInt)$LAYOUT.select(groupElement("cacheModeCA")); + + /** + * Layout for field: + * {@snippet lang=c : + * int cacheModeCA + * } + */ + public static final OfInt cacheModeCA$layout() { + return cacheModeCA$LAYOUT; + } + + private static final long cacheModeCA$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * int cacheModeCA + * } + */ + public static final long cacheModeCA$offset() { + return cacheModeCA$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int cacheModeCA + * } + */ + public static int cacheModeCA(MemorySegment struct) { + return struct.get(cacheModeCA$LAYOUT, cacheModeCA$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int cacheModeCA + * } + */ + public static void cacheModeCA(MemorySegment struct, int fieldValue) { + struct.set(cacheModeCA$LAYOUT, cacheModeCA$OFFSET, fieldValue); + } + + private static final OfInt maxDynamicSharedSizeBytes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxDynamicSharedSizeBytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * int maxDynamicSharedSizeBytes + * } + */ + public static final OfInt maxDynamicSharedSizeBytes$layout() { + return maxDynamicSharedSizeBytes$LAYOUT; + } + + private static final long maxDynamicSharedSizeBytes$OFFSET = 44; + + /** + * Offset for field: + * {@snippet lang=c : + * int maxDynamicSharedSizeBytes + * } + */ + public static final long maxDynamicSharedSizeBytes$offset() { + return maxDynamicSharedSizeBytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int maxDynamicSharedSizeBytes + * } + */ + public static int maxDynamicSharedSizeBytes(MemorySegment struct) { + return struct.get(maxDynamicSharedSizeBytes$LAYOUT, maxDynamicSharedSizeBytes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int maxDynamicSharedSizeBytes + * } + */ + public static void maxDynamicSharedSizeBytes(MemorySegment struct, int fieldValue) { + struct.set(maxDynamicSharedSizeBytes$LAYOUT, maxDynamicSharedSizeBytes$OFFSET, fieldValue); + } + + private static final OfInt preferredShmemCarveout$LAYOUT = (OfInt)$LAYOUT.select(groupElement("preferredShmemCarveout")); + + /** + * Layout for field: + * {@snippet lang=c : + * int preferredShmemCarveout + * } + */ + public static final OfInt preferredShmemCarveout$layout() { + return preferredShmemCarveout$LAYOUT; + } + + private static final long preferredShmemCarveout$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * int preferredShmemCarveout + * } + */ + public static final long preferredShmemCarveout$offset() { + return preferredShmemCarveout$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int preferredShmemCarveout + * } + */ + public static int preferredShmemCarveout(MemorySegment struct) { + return struct.get(preferredShmemCarveout$LAYOUT, preferredShmemCarveout$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int preferredShmemCarveout + * } + */ + public static void preferredShmemCarveout(MemorySegment struct, int fieldValue) { + struct.set(preferredShmemCarveout$LAYOUT, preferredShmemCarveout$OFFSET, fieldValue); + } + + private static final OfInt clusterDimMustBeSet$LAYOUT = (OfInt)$LAYOUT.select(groupElement("clusterDimMustBeSet")); + + /** + * Layout for field: + * {@snippet lang=c : + * int clusterDimMustBeSet + * } + */ + public static final OfInt clusterDimMustBeSet$layout() { + return clusterDimMustBeSet$LAYOUT; + } + + private static final long clusterDimMustBeSet$OFFSET = 52; + + /** + * Offset for field: + * {@snippet lang=c : + * int clusterDimMustBeSet + * } + */ + public static final long clusterDimMustBeSet$offset() { + return clusterDimMustBeSet$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int clusterDimMustBeSet + * } + */ + public static int clusterDimMustBeSet(MemorySegment struct) { + return struct.get(clusterDimMustBeSet$LAYOUT, clusterDimMustBeSet$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int clusterDimMustBeSet + * } + */ + public static void clusterDimMustBeSet(MemorySegment struct, int fieldValue) { + struct.set(clusterDimMustBeSet$LAYOUT, clusterDimMustBeSet$OFFSET, fieldValue); + } + + private static final OfInt requiredClusterWidth$LAYOUT = (OfInt)$LAYOUT.select(groupElement("requiredClusterWidth")); + + /** + * Layout for field: + * {@snippet lang=c : + * int requiredClusterWidth + * } + */ + public static final OfInt requiredClusterWidth$layout() { + return requiredClusterWidth$LAYOUT; + } + + private static final long requiredClusterWidth$OFFSET = 56; + + /** + * Offset for field: + * {@snippet lang=c : + * int requiredClusterWidth + * } + */ + public static final long requiredClusterWidth$offset() { + return requiredClusterWidth$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int requiredClusterWidth + * } + */ + public static int requiredClusterWidth(MemorySegment struct) { + return struct.get(requiredClusterWidth$LAYOUT, requiredClusterWidth$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int requiredClusterWidth + * } + */ + public static void requiredClusterWidth(MemorySegment struct, int fieldValue) { + struct.set(requiredClusterWidth$LAYOUT, requiredClusterWidth$OFFSET, fieldValue); + } + + private static final OfInt requiredClusterHeight$LAYOUT = (OfInt)$LAYOUT.select(groupElement("requiredClusterHeight")); + + /** + * Layout for field: + * {@snippet lang=c : + * int requiredClusterHeight + * } + */ + public static final OfInt requiredClusterHeight$layout() { + return requiredClusterHeight$LAYOUT; + } + + private static final long requiredClusterHeight$OFFSET = 60; + + /** + * Offset for field: + * {@snippet lang=c : + * int requiredClusterHeight + * } + */ + public static final long requiredClusterHeight$offset() { + return requiredClusterHeight$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int requiredClusterHeight + * } + */ + public static int requiredClusterHeight(MemorySegment struct) { + return struct.get(requiredClusterHeight$LAYOUT, requiredClusterHeight$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int requiredClusterHeight + * } + */ + public static void requiredClusterHeight(MemorySegment struct, int fieldValue) { + struct.set(requiredClusterHeight$LAYOUT, requiredClusterHeight$OFFSET, fieldValue); + } + + private static final OfInt requiredClusterDepth$LAYOUT = (OfInt)$LAYOUT.select(groupElement("requiredClusterDepth")); + + /** + * Layout for field: + * {@snippet lang=c : + * int requiredClusterDepth + * } + */ + public static final OfInt requiredClusterDepth$layout() { + return requiredClusterDepth$LAYOUT; + } + + private static final long requiredClusterDepth$OFFSET = 64; + + /** + * Offset for field: + * {@snippet lang=c : + * int requiredClusterDepth + * } + */ + public static final long requiredClusterDepth$offset() { + return requiredClusterDepth$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int requiredClusterDepth + * } + */ + public static int requiredClusterDepth(MemorySegment struct) { + return struct.get(requiredClusterDepth$LAYOUT, requiredClusterDepth$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int requiredClusterDepth + * } + */ + public static void requiredClusterDepth(MemorySegment struct, int fieldValue) { + struct.set(requiredClusterDepth$LAYOUT, requiredClusterDepth$OFFSET, fieldValue); + } + + private static final OfInt clusterSchedulingPolicyPreference$LAYOUT = (OfInt)$LAYOUT.select(groupElement("clusterSchedulingPolicyPreference")); + + /** + * Layout for field: + * {@snippet lang=c : + * int clusterSchedulingPolicyPreference + * } + */ + public static final OfInt clusterSchedulingPolicyPreference$layout() { + return clusterSchedulingPolicyPreference$LAYOUT; + } + + private static final long clusterSchedulingPolicyPreference$OFFSET = 68; + + /** + * Offset for field: + * {@snippet lang=c : + * int clusterSchedulingPolicyPreference + * } + */ + public static final long clusterSchedulingPolicyPreference$offset() { + return clusterSchedulingPolicyPreference$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int clusterSchedulingPolicyPreference + * } + */ + public static int clusterSchedulingPolicyPreference(MemorySegment struct) { + return struct.get(clusterSchedulingPolicyPreference$LAYOUT, clusterSchedulingPolicyPreference$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int clusterSchedulingPolicyPreference + * } + */ + public static void clusterSchedulingPolicyPreference(MemorySegment struct, int fieldValue) { + struct.set(clusterSchedulingPolicyPreference$LAYOUT, clusterSchedulingPolicyPreference$OFFSET, fieldValue); + } + + private static final OfInt nonPortableClusterSizeAllowed$LAYOUT = (OfInt)$LAYOUT.select(groupElement("nonPortableClusterSizeAllowed")); + + /** + * Layout for field: + * {@snippet lang=c : + * int nonPortableClusterSizeAllowed + * } + */ + public static final OfInt nonPortableClusterSizeAllowed$layout() { + return nonPortableClusterSizeAllowed$LAYOUT; + } + + private static final long nonPortableClusterSizeAllowed$OFFSET = 72; + + /** + * Offset for field: + * {@snippet lang=c : + * int nonPortableClusterSizeAllowed + * } + */ + public static final long nonPortableClusterSizeAllowed$offset() { + return nonPortableClusterSizeAllowed$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int nonPortableClusterSizeAllowed + * } + */ + public static int nonPortableClusterSizeAllowed(MemorySegment struct) { + return struct.get(nonPortableClusterSizeAllowed$LAYOUT, nonPortableClusterSizeAllowed$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int nonPortableClusterSizeAllowed + * } + */ + public static void nonPortableClusterSizeAllowed(MemorySegment struct, int fieldValue) { + struct.set(nonPortableClusterSizeAllowed$LAYOUT, nonPortableClusterSizeAllowed$OFFSET, fieldValue); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * int reserved[16] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 76; + + /** + * Offset for field: + * {@snippet lang=c : + * int reserved[16] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int reserved[16] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int reserved[16] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 16 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int reserved[16] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int reserved[16] + * } + */ + public static int reserved(MemorySegment struct, long index0) { + return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int reserved[16] + * } + */ + public static void reserved(MemorySegment struct, long index0, int fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData.java new file mode 100644 index 0000000000..ea7dd0af2c --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct cudaGraphEdgeData_st { + * unsigned char from_port; + * unsigned char to_port; + * unsigned char type; + * unsigned char reserved[5]; + * } cudaGraphEdgeData + * } + */ +public class cudaGraphEdgeData extends cudaGraphEdgeData_st { + + cudaGraphEdgeData() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData_st.java new file mode 100644 index 0000000000..57c36fb6b0 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData_st.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaGraphEdgeData_st { + * unsigned char from_port; + * unsigned char to_port; + * unsigned char type; + * unsigned char reserved[5]; + * } + * } + */ +public class cudaGraphEdgeData_st { + + cudaGraphEdgeData_st() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_CHAR.withName("from_port"), + PanamaFFMAPI.C_CHAR.withName("to_port"), + PanamaFFMAPI.C_CHAR.withName("type"), + MemoryLayout.sequenceLayout(5, PanamaFFMAPI.C_CHAR).withName("reserved") + ).withName("cudaGraphEdgeData_st"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte from_port$LAYOUT = (OfByte)$LAYOUT.select(groupElement("from_port")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char from_port + * } + */ + public static final OfByte from_port$layout() { + return from_port$LAYOUT; + } + + private static final long from_port$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char from_port + * } + */ + public static final long from_port$offset() { + return from_port$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char from_port + * } + */ + public static byte from_port(MemorySegment struct) { + return struct.get(from_port$LAYOUT, from_port$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char from_port + * } + */ + public static void from_port(MemorySegment struct, byte fieldValue) { + struct.set(from_port$LAYOUT, from_port$OFFSET, fieldValue); + } + + private static final OfByte to_port$LAYOUT = (OfByte)$LAYOUT.select(groupElement("to_port")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char to_port + * } + */ + public static final OfByte to_port$layout() { + return to_port$LAYOUT; + } + + private static final long to_port$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char to_port + * } + */ + public static final long to_port$offset() { + return to_port$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char to_port + * } + */ + public static byte to_port(MemorySegment struct) { + return struct.get(to_port$LAYOUT, to_port$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char to_port + * } + */ + public static void to_port(MemorySegment struct, byte fieldValue) { + struct.set(to_port$LAYOUT, to_port$OFFSET, fieldValue); + } + + private static final OfByte type$LAYOUT = (OfByte)$LAYOUT.select(groupElement("type")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char type + * } + */ + public static final OfByte type$layout() { + return type$LAYOUT; + } + + private static final long type$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char type + * } + */ + public static final long type$offset() { + return type$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char type + * } + */ + public static byte type(MemorySegment struct) { + return struct.get(type$LAYOUT, type$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char type + * } + */ + public static void type(MemorySegment struct, byte fieldValue) { + struct.set(type$LAYOUT, type$OFFSET, fieldValue); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char reserved[5] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 3; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char reserved[5] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char reserved[5] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char reserved[5] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 5 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned char reserved[5] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned char reserved[5] + * } + */ + public static byte reserved(MemorySegment struct, long index0) { + return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned char reserved[5] + * } + */ + public static void reserved(MemorySegment struct, long index0, byte fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo.java new file mode 100644 index 0000000000..cb180dffa4 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct cudaGraphExecUpdateResultInfo_st { + * enum cudaGraphExecUpdateResult result; + * cudaGraphNode_t errorNode; + * cudaGraphNode_t errorFromNode; + * } cudaGraphExecUpdateResultInfo + * } + */ +public class cudaGraphExecUpdateResultInfo extends cudaGraphExecUpdateResultInfo_st { + + cudaGraphExecUpdateResultInfo() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo_st.java new file mode 100644 index 0000000000..751233db15 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo_st.java @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaGraphExecUpdateResultInfo_st { + * enum cudaGraphExecUpdateResult result; + * cudaGraphNode_t errorNode; + * cudaGraphNode_t errorFromNode; + * } + * } + */ +public class cudaGraphExecUpdateResultInfo_st { + + cudaGraphExecUpdateResultInfo_st() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("result"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_POINTER.withName("errorNode"), + PanamaFFMAPI.C_POINTER.withName("errorFromNode") + ).withName("cudaGraphExecUpdateResultInfo_st"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt result$LAYOUT = (OfInt)$LAYOUT.select(groupElement("result")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult result + * } + */ + public static final OfInt result$layout() { + return result$LAYOUT; + } + + private static final long result$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult result + * } + */ + public static final long result$offset() { + return result$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult result + * } + */ + public static int result(MemorySegment struct) { + return struct.get(result$LAYOUT, result$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaGraphExecUpdateResult result + * } + */ + public static void result(MemorySegment struct, int fieldValue) { + struct.set(result$LAYOUT, result$OFFSET, fieldValue); + } + + private static final AddressLayout errorNode$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("errorNode")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaGraphNode_t errorNode + * } + */ + public static final AddressLayout errorNode$layout() { + return errorNode$LAYOUT; + } + + private static final long errorNode$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaGraphNode_t errorNode + * } + */ + public static final long errorNode$offset() { + return errorNode$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaGraphNode_t errorNode + * } + */ + public static MemorySegment errorNode(MemorySegment struct) { + return struct.get(errorNode$LAYOUT, errorNode$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaGraphNode_t errorNode + * } + */ + public static void errorNode(MemorySegment struct, MemorySegment fieldValue) { + struct.set(errorNode$LAYOUT, errorNode$OFFSET, fieldValue); + } + + private static final AddressLayout errorFromNode$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("errorFromNode")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaGraphNode_t errorFromNode + * } + */ + public static final AddressLayout errorFromNode$layout() { + return errorFromNode$LAYOUT; + } + + private static final long errorFromNode$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaGraphNode_t errorFromNode + * } + */ + public static final long errorFromNode$offset() { + return errorFromNode$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaGraphNode_t errorFromNode + * } + */ + public static MemorySegment errorFromNode(MemorySegment struct) { + return struct.get(errorFromNode$LAYOUT, errorFromNode$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaGraphNode_t errorFromNode + * } + */ + public static void errorFromNode(MemorySegment struct, MemorySegment fieldValue) { + struct.set(errorFromNode$LAYOUT, errorFromNode$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams.java new file mode 100644 index 0000000000..a70cb140d8 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct cudaGraphInstantiateParams_st { + * unsigned long long flags; + * cudaStream_t uploadStream; + * cudaGraphNode_t errNode_out; + * cudaGraphInstantiateResult result_out; + * } cudaGraphInstantiateParams + * } + */ +public class cudaGraphInstantiateParams extends cudaGraphInstantiateParams_st { + + cudaGraphInstantiateParams() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams_st.java new file mode 100644 index 0000000000..27c874879c --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams_st.java @@ -0,0 +1,282 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaGraphInstantiateParams_st { + * unsigned long long flags; + * cudaStream_t uploadStream; + * cudaGraphNode_t errNode_out; + * cudaGraphInstantiateResult result_out; + * } + * } + */ +public class cudaGraphInstantiateParams_st { + + cudaGraphInstantiateParams_st() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("flags"), + PanamaFFMAPI.C_POINTER.withName("uploadStream"), + PanamaFFMAPI.C_POINTER.withName("errNode_out"), + PanamaFFMAPI.C_INT.withName("result_out"), + MemoryLayout.paddingLayout(4) + ).withName("cudaGraphInstantiateParams_st"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong flags$LAYOUT = (OfLong)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long flags + * } + */ + public static final OfLong flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long flags + * } + */ + public static long flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long flags + * } + */ + public static void flags(MemorySegment struct, long fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + private static final AddressLayout uploadStream$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("uploadStream")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaStream_t uploadStream + * } + */ + public static final AddressLayout uploadStream$layout() { + return uploadStream$LAYOUT; + } + + private static final long uploadStream$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaStream_t uploadStream + * } + */ + public static final long uploadStream$offset() { + return uploadStream$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaStream_t uploadStream + * } + */ + public static MemorySegment uploadStream(MemorySegment struct) { + return struct.get(uploadStream$LAYOUT, uploadStream$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaStream_t uploadStream + * } + */ + public static void uploadStream(MemorySegment struct, MemorySegment fieldValue) { + struct.set(uploadStream$LAYOUT, uploadStream$OFFSET, fieldValue); + } + + private static final AddressLayout errNode_out$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("errNode_out")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaGraphNode_t errNode_out + * } + */ + public static final AddressLayout errNode_out$layout() { + return errNode_out$LAYOUT; + } + + private static final long errNode_out$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaGraphNode_t errNode_out + * } + */ + public static final long errNode_out$offset() { + return errNode_out$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaGraphNode_t errNode_out + * } + */ + public static MemorySegment errNode_out(MemorySegment struct) { + return struct.get(errNode_out$LAYOUT, errNode_out$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaGraphNode_t errNode_out + * } + */ + public static void errNode_out(MemorySegment struct, MemorySegment fieldValue) { + struct.set(errNode_out$LAYOUT, errNode_out$OFFSET, fieldValue); + } + + private static final OfInt result_out$LAYOUT = (OfInt)$LAYOUT.select(groupElement("result_out")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaGraphInstantiateResult result_out + * } + */ + public static final OfInt result_out$layout() { + return result_out$LAYOUT; + } + + private static final long result_out$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaGraphInstantiateResult result_out + * } + */ + public static final long result_out$offset() { + return result_out$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaGraphInstantiateResult result_out + * } + */ + public static int result_out(MemorySegment struct) { + return struct.get(result_out$LAYOUT, result_out$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaGraphInstantiateResult result_out + * } + */ + public static void result_out(MemorySegment struct, int fieldValue) { + struct.set(result_out$LAYOUT, result_out$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphKernelNodeUpdate.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphKernelNodeUpdate.java new file mode 100644 index 0000000000..2b3d40dcac --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphKernelNodeUpdate.java @@ -0,0 +1,706 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaGraphKernelNodeUpdate { + * cudaGraphDeviceNode_t node; + * enum cudaGraphKernelNodeField field; + * union { + * dim3 gridDim; + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } param; + * unsigned int isEnabled; + * } updateData; + * } + * } + */ +public class cudaGraphKernelNodeUpdate { + + cudaGraphKernelNodeUpdate() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("node"), + PanamaFFMAPI.C_INT.withName("field"), + MemoryLayout.paddingLayout(4), + cudaGraphKernelNodeUpdate.updateData.layout().withName("updateData") + ).withName("cudaGraphKernelNodeUpdate"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout node$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("node")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaGraphDeviceNode_t node + * } + */ + public static final AddressLayout node$layout() { + return node$LAYOUT; + } + + private static final long node$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaGraphDeviceNode_t node + * } + */ + public static final long node$offset() { + return node$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaGraphDeviceNode_t node + * } + */ + public static MemorySegment node(MemorySegment struct) { + return struct.get(node$LAYOUT, node$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaGraphDeviceNode_t node + * } + */ + public static void node(MemorySegment struct, MemorySegment fieldValue) { + struct.set(node$LAYOUT, node$OFFSET, fieldValue); + } + + private static final OfInt field$LAYOUT = (OfInt)$LAYOUT.select(groupElement("field")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaGraphKernelNodeField field + * } + */ + public static final OfInt field$layout() { + return field$LAYOUT; + } + + private static final long field$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaGraphKernelNodeField field + * } + */ + public static final long field$offset() { + return field$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaGraphKernelNodeField field + * } + */ + public static int field(MemorySegment struct) { + return struct.get(field$LAYOUT, field$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaGraphKernelNodeField field + * } + */ + public static void field(MemorySegment struct, int fieldValue) { + struct.set(field$LAYOUT, field$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * union { + * dim3 gridDim; + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } param; + * unsigned int isEnabled; + * } + * } + */ + public static class updateData { + + updateData() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + dim3.layout().withName("gridDim"), + cudaGraphKernelNodeUpdate.updateData.param.layout().withName("param"), + PanamaFFMAPI.C_INT.withName("isEnabled") + ).withName("$anon$3302:5"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout gridDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("gridDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static final GroupLayout gridDim$layout() { + return gridDim$LAYOUT; + } + + private static final long gridDim$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static final long gridDim$offset() { + return gridDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static MemorySegment gridDim(MemorySegment union) { + return union.asSlice(gridDim$OFFSET, gridDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static void gridDim(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, gridDim$OFFSET, gridDim$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } + * } + */ + public static class param { + + param() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("pValue"), + PanamaFFMAPI.C_LONG.withName("offset"), + PanamaFFMAPI.C_LONG.withName("size") + ).withName("$anon$3309:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout pValue$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("pValue")); + + /** + * Layout for field: + * {@snippet lang=c : + * const void *pValue + * } + */ + public static final AddressLayout pValue$layout() { + return pValue$LAYOUT; + } + + private static final long pValue$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * const void *pValue + * } + */ + public static final long pValue$offset() { + return pValue$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const void *pValue + * } + */ + public static MemorySegment pValue(MemorySegment struct) { + return struct.get(pValue$LAYOUT, pValue$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const void *pValue + * } + */ + public static void pValue(MemorySegment struct, MemorySegment fieldValue) { + struct.set(pValue$LAYOUT, pValue$OFFSET, fieldValue); + } + + private static final OfLong offset$LAYOUT = (OfLong)$LAYOUT.select(groupElement("offset")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t offset + * } + */ + public static final OfLong offset$layout() { + return offset$LAYOUT; + } + + private static final long offset$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t offset + * } + */ + public static final long offset$offset() { + return offset$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t offset + * } + */ + public static long offset(MemorySegment struct) { + return struct.get(offset$LAYOUT, offset$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t offset + * } + */ + public static void offset(MemorySegment struct, long fieldValue) { + struct.set(offset$LAYOUT, offset$OFFSET, fieldValue); + } + + private static final OfLong size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("size")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t size + * } + */ + public static final OfLong size$layout() { + return size$LAYOUT; + } + + private static final long size$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t size + * } + */ + public static final long size$offset() { + return size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t size + * } + */ + public static long size(MemorySegment struct) { + return struct.get(size$LAYOUT, size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t size + * } + */ + public static void size(MemorySegment struct, long fieldValue) { + struct.set(size$LAYOUT, size$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout param$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("param")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } param + * } + */ + public static final GroupLayout param$layout() { + return param$LAYOUT; + } + + private static final long param$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } param + * } + */ + public static final long param$offset() { + return param$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } param + * } + */ + public static MemorySegment param(MemorySegment union) { + return union.asSlice(param$OFFSET, param$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } param + * } + */ + public static void param(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, param$OFFSET, param$LAYOUT.byteSize()); + } + + private static final OfInt isEnabled$LAYOUT = (OfInt)$LAYOUT.select(groupElement("isEnabled")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int isEnabled + * } + */ + public static final OfInt isEnabled$layout() { + return isEnabled$LAYOUT; + } + + private static final long isEnabled$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int isEnabled + * } + */ + public static final long isEnabled$offset() { + return isEnabled$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int isEnabled + * } + */ + public static int isEnabled(MemorySegment union) { + return union.get(isEnabled$LAYOUT, isEnabled$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int isEnabled + * } + */ + public static void isEnabled(MemorySegment union, int fieldValue) { + union.set(isEnabled$LAYOUT, isEnabled$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout updateData$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("updateData")); + + /** + * Layout for field: + * {@snippet lang=c : + * union { + * dim3 gridDim; + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } param; + * unsigned int isEnabled; + * } updateData + * } + */ + public static final GroupLayout updateData$layout() { + return updateData$LAYOUT; + } + + private static final long updateData$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * union { + * dim3 gridDim; + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } param; + * unsigned int isEnabled; + * } updateData + * } + */ + public static final long updateData$offset() { + return updateData$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * union { + * dim3 gridDim; + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } param; + * unsigned int isEnabled; + * } updateData + * } + */ + public static MemorySegment updateData(MemorySegment struct) { + return struct.asSlice(updateData$OFFSET, updateData$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * union { + * dim3 gridDim; + * struct { + * const void *pValue; + * size_t offset; + * size_t size; + * } param; + * unsigned int isEnabled; + * } updateData + * } + */ + public static void updateData(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, updateData$OFFSET, updateData$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphNodeParams.java new file mode 100644 index 0000000000..64ec95c834 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphNodeParams.java @@ -0,0 +1,903 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaGraphNodeParams { + * enum cudaGraphNodeType type; + * int reserved0[3]; + * union { + * long long reserved1[29]; + * struct cudaKernelNodeParamsV2 kernel; + * struct cudaMemcpyNodeParams memcpy; + * struct cudaMemsetParamsV2 memset; + * struct cudaHostNodeParamsV2 host; + * struct cudaChildGraphNodeParams graph; + * struct cudaEventWaitNodeParams eventWait; + * struct cudaEventRecordNodeParams eventRecord; + * struct cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal; + * struct cudaExternalSemaphoreWaitNodeParamsV2 extSemWait; + * struct cudaMemAllocNodeParamsV2 alloc; + * struct cudaMemFreeNodeParams free; + * struct cudaConditionalNodeParams conditional; + * }; + * long long reserved2; + * } + * } + */ +public class cudaGraphNodeParams { + + cudaGraphNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("type"), + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("reserved0"), + MemoryLayout.unionLayout( + MemoryLayout.sequenceLayout(29, PanamaFFMAPI.C_LONG_LONG).withName("reserved1"), + cudaKernelNodeParamsV2.layout().withName("kernel"), + cudaMemcpyNodeParams.layout().withName("memcpy"), + cudaMemsetParamsV2.layout().withName("memset"), + cudaHostNodeParamsV2.layout().withName("host"), + cudaChildGraphNodeParams.layout().withName("graph"), + cudaEventWaitNodeParams.layout().withName("eventWait"), + cudaEventRecordNodeParams.layout().withName("eventRecord"), + cudaExternalSemaphoreSignalNodeParamsV2.layout().withName("extSemSignal"), + cudaExternalSemaphoreWaitNodeParamsV2.layout().withName("extSemWait"), + cudaMemAllocNodeParamsV2.layout().withName("alloc"), + cudaMemFreeNodeParams.layout().withName("free"), + cudaConditionalNodeParams.layout().withName("conditional") + ).withName("$anon$3139:5"), + PanamaFFMAPI.C_LONG_LONG.withName("reserved2") + ).withName("cudaGraphNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaGraphNodeType type + * } + */ + public static final OfInt type$layout() { + return type$LAYOUT; + } + + private static final long type$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaGraphNodeType type + * } + */ + public static final long type$offset() { + return type$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaGraphNodeType type + * } + */ + public static int type(MemorySegment struct) { + return struct.get(type$LAYOUT, type$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaGraphNodeType type + * } + */ + public static void type(MemorySegment struct, int fieldValue) { + struct.set(type$LAYOUT, type$OFFSET, fieldValue); + } + + private static final SequenceLayout reserved0$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved0")); + + /** + * Layout for field: + * {@snippet lang=c : + * int reserved0[3] + * } + */ + public static final SequenceLayout reserved0$layout() { + return reserved0$LAYOUT; + } + + private static final long reserved0$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int reserved0[3] + * } + */ + public static final long reserved0$offset() { + return reserved0$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int reserved0[3] + * } + */ + public static MemorySegment reserved0(MemorySegment struct) { + return struct.asSlice(reserved0$OFFSET, reserved0$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int reserved0[3] + * } + */ + public static void reserved0(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved0$OFFSET, reserved0$LAYOUT.byteSize()); + } + + private static long[] reserved0$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int reserved0[3] + * } + */ + public static long[] reserved0$dimensions() { + return reserved0$DIMS; + } + private static final VarHandle reserved0$ELEM_HANDLE = reserved0$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int reserved0[3] + * } + */ + public static int reserved0(MemorySegment struct, long index0) { + return (int)reserved0$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int reserved0[3] + * } + */ + public static void reserved0(MemorySegment struct, long index0, int fieldValue) { + reserved0$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final SequenceLayout reserved1$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("reserved1")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long reserved1[29] + * } + */ + public static final SequenceLayout reserved1$layout() { + return reserved1$LAYOUT; + } + + private static final long reserved1$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * long long reserved1[29] + * } + */ + public static final long reserved1$offset() { + return reserved1$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long reserved1[29] + * } + */ + public static MemorySegment reserved1(MemorySegment struct) { + return struct.asSlice(reserved1$OFFSET, reserved1$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long reserved1[29] + * } + */ + public static void reserved1(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved1$OFFSET, reserved1$LAYOUT.byteSize()); + } + + private static long[] reserved1$DIMS = { 29 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * long long reserved1[29] + * } + */ + public static long[] reserved1$dimensions() { + return reserved1$DIMS; + } + private static final VarHandle reserved1$ELEM_HANDLE = reserved1$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * long long reserved1[29] + * } + */ + public static long reserved1(MemorySegment struct, long index0) { + return (long)reserved1$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * long long reserved1[29] + * } + */ + public static void reserved1(MemorySegment struct, long index0, long fieldValue) { + reserved1$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final GroupLayout kernel$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("kernel")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaKernelNodeParamsV2 kernel + * } + */ + public static final GroupLayout kernel$layout() { + return kernel$LAYOUT; + } + + private static final long kernel$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaKernelNodeParamsV2 kernel + * } + */ + public static final long kernel$offset() { + return kernel$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaKernelNodeParamsV2 kernel + * } + */ + public static MemorySegment kernel(MemorySegment struct) { + return struct.asSlice(kernel$OFFSET, kernel$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaKernelNodeParamsV2 kernel + * } + */ + public static void kernel(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, kernel$OFFSET, kernel$LAYOUT.byteSize()); + } + + private static final GroupLayout memcpy$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("memcpy")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaMemcpyNodeParams memcpy + * } + */ + public static final GroupLayout memcpy$layout() { + return memcpy$LAYOUT; + } + + private static final long memcpy$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaMemcpyNodeParams memcpy + * } + */ + public static final long memcpy$offset() { + return memcpy$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaMemcpyNodeParams memcpy + * } + */ + public static MemorySegment memcpy(MemorySegment struct) { + return struct.asSlice(memcpy$OFFSET, memcpy$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaMemcpyNodeParams memcpy + * } + */ + public static void memcpy(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, memcpy$OFFSET, memcpy$LAYOUT.byteSize()); + } + + private static final GroupLayout memset$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("memset")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaMemsetParamsV2 memset + * } + */ + public static final GroupLayout memset$layout() { + return memset$LAYOUT; + } + + private static final long memset$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaMemsetParamsV2 memset + * } + */ + public static final long memset$offset() { + return memset$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaMemsetParamsV2 memset + * } + */ + public static MemorySegment memset(MemorySegment struct) { + return struct.asSlice(memset$OFFSET, memset$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaMemsetParamsV2 memset + * } + */ + public static void memset(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, memset$OFFSET, memset$LAYOUT.byteSize()); + } + + private static final GroupLayout host$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("host")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaHostNodeParamsV2 host + * } + */ + public static final GroupLayout host$layout() { + return host$LAYOUT; + } + + private static final long host$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaHostNodeParamsV2 host + * } + */ + public static final long host$offset() { + return host$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaHostNodeParamsV2 host + * } + */ + public static MemorySegment host(MemorySegment struct) { + return struct.asSlice(host$OFFSET, host$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaHostNodeParamsV2 host + * } + */ + public static void host(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, host$OFFSET, host$LAYOUT.byteSize()); + } + + private static final GroupLayout graph$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("graph")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaChildGraphNodeParams graph + * } + */ + public static final GroupLayout graph$layout() { + return graph$LAYOUT; + } + + private static final long graph$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaChildGraphNodeParams graph + * } + */ + public static final long graph$offset() { + return graph$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaChildGraphNodeParams graph + * } + */ + public static MemorySegment graph(MemorySegment struct) { + return struct.asSlice(graph$OFFSET, graph$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaChildGraphNodeParams graph + * } + */ + public static void graph(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, graph$OFFSET, graph$LAYOUT.byteSize()); + } + + private static final GroupLayout eventWait$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("eventWait")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaEventWaitNodeParams eventWait + * } + */ + public static final GroupLayout eventWait$layout() { + return eventWait$LAYOUT; + } + + private static final long eventWait$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaEventWaitNodeParams eventWait + * } + */ + public static final long eventWait$offset() { + return eventWait$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaEventWaitNodeParams eventWait + * } + */ + public static MemorySegment eventWait(MemorySegment struct) { + return struct.asSlice(eventWait$OFFSET, eventWait$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaEventWaitNodeParams eventWait + * } + */ + public static void eventWait(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, eventWait$OFFSET, eventWait$LAYOUT.byteSize()); + } + + private static final GroupLayout eventRecord$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("eventRecord")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaEventRecordNodeParams eventRecord + * } + */ + public static final GroupLayout eventRecord$layout() { + return eventRecord$LAYOUT; + } + + private static final long eventRecord$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaEventRecordNodeParams eventRecord + * } + */ + public static final long eventRecord$offset() { + return eventRecord$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaEventRecordNodeParams eventRecord + * } + */ + public static MemorySegment eventRecord(MemorySegment struct) { + return struct.asSlice(eventRecord$OFFSET, eventRecord$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaEventRecordNodeParams eventRecord + * } + */ + public static void eventRecord(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, eventRecord$OFFSET, eventRecord$LAYOUT.byteSize()); + } + + private static final GroupLayout extSemSignal$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("extSemSignal")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal + * } + */ + public static final GroupLayout extSemSignal$layout() { + return extSemSignal$LAYOUT; + } + + private static final long extSemSignal$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal + * } + */ + public static final long extSemSignal$offset() { + return extSemSignal$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal + * } + */ + public static MemorySegment extSemSignal(MemorySegment struct) { + return struct.asSlice(extSemSignal$OFFSET, extSemSignal$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal + * } + */ + public static void extSemSignal(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, extSemSignal$OFFSET, extSemSignal$LAYOUT.byteSize()); + } + + private static final GroupLayout extSemWait$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("extSemWait")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaExternalSemaphoreWaitNodeParamsV2 extSemWait + * } + */ + public static final GroupLayout extSemWait$layout() { + return extSemWait$LAYOUT; + } + + private static final long extSemWait$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaExternalSemaphoreWaitNodeParamsV2 extSemWait + * } + */ + public static final long extSemWait$offset() { + return extSemWait$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaExternalSemaphoreWaitNodeParamsV2 extSemWait + * } + */ + public static MemorySegment extSemWait(MemorySegment struct) { + return struct.asSlice(extSemWait$OFFSET, extSemWait$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaExternalSemaphoreWaitNodeParamsV2 extSemWait + * } + */ + public static void extSemWait(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, extSemWait$OFFSET, extSemWait$LAYOUT.byteSize()); + } + + private static final GroupLayout alloc$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("alloc")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaMemAllocNodeParamsV2 alloc + * } + */ + public static final GroupLayout alloc$layout() { + return alloc$LAYOUT; + } + + private static final long alloc$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaMemAllocNodeParamsV2 alloc + * } + */ + public static final long alloc$offset() { + return alloc$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaMemAllocNodeParamsV2 alloc + * } + */ + public static MemorySegment alloc(MemorySegment struct) { + return struct.asSlice(alloc$OFFSET, alloc$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaMemAllocNodeParamsV2 alloc + * } + */ + public static void alloc(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, alloc$OFFSET, alloc$LAYOUT.byteSize()); + } + + private static final GroupLayout free$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("free")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaMemFreeNodeParams free + * } + */ + public static final GroupLayout free$layout() { + return free$LAYOUT; + } + + private static final long free$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaMemFreeNodeParams free + * } + */ + public static final long free$offset() { + return free$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaMemFreeNodeParams free + * } + */ + public static MemorySegment free(MemorySegment struct) { + return struct.asSlice(free$OFFSET, free$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaMemFreeNodeParams free + * } + */ + public static void free(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, free$OFFSET, free$LAYOUT.byteSize()); + } + + private static final GroupLayout conditional$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("conditional")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaConditionalNodeParams conditional + * } + */ + public static final GroupLayout conditional$layout() { + return conditional$LAYOUT; + } + + private static final long conditional$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaConditionalNodeParams conditional + * } + */ + public static final long conditional$offset() { + return conditional$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaConditionalNodeParams conditional + * } + */ + public static MemorySegment conditional(MemorySegment struct) { + return struct.asSlice(conditional$OFFSET, conditional$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaConditionalNodeParams conditional + * } + */ + public static void conditional(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, conditional$OFFSET, conditional$LAYOUT.byteSize()); + } + + private static final OfLong reserved2$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reserved2")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long reserved2 + * } + */ + public static final OfLong reserved2$layout() { + return reserved2$LAYOUT; + } + + private static final long reserved2$OFFSET = 248; + + /** + * Offset for field: + * {@snippet lang=c : + * long long reserved2 + * } + */ + public static final long reserved2$offset() { + return reserved2$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long reserved2 + * } + */ + public static long reserved2(MemorySegment struct) { + return struct.get(reserved2$LAYOUT, reserved2$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long reserved2 + * } + */ + public static void reserved2(MemorySegment struct, long fieldValue) { + struct.set(reserved2$LAYOUT, reserved2$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostFn_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostFn_t.java new file mode 100644 index 0000000000..1a8416b6fd --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostFn_t.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef void (*cudaHostFn_t)(void *) + * } + */ +public class cudaHostFn_t { + + cudaHostFn_t() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + void apply(MemorySegment userData); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( + PanamaFFMAPI.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = PanamaFFMAPI.upcallHandle(cudaHostFn_t.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(cudaHostFn_t.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static void invoke(MemorySegment funcPtr,MemorySegment userData) { + try { + DOWN$MH.invokeExact(funcPtr, userData); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParams.java new file mode 100644 index 0000000000..f0d2174c97 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParams.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaHostNodeParams { + * cudaHostFn_t fn; + * void *userData; + * } + * } + */ +public class cudaHostNodeParams { + + cudaHostNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("fn"), + PanamaFFMAPI.C_POINTER.withName("userData") + ).withName("cudaHostNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout fn$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fn")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaHostFn_t fn + * } + */ + public static final AddressLayout fn$layout() { + return fn$LAYOUT; + } + + private static final long fn$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaHostFn_t fn + * } + */ + public static final long fn$offset() { + return fn$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaHostFn_t fn + * } + */ + public static MemorySegment fn(MemorySegment struct) { + return struct.get(fn$LAYOUT, fn$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaHostFn_t fn + * } + */ + public static void fn(MemorySegment struct, MemorySegment fieldValue) { + struct.set(fn$LAYOUT, fn$OFFSET, fieldValue); + } + + private static final AddressLayout userData$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("userData")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *userData + * } + */ + public static final AddressLayout userData$layout() { + return userData$LAYOUT; + } + + private static final long userData$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * void *userData + * } + */ + public static final long userData$offset() { + return userData$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *userData + * } + */ + public static MemorySegment userData(MemorySegment struct) { + return struct.get(userData$LAYOUT, userData$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *userData + * } + */ + public static void userData(MemorySegment struct, MemorySegment fieldValue) { + struct.set(userData$LAYOUT, userData$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParamsV2.java new file mode 100644 index 0000000000..a16fcc58ce --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParamsV2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaHostNodeParamsV2 { + * cudaHostFn_t fn; + * void *userData; + * } + * } + */ +public class cudaHostNodeParamsV2 { + + cudaHostNodeParamsV2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("fn"), + PanamaFFMAPI.C_POINTER.withName("userData") + ).withName("cudaHostNodeParamsV2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout fn$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fn")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaHostFn_t fn + * } + */ + public static final AddressLayout fn$layout() { + return fn$LAYOUT; + } + + private static final long fn$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaHostFn_t fn + * } + */ + public static final long fn$offset() { + return fn$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaHostFn_t fn + * } + */ + public static MemorySegment fn(MemorySegment struct) { + return struct.get(fn$LAYOUT, fn$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaHostFn_t fn + * } + */ + public static void fn(MemorySegment struct, MemorySegment fieldValue) { + struct.set(fn$LAYOUT, fn$OFFSET, fieldValue); + } + + private static final AddressLayout userData$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("userData")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *userData + * } + */ + public static final AddressLayout userData$layout() { + return userData$LAYOUT; + } + + private static final long userData$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * void *userData + * } + */ + public static final long userData$offset() { + return userData$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *userData + * } + */ + public static MemorySegment userData(MemorySegment struct) { + return struct.get(userData$LAYOUT, userData$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *userData + * } + */ + public static void userData(MemorySegment struct, MemorySegment fieldValue) { + struct.set(userData$LAYOUT, userData$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_st.java new file mode 100644 index 0000000000..c75c390917 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_st.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaIpcEventHandle_st { + * char reserved[64]; + * } + * } + */ +public class cudaIpcEventHandle_st { + + cudaIpcEventHandle_st() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(64, PanamaFFMAPI.C_CHAR).withName("reserved") + ).withName("cudaIpcEventHandle_st"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 64 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static byte reserved(MemorySegment struct, long index0) { + return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static void reserved(MemorySegment struct, long index0, byte fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_t.java new file mode 100644 index 0000000000..d27abeec3a --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_t.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct cudaIpcEventHandle_st { + * char reserved[64]; + * } cudaIpcEventHandle_t + * } + */ +public class cudaIpcEventHandle_t extends cudaIpcEventHandle_st { + + cudaIpcEventHandle_t() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_st.java new file mode 100644 index 0000000000..7339328fe6 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_st.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaIpcMemHandle_st { + * char reserved[64]; + * } + * } + */ +public class cudaIpcMemHandle_st { + + cudaIpcMemHandle_st() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(64, PanamaFFMAPI.C_CHAR).withName("reserved") + ).withName("cudaIpcMemHandle_st"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 64 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static byte reserved(MemorySegment struct, long index0) { + return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static void reserved(MemorySegment struct, long index0, byte fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_t.java new file mode 100644 index 0000000000..8109af2f59 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_t.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct cudaIpcMemHandle_st { + * char reserved[64]; + * } cudaIpcMemHandle_t + * } + */ +public class cudaIpcMemHandle_t extends cudaIpcMemHandle_st { + + cudaIpcMemHandle_t() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParams.java new file mode 100644 index 0000000000..21de29e43c --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParams.java @@ -0,0 +1,374 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaKernelNodeParams { + * void *func; + * dim3 gridDim; + * dim3 blockDim; + * unsigned int sharedMemBytes; + * void **kernelParams; + * void **extra; + * } + * } + */ +public class cudaKernelNodeParams { + + cudaKernelNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("func"), + dim3.layout().withName("gridDim"), + dim3.layout().withName("blockDim"), + PanamaFFMAPI.C_INT.withName("sharedMemBytes"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_POINTER.withName("kernelParams"), + PanamaFFMAPI.C_POINTER.withName("extra") + ).withName("cudaKernelNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout func$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("func")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *func + * } + */ + public static final AddressLayout func$layout() { + return func$LAYOUT; + } + + private static final long func$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *func + * } + */ + public static final long func$offset() { + return func$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *func + * } + */ + public static MemorySegment func(MemorySegment struct) { + return struct.get(func$LAYOUT, func$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *func + * } + */ + public static void func(MemorySegment struct, MemorySegment fieldValue) { + struct.set(func$LAYOUT, func$OFFSET, fieldValue); + } + + private static final GroupLayout gridDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("gridDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static final GroupLayout gridDim$layout() { + return gridDim$LAYOUT; + } + + private static final long gridDim$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static final long gridDim$offset() { + return gridDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static MemorySegment gridDim(MemorySegment struct) { + return struct.asSlice(gridDim$OFFSET, gridDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static void gridDim(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, gridDim$OFFSET, gridDim$LAYOUT.byteSize()); + } + + private static final GroupLayout blockDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("blockDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static final GroupLayout blockDim$layout() { + return blockDim$LAYOUT; + } + + private static final long blockDim$OFFSET = 20; + + /** + * Offset for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static final long blockDim$offset() { + return blockDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static MemorySegment blockDim(MemorySegment struct) { + return struct.asSlice(blockDim$OFFSET, blockDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static void blockDim(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, blockDim$OFFSET, blockDim$LAYOUT.byteSize()); + } + + private static final OfInt sharedMemBytes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("sharedMemBytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int sharedMemBytes + * } + */ + public static final OfInt sharedMemBytes$layout() { + return sharedMemBytes$LAYOUT; + } + + private static final long sharedMemBytes$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int sharedMemBytes + * } + */ + public static final long sharedMemBytes$offset() { + return sharedMemBytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int sharedMemBytes + * } + */ + public static int sharedMemBytes(MemorySegment struct) { + return struct.get(sharedMemBytes$LAYOUT, sharedMemBytes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int sharedMemBytes + * } + */ + public static void sharedMemBytes(MemorySegment struct, int fieldValue) { + struct.set(sharedMemBytes$LAYOUT, sharedMemBytes$OFFSET, fieldValue); + } + + private static final AddressLayout kernelParams$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("kernelParams")); + + /** + * Layout for field: + * {@snippet lang=c : + * void **kernelParams + * } + */ + public static final AddressLayout kernelParams$layout() { + return kernelParams$LAYOUT; + } + + private static final long kernelParams$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * void **kernelParams + * } + */ + public static final long kernelParams$offset() { + return kernelParams$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void **kernelParams + * } + */ + public static MemorySegment kernelParams(MemorySegment struct) { + return struct.get(kernelParams$LAYOUT, kernelParams$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void **kernelParams + * } + */ + public static void kernelParams(MemorySegment struct, MemorySegment fieldValue) { + struct.set(kernelParams$LAYOUT, kernelParams$OFFSET, fieldValue); + } + + private static final AddressLayout extra$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extra")); + + /** + * Layout for field: + * {@snippet lang=c : + * void **extra + * } + */ + public static final AddressLayout extra$layout() { + return extra$LAYOUT; + } + + private static final long extra$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * void **extra + * } + */ + public static final long extra$offset() { + return extra$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void **extra + * } + */ + public static MemorySegment extra(MemorySegment struct) { + return struct.get(extra$LAYOUT, extra$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void **extra + * } + */ + public static void extra(MemorySegment struct, MemorySegment fieldValue) { + struct.set(extra$LAYOUT, extra$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParamsV2.java new file mode 100644 index 0000000000..a0b9d1597c --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParamsV2.java @@ -0,0 +1,374 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaKernelNodeParamsV2 { + * void *func; + * dim3 gridDim; + * dim3 blockDim; + * unsigned int sharedMemBytes; + * void **kernelParams; + * void **extra; + * } + * } + */ +public class cudaKernelNodeParamsV2 { + + cudaKernelNodeParamsV2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("func"), + dim3.layout().withName("gridDim"), + dim3.layout().withName("blockDim"), + PanamaFFMAPI.C_INT.withName("sharedMemBytes"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_POINTER.withName("kernelParams"), + PanamaFFMAPI.C_POINTER.withName("extra") + ).withName("cudaKernelNodeParamsV2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout func$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("func")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *func + * } + */ + public static final AddressLayout func$layout() { + return func$LAYOUT; + } + + private static final long func$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *func + * } + */ + public static final long func$offset() { + return func$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *func + * } + */ + public static MemorySegment func(MemorySegment struct) { + return struct.get(func$LAYOUT, func$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *func + * } + */ + public static void func(MemorySegment struct, MemorySegment fieldValue) { + struct.set(func$LAYOUT, func$OFFSET, fieldValue); + } + + private static final GroupLayout gridDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("gridDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static final GroupLayout gridDim$layout() { + return gridDim$LAYOUT; + } + + private static final long gridDim$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static final long gridDim$offset() { + return gridDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static MemorySegment gridDim(MemorySegment struct) { + return struct.asSlice(gridDim$OFFSET, gridDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static void gridDim(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, gridDim$OFFSET, gridDim$LAYOUT.byteSize()); + } + + private static final GroupLayout blockDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("blockDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static final GroupLayout blockDim$layout() { + return blockDim$LAYOUT; + } + + private static final long blockDim$OFFSET = 20; + + /** + * Offset for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static final long blockDim$offset() { + return blockDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static MemorySegment blockDim(MemorySegment struct) { + return struct.asSlice(blockDim$OFFSET, blockDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static void blockDim(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, blockDim$OFFSET, blockDim$LAYOUT.byteSize()); + } + + private static final OfInt sharedMemBytes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("sharedMemBytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int sharedMemBytes + * } + */ + public static final OfInt sharedMemBytes$layout() { + return sharedMemBytes$LAYOUT; + } + + private static final long sharedMemBytes$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int sharedMemBytes + * } + */ + public static final long sharedMemBytes$offset() { + return sharedMemBytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int sharedMemBytes + * } + */ + public static int sharedMemBytes(MemorySegment struct) { + return struct.get(sharedMemBytes$LAYOUT, sharedMemBytes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int sharedMemBytes + * } + */ + public static void sharedMemBytes(MemorySegment struct, int fieldValue) { + struct.set(sharedMemBytes$LAYOUT, sharedMemBytes$OFFSET, fieldValue); + } + + private static final AddressLayout kernelParams$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("kernelParams")); + + /** + * Layout for field: + * {@snippet lang=c : + * void **kernelParams + * } + */ + public static final AddressLayout kernelParams$layout() { + return kernelParams$LAYOUT; + } + + private static final long kernelParams$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * void **kernelParams + * } + */ + public static final long kernelParams$offset() { + return kernelParams$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void **kernelParams + * } + */ + public static MemorySegment kernelParams(MemorySegment struct) { + return struct.get(kernelParams$LAYOUT, kernelParams$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void **kernelParams + * } + */ + public static void kernelParams(MemorySegment struct, MemorySegment fieldValue) { + struct.set(kernelParams$LAYOUT, kernelParams$OFFSET, fieldValue); + } + + private static final AddressLayout extra$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extra")); + + /** + * Layout for field: + * {@snippet lang=c : + * void **extra + * } + */ + public static final AddressLayout extra$layout() { + return extra$LAYOUT; + } + + private static final long extra$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * void **extra + * } + */ + public static final long extra$offset() { + return extra$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void **extra + * } + */ + public static MemorySegment extra(MemorySegment struct) { + return struct.get(extra$LAYOUT, extra$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void **extra + * } + */ + public static void extra(MemorySegment struct, MemorySegment fieldValue) { + struct.set(extra$LAYOUT, extra$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute.java new file mode 100644 index 0000000000..bfd42f0ad2 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct cudaLaunchAttribute_st { + * cudaLaunchAttributeID id; + * char pad[4]; + * cudaLaunchAttributeValue val; + * } cudaLaunchAttribute + * } + */ +public class cudaLaunchAttribute extends cudaLaunchAttribute_st { + + cudaLaunchAttribute() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttributeValue.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttributeValue.java new file mode 100644 index 0000000000..026854026c --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttributeValue.java @@ -0,0 +1,1574 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * union cudaLaunchAttributeValue { + * char pad[64]; + * struct cudaAccessPolicyWindow accessPolicyWindow; + * int cooperative; + * enum cudaSynchronizationPolicy syncPolicy; + * struct { + * unsigned int x; + * unsigned int y; + * unsigned int z; + * } clusterDim; + * enum cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference; + * int programmaticStreamSerializationAllowed; + * struct { + * cudaEvent_t event; + * int flags; + * int triggerAtBlockStart; + * } programmaticEvent; + * int priority; + * cudaLaunchMemSyncDomainMap memSyncDomainMap; + * cudaLaunchMemSyncDomain memSyncDomain; + * struct { + * cudaEvent_t event; + * int flags; + * } launchCompletionEvent; + * struct { + * int deviceUpdatable; + * cudaGraphDeviceNode_t devNode; + * } deviceUpdatableKernelNode; + * unsigned int sharedMemCarveout; + * } + * } + */ +public class cudaLaunchAttributeValue { + + cudaLaunchAttributeValue() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + MemoryLayout.sequenceLayout(64, PanamaFFMAPI.C_CHAR).withName("pad"), + cudaAccessPolicyWindow.layout().withName("accessPolicyWindow"), + PanamaFFMAPI.C_INT.withName("cooperative"), + PanamaFFMAPI.C_INT.withName("syncPolicy"), + cudaLaunchAttributeValue.clusterDim.layout().withName("clusterDim"), + PanamaFFMAPI.C_INT.withName("clusterSchedulingPolicyPreference"), + PanamaFFMAPI.C_INT.withName("programmaticStreamSerializationAllowed"), + cudaLaunchAttributeValue.programmaticEvent.layout().withName("programmaticEvent"), + PanamaFFMAPI.C_INT.withName("priority"), + cudaLaunchMemSyncDomainMap_st.layout().withName("memSyncDomainMap"), + PanamaFFMAPI.C_INT.withName("memSyncDomain"), + cudaLaunchAttributeValue.launchCompletionEvent.layout().withName("launchCompletionEvent"), + cudaLaunchAttributeValue.deviceUpdatableKernelNode.layout().withName("deviceUpdatableKernelNode"), + PanamaFFMAPI.C_INT.withName("sharedMemCarveout") + ).withName("cudaLaunchAttributeValue"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout pad$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("pad")); + + /** + * Layout for field: + * {@snippet lang=c : + * char pad[64] + * } + */ + public static final SequenceLayout pad$layout() { + return pad$LAYOUT; + } + + private static final long pad$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char pad[64] + * } + */ + public static final long pad$offset() { + return pad$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char pad[64] + * } + */ + public static MemorySegment pad(MemorySegment union) { + return union.asSlice(pad$OFFSET, pad$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char pad[64] + * } + */ + public static void pad(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, pad$OFFSET, pad$LAYOUT.byteSize()); + } + + private static long[] pad$DIMS = { 64 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char pad[64] + * } + */ + public static long[] pad$dimensions() { + return pad$DIMS; + } + private static final VarHandle pad$ELEM_HANDLE = pad$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char pad[64] + * } + */ + public static byte pad(MemorySegment union, long index0) { + return (byte)pad$ELEM_HANDLE.get(union, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char pad[64] + * } + */ + public static void pad(MemorySegment union, long index0, byte fieldValue) { + pad$ELEM_HANDLE.set(union, 0L, index0, fieldValue); + } + + private static final GroupLayout accessPolicyWindow$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("accessPolicyWindow")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaAccessPolicyWindow accessPolicyWindow + * } + */ + public static final GroupLayout accessPolicyWindow$layout() { + return accessPolicyWindow$LAYOUT; + } + + private static final long accessPolicyWindow$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaAccessPolicyWindow accessPolicyWindow + * } + */ + public static final long accessPolicyWindow$offset() { + return accessPolicyWindow$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaAccessPolicyWindow accessPolicyWindow + * } + */ + public static MemorySegment accessPolicyWindow(MemorySegment union) { + return union.asSlice(accessPolicyWindow$OFFSET, accessPolicyWindow$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaAccessPolicyWindow accessPolicyWindow + * } + */ + public static void accessPolicyWindow(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, accessPolicyWindow$OFFSET, accessPolicyWindow$LAYOUT.byteSize()); + } + + private static final OfInt cooperative$LAYOUT = (OfInt)$LAYOUT.select(groupElement("cooperative")); + + /** + * Layout for field: + * {@snippet lang=c : + * int cooperative + * } + */ + public static final OfInt cooperative$layout() { + return cooperative$LAYOUT; + } + + private static final long cooperative$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int cooperative + * } + */ + public static final long cooperative$offset() { + return cooperative$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int cooperative + * } + */ + public static int cooperative(MemorySegment union) { + return union.get(cooperative$LAYOUT, cooperative$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int cooperative + * } + */ + public static void cooperative(MemorySegment union, int fieldValue) { + union.set(cooperative$LAYOUT, cooperative$OFFSET, fieldValue); + } + + private static final OfInt syncPolicy$LAYOUT = (OfInt)$LAYOUT.select(groupElement("syncPolicy")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaSynchronizationPolicy syncPolicy + * } + */ + public static final OfInt syncPolicy$layout() { + return syncPolicy$LAYOUT; + } + + private static final long syncPolicy$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaSynchronizationPolicy syncPolicy + * } + */ + public static final long syncPolicy$offset() { + return syncPolicy$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaSynchronizationPolicy syncPolicy + * } + */ + public static int syncPolicy(MemorySegment union) { + return union.get(syncPolicy$LAYOUT, syncPolicy$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaSynchronizationPolicy syncPolicy + * } + */ + public static void syncPolicy(MemorySegment union, int fieldValue) { + union.set(syncPolicy$LAYOUT, syncPolicy$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * struct { + * unsigned int x; + * unsigned int y; + * unsigned int z; + * } + * } + */ + public static class clusterDim { + + clusterDim() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x"), + PanamaFFMAPI.C_INT.withName("y"), + PanamaFFMAPI.C_INT.withName("z") + ).withName("$anon$3544:5"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static final OfInt y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static int y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static void y(MemorySegment struct, int fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static final OfInt z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static int z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static void z(MemorySegment struct, int fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout clusterDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("clusterDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * unsigned int x; + * unsigned int y; + * unsigned int z; + * } clusterDim + * } + */ + public static final GroupLayout clusterDim$layout() { + return clusterDim$LAYOUT; + } + + private static final long clusterDim$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * unsigned int x; + * unsigned int y; + * unsigned int z; + * } clusterDim + * } + */ + public static final long clusterDim$offset() { + return clusterDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * unsigned int x; + * unsigned int y; + * unsigned int z; + * } clusterDim + * } + */ + public static MemorySegment clusterDim(MemorySegment union) { + return union.asSlice(clusterDim$OFFSET, clusterDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * unsigned int x; + * unsigned int y; + * unsigned int z; + * } clusterDim + * } + */ + public static void clusterDim(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, clusterDim$OFFSET, clusterDim$LAYOUT.byteSize()); + } + + private static final OfInt clusterSchedulingPolicyPreference$LAYOUT = (OfInt)$LAYOUT.select(groupElement("clusterSchedulingPolicyPreference")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference + * } + */ + public static final OfInt clusterSchedulingPolicyPreference$layout() { + return clusterSchedulingPolicyPreference$LAYOUT; + } + + private static final long clusterSchedulingPolicyPreference$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference + * } + */ + public static final long clusterSchedulingPolicyPreference$offset() { + return clusterSchedulingPolicyPreference$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference + * } + */ + public static int clusterSchedulingPolicyPreference(MemorySegment union) { + return union.get(clusterSchedulingPolicyPreference$LAYOUT, clusterSchedulingPolicyPreference$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference + * } + */ + public static void clusterSchedulingPolicyPreference(MemorySegment union, int fieldValue) { + union.set(clusterSchedulingPolicyPreference$LAYOUT, clusterSchedulingPolicyPreference$OFFSET, fieldValue); + } + + private static final OfInt programmaticStreamSerializationAllowed$LAYOUT = (OfInt)$LAYOUT.select(groupElement("programmaticStreamSerializationAllowed")); + + /** + * Layout for field: + * {@snippet lang=c : + * int programmaticStreamSerializationAllowed + * } + */ + public static final OfInt programmaticStreamSerializationAllowed$layout() { + return programmaticStreamSerializationAllowed$LAYOUT; + } + + private static final long programmaticStreamSerializationAllowed$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int programmaticStreamSerializationAllowed + * } + */ + public static final long programmaticStreamSerializationAllowed$offset() { + return programmaticStreamSerializationAllowed$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int programmaticStreamSerializationAllowed + * } + */ + public static int programmaticStreamSerializationAllowed(MemorySegment union) { + return union.get(programmaticStreamSerializationAllowed$LAYOUT, programmaticStreamSerializationAllowed$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int programmaticStreamSerializationAllowed + * } + */ + public static void programmaticStreamSerializationAllowed(MemorySegment union, int fieldValue) { + union.set(programmaticStreamSerializationAllowed$LAYOUT, programmaticStreamSerializationAllowed$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * struct { + * cudaEvent_t event; + * int flags; + * int triggerAtBlockStart; + * } + * } + */ + public static class programmaticEvent { + + programmaticEvent() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("event"), + PanamaFFMAPI.C_INT.withName("flags"), + PanamaFFMAPI.C_INT.withName("triggerAtBlockStart") + ).withName("$anon$3563:5"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout event$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("event")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static final AddressLayout event$layout() { + return event$LAYOUT; + } + + private static final long event$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static final long event$offset() { + return event$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static MemorySegment event(MemorySegment struct) { + return struct.get(event$LAYOUT, event$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static void event(MemorySegment struct, MemorySegment fieldValue) { + struct.set(event$LAYOUT, event$OFFSET, fieldValue); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + private static final OfInt triggerAtBlockStart$LAYOUT = (OfInt)$LAYOUT.select(groupElement("triggerAtBlockStart")); + + /** + * Layout for field: + * {@snippet lang=c : + * int triggerAtBlockStart + * } + */ + public static final OfInt triggerAtBlockStart$layout() { + return triggerAtBlockStart$LAYOUT; + } + + private static final long triggerAtBlockStart$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * int triggerAtBlockStart + * } + */ + public static final long triggerAtBlockStart$offset() { + return triggerAtBlockStart$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int triggerAtBlockStart + * } + */ + public static int triggerAtBlockStart(MemorySegment struct) { + return struct.get(triggerAtBlockStart$LAYOUT, triggerAtBlockStart$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int triggerAtBlockStart + * } + */ + public static void triggerAtBlockStart(MemorySegment struct, int fieldValue) { + struct.set(triggerAtBlockStart$LAYOUT, triggerAtBlockStart$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout programmaticEvent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("programmaticEvent")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * cudaEvent_t event; + * int flags; + * int triggerAtBlockStart; + * } programmaticEvent + * } + */ + public static final GroupLayout programmaticEvent$layout() { + return programmaticEvent$LAYOUT; + } + + private static final long programmaticEvent$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * cudaEvent_t event; + * int flags; + * int triggerAtBlockStart; + * } programmaticEvent + * } + */ + public static final long programmaticEvent$offset() { + return programmaticEvent$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * cudaEvent_t event; + * int flags; + * int triggerAtBlockStart; + * } programmaticEvent + * } + */ + public static MemorySegment programmaticEvent(MemorySegment union) { + return union.asSlice(programmaticEvent$OFFSET, programmaticEvent$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * cudaEvent_t event; + * int flags; + * int triggerAtBlockStart; + * } programmaticEvent + * } + */ + public static void programmaticEvent(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, programmaticEvent$OFFSET, programmaticEvent$LAYOUT.byteSize()); + } + + private static final OfInt priority$LAYOUT = (OfInt)$LAYOUT.select(groupElement("priority")); + + /** + * Layout for field: + * {@snippet lang=c : + * int priority + * } + */ + public static final OfInt priority$layout() { + return priority$LAYOUT; + } + + private static final long priority$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int priority + * } + */ + public static final long priority$offset() { + return priority$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int priority + * } + */ + public static int priority(MemorySegment union) { + return union.get(priority$LAYOUT, priority$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int priority + * } + */ + public static void priority(MemorySegment union, int fieldValue) { + union.set(priority$LAYOUT, priority$OFFSET, fieldValue); + } + + private static final GroupLayout memSyncDomainMap$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("memSyncDomainMap")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaLaunchMemSyncDomainMap memSyncDomainMap + * } + */ + public static final GroupLayout memSyncDomainMap$layout() { + return memSyncDomainMap$LAYOUT; + } + + private static final long memSyncDomainMap$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaLaunchMemSyncDomainMap memSyncDomainMap + * } + */ + public static final long memSyncDomainMap$offset() { + return memSyncDomainMap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaLaunchMemSyncDomainMap memSyncDomainMap + * } + */ + public static MemorySegment memSyncDomainMap(MemorySegment union) { + return union.asSlice(memSyncDomainMap$OFFSET, memSyncDomainMap$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaLaunchMemSyncDomainMap memSyncDomainMap + * } + */ + public static void memSyncDomainMap(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, memSyncDomainMap$OFFSET, memSyncDomainMap$LAYOUT.byteSize()); + } + + private static final OfInt memSyncDomain$LAYOUT = (OfInt)$LAYOUT.select(groupElement("memSyncDomain")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaLaunchMemSyncDomain memSyncDomain + * } + */ + public static final OfInt memSyncDomain$layout() { + return memSyncDomain$LAYOUT; + } + + private static final long memSyncDomain$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaLaunchMemSyncDomain memSyncDomain + * } + */ + public static final long memSyncDomain$offset() { + return memSyncDomain$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaLaunchMemSyncDomain memSyncDomain + * } + */ + public static int memSyncDomain(MemorySegment union) { + return union.get(memSyncDomain$LAYOUT, memSyncDomain$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaLaunchMemSyncDomain memSyncDomain + * } + */ + public static void memSyncDomain(MemorySegment union, int fieldValue) { + union.set(memSyncDomain$LAYOUT, memSyncDomain$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * struct { + * cudaEvent_t event; + * int flags; + * } + * } + */ + public static class launchCompletionEvent { + + launchCompletionEvent() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("event"), + PanamaFFMAPI.C_INT.withName("flags"), + MemoryLayout.paddingLayout(4) + ).withName("$anon$3581:5"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout event$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("event")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static final AddressLayout event$layout() { + return event$LAYOUT; + } + + private static final long event$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static final long event$offset() { + return event$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static MemorySegment event(MemorySegment struct) { + return struct.get(event$LAYOUT, event$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaEvent_t event + * } + */ + public static void event(MemorySegment struct, MemorySegment fieldValue) { + struct.set(event$LAYOUT, event$OFFSET, fieldValue); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout launchCompletionEvent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("launchCompletionEvent")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * cudaEvent_t event; + * int flags; + * } launchCompletionEvent + * } + */ + public static final GroupLayout launchCompletionEvent$layout() { + return launchCompletionEvent$LAYOUT; + } + + private static final long launchCompletionEvent$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * cudaEvent_t event; + * int flags; + * } launchCompletionEvent + * } + */ + public static final long launchCompletionEvent$offset() { + return launchCompletionEvent$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * cudaEvent_t event; + * int flags; + * } launchCompletionEvent + * } + */ + public static MemorySegment launchCompletionEvent(MemorySegment union) { + return union.asSlice(launchCompletionEvent$OFFSET, launchCompletionEvent$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * cudaEvent_t event; + * int flags; + * } launchCompletionEvent + * } + */ + public static void launchCompletionEvent(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, launchCompletionEvent$OFFSET, launchCompletionEvent$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * struct { + * int deviceUpdatable; + * cudaGraphDeviceNode_t devNode; + * } + * } + */ + public static class deviceUpdatableKernelNode { + + deviceUpdatableKernelNode() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("deviceUpdatable"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_POINTER.withName("devNode") + ).withName("$anon$3592:5"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt deviceUpdatable$LAYOUT = (OfInt)$LAYOUT.select(groupElement("deviceUpdatable")); + + /** + * Layout for field: + * {@snippet lang=c : + * int deviceUpdatable + * } + */ + public static final OfInt deviceUpdatable$layout() { + return deviceUpdatable$LAYOUT; + } + + private static final long deviceUpdatable$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int deviceUpdatable + * } + */ + public static final long deviceUpdatable$offset() { + return deviceUpdatable$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int deviceUpdatable + * } + */ + public static int deviceUpdatable(MemorySegment struct) { + return struct.get(deviceUpdatable$LAYOUT, deviceUpdatable$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int deviceUpdatable + * } + */ + public static void deviceUpdatable(MemorySegment struct, int fieldValue) { + struct.set(deviceUpdatable$LAYOUT, deviceUpdatable$OFFSET, fieldValue); + } + + private static final AddressLayout devNode$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("devNode")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaGraphDeviceNode_t devNode + * } + */ + public static final AddressLayout devNode$layout() { + return devNode$LAYOUT; + } + + private static final long devNode$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaGraphDeviceNode_t devNode + * } + */ + public static final long devNode$offset() { + return devNode$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaGraphDeviceNode_t devNode + * } + */ + public static MemorySegment devNode(MemorySegment struct) { + return struct.get(devNode$LAYOUT, devNode$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaGraphDeviceNode_t devNode + * } + */ + public static void devNode(MemorySegment struct, MemorySegment fieldValue) { + struct.set(devNode$LAYOUT, devNode$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout deviceUpdatableKernelNode$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("deviceUpdatableKernelNode")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * int deviceUpdatable; + * cudaGraphDeviceNode_t devNode; + * } deviceUpdatableKernelNode + * } + */ + public static final GroupLayout deviceUpdatableKernelNode$layout() { + return deviceUpdatableKernelNode$LAYOUT; + } + + private static final long deviceUpdatableKernelNode$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * int deviceUpdatable; + * cudaGraphDeviceNode_t devNode; + * } deviceUpdatableKernelNode + * } + */ + public static final long deviceUpdatableKernelNode$offset() { + return deviceUpdatableKernelNode$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * int deviceUpdatable; + * cudaGraphDeviceNode_t devNode; + * } deviceUpdatableKernelNode + * } + */ + public static MemorySegment deviceUpdatableKernelNode(MemorySegment union) { + return union.asSlice(deviceUpdatableKernelNode$OFFSET, deviceUpdatableKernelNode$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * int deviceUpdatable; + * cudaGraphDeviceNode_t devNode; + * } deviceUpdatableKernelNode + * } + */ + public static void deviceUpdatableKernelNode(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, deviceUpdatableKernelNode$OFFSET, deviceUpdatableKernelNode$LAYOUT.byteSize()); + } + + private static final OfInt sharedMemCarveout$LAYOUT = (OfInt)$LAYOUT.select(groupElement("sharedMemCarveout")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int sharedMemCarveout + * } + */ + public static final OfInt sharedMemCarveout$layout() { + return sharedMemCarveout$LAYOUT; + } + + private static final long sharedMemCarveout$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int sharedMemCarveout + * } + */ + public static final long sharedMemCarveout$offset() { + return sharedMemCarveout$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int sharedMemCarveout + * } + */ + public static int sharedMemCarveout(MemorySegment union) { + return union.get(sharedMemCarveout$LAYOUT, sharedMemCarveout$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int sharedMemCarveout + * } + */ + public static void sharedMemCarveout(MemorySegment union, int fieldValue) { + union.set(sharedMemCarveout$LAYOUT, sharedMemCarveout$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute_st.java new file mode 100644 index 0000000000..fb3ad22fe3 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute_st.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaLaunchAttribute_st { + * cudaLaunchAttributeID id; + * char pad[4]; + * cudaLaunchAttributeValue val; + * } + * } + */ +public class cudaLaunchAttribute_st { + + cudaLaunchAttribute_st() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("id"), + MemoryLayout.sequenceLayout(4, PanamaFFMAPI.C_CHAR).withName("pad"), + cudaLaunchAttributeValue.layout().withName("val") + ).withName("cudaLaunchAttribute_st"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("id")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaLaunchAttributeID id + * } + */ + public static final OfInt id$layout() { + return id$LAYOUT; + } + + private static final long id$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaLaunchAttributeID id + * } + */ + public static final long id$offset() { + return id$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaLaunchAttributeID id + * } + */ + public static int id(MemorySegment struct) { + return struct.get(id$LAYOUT, id$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaLaunchAttributeID id + * } + */ + public static void id(MemorySegment struct, int fieldValue) { + struct.set(id$LAYOUT, id$OFFSET, fieldValue); + } + + private static final SequenceLayout pad$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("pad")); + + /** + * Layout for field: + * {@snippet lang=c : + * char pad[4] + * } + */ + public static final SequenceLayout pad$layout() { + return pad$LAYOUT; + } + + private static final long pad$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * char pad[4] + * } + */ + public static final long pad$offset() { + return pad$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char pad[4] + * } + */ + public static MemorySegment pad(MemorySegment struct) { + return struct.asSlice(pad$OFFSET, pad$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char pad[4] + * } + */ + public static void pad(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, pad$OFFSET, pad$LAYOUT.byteSize()); + } + + private static long[] pad$DIMS = { 4 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char pad[4] + * } + */ + public static long[] pad$dimensions() { + return pad$DIMS; + } + private static final VarHandle pad$ELEM_HANDLE = pad$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char pad[4] + * } + */ + public static byte pad(MemorySegment struct, long index0) { + return (byte)pad$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char pad[4] + * } + */ + public static void pad(MemorySegment struct, long index0, byte fieldValue) { + pad$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final GroupLayout val$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("val")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaLaunchAttributeValue val + * } + */ + public static final GroupLayout val$layout() { + return val$LAYOUT; + } + + private static final long val$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaLaunchAttributeValue val + * } + */ + public static final long val$offset() { + return val$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaLaunchAttributeValue val + * } + */ + public static MemorySegment val(MemorySegment struct) { + return struct.asSlice(val$OFFSET, val$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaLaunchAttributeValue val + * } + */ + public static void val(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, val$OFFSET, val$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_st.java new file mode 100644 index 0000000000..f8654a34f3 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_st.java @@ -0,0 +1,374 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaLaunchConfig_st { + * dim3 gridDim; + * dim3 blockDim; + * size_t dynamicSmemBytes; + * cudaStream_t stream; + * cudaLaunchAttribute *attrs; + * unsigned int numAttrs; + * } + * } + */ +public class cudaLaunchConfig_st { + + cudaLaunchConfig_st() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + dim3.layout().withName("gridDim"), + dim3.layout().withName("blockDim"), + PanamaFFMAPI.C_LONG.withName("dynamicSmemBytes"), + PanamaFFMAPI.C_POINTER.withName("stream"), + PanamaFFMAPI.C_POINTER.withName("attrs"), + PanamaFFMAPI.C_INT.withName("numAttrs"), + MemoryLayout.paddingLayout(4) + ).withName("cudaLaunchConfig_st"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout gridDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("gridDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static final GroupLayout gridDim$layout() { + return gridDim$LAYOUT; + } + + private static final long gridDim$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static final long gridDim$offset() { + return gridDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static MemorySegment gridDim(MemorySegment struct) { + return struct.asSlice(gridDim$OFFSET, gridDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static void gridDim(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, gridDim$OFFSET, gridDim$LAYOUT.byteSize()); + } + + private static final GroupLayout blockDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("blockDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static final GroupLayout blockDim$layout() { + return blockDim$LAYOUT; + } + + private static final long blockDim$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static final long blockDim$offset() { + return blockDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static MemorySegment blockDim(MemorySegment struct) { + return struct.asSlice(blockDim$OFFSET, blockDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static void blockDim(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, blockDim$OFFSET, blockDim$LAYOUT.byteSize()); + } + + private static final OfLong dynamicSmemBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("dynamicSmemBytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t dynamicSmemBytes + * } + */ + public static final OfLong dynamicSmemBytes$layout() { + return dynamicSmemBytes$LAYOUT; + } + + private static final long dynamicSmemBytes$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t dynamicSmemBytes + * } + */ + public static final long dynamicSmemBytes$offset() { + return dynamicSmemBytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t dynamicSmemBytes + * } + */ + public static long dynamicSmemBytes(MemorySegment struct) { + return struct.get(dynamicSmemBytes$LAYOUT, dynamicSmemBytes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t dynamicSmemBytes + * } + */ + public static void dynamicSmemBytes(MemorySegment struct, long fieldValue) { + struct.set(dynamicSmemBytes$LAYOUT, dynamicSmemBytes$OFFSET, fieldValue); + } + + private static final AddressLayout stream$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("stream")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaStream_t stream + * } + */ + public static final AddressLayout stream$layout() { + return stream$LAYOUT; + } + + private static final long stream$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaStream_t stream + * } + */ + public static final long stream$offset() { + return stream$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaStream_t stream + * } + */ + public static MemorySegment stream(MemorySegment struct) { + return struct.get(stream$LAYOUT, stream$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaStream_t stream + * } + */ + public static void stream(MemorySegment struct, MemorySegment fieldValue) { + struct.set(stream$LAYOUT, stream$OFFSET, fieldValue); + } + + private static final AddressLayout attrs$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("attrs")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaLaunchAttribute *attrs + * } + */ + public static final AddressLayout attrs$layout() { + return attrs$LAYOUT; + } + + private static final long attrs$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaLaunchAttribute *attrs + * } + */ + public static final long attrs$offset() { + return attrs$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaLaunchAttribute *attrs + * } + */ + public static MemorySegment attrs(MemorySegment struct) { + return struct.get(attrs$LAYOUT, attrs$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaLaunchAttribute *attrs + * } + */ + public static void attrs(MemorySegment struct, MemorySegment fieldValue) { + struct.set(attrs$LAYOUT, attrs$OFFSET, fieldValue); + } + + private static final OfInt numAttrs$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numAttrs")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int numAttrs + * } + */ + public static final OfInt numAttrs$layout() { + return numAttrs$LAYOUT; + } + + private static final long numAttrs$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int numAttrs + * } + */ + public static final long numAttrs$offset() { + return numAttrs$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int numAttrs + * } + */ + public static int numAttrs(MemorySegment struct) { + return struct.get(numAttrs$LAYOUT, numAttrs$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int numAttrs + * } + */ + public static void numAttrs(MemorySegment struct, int fieldValue) { + struct.set(numAttrs$LAYOUT, numAttrs$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_t.java new file mode 100644 index 0000000000..16b38398cd --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_t.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct cudaLaunchConfig_st { + * dim3 gridDim; + * dim3 blockDim; + * size_t dynamicSmemBytes; + * cudaStream_t stream; + * cudaLaunchAttribute *attrs; + * unsigned int numAttrs; + * } cudaLaunchConfig_t + * } + */ +public class cudaLaunchConfig_t extends cudaLaunchConfig_st { + + cudaLaunchConfig_t() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap.java new file mode 100644 index 0000000000..0c76d4713d --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct cudaLaunchMemSyncDomainMap_st { + * unsigned char default_; + * unsigned char remote; + * } cudaLaunchMemSyncDomainMap + * } + */ +public class cudaLaunchMemSyncDomainMap extends cudaLaunchMemSyncDomainMap_st { + + cudaLaunchMemSyncDomainMap() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap_st.java new file mode 100644 index 0000000000..8372e58646 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap_st.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaLaunchMemSyncDomainMap_st { + * unsigned char default_; + * unsigned char remote; + * } + * } + */ +public class cudaLaunchMemSyncDomainMap_st { + + cudaLaunchMemSyncDomainMap_st() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_CHAR.withName("default_"), + PanamaFFMAPI.C_CHAR.withName("remote") + ).withName("cudaLaunchMemSyncDomainMap_st"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte default_$LAYOUT = (OfByte)$LAYOUT.select(groupElement("default_")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char default_ + * } + */ + public static final OfByte default_$layout() { + return default_$LAYOUT; + } + + private static final long default_$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char default_ + * } + */ + public static final long default_$offset() { + return default_$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char default_ + * } + */ + public static byte default_(MemorySegment struct) { + return struct.get(default_$LAYOUT, default_$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char default_ + * } + */ + public static void default_(MemorySegment struct, byte fieldValue) { + struct.set(default_$LAYOUT, default_$OFFSET, fieldValue); + } + + private static final OfByte remote$LAYOUT = (OfByte)$LAYOUT.select(groupElement("remote")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char remote + * } + */ + public static final OfByte remote$layout() { + return remote$LAYOUT; + } + + private static final long remote$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char remote + * } + */ + public static final long remote$offset() { + return remote$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char remote + * } + */ + public static byte remote(MemorySegment struct) { + return struct.get(remote$LAYOUT, remote$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char remote + * } + */ + public static void remote(MemorySegment struct, byte fieldValue) { + struct.set(remote$LAYOUT, remote$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchParams.java new file mode 100644 index 0000000000..3a7efd2c5a --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchParams.java @@ -0,0 +1,373 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaLaunchParams { + * void *func; + * dim3 gridDim; + * dim3 blockDim; + * void **args; + * size_t sharedMem; + * cudaStream_t stream; + * } + * } + */ +public class cudaLaunchParams { + + cudaLaunchParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("func"), + dim3.layout().withName("gridDim"), + dim3.layout().withName("blockDim"), + PanamaFFMAPI.C_POINTER.withName("args"), + PanamaFFMAPI.C_LONG.withName("sharedMem"), + PanamaFFMAPI.C_POINTER.withName("stream") + ).withName("cudaLaunchParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout func$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("func")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *func + * } + */ + public static final AddressLayout func$layout() { + return func$LAYOUT; + } + + private static final long func$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *func + * } + */ + public static final long func$offset() { + return func$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *func + * } + */ + public static MemorySegment func(MemorySegment struct) { + return struct.get(func$LAYOUT, func$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *func + * } + */ + public static void func(MemorySegment struct, MemorySegment fieldValue) { + struct.set(func$LAYOUT, func$OFFSET, fieldValue); + } + + private static final GroupLayout gridDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("gridDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static final GroupLayout gridDim$layout() { + return gridDim$LAYOUT; + } + + private static final long gridDim$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static final long gridDim$offset() { + return gridDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static MemorySegment gridDim(MemorySegment struct) { + return struct.asSlice(gridDim$OFFSET, gridDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * dim3 gridDim + * } + */ + public static void gridDim(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, gridDim$OFFSET, gridDim$LAYOUT.byteSize()); + } + + private static final GroupLayout blockDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("blockDim")); + + /** + * Layout for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static final GroupLayout blockDim$layout() { + return blockDim$LAYOUT; + } + + private static final long blockDim$OFFSET = 20; + + /** + * Offset for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static final long blockDim$offset() { + return blockDim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static MemorySegment blockDim(MemorySegment struct) { + return struct.asSlice(blockDim$OFFSET, blockDim$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * dim3 blockDim + * } + */ + public static void blockDim(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, blockDim$OFFSET, blockDim$LAYOUT.byteSize()); + } + + private static final AddressLayout args$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("args")); + + /** + * Layout for field: + * {@snippet lang=c : + * void **args + * } + */ + public static final AddressLayout args$layout() { + return args$LAYOUT; + } + + private static final long args$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * void **args + * } + */ + public static final long args$offset() { + return args$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void **args + * } + */ + public static MemorySegment args(MemorySegment struct) { + return struct.get(args$LAYOUT, args$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void **args + * } + */ + public static void args(MemorySegment struct, MemorySegment fieldValue) { + struct.set(args$LAYOUT, args$OFFSET, fieldValue); + } + + private static final OfLong sharedMem$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sharedMem")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t sharedMem + * } + */ + public static final OfLong sharedMem$layout() { + return sharedMem$LAYOUT; + } + + private static final long sharedMem$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t sharedMem + * } + */ + public static final long sharedMem$offset() { + return sharedMem$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t sharedMem + * } + */ + public static long sharedMem(MemorySegment struct) { + return struct.get(sharedMem$LAYOUT, sharedMem$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t sharedMem + * } + */ + public static void sharedMem(MemorySegment struct, long fieldValue) { + struct.set(sharedMem$LAYOUT, sharedMem$OFFSET, fieldValue); + } + + private static final AddressLayout stream$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("stream")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaStream_t stream + * } + */ + public static final AddressLayout stream$layout() { + return stream$LAYOUT; + } + + private static final long stream$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaStream_t stream + * } + */ + public static final long stream$offset() { + return stream$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaStream_t stream + * } + */ + public static MemorySegment stream(MemorySegment struct) { + return struct.get(stream$LAYOUT, stream$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaStream_t stream + * } + */ + public static void stream(MemorySegment struct, MemorySegment fieldValue) { + struct.set(stream$LAYOUT, stream$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAccessDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAccessDesc.java new file mode 100644 index 0000000000..ec9ed09d37 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAccessDesc.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemAccessDesc { + * struct cudaMemLocation location; + * enum cudaMemAccessFlags flags; + * } + * } + */ +public class cudaMemAccessDesc { + + cudaMemAccessDesc() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaMemLocation.layout().withName("location"), + PanamaFFMAPI.C_INT.withName("flags") + ).withName("cudaMemAccessDesc"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout location$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("location")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaMemLocation location + * } + */ + public static final GroupLayout location$layout() { + return location$LAYOUT; + } + + private static final long location$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaMemLocation location + * } + */ + public static final long location$offset() { + return location$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaMemLocation location + * } + */ + public static MemorySegment location(MemorySegment struct) { + return struct.asSlice(location$OFFSET, location$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaMemLocation location + * } + */ + public static void location(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, location$OFFSET, location$LAYOUT.byteSize()); + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaMemAccessFlags flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaMemAccessFlags flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaMemAccessFlags flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaMemAccessFlags flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParams.java new file mode 100644 index 0000000000..200737bf35 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParams.java @@ -0,0 +1,327 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemAllocNodeParams { + * struct cudaMemPoolProps poolProps; + * const struct cudaMemAccessDesc *accessDescs; + * size_t accessDescCount; + * size_t bytesize; + * void *dptr; + * } + * } + */ +public class cudaMemAllocNodeParams { + + cudaMemAllocNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaMemPoolProps.layout().withName("poolProps"), + PanamaFFMAPI.C_POINTER.withName("accessDescs"), + PanamaFFMAPI.C_LONG.withName("accessDescCount"), + PanamaFFMAPI.C_LONG.withName("bytesize"), + PanamaFFMAPI.C_POINTER.withName("dptr") + ).withName("cudaMemAllocNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout poolProps$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("poolProps")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaMemPoolProps poolProps + * } + */ + public static final GroupLayout poolProps$layout() { + return poolProps$LAYOUT; + } + + private static final long poolProps$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaMemPoolProps poolProps + * } + */ + public static final long poolProps$offset() { + return poolProps$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaMemPoolProps poolProps + * } + */ + public static MemorySegment poolProps(MemorySegment struct) { + return struct.asSlice(poolProps$OFFSET, poolProps$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaMemPoolProps poolProps + * } + */ + public static void poolProps(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, poolProps$OFFSET, poolProps$LAYOUT.byteSize()); + } + + private static final AddressLayout accessDescs$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("accessDescs")); + + /** + * Layout for field: + * {@snippet lang=c : + * const struct cudaMemAccessDesc *accessDescs + * } + */ + public static final AddressLayout accessDescs$layout() { + return accessDescs$LAYOUT; + } + + private static final long accessDescs$OFFSET = 88; + + /** + * Offset for field: + * {@snippet lang=c : + * const struct cudaMemAccessDesc *accessDescs + * } + */ + public static final long accessDescs$offset() { + return accessDescs$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const struct cudaMemAccessDesc *accessDescs + * } + */ + public static MemorySegment accessDescs(MemorySegment struct) { + return struct.get(accessDescs$LAYOUT, accessDescs$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const struct cudaMemAccessDesc *accessDescs + * } + */ + public static void accessDescs(MemorySegment struct, MemorySegment fieldValue) { + struct.set(accessDescs$LAYOUT, accessDescs$OFFSET, fieldValue); + } + + private static final OfLong accessDescCount$LAYOUT = (OfLong)$LAYOUT.select(groupElement("accessDescCount")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t accessDescCount + * } + */ + public static final OfLong accessDescCount$layout() { + return accessDescCount$LAYOUT; + } + + private static final long accessDescCount$OFFSET = 96; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t accessDescCount + * } + */ + public static final long accessDescCount$offset() { + return accessDescCount$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t accessDescCount + * } + */ + public static long accessDescCount(MemorySegment struct) { + return struct.get(accessDescCount$LAYOUT, accessDescCount$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t accessDescCount + * } + */ + public static void accessDescCount(MemorySegment struct, long fieldValue) { + struct.set(accessDescCount$LAYOUT, accessDescCount$OFFSET, fieldValue); + } + + private static final OfLong bytesize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("bytesize")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t bytesize + * } + */ + public static final OfLong bytesize$layout() { + return bytesize$LAYOUT; + } + + private static final long bytesize$OFFSET = 104; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t bytesize + * } + */ + public static final long bytesize$offset() { + return bytesize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t bytesize + * } + */ + public static long bytesize(MemorySegment struct) { + return struct.get(bytesize$LAYOUT, bytesize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t bytesize + * } + */ + public static void bytesize(MemorySegment struct, long fieldValue) { + struct.set(bytesize$LAYOUT, bytesize$OFFSET, fieldValue); + } + + private static final AddressLayout dptr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dptr")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static final AddressLayout dptr$layout() { + return dptr$LAYOUT; + } + + private static final long dptr$OFFSET = 112; + + /** + * Offset for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static final long dptr$offset() { + return dptr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static MemorySegment dptr(MemorySegment struct) { + return struct.get(dptr$LAYOUT, dptr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static void dptr(MemorySegment struct, MemorySegment fieldValue) { + struct.set(dptr$LAYOUT, dptr$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParamsV2.java new file mode 100644 index 0000000000..fc1af4201f --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParamsV2.java @@ -0,0 +1,327 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemAllocNodeParamsV2 { + * struct cudaMemPoolProps poolProps; + * const struct cudaMemAccessDesc *accessDescs; + * size_t accessDescCount; + * size_t bytesize; + * void *dptr; + * } + * } + */ +public class cudaMemAllocNodeParamsV2 { + + cudaMemAllocNodeParamsV2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + cudaMemPoolProps.layout().withName("poolProps"), + PanamaFFMAPI.C_POINTER.withName("accessDescs"), + PanamaFFMAPI.C_LONG.withName("accessDescCount"), + PanamaFFMAPI.C_LONG.withName("bytesize"), + PanamaFFMAPI.C_POINTER.withName("dptr") + ).withName("cudaMemAllocNodeParamsV2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final GroupLayout poolProps$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("poolProps")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaMemPoolProps poolProps + * } + */ + public static final GroupLayout poolProps$layout() { + return poolProps$LAYOUT; + } + + private static final long poolProps$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaMemPoolProps poolProps + * } + */ + public static final long poolProps$offset() { + return poolProps$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaMemPoolProps poolProps + * } + */ + public static MemorySegment poolProps(MemorySegment struct) { + return struct.asSlice(poolProps$OFFSET, poolProps$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaMemPoolProps poolProps + * } + */ + public static void poolProps(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, poolProps$OFFSET, poolProps$LAYOUT.byteSize()); + } + + private static final AddressLayout accessDescs$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("accessDescs")); + + /** + * Layout for field: + * {@snippet lang=c : + * const struct cudaMemAccessDesc *accessDescs + * } + */ + public static final AddressLayout accessDescs$layout() { + return accessDescs$LAYOUT; + } + + private static final long accessDescs$OFFSET = 88; + + /** + * Offset for field: + * {@snippet lang=c : + * const struct cudaMemAccessDesc *accessDescs + * } + */ + public static final long accessDescs$offset() { + return accessDescs$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * const struct cudaMemAccessDesc *accessDescs + * } + */ + public static MemorySegment accessDescs(MemorySegment struct) { + return struct.get(accessDescs$LAYOUT, accessDescs$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * const struct cudaMemAccessDesc *accessDescs + * } + */ + public static void accessDescs(MemorySegment struct, MemorySegment fieldValue) { + struct.set(accessDescs$LAYOUT, accessDescs$OFFSET, fieldValue); + } + + private static final OfLong accessDescCount$LAYOUT = (OfLong)$LAYOUT.select(groupElement("accessDescCount")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t accessDescCount + * } + */ + public static final OfLong accessDescCount$layout() { + return accessDescCount$LAYOUT; + } + + private static final long accessDescCount$OFFSET = 96; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t accessDescCount + * } + */ + public static final long accessDescCount$offset() { + return accessDescCount$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t accessDescCount + * } + */ + public static long accessDescCount(MemorySegment struct) { + return struct.get(accessDescCount$LAYOUT, accessDescCount$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t accessDescCount + * } + */ + public static void accessDescCount(MemorySegment struct, long fieldValue) { + struct.set(accessDescCount$LAYOUT, accessDescCount$OFFSET, fieldValue); + } + + private static final OfLong bytesize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("bytesize")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t bytesize + * } + */ + public static final OfLong bytesize$layout() { + return bytesize$LAYOUT; + } + + private static final long bytesize$OFFSET = 104; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t bytesize + * } + */ + public static final long bytesize$offset() { + return bytesize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t bytesize + * } + */ + public static long bytesize(MemorySegment struct) { + return struct.get(bytesize$LAYOUT, bytesize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t bytesize + * } + */ + public static void bytesize(MemorySegment struct, long fieldValue) { + struct.set(bytesize$LAYOUT, bytesize$OFFSET, fieldValue); + } + + private static final AddressLayout dptr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dptr")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static final AddressLayout dptr$layout() { + return dptr$LAYOUT; + } + + private static final long dptr$OFFSET = 112; + + /** + * Offset for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static final long dptr$offset() { + return dptr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static MemorySegment dptr(MemorySegment struct) { + return struct.get(dptr$LAYOUT, dptr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static void dptr(MemorySegment struct, MemorySegment fieldValue) { + struct.set(dptr$LAYOUT, dptr$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_st.java new file mode 100644 index 0000000000..e6881523eb --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_st.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemFabricHandle_st { + * char reserved[64]; + * } + * } + */ +public class cudaMemFabricHandle_st { + + cudaMemFabricHandle_st() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(64, PanamaFFMAPI.C_CHAR).withName("reserved") + ).withName("cudaMemFabricHandle_st"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 64 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static byte reserved(MemorySegment struct, long index0) { + return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * char reserved[64] + * } + */ + public static void reserved(MemorySegment struct, long index0, byte fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_t.java new file mode 100644 index 0000000000..51f9bb75e8 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_t.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct cudaMemFabricHandle_st { + * char reserved[64]; + * } cudaMemFabricHandle_t + * } + */ +public class cudaMemFabricHandle_t extends cudaMemFabricHandle_st { + + cudaMemFabricHandle_t() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFreeNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFreeNodeParams.java new file mode 100644 index 0000000000..a81e389d26 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFreeNodeParams.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemFreeNodeParams { + * void *dptr; + * } + * } + */ +public class cudaMemFreeNodeParams { + + cudaMemFreeNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("dptr") + ).withName("cudaMemFreeNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout dptr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dptr")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static final AddressLayout dptr$layout() { + return dptr$LAYOUT; + } + + private static final long dptr$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static final long dptr$offset() { + return dptr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static MemorySegment dptr(MemorySegment struct) { + return struct.get(dptr$LAYOUT, dptr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *dptr + * } + */ + public static void dptr(MemorySegment struct, MemorySegment fieldValue) { + struct.set(dptr$LAYOUT, dptr$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemLocation.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemLocation.java new file mode 100644 index 0000000000..e41966adad --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemLocation.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemLocation { + * enum cudaMemLocationType type; + * int id; + * } + * } + */ +public class cudaMemLocation { + + cudaMemLocation() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("type"), + PanamaFFMAPI.C_INT.withName("id") + ).withName("cudaMemLocation"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaMemLocationType type + * } + */ + public static final OfInt type$layout() { + return type$LAYOUT; + } + + private static final long type$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaMemLocationType type + * } + */ + public static final long type$offset() { + return type$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaMemLocationType type + * } + */ + public static int type(MemorySegment struct) { + return struct.get(type$LAYOUT, type$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaMemLocationType type + * } + */ + public static void type(MemorySegment struct, int fieldValue) { + struct.set(type$LAYOUT, type$OFFSET, fieldValue); + } + + private static final OfInt id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("id")); + + /** + * Layout for field: + * {@snippet lang=c : + * int id + * } + */ + public static final OfInt id$layout() { + return id$LAYOUT; + } + + private static final long id$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int id + * } + */ + public static final long id$offset() { + return id$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int id + * } + */ + public static int id(MemorySegment struct) { + return struct.get(id$LAYOUT, id$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int id + * } + */ + public static void id(MemorySegment struct, int fieldValue) { + struct.set(id$LAYOUT, id$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolProps.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolProps.java new file mode 100644 index 0000000000..31a3d15543 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolProps.java @@ -0,0 +1,452 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemPoolProps { + * enum cudaMemAllocationType allocType; + * enum cudaMemAllocationHandleType handleTypes; + * struct cudaMemLocation location; + * void *win32SecurityAttributes; + * size_t maxSize; + * unsigned short usage; + * unsigned char reserved[54]; + * } + * } + */ +public class cudaMemPoolProps { + + cudaMemPoolProps() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("allocType"), + PanamaFFMAPI.C_INT.withName("handleTypes"), + cudaMemLocation.layout().withName("location"), + PanamaFFMAPI.C_POINTER.withName("win32SecurityAttributes"), + PanamaFFMAPI.C_LONG.withName("maxSize"), + PanamaFFMAPI.C_SHORT.withName("usage"), + MemoryLayout.sequenceLayout(54, PanamaFFMAPI.C_CHAR).withName("reserved") + ).withName("cudaMemPoolProps"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt allocType$LAYOUT = (OfInt)$LAYOUT.select(groupElement("allocType")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaMemAllocationType allocType + * } + */ + public static final OfInt allocType$layout() { + return allocType$LAYOUT; + } + + private static final long allocType$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaMemAllocationType allocType + * } + */ + public static final long allocType$offset() { + return allocType$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaMemAllocationType allocType + * } + */ + public static int allocType(MemorySegment struct) { + return struct.get(allocType$LAYOUT, allocType$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaMemAllocationType allocType + * } + */ + public static void allocType(MemorySegment struct, int fieldValue) { + struct.set(allocType$LAYOUT, allocType$OFFSET, fieldValue); + } + + private static final OfInt handleTypes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("handleTypes")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaMemAllocationHandleType handleTypes + * } + */ + public static final OfInt handleTypes$layout() { + return handleTypes$LAYOUT; + } + + private static final long handleTypes$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaMemAllocationHandleType handleTypes + * } + */ + public static final long handleTypes$offset() { + return handleTypes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaMemAllocationHandleType handleTypes + * } + */ + public static int handleTypes(MemorySegment struct) { + return struct.get(handleTypes$LAYOUT, handleTypes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaMemAllocationHandleType handleTypes + * } + */ + public static void handleTypes(MemorySegment struct, int fieldValue) { + struct.set(handleTypes$LAYOUT, handleTypes$OFFSET, fieldValue); + } + + private static final GroupLayout location$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("location")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaMemLocation location + * } + */ + public static final GroupLayout location$layout() { + return location$LAYOUT; + } + + private static final long location$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaMemLocation location + * } + */ + public static final long location$offset() { + return location$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaMemLocation location + * } + */ + public static MemorySegment location(MemorySegment struct) { + return struct.asSlice(location$OFFSET, location$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaMemLocation location + * } + */ + public static void location(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, location$OFFSET, location$LAYOUT.byteSize()); + } + + private static final AddressLayout win32SecurityAttributes$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("win32SecurityAttributes")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *win32SecurityAttributes + * } + */ + public static final AddressLayout win32SecurityAttributes$layout() { + return win32SecurityAttributes$LAYOUT; + } + + private static final long win32SecurityAttributes$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * void *win32SecurityAttributes + * } + */ + public static final long win32SecurityAttributes$offset() { + return win32SecurityAttributes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *win32SecurityAttributes + * } + */ + public static MemorySegment win32SecurityAttributes(MemorySegment struct) { + return struct.get(win32SecurityAttributes$LAYOUT, win32SecurityAttributes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *win32SecurityAttributes + * } + */ + public static void win32SecurityAttributes(MemorySegment struct, MemorySegment fieldValue) { + struct.set(win32SecurityAttributes$LAYOUT, win32SecurityAttributes$OFFSET, fieldValue); + } + + private static final OfLong maxSize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("maxSize")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t maxSize + * } + */ + public static final OfLong maxSize$layout() { + return maxSize$LAYOUT; + } + + private static final long maxSize$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t maxSize + * } + */ + public static final long maxSize$offset() { + return maxSize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t maxSize + * } + */ + public static long maxSize(MemorySegment struct) { + return struct.get(maxSize$LAYOUT, maxSize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t maxSize + * } + */ + public static void maxSize(MemorySegment struct, long fieldValue) { + struct.set(maxSize$LAYOUT, maxSize$OFFSET, fieldValue); + } + + private static final OfShort usage$LAYOUT = (OfShort)$LAYOUT.select(groupElement("usage")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short usage + * } + */ + public static final OfShort usage$layout() { + return usage$LAYOUT; + } + + private static final long usage$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short usage + * } + */ + public static final long usage$offset() { + return usage$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short usage + * } + */ + public static short usage(MemorySegment struct) { + return struct.get(usage$LAYOUT, usage$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short usage + * } + */ + public static void usage(MemorySegment struct, short fieldValue) { + struct.set(usage$LAYOUT, usage$OFFSET, fieldValue); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char reserved[54] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 34; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char reserved[54] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char reserved[54] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char reserved[54] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 54 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned char reserved[54] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned char reserved[54] + * } + */ + public static byte reserved(MemorySegment struct, long index0) { + return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned char reserved[54] + * } + */ + public static void reserved(MemorySegment struct, long index0, byte fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolPtrExportData.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolPtrExportData.java new file mode 100644 index 0000000000..01c9bb03c6 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolPtrExportData.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemPoolPtrExportData { + * unsigned char reserved[64]; + * } + * } + */ +public class cudaMemPoolPtrExportData { + + cudaMemPoolPtrExportData() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(64, PanamaFFMAPI.C_CHAR).withName("reserved") + ).withName("cudaMemPoolPtrExportData"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char reserved[64] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char reserved[64] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char reserved[64] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char reserved[64] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 64 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * unsigned char reserved[64] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * unsigned char reserved[64] + * } + */ + public static byte reserved(MemorySegment struct, long index0) { + return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * unsigned char reserved[64] + * } + */ + public static void reserved(MemorySegment struct, long index0, byte fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DParms.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DParms.java new file mode 100644 index 0000000000..5a543cc3cb --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DParms.java @@ -0,0 +1,466 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemcpy3DParms { + * cudaArray_t srcArray; + * struct cudaPos srcPos; + * struct cudaPitchedPtr srcPtr; + * cudaArray_t dstArray; + * struct cudaPos dstPos; + * struct cudaPitchedPtr dstPtr; + * struct cudaExtent extent; + * enum cudaMemcpyKind kind; + * } + * } + */ +public class cudaMemcpy3DParms { + + cudaMemcpy3DParms() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("srcArray"), + cudaPos.layout().withName("srcPos"), + cudaPitchedPtr.layout().withName("srcPtr"), + PanamaFFMAPI.C_POINTER.withName("dstArray"), + cudaPos.layout().withName("dstPos"), + cudaPitchedPtr.layout().withName("dstPtr"), + cudaExtent.layout().withName("extent"), + PanamaFFMAPI.C_INT.withName("kind"), + MemoryLayout.paddingLayout(4) + ).withName("cudaMemcpy3DParms"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout srcArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("srcArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaArray_t srcArray + * } + */ + public static final AddressLayout srcArray$layout() { + return srcArray$LAYOUT; + } + + private static final long srcArray$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaArray_t srcArray + * } + */ + public static final long srcArray$offset() { + return srcArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaArray_t srcArray + * } + */ + public static MemorySegment srcArray(MemorySegment struct) { + return struct.get(srcArray$LAYOUT, srcArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaArray_t srcArray + * } + */ + public static void srcArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(srcArray$LAYOUT, srcArray$OFFSET, fieldValue); + } + + private static final GroupLayout srcPos$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("srcPos")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaPos srcPos + * } + */ + public static final GroupLayout srcPos$layout() { + return srcPos$LAYOUT; + } + + private static final long srcPos$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaPos srcPos + * } + */ + public static final long srcPos$offset() { + return srcPos$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaPos srcPos + * } + */ + public static MemorySegment srcPos(MemorySegment struct) { + return struct.asSlice(srcPos$OFFSET, srcPos$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaPos srcPos + * } + */ + public static void srcPos(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, srcPos$OFFSET, srcPos$LAYOUT.byteSize()); + } + + private static final GroupLayout srcPtr$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("srcPtr")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaPitchedPtr srcPtr + * } + */ + public static final GroupLayout srcPtr$layout() { + return srcPtr$LAYOUT; + } + + private static final long srcPtr$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaPitchedPtr srcPtr + * } + */ + public static final long srcPtr$offset() { + return srcPtr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaPitchedPtr srcPtr + * } + */ + public static MemorySegment srcPtr(MemorySegment struct) { + return struct.asSlice(srcPtr$OFFSET, srcPtr$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaPitchedPtr srcPtr + * } + */ + public static void srcPtr(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, srcPtr$OFFSET, srcPtr$LAYOUT.byteSize()); + } + + private static final AddressLayout dstArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dstArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaArray_t dstArray + * } + */ + public static final AddressLayout dstArray$layout() { + return dstArray$LAYOUT; + } + + private static final long dstArray$OFFSET = 64; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaArray_t dstArray + * } + */ + public static final long dstArray$offset() { + return dstArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaArray_t dstArray + * } + */ + public static MemorySegment dstArray(MemorySegment struct) { + return struct.get(dstArray$LAYOUT, dstArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaArray_t dstArray + * } + */ + public static void dstArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(dstArray$LAYOUT, dstArray$OFFSET, fieldValue); + } + + private static final GroupLayout dstPos$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dstPos")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaPos dstPos + * } + */ + public static final GroupLayout dstPos$layout() { + return dstPos$LAYOUT; + } + + private static final long dstPos$OFFSET = 72; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaPos dstPos + * } + */ + public static final long dstPos$offset() { + return dstPos$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaPos dstPos + * } + */ + public static MemorySegment dstPos(MemorySegment struct) { + return struct.asSlice(dstPos$OFFSET, dstPos$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaPos dstPos + * } + */ + public static void dstPos(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, dstPos$OFFSET, dstPos$LAYOUT.byteSize()); + } + + private static final GroupLayout dstPtr$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dstPtr")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaPitchedPtr dstPtr + * } + */ + public static final GroupLayout dstPtr$layout() { + return dstPtr$LAYOUT; + } + + private static final long dstPtr$OFFSET = 96; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaPitchedPtr dstPtr + * } + */ + public static final long dstPtr$offset() { + return dstPtr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaPitchedPtr dstPtr + * } + */ + public static MemorySegment dstPtr(MemorySegment struct) { + return struct.asSlice(dstPtr$OFFSET, dstPtr$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaPitchedPtr dstPtr + * } + */ + public static void dstPtr(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, dstPtr$OFFSET, dstPtr$LAYOUT.byteSize()); + } + + private static final GroupLayout extent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("extent")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static final GroupLayout extent$layout() { + return extent$LAYOUT; + } + + private static final long extent$OFFSET = 128; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static final long extent$offset() { + return extent$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static MemorySegment extent(MemorySegment struct) { + return struct.asSlice(extent$OFFSET, extent$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static void extent(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, extent$OFFSET, extent$LAYOUT.byteSize()); + } + + private static final OfInt kind$LAYOUT = (OfInt)$LAYOUT.select(groupElement("kind")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaMemcpyKind kind + * } + */ + public static final OfInt kind$layout() { + return kind$LAYOUT; + } + + private static final long kind$OFFSET = 152; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaMemcpyKind kind + * } + */ + public static final long kind$offset() { + return kind$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaMemcpyKind kind + * } + */ + public static int kind(MemorySegment struct) { + return struct.get(kind$LAYOUT, kind$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaMemcpyKind kind + * } + */ + public static void kind(MemorySegment struct, int fieldValue) { + struct.set(kind$LAYOUT, kind$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DPeerParms.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DPeerParms.java new file mode 100644 index 0000000000..dc66c9f6d6 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DPeerParms.java @@ -0,0 +1,513 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemcpy3DPeerParms { + * cudaArray_t srcArray; + * struct cudaPos srcPos; + * struct cudaPitchedPtr srcPtr; + * int srcDevice; + * cudaArray_t dstArray; + * struct cudaPos dstPos; + * struct cudaPitchedPtr dstPtr; + * int dstDevice; + * struct cudaExtent extent; + * } + * } + */ +public class cudaMemcpy3DPeerParms { + + cudaMemcpy3DPeerParms() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("srcArray"), + cudaPos.layout().withName("srcPos"), + cudaPitchedPtr.layout().withName("srcPtr"), + PanamaFFMAPI.C_INT.withName("srcDevice"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_POINTER.withName("dstArray"), + cudaPos.layout().withName("dstPos"), + cudaPitchedPtr.layout().withName("dstPtr"), + PanamaFFMAPI.C_INT.withName("dstDevice"), + MemoryLayout.paddingLayout(4), + cudaExtent.layout().withName("extent") + ).withName("cudaMemcpy3DPeerParms"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout srcArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("srcArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaArray_t srcArray + * } + */ + public static final AddressLayout srcArray$layout() { + return srcArray$LAYOUT; + } + + private static final long srcArray$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaArray_t srcArray + * } + */ + public static final long srcArray$offset() { + return srcArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaArray_t srcArray + * } + */ + public static MemorySegment srcArray(MemorySegment struct) { + return struct.get(srcArray$LAYOUT, srcArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaArray_t srcArray + * } + */ + public static void srcArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(srcArray$LAYOUT, srcArray$OFFSET, fieldValue); + } + + private static final GroupLayout srcPos$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("srcPos")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaPos srcPos + * } + */ + public static final GroupLayout srcPos$layout() { + return srcPos$LAYOUT; + } + + private static final long srcPos$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaPos srcPos + * } + */ + public static final long srcPos$offset() { + return srcPos$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaPos srcPos + * } + */ + public static MemorySegment srcPos(MemorySegment struct) { + return struct.asSlice(srcPos$OFFSET, srcPos$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaPos srcPos + * } + */ + public static void srcPos(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, srcPos$OFFSET, srcPos$LAYOUT.byteSize()); + } + + private static final GroupLayout srcPtr$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("srcPtr")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaPitchedPtr srcPtr + * } + */ + public static final GroupLayout srcPtr$layout() { + return srcPtr$LAYOUT; + } + + private static final long srcPtr$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaPitchedPtr srcPtr + * } + */ + public static final long srcPtr$offset() { + return srcPtr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaPitchedPtr srcPtr + * } + */ + public static MemorySegment srcPtr(MemorySegment struct) { + return struct.asSlice(srcPtr$OFFSET, srcPtr$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaPitchedPtr srcPtr + * } + */ + public static void srcPtr(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, srcPtr$OFFSET, srcPtr$LAYOUT.byteSize()); + } + + private static final OfInt srcDevice$LAYOUT = (OfInt)$LAYOUT.select(groupElement("srcDevice")); + + /** + * Layout for field: + * {@snippet lang=c : + * int srcDevice + * } + */ + public static final OfInt srcDevice$layout() { + return srcDevice$LAYOUT; + } + + private static final long srcDevice$OFFSET = 64; + + /** + * Offset for field: + * {@snippet lang=c : + * int srcDevice + * } + */ + public static final long srcDevice$offset() { + return srcDevice$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int srcDevice + * } + */ + public static int srcDevice(MemorySegment struct) { + return struct.get(srcDevice$LAYOUT, srcDevice$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int srcDevice + * } + */ + public static void srcDevice(MemorySegment struct, int fieldValue) { + struct.set(srcDevice$LAYOUT, srcDevice$OFFSET, fieldValue); + } + + private static final AddressLayout dstArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dstArray")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaArray_t dstArray + * } + */ + public static final AddressLayout dstArray$layout() { + return dstArray$LAYOUT; + } + + private static final long dstArray$OFFSET = 72; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaArray_t dstArray + * } + */ + public static final long dstArray$offset() { + return dstArray$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaArray_t dstArray + * } + */ + public static MemorySegment dstArray(MemorySegment struct) { + return struct.get(dstArray$LAYOUT, dstArray$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaArray_t dstArray + * } + */ + public static void dstArray(MemorySegment struct, MemorySegment fieldValue) { + struct.set(dstArray$LAYOUT, dstArray$OFFSET, fieldValue); + } + + private static final GroupLayout dstPos$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dstPos")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaPos dstPos + * } + */ + public static final GroupLayout dstPos$layout() { + return dstPos$LAYOUT; + } + + private static final long dstPos$OFFSET = 80; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaPos dstPos + * } + */ + public static final long dstPos$offset() { + return dstPos$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaPos dstPos + * } + */ + public static MemorySegment dstPos(MemorySegment struct) { + return struct.asSlice(dstPos$OFFSET, dstPos$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaPos dstPos + * } + */ + public static void dstPos(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, dstPos$OFFSET, dstPos$LAYOUT.byteSize()); + } + + private static final GroupLayout dstPtr$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dstPtr")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaPitchedPtr dstPtr + * } + */ + public static final GroupLayout dstPtr$layout() { + return dstPtr$LAYOUT; + } + + private static final long dstPtr$OFFSET = 104; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaPitchedPtr dstPtr + * } + */ + public static final long dstPtr$offset() { + return dstPtr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaPitchedPtr dstPtr + * } + */ + public static MemorySegment dstPtr(MemorySegment struct) { + return struct.asSlice(dstPtr$OFFSET, dstPtr$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaPitchedPtr dstPtr + * } + */ + public static void dstPtr(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, dstPtr$OFFSET, dstPtr$LAYOUT.byteSize()); + } + + private static final OfInt dstDevice$LAYOUT = (OfInt)$LAYOUT.select(groupElement("dstDevice")); + + /** + * Layout for field: + * {@snippet lang=c : + * int dstDevice + * } + */ + public static final OfInt dstDevice$layout() { + return dstDevice$LAYOUT; + } + + private static final long dstDevice$OFFSET = 136; + + /** + * Offset for field: + * {@snippet lang=c : + * int dstDevice + * } + */ + public static final long dstDevice$offset() { + return dstDevice$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int dstDevice + * } + */ + public static int dstDevice(MemorySegment struct) { + return struct.get(dstDevice$LAYOUT, dstDevice$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int dstDevice + * } + */ + public static void dstDevice(MemorySegment struct, int fieldValue) { + struct.set(dstDevice$LAYOUT, dstDevice$OFFSET, fieldValue); + } + + private static final GroupLayout extent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("extent")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static final GroupLayout extent$layout() { + return extent$LAYOUT; + } + + private static final long extent$OFFSET = 144; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static final long extent$offset() { + return extent$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static MemorySegment extent(MemorySegment struct) { + return struct.asSlice(extent$OFFSET, extent$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaExtent extent + * } + */ + public static void extent(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, extent$OFFSET, extent$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpyNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpyNodeParams.java new file mode 100644 index 0000000000..fe85ee793a --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpyNodeParams.java @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemcpyNodeParams { + * int flags; + * int reserved[3]; + * struct cudaMemcpy3DParms copyParams; + * } + * } + */ +public class cudaMemcpyNodeParams { + + cudaMemcpyNodeParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("flags"), + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("reserved"), + cudaMemcpy3DParms.layout().withName("copyParams") + ).withName("cudaMemcpyNodeParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); + + /** + * Layout for field: + * {@snippet lang=c : + * int flags + * } + */ + public static final OfInt flags$layout() { + return flags$LAYOUT; + } + + private static final long flags$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int flags + * } + */ + public static final long flags$offset() { + return flags$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int flags + * } + */ + public static int flags(MemorySegment struct) { + return struct.get(flags$LAYOUT, flags$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int flags + * } + */ + public static void flags(MemorySegment struct, int fieldValue) { + struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); + } + + private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); + + /** + * Layout for field: + * {@snippet lang=c : + * int reserved[3] + * } + */ + public static final SequenceLayout reserved$layout() { + return reserved$LAYOUT; + } + + private static final long reserved$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int reserved[3] + * } + */ + public static final long reserved$offset() { + return reserved$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int reserved[3] + * } + */ + public static MemorySegment reserved(MemorySegment struct) { + return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int reserved[3] + * } + */ + public static void reserved(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); + } + + private static long[] reserved$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * int reserved[3] + * } + */ + public static long[] reserved$dimensions() { + return reserved$DIMS; + } + private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * int reserved[3] + * } + */ + public static int reserved(MemorySegment struct, long index0) { + return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * int reserved[3] + * } + */ + public static void reserved(MemorySegment struct, long index0, int fieldValue) { + reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final GroupLayout copyParams$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("copyParams")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaMemcpy3DParms copyParams + * } + */ + public static final GroupLayout copyParams$layout() { + return copyParams$LAYOUT; + } + + private static final long copyParams$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaMemcpy3DParms copyParams + * } + */ + public static final long copyParams$offset() { + return copyParams$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaMemcpy3DParms copyParams + * } + */ + public static MemorySegment copyParams(MemorySegment struct) { + return struct.asSlice(copyParams$OFFSET, copyParams$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaMemcpy3DParms copyParams + * } + */ + public static void copyParams(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, copyParams$OFFSET, copyParams$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParams.java new file mode 100644 index 0000000000..69f51851f5 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParams.java @@ -0,0 +1,373 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemsetParams { + * void *dst; + * size_t pitch; + * unsigned int value; + * unsigned int elementSize; + * size_t width; + * size_t height; + * } + * } + */ +public class cudaMemsetParams { + + cudaMemsetParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("dst"), + PanamaFFMAPI.C_LONG.withName("pitch"), + PanamaFFMAPI.C_INT.withName("value"), + PanamaFFMAPI.C_INT.withName("elementSize"), + PanamaFFMAPI.C_LONG.withName("width"), + PanamaFFMAPI.C_LONG.withName("height") + ).withName("cudaMemsetParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout dst$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dst")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *dst + * } + */ + public static final AddressLayout dst$layout() { + return dst$LAYOUT; + } + + private static final long dst$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *dst + * } + */ + public static final long dst$offset() { + return dst$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *dst + * } + */ + public static MemorySegment dst(MemorySegment struct) { + return struct.get(dst$LAYOUT, dst$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *dst + * } + */ + public static void dst(MemorySegment struct, MemorySegment fieldValue) { + struct.set(dst$LAYOUT, dst$OFFSET, fieldValue); + } + + private static final OfLong pitch$LAYOUT = (OfLong)$LAYOUT.select(groupElement("pitch")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static final OfLong pitch$layout() { + return pitch$LAYOUT; + } + + private static final long pitch$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static final long pitch$offset() { + return pitch$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static long pitch(MemorySegment struct) { + return struct.get(pitch$LAYOUT, pitch$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static void pitch(MemorySegment struct, long fieldValue) { + struct.set(pitch$LAYOUT, pitch$OFFSET, fieldValue); + } + + private static final OfInt value$LAYOUT = (OfInt)$LAYOUT.select(groupElement("value")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int value + * } + */ + public static final OfInt value$layout() { + return value$LAYOUT; + } + + private static final long value$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int value + * } + */ + public static final long value$offset() { + return value$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int value + * } + */ + public static int value(MemorySegment struct) { + return struct.get(value$LAYOUT, value$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int value + * } + */ + public static void value(MemorySegment struct, int fieldValue) { + struct.set(value$LAYOUT, value$OFFSET, fieldValue); + } + + private static final OfInt elementSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("elementSize")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int elementSize + * } + */ + public static final OfInt elementSize$layout() { + return elementSize$LAYOUT; + } + + private static final long elementSize$OFFSET = 20; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int elementSize + * } + */ + public static final long elementSize$offset() { + return elementSize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int elementSize + * } + */ + public static int elementSize(MemorySegment struct) { + return struct.get(elementSize$LAYOUT, elementSize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int elementSize + * } + */ + public static void elementSize(MemorySegment struct, int fieldValue) { + struct.set(elementSize$LAYOUT, elementSize$OFFSET, fieldValue); + } + + private static final OfLong width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("width")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static final OfLong width$layout() { + return width$LAYOUT; + } + + private static final long width$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static final long width$offset() { + return width$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static long width(MemorySegment struct) { + return struct.get(width$LAYOUT, width$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static void width(MemorySegment struct, long fieldValue) { + struct.set(width$LAYOUT, width$OFFSET, fieldValue); + } + + private static final OfLong height$LAYOUT = (OfLong)$LAYOUT.select(groupElement("height")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static final OfLong height$layout() { + return height$LAYOUT; + } + + private static final long height$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static final long height$offset() { + return height$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static long height(MemorySegment struct) { + return struct.get(height$LAYOUT, height$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static void height(MemorySegment struct, long fieldValue) { + struct.set(height$LAYOUT, height$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParamsV2.java new file mode 100644 index 0000000000..a6d6884a55 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParamsV2.java @@ -0,0 +1,373 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaMemsetParamsV2 { + * void *dst; + * size_t pitch; + * unsigned int value; + * unsigned int elementSize; + * size_t width; + * size_t height; + * } + * } + */ +public class cudaMemsetParamsV2 { + + cudaMemsetParamsV2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("dst"), + PanamaFFMAPI.C_LONG.withName("pitch"), + PanamaFFMAPI.C_INT.withName("value"), + PanamaFFMAPI.C_INT.withName("elementSize"), + PanamaFFMAPI.C_LONG.withName("width"), + PanamaFFMAPI.C_LONG.withName("height") + ).withName("cudaMemsetParamsV2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout dst$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dst")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *dst + * } + */ + public static final AddressLayout dst$layout() { + return dst$LAYOUT; + } + + private static final long dst$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *dst + * } + */ + public static final long dst$offset() { + return dst$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *dst + * } + */ + public static MemorySegment dst(MemorySegment struct) { + return struct.get(dst$LAYOUT, dst$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *dst + * } + */ + public static void dst(MemorySegment struct, MemorySegment fieldValue) { + struct.set(dst$LAYOUT, dst$OFFSET, fieldValue); + } + + private static final OfLong pitch$LAYOUT = (OfLong)$LAYOUT.select(groupElement("pitch")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static final OfLong pitch$layout() { + return pitch$LAYOUT; + } + + private static final long pitch$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static final long pitch$offset() { + return pitch$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static long pitch(MemorySegment struct) { + return struct.get(pitch$LAYOUT, pitch$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static void pitch(MemorySegment struct, long fieldValue) { + struct.set(pitch$LAYOUT, pitch$OFFSET, fieldValue); + } + + private static final OfInt value$LAYOUT = (OfInt)$LAYOUT.select(groupElement("value")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int value + * } + */ + public static final OfInt value$layout() { + return value$LAYOUT; + } + + private static final long value$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int value + * } + */ + public static final long value$offset() { + return value$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int value + * } + */ + public static int value(MemorySegment struct) { + return struct.get(value$LAYOUT, value$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int value + * } + */ + public static void value(MemorySegment struct, int fieldValue) { + struct.set(value$LAYOUT, value$OFFSET, fieldValue); + } + + private static final OfInt elementSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("elementSize")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int elementSize + * } + */ + public static final OfInt elementSize$layout() { + return elementSize$LAYOUT; + } + + private static final long elementSize$OFFSET = 20; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int elementSize + * } + */ + public static final long elementSize$offset() { + return elementSize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int elementSize + * } + */ + public static int elementSize(MemorySegment struct) { + return struct.get(elementSize$LAYOUT, elementSize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int elementSize + * } + */ + public static void elementSize(MemorySegment struct, int fieldValue) { + struct.set(elementSize$LAYOUT, elementSize$OFFSET, fieldValue); + } + + private static final OfLong width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("width")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static final OfLong width$layout() { + return width$LAYOUT; + } + + private static final long width$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static final long width$offset() { + return width$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static long width(MemorySegment struct) { + return struct.get(width$LAYOUT, width$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static void width(MemorySegment struct, long fieldValue) { + struct.set(width$LAYOUT, width$OFFSET, fieldValue); + } + + private static final OfLong height$LAYOUT = (OfLong)$LAYOUT.select(groupElement("height")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static final OfLong height$layout() { + return height$LAYOUT; + } + + private static final long height$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static final long height$offset() { + return height$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static long height(MemorySegment struct) { + return struct.get(height$LAYOUT, height$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static void height(MemorySegment struct, long fieldValue) { + struct.set(height$LAYOUT, height$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPitchedPtr.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPitchedPtr.java new file mode 100644 index 0000000000..e06294b00e --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPitchedPtr.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaPitchedPtr { + * void *ptr; + * size_t pitch; + * size_t xsize; + * size_t ysize; + * } + * } + */ +public class cudaPitchedPtr { + + cudaPitchedPtr() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("ptr"), + PanamaFFMAPI.C_LONG.withName("pitch"), + PanamaFFMAPI.C_LONG.withName("xsize"), + PanamaFFMAPI.C_LONG.withName("ysize") + ).withName("cudaPitchedPtr"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout ptr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("ptr")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *ptr + * } + */ + public static final AddressLayout ptr$layout() { + return ptr$LAYOUT; + } + + private static final long ptr$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *ptr + * } + */ + public static final long ptr$offset() { + return ptr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *ptr + * } + */ + public static MemorySegment ptr(MemorySegment struct) { + return struct.get(ptr$LAYOUT, ptr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *ptr + * } + */ + public static void ptr(MemorySegment struct, MemorySegment fieldValue) { + struct.set(ptr$LAYOUT, ptr$OFFSET, fieldValue); + } + + private static final OfLong pitch$LAYOUT = (OfLong)$LAYOUT.select(groupElement("pitch")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static final OfLong pitch$layout() { + return pitch$LAYOUT; + } + + private static final long pitch$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static final long pitch$offset() { + return pitch$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static long pitch(MemorySegment struct) { + return struct.get(pitch$LAYOUT, pitch$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t pitch + * } + */ + public static void pitch(MemorySegment struct, long fieldValue) { + struct.set(pitch$LAYOUT, pitch$OFFSET, fieldValue); + } + + private static final OfLong xsize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("xsize")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t xsize + * } + */ + public static final OfLong xsize$layout() { + return xsize$LAYOUT; + } + + private static final long xsize$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t xsize + * } + */ + public static final long xsize$offset() { + return xsize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t xsize + * } + */ + public static long xsize(MemorySegment struct) { + return struct.get(xsize$LAYOUT, xsize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t xsize + * } + */ + public static void xsize(MemorySegment struct, long fieldValue) { + struct.set(xsize$LAYOUT, xsize$OFFSET, fieldValue); + } + + private static final OfLong ysize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("ysize")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t ysize + * } + */ + public static final OfLong ysize$layout() { + return ysize$LAYOUT; + } + + private static final long ysize$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t ysize + * } + */ + public static final long ysize$offset() { + return ysize$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t ysize + * } + */ + public static long ysize(MemorySegment struct) { + return struct.get(ysize$LAYOUT, ysize$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t ysize + * } + */ + public static void ysize(MemorySegment struct, long fieldValue) { + struct.set(ysize$LAYOUT, ysize$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPointerAttributes.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPointerAttributes.java new file mode 100644 index 0000000000..2f7e7ef7f2 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPointerAttributes.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaPointerAttributes { + * enum cudaMemoryType type; + * int device; + * void *devicePointer; + * void *hostPointer; + * } + * } + */ +public class cudaPointerAttributes { + + cudaPointerAttributes() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("type"), + PanamaFFMAPI.C_INT.withName("device"), + PanamaFFMAPI.C_POINTER.withName("devicePointer"), + PanamaFFMAPI.C_POINTER.withName("hostPointer") + ).withName("cudaPointerAttributes"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaMemoryType type + * } + */ + public static final OfInt type$layout() { + return type$LAYOUT; + } + + private static final long type$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaMemoryType type + * } + */ + public static final long type$offset() { + return type$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaMemoryType type + * } + */ + public static int type(MemorySegment struct) { + return struct.get(type$LAYOUT, type$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaMemoryType type + * } + */ + public static void type(MemorySegment struct, int fieldValue) { + struct.set(type$LAYOUT, type$OFFSET, fieldValue); + } + + private static final OfInt device$LAYOUT = (OfInt)$LAYOUT.select(groupElement("device")); + + /** + * Layout for field: + * {@snippet lang=c : + * int device + * } + */ + public static final OfInt device$layout() { + return device$LAYOUT; + } + + private static final long device$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int device + * } + */ + public static final long device$offset() { + return device$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int device + * } + */ + public static int device(MemorySegment struct) { + return struct.get(device$LAYOUT, device$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int device + * } + */ + public static void device(MemorySegment struct, int fieldValue) { + struct.set(device$LAYOUT, device$OFFSET, fieldValue); + } + + private static final AddressLayout devicePointer$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("devicePointer")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *devicePointer + * } + */ + public static final AddressLayout devicePointer$layout() { + return devicePointer$LAYOUT; + } + + private static final long devicePointer$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * void *devicePointer + * } + */ + public static final long devicePointer$offset() { + return devicePointer$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *devicePointer + * } + */ + public static MemorySegment devicePointer(MemorySegment struct) { + return struct.get(devicePointer$LAYOUT, devicePointer$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *devicePointer + * } + */ + public static void devicePointer(MemorySegment struct, MemorySegment fieldValue) { + struct.set(devicePointer$LAYOUT, devicePointer$OFFSET, fieldValue); + } + + private static final AddressLayout hostPointer$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("hostPointer")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *hostPointer + * } + */ + public static final AddressLayout hostPointer$layout() { + return hostPointer$LAYOUT; + } + + private static final long hostPointer$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * void *hostPointer + * } + */ + public static final long hostPointer$offset() { + return hostPointer$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *hostPointer + * } + */ + public static MemorySegment hostPointer(MemorySegment struct) { + return struct.get(hostPointer$LAYOUT, hostPointer$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *hostPointer + * } + */ + public static void hostPointer(MemorySegment struct, MemorySegment fieldValue) { + struct.set(hostPointer$LAYOUT, hostPointer$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPos.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPos.java new file mode 100644 index 0000000000..85c75e933b --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPos.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaPos { + * size_t x; + * size_t y; + * size_t z; + * } + * } + */ +public class cudaPos { + + cudaPos() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("x"), + PanamaFFMAPI.C_LONG.withName("y"), + PanamaFFMAPI.C_LONG.withName("z") + ).withName("cudaPos"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t z + * } + */ + public static final OfLong z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t z + * } + */ + public static long z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t z + * } + */ + public static void z(MemorySegment struct, long fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceDesc.java new file mode 100644 index 0000000000..3b0f0d696f --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceDesc.java @@ -0,0 +1,1336 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaResourceDesc { + * enum cudaResourceType resType; + * union { + * struct { + * cudaArray_t array; + * } array; + * struct { + * cudaMipmappedArray_t mipmap; + * } mipmap; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } linear; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } pitch2D; + * } res; + * } + * } + */ +public class cudaResourceDesc { + + cudaResourceDesc() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("resType"), + MemoryLayout.paddingLayout(4), + cudaResourceDesc.res.layout().withName("res") + ).withName("cudaResourceDesc"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt resType$LAYOUT = (OfInt)$LAYOUT.select(groupElement("resType")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaResourceType resType + * } + */ + public static final OfInt resType$layout() { + return resType$LAYOUT; + } + + private static final long resType$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaResourceType resType + * } + */ + public static final long resType$offset() { + return resType$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaResourceType resType + * } + */ + public static int resType(MemorySegment struct) { + return struct.get(resType$LAYOUT, resType$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaResourceType resType + * } + */ + public static void resType(MemorySegment struct, int fieldValue) { + struct.set(resType$LAYOUT, resType$OFFSET, fieldValue); + } + + /** + * {@snippet lang=c : + * union { + * struct { + * cudaArray_t array; + * } array; + * struct { + * cudaMipmappedArray_t mipmap; + * } mipmap; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } linear; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } pitch2D; + * } + * } + */ + public static class res { + + res() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( + cudaResourceDesc.res.array.layout().withName("array"), + cudaResourceDesc.res.mipmap.layout().withName("mipmap"), + cudaResourceDesc.res.linear.layout().withName("linear"), + cudaResourceDesc.res.pitch2D.layout().withName("pitch2D") + ).withName("$anon$1564:5"); + + /** + * The layout of this union + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + /** + * {@snippet lang=c : + * struct { + * cudaArray_t array; + * } + * } + */ + public static class array { + + array() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("array") + ).withName("$anon$1565:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout array$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("array")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaArray_t array + * } + */ + public static final AddressLayout array$layout() { + return array$LAYOUT; + } + + private static final long array$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaArray_t array + * } + */ + public static final long array$offset() { + return array$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaArray_t array + * } + */ + public static MemorySegment array(MemorySegment struct) { + return struct.get(array$LAYOUT, array$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaArray_t array + * } + */ + public static void array(MemorySegment struct, MemorySegment fieldValue) { + struct.set(array$LAYOUT, array$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array$, long index) { + return array$.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout array$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("array")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * cudaArray_t array; + * } array + * } + */ + public static final GroupLayout array$layout() { + return array$LAYOUT; + } + + private static final long array$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * cudaArray_t array; + * } array + * } + */ + public static final long array$offset() { + return array$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * cudaArray_t array; + * } array + * } + */ + public static MemorySegment array(MemorySegment union) { + return union.asSlice(array$OFFSET, array$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * cudaArray_t array; + * } array + * } + */ + public static void array(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, array$OFFSET, array$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * struct { + * cudaMipmappedArray_t mipmap; + * } + * } + */ + public static class mipmap { + + mipmap() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("mipmap") + ).withName("$anon$1568:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout mipmap$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("mipmap")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaMipmappedArray_t mipmap + * } + */ + public static final AddressLayout mipmap$layout() { + return mipmap$LAYOUT; + } + + private static final long mipmap$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaMipmappedArray_t mipmap + * } + */ + public static final long mipmap$offset() { + return mipmap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaMipmappedArray_t mipmap + * } + */ + public static MemorySegment mipmap(MemorySegment struct) { + return struct.get(mipmap$LAYOUT, mipmap$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaMipmappedArray_t mipmap + * } + */ + public static void mipmap(MemorySegment struct, MemorySegment fieldValue) { + struct.set(mipmap$LAYOUT, mipmap$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout mipmap$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("mipmap")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * cudaMipmappedArray_t mipmap; + * } mipmap + * } + */ + public static final GroupLayout mipmap$layout() { + return mipmap$LAYOUT; + } + + private static final long mipmap$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * cudaMipmappedArray_t mipmap; + * } mipmap + * } + */ + public static final long mipmap$offset() { + return mipmap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * cudaMipmappedArray_t mipmap; + * } mipmap + * } + */ + public static MemorySegment mipmap(MemorySegment union) { + return union.asSlice(mipmap$OFFSET, mipmap$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * cudaMipmappedArray_t mipmap; + * } mipmap + * } + */ + public static void mipmap(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, mipmap$OFFSET, mipmap$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } + * } + */ + public static class linear { + + linear() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("devPtr"), + cudaChannelFormatDesc.layout().withName("desc"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_LONG.withName("sizeInBytes") + ).withName("$anon$1571:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout devPtr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("devPtr")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *devPtr + * } + */ + public static final AddressLayout devPtr$layout() { + return devPtr$LAYOUT; + } + + private static final long devPtr$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *devPtr + * } + */ + public static final long devPtr$offset() { + return devPtr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *devPtr + * } + */ + public static MemorySegment devPtr(MemorySegment struct) { + return struct.get(devPtr$LAYOUT, devPtr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *devPtr + * } + */ + public static void devPtr(MemorySegment struct, MemorySegment fieldValue) { + struct.set(devPtr$LAYOUT, devPtr$OFFSET, fieldValue); + } + + private static final GroupLayout desc$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("desc")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc desc + * } + */ + public static final GroupLayout desc$layout() { + return desc$LAYOUT; + } + + private static final long desc$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc desc + * } + */ + public static final long desc$offset() { + return desc$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc desc + * } + */ + public static MemorySegment desc(MemorySegment struct) { + return struct.asSlice(desc$OFFSET, desc$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc desc + * } + */ + public static void desc(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, desc$OFFSET, desc$LAYOUT.byteSize()); + } + + private static final OfLong sizeInBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sizeInBytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t sizeInBytes + * } + */ + public static final OfLong sizeInBytes$layout() { + return sizeInBytes$LAYOUT; + } + + private static final long sizeInBytes$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t sizeInBytes + * } + */ + public static final long sizeInBytes$offset() { + return sizeInBytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t sizeInBytes + * } + */ + public static long sizeInBytes(MemorySegment struct) { + return struct.get(sizeInBytes$LAYOUT, sizeInBytes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t sizeInBytes + * } + */ + public static void sizeInBytes(MemorySegment struct, long fieldValue) { + struct.set(sizeInBytes$LAYOUT, sizeInBytes$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout linear$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("linear")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } linear + * } + */ + public static final GroupLayout linear$layout() { + return linear$LAYOUT; + } + + private static final long linear$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } linear + * } + */ + public static final long linear$offset() { + return linear$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } linear + * } + */ + public static MemorySegment linear(MemorySegment union) { + return union.asSlice(linear$OFFSET, linear$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } linear + * } + */ + public static void linear(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, linear$OFFSET, linear$LAYOUT.byteSize()); + } + + /** + * {@snippet lang=c : + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } + * } + */ + public static class pitch2D { + + pitch2D() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("devPtr"), + cudaChannelFormatDesc.layout().withName("desc"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_LONG.withName("width"), + PanamaFFMAPI.C_LONG.withName("height"), + PanamaFFMAPI.C_LONG.withName("pitchInBytes") + ).withName("$anon$1576:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout devPtr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("devPtr")); + + /** + * Layout for field: + * {@snippet lang=c : + * void *devPtr + * } + */ + public static final AddressLayout devPtr$layout() { + return devPtr$LAYOUT; + } + + private static final long devPtr$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * void *devPtr + * } + */ + public static final long devPtr$offset() { + return devPtr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * void *devPtr + * } + */ + public static MemorySegment devPtr(MemorySegment struct) { + return struct.get(devPtr$LAYOUT, devPtr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * void *devPtr + * } + */ + public static void devPtr(MemorySegment struct, MemorySegment fieldValue) { + struct.set(devPtr$LAYOUT, devPtr$OFFSET, fieldValue); + } + + private static final GroupLayout desc$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("desc")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc desc + * } + */ + public static final GroupLayout desc$layout() { + return desc$LAYOUT; + } + + private static final long desc$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc desc + * } + */ + public static final long desc$offset() { + return desc$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc desc + * } + */ + public static MemorySegment desc(MemorySegment struct) { + return struct.asSlice(desc$OFFSET, desc$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct cudaChannelFormatDesc desc + * } + */ + public static void desc(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, desc$OFFSET, desc$LAYOUT.byteSize()); + } + + private static final OfLong width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("width")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static final OfLong width$layout() { + return width$LAYOUT; + } + + private static final long width$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static final long width$offset() { + return width$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static long width(MemorySegment struct) { + return struct.get(width$LAYOUT, width$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static void width(MemorySegment struct, long fieldValue) { + struct.set(width$LAYOUT, width$OFFSET, fieldValue); + } + + private static final OfLong height$LAYOUT = (OfLong)$LAYOUT.select(groupElement("height")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static final OfLong height$layout() { + return height$LAYOUT; + } + + private static final long height$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static final long height$offset() { + return height$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static long height(MemorySegment struct) { + return struct.get(height$LAYOUT, height$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static void height(MemorySegment struct, long fieldValue) { + struct.set(height$LAYOUT, height$OFFSET, fieldValue); + } + + private static final OfLong pitchInBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("pitchInBytes")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t pitchInBytes + * } + */ + public static final OfLong pitchInBytes$layout() { + return pitchInBytes$LAYOUT; + } + + private static final long pitchInBytes$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t pitchInBytes + * } + */ + public static final long pitchInBytes$offset() { + return pitchInBytes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t pitchInBytes + * } + */ + public static long pitchInBytes(MemorySegment struct) { + return struct.get(pitchInBytes$LAYOUT, pitchInBytes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t pitchInBytes + * } + */ + public static void pitchInBytes(MemorySegment struct, long fieldValue) { + struct.set(pitchInBytes$LAYOUT, pitchInBytes$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout pitch2D$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("pitch2D")); + + /** + * Layout for field: + * {@snippet lang=c : + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } pitch2D + * } + */ + public static final GroupLayout pitch2D$layout() { + return pitch2D$LAYOUT; + } + + private static final long pitch2D$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } pitch2D + * } + */ + public static final long pitch2D$offset() { + return pitch2D$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } pitch2D + * } + */ + public static MemorySegment pitch2D(MemorySegment union) { + return union.asSlice(pitch2D$OFFSET, pitch2D$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } pitch2D + * } + */ + public static void pitch2D(MemorySegment union, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, union, pitch2D$OFFSET, pitch2D$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this union + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } + } + + private static final GroupLayout res$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("res")); + + /** + * Layout for field: + * {@snippet lang=c : + * union { + * struct { + * cudaArray_t array; + * } array; + * struct { + * cudaMipmappedArray_t mipmap; + * } mipmap; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } linear; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } pitch2D; + * } res + * } + */ + public static final GroupLayout res$layout() { + return res$LAYOUT; + } + + private static final long res$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * union { + * struct { + * cudaArray_t array; + * } array; + * struct { + * cudaMipmappedArray_t mipmap; + * } mipmap; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } linear; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } pitch2D; + * } res + * } + */ + public static final long res$offset() { + return res$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * union { + * struct { + * cudaArray_t array; + * } array; + * struct { + * cudaMipmappedArray_t mipmap; + * } mipmap; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } linear; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } pitch2D; + * } res + * } + */ + public static MemorySegment res(MemorySegment struct) { + return struct.asSlice(res$OFFSET, res$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * union { + * struct { + * cudaArray_t array; + * } array; + * struct { + * cudaMipmappedArray_t mipmap; + * } mipmap; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t sizeInBytes; + * } linear; + * struct { + * void *devPtr; + * struct cudaChannelFormatDesc desc; + * size_t width; + * size_t height; + * size_t pitchInBytes; + * } pitch2D; + * } res + * } + */ + public static void res(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, res$OFFSET, res$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceViewDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceViewDesc.java new file mode 100644 index 0000000000..d36d721017 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceViewDesc.java @@ -0,0 +1,466 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaResourceViewDesc { + * enum cudaResourceViewFormat format; + * size_t width; + * size_t height; + * size_t depth; + * unsigned int firstMipmapLevel; + * unsigned int lastMipmapLevel; + * unsigned int firstLayer; + * unsigned int lastLayer; + * } + * } + */ +public class cudaResourceViewDesc { + + cudaResourceViewDesc() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("format"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_LONG.withName("width"), + PanamaFFMAPI.C_LONG.withName("height"), + PanamaFFMAPI.C_LONG.withName("depth"), + PanamaFFMAPI.C_INT.withName("firstMipmapLevel"), + PanamaFFMAPI.C_INT.withName("lastMipmapLevel"), + PanamaFFMAPI.C_INT.withName("firstLayer"), + PanamaFFMAPI.C_INT.withName("lastLayer") + ).withName("cudaResourceViewDesc"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt format$LAYOUT = (OfInt)$LAYOUT.select(groupElement("format")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaResourceViewFormat format + * } + */ + public static final OfInt format$layout() { + return format$LAYOUT; + } + + private static final long format$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaResourceViewFormat format + * } + */ + public static final long format$offset() { + return format$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaResourceViewFormat format + * } + */ + public static int format(MemorySegment struct) { + return struct.get(format$LAYOUT, format$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaResourceViewFormat format + * } + */ + public static void format(MemorySegment struct, int fieldValue) { + struct.set(format$LAYOUT, format$OFFSET, fieldValue); + } + + private static final OfLong width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("width")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static final OfLong width$layout() { + return width$LAYOUT; + } + + private static final long width$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static final long width$offset() { + return width$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static long width(MemorySegment struct) { + return struct.get(width$LAYOUT, width$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t width + * } + */ + public static void width(MemorySegment struct, long fieldValue) { + struct.set(width$LAYOUT, width$OFFSET, fieldValue); + } + + private static final OfLong height$LAYOUT = (OfLong)$LAYOUT.select(groupElement("height")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static final OfLong height$layout() { + return height$LAYOUT; + } + + private static final long height$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static final long height$offset() { + return height$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static long height(MemorySegment struct) { + return struct.get(height$LAYOUT, height$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t height + * } + */ + public static void height(MemorySegment struct, long fieldValue) { + struct.set(height$LAYOUT, height$OFFSET, fieldValue); + } + + private static final OfLong depth$LAYOUT = (OfLong)$LAYOUT.select(groupElement("depth")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t depth + * } + */ + public static final OfLong depth$layout() { + return depth$LAYOUT; + } + + private static final long depth$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t depth + * } + */ + public static final long depth$offset() { + return depth$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t depth + * } + */ + public static long depth(MemorySegment struct) { + return struct.get(depth$LAYOUT, depth$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t depth + * } + */ + public static void depth(MemorySegment struct, long fieldValue) { + struct.set(depth$LAYOUT, depth$OFFSET, fieldValue); + } + + private static final OfInt firstMipmapLevel$LAYOUT = (OfInt)$LAYOUT.select(groupElement("firstMipmapLevel")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int firstMipmapLevel + * } + */ + public static final OfInt firstMipmapLevel$layout() { + return firstMipmapLevel$LAYOUT; + } + + private static final long firstMipmapLevel$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int firstMipmapLevel + * } + */ + public static final long firstMipmapLevel$offset() { + return firstMipmapLevel$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int firstMipmapLevel + * } + */ + public static int firstMipmapLevel(MemorySegment struct) { + return struct.get(firstMipmapLevel$LAYOUT, firstMipmapLevel$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int firstMipmapLevel + * } + */ + public static void firstMipmapLevel(MemorySegment struct, int fieldValue) { + struct.set(firstMipmapLevel$LAYOUT, firstMipmapLevel$OFFSET, fieldValue); + } + + private static final OfInt lastMipmapLevel$LAYOUT = (OfInt)$LAYOUT.select(groupElement("lastMipmapLevel")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int lastMipmapLevel + * } + */ + public static final OfInt lastMipmapLevel$layout() { + return lastMipmapLevel$LAYOUT; + } + + private static final long lastMipmapLevel$OFFSET = 36; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int lastMipmapLevel + * } + */ + public static final long lastMipmapLevel$offset() { + return lastMipmapLevel$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int lastMipmapLevel + * } + */ + public static int lastMipmapLevel(MemorySegment struct) { + return struct.get(lastMipmapLevel$LAYOUT, lastMipmapLevel$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int lastMipmapLevel + * } + */ + public static void lastMipmapLevel(MemorySegment struct, int fieldValue) { + struct.set(lastMipmapLevel$LAYOUT, lastMipmapLevel$OFFSET, fieldValue); + } + + private static final OfInt firstLayer$LAYOUT = (OfInt)$LAYOUT.select(groupElement("firstLayer")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int firstLayer + * } + */ + public static final OfInt firstLayer$layout() { + return firstLayer$LAYOUT; + } + + private static final long firstLayer$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int firstLayer + * } + */ + public static final long firstLayer$offset() { + return firstLayer$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int firstLayer + * } + */ + public static int firstLayer(MemorySegment struct) { + return struct.get(firstLayer$LAYOUT, firstLayer$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int firstLayer + * } + */ + public static void firstLayer(MemorySegment struct, int fieldValue) { + struct.set(firstLayer$LAYOUT, firstLayer$OFFSET, fieldValue); + } + + private static final OfInt lastLayer$LAYOUT = (OfInt)$LAYOUT.select(groupElement("lastLayer")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int lastLayer + * } + */ + public static final OfInt lastLayer$layout() { + return lastLayer$LAYOUT; + } + + private static final long lastLayer$OFFSET = 44; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int lastLayer + * } + */ + public static final long lastLayer$offset() { + return lastLayer$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int lastLayer + * } + */ + public static int lastLayer(MemorySegment struct) { + return struct.get(lastLayer$LAYOUT, lastLayer$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int lastLayer + * } + */ + public static void lastLayer(MemorySegment struct, int fieldValue) { + struct.set(lastLayer$LAYOUT, lastLayer$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaStreamCallback_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaStreamCallback_t.java new file mode 100644 index 0000000000..84a8cc9346 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaStreamCallback_t.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef void (*cudaStreamCallback_t)(cudaStream_t, cudaError_t, void *) + * } + */ +public class cudaStreamCallback_t { + + cudaStreamCallback_t() { + // Should not be called directly + } + + /** + * The function pointer signature, expressed as a functional interface + */ + public interface Function { + void apply(MemorySegment stream, int status, MemorySegment userData); + } + + private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( + PanamaFFMAPI.C_POINTER, + PanamaFFMAPI.C_INT, + PanamaFFMAPI.C_POINTER + ); + + /** + * The descriptor of this function pointer + */ + public static FunctionDescriptor descriptor() { + return $DESC; + } + + private static final MethodHandle UP$MH = PanamaFFMAPI.upcallHandle(cudaStreamCallback_t.Function.class, "apply", $DESC); + + /** + * Allocates a new upcall stub, whose implementation is defined by {@code fi}. + * The lifetime of the returned segment is managed by {@code arena} + */ + public static MemorySegment allocate(cudaStreamCallback_t.Function fi, Arena arena) { + return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); + } + + private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); + + /** + * Invoke the upcall stub {@code funcPtr}, with given parameters + */ + public static void invoke(MemorySegment funcPtr,MemorySegment stream, int status, MemorySegment userData) { + try { + DOWN$MH.invokeExact(funcPtr, stream, status, userData); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaTextureDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaTextureDesc.java new file mode 100644 index 0000000000..7fcf5946df --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaTextureDesc.java @@ -0,0 +1,761 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cudaTextureDesc { + * enum cudaTextureAddressMode addressMode[3]; + * enum cudaTextureFilterMode filterMode; + * enum cudaTextureReadMode readMode; + * int sRGB; + * float borderColor[4]; + * int normalizedCoords; + * unsigned int maxAnisotropy; + * enum cudaTextureFilterMode mipmapFilterMode; + * float mipmapLevelBias; + * float minMipmapLevelClamp; + * float maxMipmapLevelClamp; + * int disableTrilinearOptimization; + * int seamlessCubemap; + * } + * } + */ +public class cudaTextureDesc { + + cudaTextureDesc() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("addressMode"), + PanamaFFMAPI.C_INT.withName("filterMode"), + PanamaFFMAPI.C_INT.withName("readMode"), + PanamaFFMAPI.C_INT.withName("sRGB"), + MemoryLayout.sequenceLayout(4, PanamaFFMAPI.C_FLOAT).withName("borderColor"), + PanamaFFMAPI.C_INT.withName("normalizedCoords"), + PanamaFFMAPI.C_INT.withName("maxAnisotropy"), + PanamaFFMAPI.C_INT.withName("mipmapFilterMode"), + PanamaFFMAPI.C_FLOAT.withName("mipmapLevelBias"), + PanamaFFMAPI.C_FLOAT.withName("minMipmapLevelClamp"), + PanamaFFMAPI.C_FLOAT.withName("maxMipmapLevelClamp"), + PanamaFFMAPI.C_INT.withName("disableTrilinearOptimization"), + PanamaFFMAPI.C_INT.withName("seamlessCubemap") + ).withName("cudaTextureDesc"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final SequenceLayout addressMode$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("addressMode")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaTextureAddressMode addressMode[3] + * } + */ + public static final SequenceLayout addressMode$layout() { + return addressMode$LAYOUT; + } + + private static final long addressMode$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaTextureAddressMode addressMode[3] + * } + */ + public static final long addressMode$offset() { + return addressMode$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaTextureAddressMode addressMode[3] + * } + */ + public static MemorySegment addressMode(MemorySegment struct) { + return struct.asSlice(addressMode$OFFSET, addressMode$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaTextureAddressMode addressMode[3] + * } + */ + public static void addressMode(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, addressMode$OFFSET, addressMode$LAYOUT.byteSize()); + } + + private static long[] addressMode$DIMS = { 3 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * enum cudaTextureAddressMode addressMode[3] + * } + */ + public static long[] addressMode$dimensions() { + return addressMode$DIMS; + } + private static final VarHandle addressMode$ELEM_HANDLE = addressMode$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * enum cudaTextureAddressMode addressMode[3] + * } + */ + public static int addressMode(MemorySegment struct, long index0) { + return (int)addressMode$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * enum cudaTextureAddressMode addressMode[3] + * } + */ + public static void addressMode(MemorySegment struct, long index0, int fieldValue) { + addressMode$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final OfInt filterMode$LAYOUT = (OfInt)$LAYOUT.select(groupElement("filterMode")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaTextureFilterMode filterMode + * } + */ + public static final OfInt filterMode$layout() { + return filterMode$LAYOUT; + } + + private static final long filterMode$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaTextureFilterMode filterMode + * } + */ + public static final long filterMode$offset() { + return filterMode$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaTextureFilterMode filterMode + * } + */ + public static int filterMode(MemorySegment struct) { + return struct.get(filterMode$LAYOUT, filterMode$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaTextureFilterMode filterMode + * } + */ + public static void filterMode(MemorySegment struct, int fieldValue) { + struct.set(filterMode$LAYOUT, filterMode$OFFSET, fieldValue); + } + + private static final OfInt readMode$LAYOUT = (OfInt)$LAYOUT.select(groupElement("readMode")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaTextureReadMode readMode + * } + */ + public static final OfInt readMode$layout() { + return readMode$LAYOUT; + } + + private static final long readMode$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaTextureReadMode readMode + * } + */ + public static final long readMode$offset() { + return readMode$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaTextureReadMode readMode + * } + */ + public static int readMode(MemorySegment struct) { + return struct.get(readMode$LAYOUT, readMode$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaTextureReadMode readMode + * } + */ + public static void readMode(MemorySegment struct, int fieldValue) { + struct.set(readMode$LAYOUT, readMode$OFFSET, fieldValue); + } + + private static final OfInt sRGB$LAYOUT = (OfInt)$LAYOUT.select(groupElement("sRGB")); + + /** + * Layout for field: + * {@snippet lang=c : + * int sRGB + * } + */ + public static final OfInt sRGB$layout() { + return sRGB$LAYOUT; + } + + private static final long sRGB$OFFSET = 20; + + /** + * Offset for field: + * {@snippet lang=c : + * int sRGB + * } + */ + public static final long sRGB$offset() { + return sRGB$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int sRGB + * } + */ + public static int sRGB(MemorySegment struct) { + return struct.get(sRGB$LAYOUT, sRGB$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int sRGB + * } + */ + public static void sRGB(MemorySegment struct, int fieldValue) { + struct.set(sRGB$LAYOUT, sRGB$OFFSET, fieldValue); + } + + private static final SequenceLayout borderColor$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("borderColor")); + + /** + * Layout for field: + * {@snippet lang=c : + * float borderColor[4] + * } + */ + public static final SequenceLayout borderColor$layout() { + return borderColor$LAYOUT; + } + + private static final long borderColor$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * float borderColor[4] + * } + */ + public static final long borderColor$offset() { + return borderColor$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float borderColor[4] + * } + */ + public static MemorySegment borderColor(MemorySegment struct) { + return struct.asSlice(borderColor$OFFSET, borderColor$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float borderColor[4] + * } + */ + public static void borderColor(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, borderColor$OFFSET, borderColor$LAYOUT.byteSize()); + } + + private static long[] borderColor$DIMS = { 4 }; + + /** + * Dimensions for array field: + * {@snippet lang=c : + * float borderColor[4] + * } + */ + public static long[] borderColor$dimensions() { + return borderColor$DIMS; + } + private static final VarHandle borderColor$ELEM_HANDLE = borderColor$LAYOUT.varHandle(sequenceElement()); + + /** + * Indexed getter for field: + * {@snippet lang=c : + * float borderColor[4] + * } + */ + public static float borderColor(MemorySegment struct, long index0) { + return (float)borderColor$ELEM_HANDLE.get(struct, 0L, index0); + } + + /** + * Indexed setter for field: + * {@snippet lang=c : + * float borderColor[4] + * } + */ + public static void borderColor(MemorySegment struct, long index0, float fieldValue) { + borderColor$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); + } + + private static final OfInt normalizedCoords$LAYOUT = (OfInt)$LAYOUT.select(groupElement("normalizedCoords")); + + /** + * Layout for field: + * {@snippet lang=c : + * int normalizedCoords + * } + */ + public static final OfInt normalizedCoords$layout() { + return normalizedCoords$LAYOUT; + } + + private static final long normalizedCoords$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * int normalizedCoords + * } + */ + public static final long normalizedCoords$offset() { + return normalizedCoords$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int normalizedCoords + * } + */ + public static int normalizedCoords(MemorySegment struct) { + return struct.get(normalizedCoords$LAYOUT, normalizedCoords$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int normalizedCoords + * } + */ + public static void normalizedCoords(MemorySegment struct, int fieldValue) { + struct.set(normalizedCoords$LAYOUT, normalizedCoords$OFFSET, fieldValue); + } + + private static final OfInt maxAnisotropy$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxAnisotropy")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int maxAnisotropy + * } + */ + public static final OfInt maxAnisotropy$layout() { + return maxAnisotropy$LAYOUT; + } + + private static final long maxAnisotropy$OFFSET = 44; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int maxAnisotropy + * } + */ + public static final long maxAnisotropy$offset() { + return maxAnisotropy$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int maxAnisotropy + * } + */ + public static int maxAnisotropy(MemorySegment struct) { + return struct.get(maxAnisotropy$LAYOUT, maxAnisotropy$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int maxAnisotropy + * } + */ + public static void maxAnisotropy(MemorySegment struct, int fieldValue) { + struct.set(maxAnisotropy$LAYOUT, maxAnisotropy$OFFSET, fieldValue); + } + + private static final OfInt mipmapFilterMode$LAYOUT = (OfInt)$LAYOUT.select(groupElement("mipmapFilterMode")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cudaTextureFilterMode mipmapFilterMode + * } + */ + public static final OfInt mipmapFilterMode$layout() { + return mipmapFilterMode$LAYOUT; + } + + private static final long mipmapFilterMode$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cudaTextureFilterMode mipmapFilterMode + * } + */ + public static final long mipmapFilterMode$offset() { + return mipmapFilterMode$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cudaTextureFilterMode mipmapFilterMode + * } + */ + public static int mipmapFilterMode(MemorySegment struct) { + return struct.get(mipmapFilterMode$LAYOUT, mipmapFilterMode$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cudaTextureFilterMode mipmapFilterMode + * } + */ + public static void mipmapFilterMode(MemorySegment struct, int fieldValue) { + struct.set(mipmapFilterMode$LAYOUT, mipmapFilterMode$OFFSET, fieldValue); + } + + private static final OfFloat mipmapLevelBias$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("mipmapLevelBias")); + + /** + * Layout for field: + * {@snippet lang=c : + * float mipmapLevelBias + * } + */ + public static final OfFloat mipmapLevelBias$layout() { + return mipmapLevelBias$LAYOUT; + } + + private static final long mipmapLevelBias$OFFSET = 52; + + /** + * Offset for field: + * {@snippet lang=c : + * float mipmapLevelBias + * } + */ + public static final long mipmapLevelBias$offset() { + return mipmapLevelBias$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float mipmapLevelBias + * } + */ + public static float mipmapLevelBias(MemorySegment struct) { + return struct.get(mipmapLevelBias$LAYOUT, mipmapLevelBias$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float mipmapLevelBias + * } + */ + public static void mipmapLevelBias(MemorySegment struct, float fieldValue) { + struct.set(mipmapLevelBias$LAYOUT, mipmapLevelBias$OFFSET, fieldValue); + } + + private static final OfFloat minMipmapLevelClamp$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("minMipmapLevelClamp")); + + /** + * Layout for field: + * {@snippet lang=c : + * float minMipmapLevelClamp + * } + */ + public static final OfFloat minMipmapLevelClamp$layout() { + return minMipmapLevelClamp$LAYOUT; + } + + private static final long minMipmapLevelClamp$OFFSET = 56; + + /** + * Offset for field: + * {@snippet lang=c : + * float minMipmapLevelClamp + * } + */ + public static final long minMipmapLevelClamp$offset() { + return minMipmapLevelClamp$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float minMipmapLevelClamp + * } + */ + public static float minMipmapLevelClamp(MemorySegment struct) { + return struct.get(minMipmapLevelClamp$LAYOUT, minMipmapLevelClamp$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float minMipmapLevelClamp + * } + */ + public static void minMipmapLevelClamp(MemorySegment struct, float fieldValue) { + struct.set(minMipmapLevelClamp$LAYOUT, minMipmapLevelClamp$OFFSET, fieldValue); + } + + private static final OfFloat maxMipmapLevelClamp$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("maxMipmapLevelClamp")); + + /** + * Layout for field: + * {@snippet lang=c : + * float maxMipmapLevelClamp + * } + */ + public static final OfFloat maxMipmapLevelClamp$layout() { + return maxMipmapLevelClamp$LAYOUT; + } + + private static final long maxMipmapLevelClamp$OFFSET = 60; + + /** + * Offset for field: + * {@snippet lang=c : + * float maxMipmapLevelClamp + * } + */ + public static final long maxMipmapLevelClamp$offset() { + return maxMipmapLevelClamp$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float maxMipmapLevelClamp + * } + */ + public static float maxMipmapLevelClamp(MemorySegment struct) { + return struct.get(maxMipmapLevelClamp$LAYOUT, maxMipmapLevelClamp$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float maxMipmapLevelClamp + * } + */ + public static void maxMipmapLevelClamp(MemorySegment struct, float fieldValue) { + struct.set(maxMipmapLevelClamp$LAYOUT, maxMipmapLevelClamp$OFFSET, fieldValue); + } + + private static final OfInt disableTrilinearOptimization$LAYOUT = (OfInt)$LAYOUT.select(groupElement("disableTrilinearOptimization")); + + /** + * Layout for field: + * {@snippet lang=c : + * int disableTrilinearOptimization + * } + */ + public static final OfInt disableTrilinearOptimization$layout() { + return disableTrilinearOptimization$LAYOUT; + } + + private static final long disableTrilinearOptimization$OFFSET = 64; + + /** + * Offset for field: + * {@snippet lang=c : + * int disableTrilinearOptimization + * } + */ + public static final long disableTrilinearOptimization$offset() { + return disableTrilinearOptimization$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int disableTrilinearOptimization + * } + */ + public static int disableTrilinearOptimization(MemorySegment struct) { + return struct.get(disableTrilinearOptimization$LAYOUT, disableTrilinearOptimization$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int disableTrilinearOptimization + * } + */ + public static void disableTrilinearOptimization(MemorySegment struct, int fieldValue) { + struct.set(disableTrilinearOptimization$LAYOUT, disableTrilinearOptimization$OFFSET, fieldValue); + } + + private static final OfInt seamlessCubemap$LAYOUT = (OfInt)$LAYOUT.select(groupElement("seamlessCubemap")); + + /** + * Layout for field: + * {@snippet lang=c : + * int seamlessCubemap + * } + */ + public static final OfInt seamlessCubemap$layout() { + return seamlessCubemap$LAYOUT; + } + + private static final long seamlessCubemap$OFFSET = 68; + + /** + * Offset for field: + * {@snippet lang=c : + * int seamlessCubemap + * } + */ + public static final long seamlessCubemap$offset() { + return seamlessCubemap$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int seamlessCubemap + * } + */ + public static int seamlessCubemap(MemorySegment struct) { + return struct.get(seamlessCubemap$LAYOUT, seamlessCubemap$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int seamlessCubemap + * } + */ + public static void seamlessCubemap(MemorySegment struct, int fieldValue) { + struct.set(seamlessCubemap$LAYOUT, seamlessCubemap$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaUUID_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaUUID_t.java new file mode 100644 index 0000000000..4e66f44ac1 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaUUID_t.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * typedef struct CUuuid_st { + * char bytes[16]; + * } cudaUUID_t + * } + */ +public class cudaUUID_t extends CUuuid_st { + + cudaUUID_t() { + // Should not be called directly + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsBruteForceIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsBruteForceIndex.java new file mode 100644 index 0000000000..494902f9f5 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsBruteForceIndex.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct { + * uintptr_t addr; + * DLDataType dtype; + * } + * } + */ +public class cuvsBruteForceIndex { + + cuvsBruteForceIndex() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("addr"), + DLDataType.layout().withName("dtype"), + MemoryLayout.paddingLayout(4) + ).withName("$anon$37:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addr")); + + /** + * Layout for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static final OfLong addr$layout() { + return addr$LAYOUT; + } + + private static final long addr$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static final long addr$offset() { + return addr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static long addr(MemorySegment struct) { + return struct.get(addr$LAYOUT, addr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static void addr(MemorySegment struct, long fieldValue) { + struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); + } + + private static final GroupLayout dtype$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dtype")); + + /** + * Layout for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static final GroupLayout dtype$layout() { + return dtype$LAYOUT; + } + + private static final long dtype$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static final long dtype$offset() { + return dtype$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static MemorySegment dtype(MemorySegment struct) { + return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static void dtype(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraCompressionParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraCompressionParams.java new file mode 100644 index 0000000000..f3b48a4f85 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraCompressionParams.java @@ -0,0 +1,373 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cuvsCagraCompressionParams { + * uint32_t pq_bits; + * uint32_t pq_dim; + * uint32_t vq_n_centers; + * uint32_t kmeans_n_iters; + * double vq_kmeans_trainset_fraction; + * double pq_kmeans_trainset_fraction; + * } + * } + */ +public class cuvsCagraCompressionParams { + + cuvsCagraCompressionParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("pq_bits"), + PanamaFFMAPI.C_INT.withName("pq_dim"), + PanamaFFMAPI.C_INT.withName("vq_n_centers"), + PanamaFFMAPI.C_INT.withName("kmeans_n_iters"), + PanamaFFMAPI.C_DOUBLE.withName("vq_kmeans_trainset_fraction"), + PanamaFFMAPI.C_DOUBLE.withName("pq_kmeans_trainset_fraction") + ).withName("cuvsCagraCompressionParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt pq_bits$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pq_bits")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t pq_bits + * } + */ + public static final OfInt pq_bits$layout() { + return pq_bits$LAYOUT; + } + + private static final long pq_bits$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t pq_bits + * } + */ + public static final long pq_bits$offset() { + return pq_bits$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t pq_bits + * } + */ + public static int pq_bits(MemorySegment struct) { + return struct.get(pq_bits$LAYOUT, pq_bits$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t pq_bits + * } + */ + public static void pq_bits(MemorySegment struct, int fieldValue) { + struct.set(pq_bits$LAYOUT, pq_bits$OFFSET, fieldValue); + } + + private static final OfInt pq_dim$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pq_dim")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t pq_dim + * } + */ + public static final OfInt pq_dim$layout() { + return pq_dim$LAYOUT; + } + + private static final long pq_dim$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t pq_dim + * } + */ + public static final long pq_dim$offset() { + return pq_dim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t pq_dim + * } + */ + public static int pq_dim(MemorySegment struct) { + return struct.get(pq_dim$LAYOUT, pq_dim$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t pq_dim + * } + */ + public static void pq_dim(MemorySegment struct, int fieldValue) { + struct.set(pq_dim$LAYOUT, pq_dim$OFFSET, fieldValue); + } + + private static final OfInt vq_n_centers$LAYOUT = (OfInt)$LAYOUT.select(groupElement("vq_n_centers")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t vq_n_centers + * } + */ + public static final OfInt vq_n_centers$layout() { + return vq_n_centers$LAYOUT; + } + + private static final long vq_n_centers$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t vq_n_centers + * } + */ + public static final long vq_n_centers$offset() { + return vq_n_centers$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t vq_n_centers + * } + */ + public static int vq_n_centers(MemorySegment struct) { + return struct.get(vq_n_centers$LAYOUT, vq_n_centers$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t vq_n_centers + * } + */ + public static void vq_n_centers(MemorySegment struct, int fieldValue) { + struct.set(vq_n_centers$LAYOUT, vq_n_centers$OFFSET, fieldValue); + } + + private static final OfInt kmeans_n_iters$LAYOUT = (OfInt)$LAYOUT.select(groupElement("kmeans_n_iters")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t kmeans_n_iters + * } + */ + public static final OfInt kmeans_n_iters$layout() { + return kmeans_n_iters$LAYOUT; + } + + private static final long kmeans_n_iters$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t kmeans_n_iters + * } + */ + public static final long kmeans_n_iters$offset() { + return kmeans_n_iters$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t kmeans_n_iters + * } + */ + public static int kmeans_n_iters(MemorySegment struct) { + return struct.get(kmeans_n_iters$LAYOUT, kmeans_n_iters$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t kmeans_n_iters + * } + */ + public static void kmeans_n_iters(MemorySegment struct, int fieldValue) { + struct.set(kmeans_n_iters$LAYOUT, kmeans_n_iters$OFFSET, fieldValue); + } + + private static final OfDouble vq_kmeans_trainset_fraction$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("vq_kmeans_trainset_fraction")); + + /** + * Layout for field: + * {@snippet lang=c : + * double vq_kmeans_trainset_fraction + * } + */ + public static final OfDouble vq_kmeans_trainset_fraction$layout() { + return vq_kmeans_trainset_fraction$LAYOUT; + } + + private static final long vq_kmeans_trainset_fraction$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * double vq_kmeans_trainset_fraction + * } + */ + public static final long vq_kmeans_trainset_fraction$offset() { + return vq_kmeans_trainset_fraction$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double vq_kmeans_trainset_fraction + * } + */ + public static double vq_kmeans_trainset_fraction(MemorySegment struct) { + return struct.get(vq_kmeans_trainset_fraction$LAYOUT, vq_kmeans_trainset_fraction$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double vq_kmeans_trainset_fraction + * } + */ + public static void vq_kmeans_trainset_fraction(MemorySegment struct, double fieldValue) { + struct.set(vq_kmeans_trainset_fraction$LAYOUT, vq_kmeans_trainset_fraction$OFFSET, fieldValue); + } + + private static final OfDouble pq_kmeans_trainset_fraction$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("pq_kmeans_trainset_fraction")); + + /** + * Layout for field: + * {@snippet lang=c : + * double pq_kmeans_trainset_fraction + * } + */ + public static final OfDouble pq_kmeans_trainset_fraction$layout() { + return pq_kmeans_trainset_fraction$LAYOUT; + } + + private static final long pq_kmeans_trainset_fraction$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * double pq_kmeans_trainset_fraction + * } + */ + public static final long pq_kmeans_trainset_fraction$offset() { + return pq_kmeans_trainset_fraction$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double pq_kmeans_trainset_fraction + * } + */ + public static double pq_kmeans_trainset_fraction(MemorySegment struct) { + return struct.get(pq_kmeans_trainset_fraction$LAYOUT, pq_kmeans_trainset_fraction$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double pq_kmeans_trainset_fraction + * } + */ + public static void pq_kmeans_trainset_fraction(MemorySegment struct, double fieldValue) { + struct.set(pq_kmeans_trainset_fraction$LAYOUT, pq_kmeans_trainset_fraction$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraExtendParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraExtendParams.java new file mode 100644 index 0000000000..7697b79b9a --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraExtendParams.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cuvsCagraExtendParams { + * uint32_t max_chunk_size; + * } + * } + */ +public class cuvsCagraExtendParams { + + cuvsCagraExtendParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("max_chunk_size") + ).withName("cuvsCagraExtendParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt max_chunk_size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("max_chunk_size")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t max_chunk_size + * } + */ + public static final OfInt max_chunk_size$layout() { + return max_chunk_size$LAYOUT; + } + + private static final long max_chunk_size$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t max_chunk_size + * } + */ + public static final long max_chunk_size$offset() { + return max_chunk_size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t max_chunk_size + * } + */ + public static int max_chunk_size(MemorySegment struct) { + return struct.get(max_chunk_size$LAYOUT, max_chunk_size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t max_chunk_size + * } + */ + public static void max_chunk_size(MemorySegment struct, int fieldValue) { + struct.set(max_chunk_size$LAYOUT, max_chunk_size$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndex.java new file mode 100644 index 0000000000..c0c813178d --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndex.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct { + * uintptr_t addr; + * DLDataType dtype; + * } + * } + */ +public class cuvsCagraIndex { + + cuvsCagraIndex() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("addr"), + DLDataType.layout().withName("dtype"), + MemoryLayout.paddingLayout(4) + ).withName("$anon$305:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addr")); + + /** + * Layout for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static final OfLong addr$layout() { + return addr$LAYOUT; + } + + private static final long addr$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static final long addr$offset() { + return addr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static long addr(MemorySegment struct) { + return struct.get(addr$LAYOUT, addr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static void addr(MemorySegment struct, long fieldValue) { + struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); + } + + private static final GroupLayout dtype$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dtype")); + + /** + * Layout for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static final GroupLayout dtype$layout() { + return dtype$LAYOUT; + } + + private static final long dtype$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static final long dtype$offset() { + return dtype$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static MemorySegment dtype(MemorySegment struct) { + return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static void dtype(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndexParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndexParams.java new file mode 100644 index 0000000000..9ba026c1c6 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndexParams.java @@ -0,0 +1,421 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cuvsCagraIndexParams { + * cuvsDistanceType metric; + * size_t intermediate_graph_degree; + * size_t graph_degree; + * enum cuvsCagraGraphBuildAlgo build_algo; + * size_t nn_descent_niter; + * cuvsCagraCompressionParams_t compression; + * cuvsIvfPqParams_t graph_build_params; + * } + * } + */ +public class cuvsCagraIndexParams { + + cuvsCagraIndexParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("metric"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_LONG.withName("intermediate_graph_degree"), + PanamaFFMAPI.C_LONG.withName("graph_degree"), + PanamaFFMAPI.C_INT.withName("build_algo"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_LONG.withName("nn_descent_niter"), + PanamaFFMAPI.C_POINTER.withName("compression"), + PanamaFFMAPI.C_POINTER.withName("graph_build_params") + ).withName("cuvsCagraIndexParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt metric$LAYOUT = (OfInt)$LAYOUT.select(groupElement("metric")); + + /** + * Layout for field: + * {@snippet lang=c : + * cuvsDistanceType metric + * } + */ + public static final OfInt metric$layout() { + return metric$LAYOUT; + } + + private static final long metric$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cuvsDistanceType metric + * } + */ + public static final long metric$offset() { + return metric$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cuvsDistanceType metric + * } + */ + public static int metric(MemorySegment struct) { + return struct.get(metric$LAYOUT, metric$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cuvsDistanceType metric + * } + */ + public static void metric(MemorySegment struct, int fieldValue) { + struct.set(metric$LAYOUT, metric$OFFSET, fieldValue); + } + + private static final OfLong intermediate_graph_degree$LAYOUT = (OfLong)$LAYOUT.select(groupElement("intermediate_graph_degree")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t intermediate_graph_degree + * } + */ + public static final OfLong intermediate_graph_degree$layout() { + return intermediate_graph_degree$LAYOUT; + } + + private static final long intermediate_graph_degree$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t intermediate_graph_degree + * } + */ + public static final long intermediate_graph_degree$offset() { + return intermediate_graph_degree$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t intermediate_graph_degree + * } + */ + public static long intermediate_graph_degree(MemorySegment struct) { + return struct.get(intermediate_graph_degree$LAYOUT, intermediate_graph_degree$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t intermediate_graph_degree + * } + */ + public static void intermediate_graph_degree(MemorySegment struct, long fieldValue) { + struct.set(intermediate_graph_degree$LAYOUT, intermediate_graph_degree$OFFSET, fieldValue); + } + + private static final OfLong graph_degree$LAYOUT = (OfLong)$LAYOUT.select(groupElement("graph_degree")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t graph_degree + * } + */ + public static final OfLong graph_degree$layout() { + return graph_degree$LAYOUT; + } + + private static final long graph_degree$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t graph_degree + * } + */ + public static final long graph_degree$offset() { + return graph_degree$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t graph_degree + * } + */ + public static long graph_degree(MemorySegment struct) { + return struct.get(graph_degree$LAYOUT, graph_degree$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t graph_degree + * } + */ + public static void graph_degree(MemorySegment struct, long fieldValue) { + struct.set(graph_degree$LAYOUT, graph_degree$OFFSET, fieldValue); + } + + private static final OfInt build_algo$LAYOUT = (OfInt)$LAYOUT.select(groupElement("build_algo")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cuvsCagraGraphBuildAlgo build_algo + * } + */ + public static final OfInt build_algo$layout() { + return build_algo$LAYOUT; + } + + private static final long build_algo$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cuvsCagraGraphBuildAlgo build_algo + * } + */ + public static final long build_algo$offset() { + return build_algo$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cuvsCagraGraphBuildAlgo build_algo + * } + */ + public static int build_algo(MemorySegment struct) { + return struct.get(build_algo$LAYOUT, build_algo$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cuvsCagraGraphBuildAlgo build_algo + * } + */ + public static void build_algo(MemorySegment struct, int fieldValue) { + struct.set(build_algo$LAYOUT, build_algo$OFFSET, fieldValue); + } + + private static final OfLong nn_descent_niter$LAYOUT = (OfLong)$LAYOUT.select(groupElement("nn_descent_niter")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t nn_descent_niter + * } + */ + public static final OfLong nn_descent_niter$layout() { + return nn_descent_niter$LAYOUT; + } + + private static final long nn_descent_niter$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t nn_descent_niter + * } + */ + public static final long nn_descent_niter$offset() { + return nn_descent_niter$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t nn_descent_niter + * } + */ + public static long nn_descent_niter(MemorySegment struct) { + return struct.get(nn_descent_niter$LAYOUT, nn_descent_niter$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t nn_descent_niter + * } + */ + public static void nn_descent_niter(MemorySegment struct, long fieldValue) { + struct.set(nn_descent_niter$LAYOUT, nn_descent_niter$OFFSET, fieldValue); + } + + private static final AddressLayout compression$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("compression")); + + /** + * Layout for field: + * {@snippet lang=c : + * cuvsCagraCompressionParams_t compression + * } + */ + public static final AddressLayout compression$layout() { + return compression$LAYOUT; + } + + private static final long compression$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * cuvsCagraCompressionParams_t compression + * } + */ + public static final long compression$offset() { + return compression$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cuvsCagraCompressionParams_t compression + * } + */ + public static MemorySegment compression(MemorySegment struct) { + return struct.get(compression$LAYOUT, compression$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cuvsCagraCompressionParams_t compression + * } + */ + public static void compression(MemorySegment struct, MemorySegment fieldValue) { + struct.set(compression$LAYOUT, compression$OFFSET, fieldValue); + } + + private static final AddressLayout graph_build_params$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("graph_build_params")); + + /** + * Layout for field: + * {@snippet lang=c : + * cuvsIvfPqParams_t graph_build_params + * } + */ + public static final AddressLayout graph_build_params$layout() { + return graph_build_params$LAYOUT; + } + + private static final long graph_build_params$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * cuvsIvfPqParams_t graph_build_params + * } + */ + public static final long graph_build_params$offset() { + return graph_build_params$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cuvsIvfPqParams_t graph_build_params + * } + */ + public static MemorySegment graph_build_params(MemorySegment struct) { + return struct.get(graph_build_params$LAYOUT, graph_build_params$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cuvsIvfPqParams_t graph_build_params + * } + */ + public static void graph_build_params(MemorySegment struct, MemorySegment fieldValue) { + struct.set(graph_build_params$LAYOUT, graph_build_params$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraSearchParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraSearchParams.java new file mode 100644 index 0000000000..b192765985 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraSearchParams.java @@ -0,0 +1,697 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cuvsCagraSearchParams { + * size_t max_queries; + * size_t itopk_size; + * size_t max_iterations; + * enum cuvsCagraSearchAlgo algo; + * size_t team_size; + * size_t search_width; + * size_t min_iterations; + * size_t thread_block_size; + * enum cuvsCagraHashMode hashmap_mode; + * size_t hashmap_min_bitlen; + * float hashmap_max_fill_rate; + * uint32_t num_random_samplings; + * uint64_t rand_xor_mask; + * } + * } + */ +public class cuvsCagraSearchParams { + + cuvsCagraSearchParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("max_queries"), + PanamaFFMAPI.C_LONG.withName("itopk_size"), + PanamaFFMAPI.C_LONG.withName("max_iterations"), + PanamaFFMAPI.C_INT.withName("algo"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_LONG.withName("team_size"), + PanamaFFMAPI.C_LONG.withName("search_width"), + PanamaFFMAPI.C_LONG.withName("min_iterations"), + PanamaFFMAPI.C_LONG.withName("thread_block_size"), + PanamaFFMAPI.C_INT.withName("hashmap_mode"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_LONG.withName("hashmap_min_bitlen"), + PanamaFFMAPI.C_FLOAT.withName("hashmap_max_fill_rate"), + PanamaFFMAPI.C_INT.withName("num_random_samplings"), + PanamaFFMAPI.C_LONG.withName("rand_xor_mask") + ).withName("cuvsCagraSearchParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong max_queries$LAYOUT = (OfLong)$LAYOUT.select(groupElement("max_queries")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t max_queries + * } + */ + public static final OfLong max_queries$layout() { + return max_queries$LAYOUT; + } + + private static final long max_queries$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t max_queries + * } + */ + public static final long max_queries$offset() { + return max_queries$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t max_queries + * } + */ + public static long max_queries(MemorySegment struct) { + return struct.get(max_queries$LAYOUT, max_queries$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t max_queries + * } + */ + public static void max_queries(MemorySegment struct, long fieldValue) { + struct.set(max_queries$LAYOUT, max_queries$OFFSET, fieldValue); + } + + private static final OfLong itopk_size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("itopk_size")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t itopk_size + * } + */ + public static final OfLong itopk_size$layout() { + return itopk_size$LAYOUT; + } + + private static final long itopk_size$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t itopk_size + * } + */ + public static final long itopk_size$offset() { + return itopk_size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t itopk_size + * } + */ + public static long itopk_size(MemorySegment struct) { + return struct.get(itopk_size$LAYOUT, itopk_size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t itopk_size + * } + */ + public static void itopk_size(MemorySegment struct, long fieldValue) { + struct.set(itopk_size$LAYOUT, itopk_size$OFFSET, fieldValue); + } + + private static final OfLong max_iterations$LAYOUT = (OfLong)$LAYOUT.select(groupElement("max_iterations")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t max_iterations + * } + */ + public static final OfLong max_iterations$layout() { + return max_iterations$LAYOUT; + } + + private static final long max_iterations$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t max_iterations + * } + */ + public static final long max_iterations$offset() { + return max_iterations$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t max_iterations + * } + */ + public static long max_iterations(MemorySegment struct) { + return struct.get(max_iterations$LAYOUT, max_iterations$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t max_iterations + * } + */ + public static void max_iterations(MemorySegment struct, long fieldValue) { + struct.set(max_iterations$LAYOUT, max_iterations$OFFSET, fieldValue); + } + + private static final OfInt algo$LAYOUT = (OfInt)$LAYOUT.select(groupElement("algo")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cuvsCagraSearchAlgo algo + * } + */ + public static final OfInt algo$layout() { + return algo$LAYOUT; + } + + private static final long algo$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cuvsCagraSearchAlgo algo + * } + */ + public static final long algo$offset() { + return algo$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cuvsCagraSearchAlgo algo + * } + */ + public static int algo(MemorySegment struct) { + return struct.get(algo$LAYOUT, algo$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cuvsCagraSearchAlgo algo + * } + */ + public static void algo(MemorySegment struct, int fieldValue) { + struct.set(algo$LAYOUT, algo$OFFSET, fieldValue); + } + + private static final OfLong team_size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("team_size")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t team_size + * } + */ + public static final OfLong team_size$layout() { + return team_size$LAYOUT; + } + + private static final long team_size$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t team_size + * } + */ + public static final long team_size$offset() { + return team_size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t team_size + * } + */ + public static long team_size(MemorySegment struct) { + return struct.get(team_size$LAYOUT, team_size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t team_size + * } + */ + public static void team_size(MemorySegment struct, long fieldValue) { + struct.set(team_size$LAYOUT, team_size$OFFSET, fieldValue); + } + + private static final OfLong search_width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("search_width")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t search_width + * } + */ + public static final OfLong search_width$layout() { + return search_width$LAYOUT; + } + + private static final long search_width$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t search_width + * } + */ + public static final long search_width$offset() { + return search_width$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t search_width + * } + */ + public static long search_width(MemorySegment struct) { + return struct.get(search_width$LAYOUT, search_width$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t search_width + * } + */ + public static void search_width(MemorySegment struct, long fieldValue) { + struct.set(search_width$LAYOUT, search_width$OFFSET, fieldValue); + } + + private static final OfLong min_iterations$LAYOUT = (OfLong)$LAYOUT.select(groupElement("min_iterations")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t min_iterations + * } + */ + public static final OfLong min_iterations$layout() { + return min_iterations$LAYOUT; + } + + private static final long min_iterations$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t min_iterations + * } + */ + public static final long min_iterations$offset() { + return min_iterations$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t min_iterations + * } + */ + public static long min_iterations(MemorySegment struct) { + return struct.get(min_iterations$LAYOUT, min_iterations$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t min_iterations + * } + */ + public static void min_iterations(MemorySegment struct, long fieldValue) { + struct.set(min_iterations$LAYOUT, min_iterations$OFFSET, fieldValue); + } + + private static final OfLong thread_block_size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("thread_block_size")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t thread_block_size + * } + */ + public static final OfLong thread_block_size$layout() { + return thread_block_size$LAYOUT; + } + + private static final long thread_block_size$OFFSET = 56; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t thread_block_size + * } + */ + public static final long thread_block_size$offset() { + return thread_block_size$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t thread_block_size + * } + */ + public static long thread_block_size(MemorySegment struct) { + return struct.get(thread_block_size$LAYOUT, thread_block_size$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t thread_block_size + * } + */ + public static void thread_block_size(MemorySegment struct, long fieldValue) { + struct.set(thread_block_size$LAYOUT, thread_block_size$OFFSET, fieldValue); + } + + private static final OfInt hashmap_mode$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hashmap_mode")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cuvsCagraHashMode hashmap_mode + * } + */ + public static final OfInt hashmap_mode$layout() { + return hashmap_mode$LAYOUT; + } + + private static final long hashmap_mode$OFFSET = 64; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cuvsCagraHashMode hashmap_mode + * } + */ + public static final long hashmap_mode$offset() { + return hashmap_mode$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cuvsCagraHashMode hashmap_mode + * } + */ + public static int hashmap_mode(MemorySegment struct) { + return struct.get(hashmap_mode$LAYOUT, hashmap_mode$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cuvsCagraHashMode hashmap_mode + * } + */ + public static void hashmap_mode(MemorySegment struct, int fieldValue) { + struct.set(hashmap_mode$LAYOUT, hashmap_mode$OFFSET, fieldValue); + } + + private static final OfLong hashmap_min_bitlen$LAYOUT = (OfLong)$LAYOUT.select(groupElement("hashmap_min_bitlen")); + + /** + * Layout for field: + * {@snippet lang=c : + * size_t hashmap_min_bitlen + * } + */ + public static final OfLong hashmap_min_bitlen$layout() { + return hashmap_min_bitlen$LAYOUT; + } + + private static final long hashmap_min_bitlen$OFFSET = 72; + + /** + * Offset for field: + * {@snippet lang=c : + * size_t hashmap_min_bitlen + * } + */ + public static final long hashmap_min_bitlen$offset() { + return hashmap_min_bitlen$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * size_t hashmap_min_bitlen + * } + */ + public static long hashmap_min_bitlen(MemorySegment struct) { + return struct.get(hashmap_min_bitlen$LAYOUT, hashmap_min_bitlen$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * size_t hashmap_min_bitlen + * } + */ + public static void hashmap_min_bitlen(MemorySegment struct, long fieldValue) { + struct.set(hashmap_min_bitlen$LAYOUT, hashmap_min_bitlen$OFFSET, fieldValue); + } + + private static final OfFloat hashmap_max_fill_rate$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("hashmap_max_fill_rate")); + + /** + * Layout for field: + * {@snippet lang=c : + * float hashmap_max_fill_rate + * } + */ + public static final OfFloat hashmap_max_fill_rate$layout() { + return hashmap_max_fill_rate$LAYOUT; + } + + private static final long hashmap_max_fill_rate$OFFSET = 80; + + /** + * Offset for field: + * {@snippet lang=c : + * float hashmap_max_fill_rate + * } + */ + public static final long hashmap_max_fill_rate$offset() { + return hashmap_max_fill_rate$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float hashmap_max_fill_rate + * } + */ + public static float hashmap_max_fill_rate(MemorySegment struct) { + return struct.get(hashmap_max_fill_rate$LAYOUT, hashmap_max_fill_rate$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float hashmap_max_fill_rate + * } + */ + public static void hashmap_max_fill_rate(MemorySegment struct, float fieldValue) { + struct.set(hashmap_max_fill_rate$LAYOUT, hashmap_max_fill_rate$OFFSET, fieldValue); + } + + private static final OfInt num_random_samplings$LAYOUT = (OfInt)$LAYOUT.select(groupElement("num_random_samplings")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t num_random_samplings + * } + */ + public static final OfInt num_random_samplings$layout() { + return num_random_samplings$LAYOUT; + } + + private static final long num_random_samplings$OFFSET = 84; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t num_random_samplings + * } + */ + public static final long num_random_samplings$offset() { + return num_random_samplings$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t num_random_samplings + * } + */ + public static int num_random_samplings(MemorySegment struct) { + return struct.get(num_random_samplings$LAYOUT, num_random_samplings$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t num_random_samplings + * } + */ + public static void num_random_samplings(MemorySegment struct, int fieldValue) { + struct.set(num_random_samplings$LAYOUT, num_random_samplings$OFFSET, fieldValue); + } + + private static final OfLong rand_xor_mask$LAYOUT = (OfLong)$LAYOUT.select(groupElement("rand_xor_mask")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint64_t rand_xor_mask + * } + */ + public static final OfLong rand_xor_mask$layout() { + return rand_xor_mask$LAYOUT; + } + + private static final long rand_xor_mask$OFFSET = 88; + + /** + * Offset for field: + * {@snippet lang=c : + * uint64_t rand_xor_mask + * } + */ + public static final long rand_xor_mask$offset() { + return rand_xor_mask$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint64_t rand_xor_mask + * } + */ + public static long rand_xor_mask(MemorySegment struct) { + return struct.get(rand_xor_mask$LAYOUT, rand_xor_mask$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint64_t rand_xor_mask + * } + */ + public static void rand_xor_mask(MemorySegment struct, long fieldValue) { + struct.set(rand_xor_mask$LAYOUT, rand_xor_mask$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSFilter.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsFilter.java similarity index 90% rename from java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSFilter.java rename to java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsFilter.java index dceaca994b..84d1450270 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CuVSFilter.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsFilter.java @@ -14,18 +14,20 @@ * limitations under the License. */ +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + package com.nvidia.cuvs.internal.panama; -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.util.function.Consumer; +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; /** * {@snippet lang=c : @@ -35,15 +37,15 @@ * } * } */ -public class CuVSFilter { +public class cuvsFilter { - CuVSFilter() { + cuvsFilter() { // Should not be called directly } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - BruteForceH.C_LONG.withName("addr"), - BruteForceH.C_INT.withName("type"), + PanamaFFMAPI.C_LONG.withName("addr"), + PanamaFFMAPI.C_INT.withName("type"), MemoryLayout.paddingLayout(4) ).withName("$anon$50:9"); diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswExtendParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswExtendParams.java new file mode 100644 index 0000000000..e82848bf4e --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswExtendParams.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cuvsHnswExtendParams { + * int num_threads; + * } + * } + */ +public class cuvsHnswExtendParams { + + cuvsHnswExtendParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("num_threads") + ).withName("cuvsHnswExtendParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt num_threads$LAYOUT = (OfInt)$LAYOUT.select(groupElement("num_threads")); + + /** + * Layout for field: + * {@snippet lang=c : + * int num_threads + * } + */ + public static final OfInt num_threads$layout() { + return num_threads$LAYOUT; + } + + private static final long num_threads$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int num_threads + * } + */ + public static final long num_threads$offset() { + return num_threads$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int num_threads + * } + */ + public static int num_threads(MemorySegment struct) { + return struct.get(num_threads$LAYOUT, num_threads$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int num_threads + * } + */ + public static void num_threads(MemorySegment struct, int fieldValue) { + struct.set(num_threads$LAYOUT, num_threads$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndex.java new file mode 100644 index 0000000000..911fa6c389 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndex.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct { + * uintptr_t addr; + * DLDataType dtype; + * } + * } + */ +public class cuvsHnswIndex { + + cuvsHnswIndex() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("addr"), + DLDataType.layout().withName("dtype"), + MemoryLayout.paddingLayout(4) + ).withName("$anon$96:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addr")); + + /** + * Layout for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static final OfLong addr$layout() { + return addr$LAYOUT; + } + + private static final long addr$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static final long addr$offset() { + return addr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static long addr(MemorySegment struct) { + return struct.get(addr$LAYOUT, addr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static void addr(MemorySegment struct, long fieldValue) { + struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); + } + + private static final GroupLayout dtype$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dtype")); + + /** + * Layout for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static final GroupLayout dtype$layout() { + return dtype$LAYOUT; + } + + private static final long dtype$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static final long dtype$offset() { + return dtype$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static MemorySegment dtype(MemorySegment struct) { + return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static void dtype(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndexParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndexParams.java new file mode 100644 index 0000000000..9dc3f7b4a3 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndexParams.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cuvsHnswIndexParams { + * enum cuvsHnswHierarchy hierarchy; + * int ef_construction; + * int num_threads; + * } + * } + */ +public class cuvsHnswIndexParams { + + cuvsHnswIndexParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("hierarchy"), + PanamaFFMAPI.C_INT.withName("ef_construction"), + PanamaFFMAPI.C_INT.withName("num_threads") + ).withName("cuvsHnswIndexParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt hierarchy$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hierarchy")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum cuvsHnswHierarchy hierarchy + * } + */ + public static final OfInt hierarchy$layout() { + return hierarchy$LAYOUT; + } + + private static final long hierarchy$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * enum cuvsHnswHierarchy hierarchy + * } + */ + public static final long hierarchy$offset() { + return hierarchy$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum cuvsHnswHierarchy hierarchy + * } + */ + public static int hierarchy(MemorySegment struct) { + return struct.get(hierarchy$LAYOUT, hierarchy$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum cuvsHnswHierarchy hierarchy + * } + */ + public static void hierarchy(MemorySegment struct, int fieldValue) { + struct.set(hierarchy$LAYOUT, hierarchy$OFFSET, fieldValue); + } + + private static final OfInt ef_construction$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ef_construction")); + + /** + * Layout for field: + * {@snippet lang=c : + * int ef_construction + * } + */ + public static final OfInt ef_construction$layout() { + return ef_construction$LAYOUT; + } + + private static final long ef_construction$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int ef_construction + * } + */ + public static final long ef_construction$offset() { + return ef_construction$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int ef_construction + * } + */ + public static int ef_construction(MemorySegment struct) { + return struct.get(ef_construction$LAYOUT, ef_construction$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int ef_construction + * } + */ + public static void ef_construction(MemorySegment struct, int fieldValue) { + struct.set(ef_construction$LAYOUT, ef_construction$OFFSET, fieldValue); + } + + private static final OfInt num_threads$LAYOUT = (OfInt)$LAYOUT.select(groupElement("num_threads")); + + /** + * Layout for field: + * {@snippet lang=c : + * int num_threads + * } + */ + public static final OfInt num_threads$layout() { + return num_threads$LAYOUT; + } + + private static final long num_threads$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * int num_threads + * } + */ + public static final long num_threads$offset() { + return num_threads$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int num_threads + * } + */ + public static int num_threads(MemorySegment struct) { + return struct.get(num_threads$LAYOUT, num_threads$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int num_threads + * } + */ + public static void num_threads(MemorySegment struct, int fieldValue) { + struct.set(num_threads$LAYOUT, num_threads$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswSearchParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswSearchParams.java new file mode 100644 index 0000000000..66c1d5e0ae --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswSearchParams.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cuvsHnswSearchParams { + * int32_t ef; + * int32_t num_threads; + * } + * } + */ +public class cuvsHnswSearchParams { + + cuvsHnswSearchParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("ef"), + PanamaFFMAPI.C_INT.withName("num_threads") + ).withName("cuvsHnswSearchParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt ef$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ef")); + + /** + * Layout for field: + * {@snippet lang=c : + * int32_t ef + * } + */ + public static final OfInt ef$layout() { + return ef$LAYOUT; + } + + private static final long ef$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int32_t ef + * } + */ + public static final long ef$offset() { + return ef$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int32_t ef + * } + */ + public static int ef(MemorySegment struct) { + return struct.get(ef$LAYOUT, ef$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int32_t ef + * } + */ + public static void ef(MemorySegment struct, int fieldValue) { + struct.set(ef$LAYOUT, ef$OFFSET, fieldValue); + } + + private static final OfInt num_threads$LAYOUT = (OfInt)$LAYOUT.select(groupElement("num_threads")); + + /** + * Layout for field: + * {@snippet lang=c : + * int32_t num_threads + * } + */ + public static final OfInt num_threads$layout() { + return num_threads$LAYOUT; + } + + private static final long num_threads$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int32_t num_threads + * } + */ + public static final long num_threads$offset() { + return num_threads$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int32_t num_threads + * } + */ + public static int num_threads(MemorySegment struct) { + return struct.get(num_threads$LAYOUT, num_threads$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int32_t num_threads + * } + */ + public static void num_threads(MemorySegment struct, int fieldValue) { + struct.set(num_threads$LAYOUT, num_threads$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndex.java new file mode 100644 index 0000000000..9f48b1259b --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndex.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct { + * uintptr_t addr; + * DLDataType dtype; + * } + * } + */ +public class cuvsIvfPqIndex { + + cuvsIvfPqIndex() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("addr"), + DLDataType.layout().withName("dtype"), + MemoryLayout.paddingLayout(4) + ).withName("$anon$227:9"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addr")); + + /** + * Layout for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static final OfLong addr$layout() { + return addr$LAYOUT; + } + + private static final long addr$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static final long addr$offset() { + return addr$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static long addr(MemorySegment struct) { + return struct.get(addr$LAYOUT, addr$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uintptr_t addr + * } + */ + public static void addr(MemorySegment struct, long fieldValue) { + struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); + } + + private static final GroupLayout dtype$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dtype")); + + /** + * Layout for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static final GroupLayout dtype$layout() { + return dtype$LAYOUT; + } + + private static final long dtype$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static final long dtype$offset() { + return dtype$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static MemorySegment dtype(MemorySegment struct) { + return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); + } + + /** + * Setter for field: + * {@snippet lang=c : + * DLDataType dtype + * } + */ + public static void dtype(MemorySegment struct, MemorySegment fieldValue) { + MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndexParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndexParams.java new file mode 100644 index 0000000000..83153a7ba1 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndexParams.java @@ -0,0 +1,653 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cuvsIvfPqIndexParams { + * cuvsDistanceType metric; + * float metric_arg; + * bool add_data_on_build; + * uint32_t n_lists; + * uint32_t kmeans_n_iters; + * double kmeans_trainset_fraction; + * uint32_t pq_bits; + * uint32_t pq_dim; + * enum codebook_gen codebook_kind; + * bool force_random_rotation; + * bool conservative_memory_allocation; + * uint32_t max_train_points_per_pq_code; + * } + * } + */ +public class cuvsIvfPqIndexParams { + + cuvsIvfPqIndexParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("metric"), + PanamaFFMAPI.C_FLOAT.withName("metric_arg"), + PanamaFFMAPI.C_BOOL.withName("add_data_on_build"), + MemoryLayout.paddingLayout(3), + PanamaFFMAPI.C_INT.withName("n_lists"), + PanamaFFMAPI.C_INT.withName("kmeans_n_iters"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_DOUBLE.withName("kmeans_trainset_fraction"), + PanamaFFMAPI.C_INT.withName("pq_bits"), + PanamaFFMAPI.C_INT.withName("pq_dim"), + PanamaFFMAPI.C_INT.withName("codebook_kind"), + PanamaFFMAPI.C_BOOL.withName("force_random_rotation"), + PanamaFFMAPI.C_BOOL.withName("conservative_memory_allocation"), + MemoryLayout.paddingLayout(2), + PanamaFFMAPI.C_INT.withName("max_train_points_per_pq_code"), + MemoryLayout.paddingLayout(4) + ).withName("cuvsIvfPqIndexParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt metric$LAYOUT = (OfInt)$LAYOUT.select(groupElement("metric")); + + /** + * Layout for field: + * {@snippet lang=c : + * cuvsDistanceType metric + * } + */ + public static final OfInt metric$layout() { + return metric$LAYOUT; + } + + private static final long metric$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cuvsDistanceType metric + * } + */ + public static final long metric$offset() { + return metric$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cuvsDistanceType metric + * } + */ + public static int metric(MemorySegment struct) { + return struct.get(metric$LAYOUT, metric$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cuvsDistanceType metric + * } + */ + public static void metric(MemorySegment struct, int fieldValue) { + struct.set(metric$LAYOUT, metric$OFFSET, fieldValue); + } + + private static final OfFloat metric_arg$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("metric_arg")); + + /** + * Layout for field: + * {@snippet lang=c : + * float metric_arg + * } + */ + public static final OfFloat metric_arg$layout() { + return metric_arg$LAYOUT; + } + + private static final long metric_arg$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * float metric_arg + * } + */ + public static final long metric_arg$offset() { + return metric_arg$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float metric_arg + * } + */ + public static float metric_arg(MemorySegment struct) { + return struct.get(metric_arg$LAYOUT, metric_arg$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float metric_arg + * } + */ + public static void metric_arg(MemorySegment struct, float fieldValue) { + struct.set(metric_arg$LAYOUT, metric_arg$OFFSET, fieldValue); + } + + private static final OfBoolean add_data_on_build$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("add_data_on_build")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool add_data_on_build + * } + */ + public static final OfBoolean add_data_on_build$layout() { + return add_data_on_build$LAYOUT; + } + + private static final long add_data_on_build$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * bool add_data_on_build + * } + */ + public static final long add_data_on_build$offset() { + return add_data_on_build$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool add_data_on_build + * } + */ + public static boolean add_data_on_build(MemorySegment struct) { + return struct.get(add_data_on_build$LAYOUT, add_data_on_build$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool add_data_on_build + * } + */ + public static void add_data_on_build(MemorySegment struct, boolean fieldValue) { + struct.set(add_data_on_build$LAYOUT, add_data_on_build$OFFSET, fieldValue); + } + + private static final OfInt n_lists$LAYOUT = (OfInt)$LAYOUT.select(groupElement("n_lists")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t n_lists + * } + */ + public static final OfInt n_lists$layout() { + return n_lists$LAYOUT; + } + + private static final long n_lists$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t n_lists + * } + */ + public static final long n_lists$offset() { + return n_lists$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t n_lists + * } + */ + public static int n_lists(MemorySegment struct) { + return struct.get(n_lists$LAYOUT, n_lists$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t n_lists + * } + */ + public static void n_lists(MemorySegment struct, int fieldValue) { + struct.set(n_lists$LAYOUT, n_lists$OFFSET, fieldValue); + } + + private static final OfInt kmeans_n_iters$LAYOUT = (OfInt)$LAYOUT.select(groupElement("kmeans_n_iters")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t kmeans_n_iters + * } + */ + public static final OfInt kmeans_n_iters$layout() { + return kmeans_n_iters$LAYOUT; + } + + private static final long kmeans_n_iters$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t kmeans_n_iters + * } + */ + public static final long kmeans_n_iters$offset() { + return kmeans_n_iters$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t kmeans_n_iters + * } + */ + public static int kmeans_n_iters(MemorySegment struct) { + return struct.get(kmeans_n_iters$LAYOUT, kmeans_n_iters$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t kmeans_n_iters + * } + */ + public static void kmeans_n_iters(MemorySegment struct, int fieldValue) { + struct.set(kmeans_n_iters$LAYOUT, kmeans_n_iters$OFFSET, fieldValue); + } + + private static final OfDouble kmeans_trainset_fraction$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("kmeans_trainset_fraction")); + + /** + * Layout for field: + * {@snippet lang=c : + * double kmeans_trainset_fraction + * } + */ + public static final OfDouble kmeans_trainset_fraction$layout() { + return kmeans_trainset_fraction$LAYOUT; + } + + private static final long kmeans_trainset_fraction$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * double kmeans_trainset_fraction + * } + */ + public static final long kmeans_trainset_fraction$offset() { + return kmeans_trainset_fraction$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double kmeans_trainset_fraction + * } + */ + public static double kmeans_trainset_fraction(MemorySegment struct) { + return struct.get(kmeans_trainset_fraction$LAYOUT, kmeans_trainset_fraction$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double kmeans_trainset_fraction + * } + */ + public static void kmeans_trainset_fraction(MemorySegment struct, double fieldValue) { + struct.set(kmeans_trainset_fraction$LAYOUT, kmeans_trainset_fraction$OFFSET, fieldValue); + } + + private static final OfInt pq_bits$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pq_bits")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t pq_bits + * } + */ + public static final OfInt pq_bits$layout() { + return pq_bits$LAYOUT; + } + + private static final long pq_bits$OFFSET = 32; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t pq_bits + * } + */ + public static final long pq_bits$offset() { + return pq_bits$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t pq_bits + * } + */ + public static int pq_bits(MemorySegment struct) { + return struct.get(pq_bits$LAYOUT, pq_bits$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t pq_bits + * } + */ + public static void pq_bits(MemorySegment struct, int fieldValue) { + struct.set(pq_bits$LAYOUT, pq_bits$OFFSET, fieldValue); + } + + private static final OfInt pq_dim$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pq_dim")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t pq_dim + * } + */ + public static final OfInt pq_dim$layout() { + return pq_dim$LAYOUT; + } + + private static final long pq_dim$OFFSET = 36; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t pq_dim + * } + */ + public static final long pq_dim$offset() { + return pq_dim$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t pq_dim + * } + */ + public static int pq_dim(MemorySegment struct) { + return struct.get(pq_dim$LAYOUT, pq_dim$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t pq_dim + * } + */ + public static void pq_dim(MemorySegment struct, int fieldValue) { + struct.set(pq_dim$LAYOUT, pq_dim$OFFSET, fieldValue); + } + + private static final OfInt codebook_kind$LAYOUT = (OfInt)$LAYOUT.select(groupElement("codebook_kind")); + + /** + * Layout for field: + * {@snippet lang=c : + * enum codebook_gen codebook_kind + * } + */ + public static final OfInt codebook_kind$layout() { + return codebook_kind$LAYOUT; + } + + private static final long codebook_kind$OFFSET = 40; + + /** + * Offset for field: + * {@snippet lang=c : + * enum codebook_gen codebook_kind + * } + */ + public static final long codebook_kind$offset() { + return codebook_kind$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * enum codebook_gen codebook_kind + * } + */ + public static int codebook_kind(MemorySegment struct) { + return struct.get(codebook_kind$LAYOUT, codebook_kind$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * enum codebook_gen codebook_kind + * } + */ + public static void codebook_kind(MemorySegment struct, int fieldValue) { + struct.set(codebook_kind$LAYOUT, codebook_kind$OFFSET, fieldValue); + } + + private static final OfBoolean force_random_rotation$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("force_random_rotation")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool force_random_rotation + * } + */ + public static final OfBoolean force_random_rotation$layout() { + return force_random_rotation$LAYOUT; + } + + private static final long force_random_rotation$OFFSET = 44; + + /** + * Offset for field: + * {@snippet lang=c : + * bool force_random_rotation + * } + */ + public static final long force_random_rotation$offset() { + return force_random_rotation$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool force_random_rotation + * } + */ + public static boolean force_random_rotation(MemorySegment struct) { + return struct.get(force_random_rotation$LAYOUT, force_random_rotation$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool force_random_rotation + * } + */ + public static void force_random_rotation(MemorySegment struct, boolean fieldValue) { + struct.set(force_random_rotation$LAYOUT, force_random_rotation$OFFSET, fieldValue); + } + + private static final OfBoolean conservative_memory_allocation$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("conservative_memory_allocation")); + + /** + * Layout for field: + * {@snippet lang=c : + * bool conservative_memory_allocation + * } + */ + public static final OfBoolean conservative_memory_allocation$layout() { + return conservative_memory_allocation$LAYOUT; + } + + private static final long conservative_memory_allocation$OFFSET = 45; + + /** + * Offset for field: + * {@snippet lang=c : + * bool conservative_memory_allocation + * } + */ + public static final long conservative_memory_allocation$offset() { + return conservative_memory_allocation$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * bool conservative_memory_allocation + * } + */ + public static boolean conservative_memory_allocation(MemorySegment struct) { + return struct.get(conservative_memory_allocation$LAYOUT, conservative_memory_allocation$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * bool conservative_memory_allocation + * } + */ + public static void conservative_memory_allocation(MemorySegment struct, boolean fieldValue) { + struct.set(conservative_memory_allocation$LAYOUT, conservative_memory_allocation$OFFSET, fieldValue); + } + + private static final OfInt max_train_points_per_pq_code$LAYOUT = (OfInt)$LAYOUT.select(groupElement("max_train_points_per_pq_code")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t max_train_points_per_pq_code + * } + */ + public static final OfInt max_train_points_per_pq_code$layout() { + return max_train_points_per_pq_code$LAYOUT; + } + + private static final long max_train_points_per_pq_code$OFFSET = 48; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t max_train_points_per_pq_code + * } + */ + public static final long max_train_points_per_pq_code$offset() { + return max_train_points_per_pq_code$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t max_train_points_per_pq_code + * } + */ + public static int max_train_points_per_pq_code(MemorySegment struct) { + return struct.get(max_train_points_per_pq_code$LAYOUT, max_train_points_per_pq_code$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t max_train_points_per_pq_code + * } + */ + public static void max_train_points_per_pq_code(MemorySegment struct, int fieldValue) { + struct.set(max_train_points_per_pq_code$LAYOUT, max_train_points_per_pq_code$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqParams.java new file mode 100644 index 0000000000..b86e49f7ee --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqParams.java @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cuvsIvfPqParams { + * cuvsIvfPqIndexParams_t ivf_pq_build_params; + * cuvsIvfPqSearchParams_t ivf_pq_search_params; + * float refinement_rate; + * } + * } + */ +public class cuvsIvfPqParams { + + cuvsIvfPqParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_POINTER.withName("ivf_pq_build_params"), + PanamaFFMAPI.C_POINTER.withName("ivf_pq_search_params"), + PanamaFFMAPI.C_FLOAT.withName("refinement_rate"), + MemoryLayout.paddingLayout(4) + ).withName("cuvsIvfPqParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final AddressLayout ivf_pq_build_params$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("ivf_pq_build_params")); + + /** + * Layout for field: + * {@snippet lang=c : + * cuvsIvfPqIndexParams_t ivf_pq_build_params + * } + */ + public static final AddressLayout ivf_pq_build_params$layout() { + return ivf_pq_build_params$LAYOUT; + } + + private static final long ivf_pq_build_params$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * cuvsIvfPqIndexParams_t ivf_pq_build_params + * } + */ + public static final long ivf_pq_build_params$offset() { + return ivf_pq_build_params$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cuvsIvfPqIndexParams_t ivf_pq_build_params + * } + */ + public static MemorySegment ivf_pq_build_params(MemorySegment struct) { + return struct.get(ivf_pq_build_params$LAYOUT, ivf_pq_build_params$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cuvsIvfPqIndexParams_t ivf_pq_build_params + * } + */ + public static void ivf_pq_build_params(MemorySegment struct, MemorySegment fieldValue) { + struct.set(ivf_pq_build_params$LAYOUT, ivf_pq_build_params$OFFSET, fieldValue); + } + + private static final AddressLayout ivf_pq_search_params$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("ivf_pq_search_params")); + + /** + * Layout for field: + * {@snippet lang=c : + * cuvsIvfPqSearchParams_t ivf_pq_search_params + * } + */ + public static final AddressLayout ivf_pq_search_params$layout() { + return ivf_pq_search_params$LAYOUT; + } + + private static final long ivf_pq_search_params$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * cuvsIvfPqSearchParams_t ivf_pq_search_params + * } + */ + public static final long ivf_pq_search_params$offset() { + return ivf_pq_search_params$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cuvsIvfPqSearchParams_t ivf_pq_search_params + * } + */ + public static MemorySegment ivf_pq_search_params(MemorySegment struct) { + return struct.get(ivf_pq_search_params$LAYOUT, ivf_pq_search_params$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cuvsIvfPqSearchParams_t ivf_pq_search_params + * } + */ + public static void ivf_pq_search_params(MemorySegment struct, MemorySegment fieldValue) { + struct.set(ivf_pq_search_params$LAYOUT, ivf_pq_search_params$OFFSET, fieldValue); + } + + private static final OfFloat refinement_rate$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("refinement_rate")); + + /** + * Layout for field: + * {@snippet lang=c : + * float refinement_rate + * } + */ + public static final OfFloat refinement_rate$layout() { + return refinement_rate$LAYOUT; + } + + private static final long refinement_rate$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * float refinement_rate + * } + */ + public static final long refinement_rate$offset() { + return refinement_rate$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float refinement_rate + * } + */ + public static float refinement_rate(MemorySegment struct) { + return struct.get(refinement_rate$LAYOUT, refinement_rate$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float refinement_rate + * } + */ + public static void refinement_rate(MemorySegment struct, float fieldValue) { + struct.set(refinement_rate$LAYOUT, refinement_rate$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqSearchParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqSearchParams.java new file mode 100644 index 0000000000..bea9076642 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqSearchParams.java @@ -0,0 +1,282 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct cuvsIvfPqSearchParams { + * uint32_t n_probes; + * cudaDataType_t lut_dtype; + * cudaDataType_t internal_distance_dtype; + * double preferred_shmem_carveout; + * } + * } + */ +public class cuvsIvfPqSearchParams { + + cuvsIvfPqSearchParams() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("n_probes"), + PanamaFFMAPI.C_INT.withName("lut_dtype"), + PanamaFFMAPI.C_INT.withName("internal_distance_dtype"), + MemoryLayout.paddingLayout(4), + PanamaFFMAPI.C_DOUBLE.withName("preferred_shmem_carveout") + ).withName("cuvsIvfPqSearchParams"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt n_probes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("n_probes")); + + /** + * Layout for field: + * {@snippet lang=c : + * uint32_t n_probes + * } + */ + public static final OfInt n_probes$layout() { + return n_probes$LAYOUT; + } + + private static final long n_probes$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * uint32_t n_probes + * } + */ + public static final long n_probes$offset() { + return n_probes$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * uint32_t n_probes + * } + */ + public static int n_probes(MemorySegment struct) { + return struct.get(n_probes$LAYOUT, n_probes$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * uint32_t n_probes + * } + */ + public static void n_probes(MemorySegment struct, int fieldValue) { + struct.set(n_probes$LAYOUT, n_probes$OFFSET, fieldValue); + } + + private static final OfInt lut_dtype$LAYOUT = (OfInt)$LAYOUT.select(groupElement("lut_dtype")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaDataType_t lut_dtype + * } + */ + public static final OfInt lut_dtype$layout() { + return lut_dtype$LAYOUT; + } + + private static final long lut_dtype$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaDataType_t lut_dtype + * } + */ + public static final long lut_dtype$offset() { + return lut_dtype$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaDataType_t lut_dtype + * } + */ + public static int lut_dtype(MemorySegment struct) { + return struct.get(lut_dtype$LAYOUT, lut_dtype$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaDataType_t lut_dtype + * } + */ + public static void lut_dtype(MemorySegment struct, int fieldValue) { + struct.set(lut_dtype$LAYOUT, lut_dtype$OFFSET, fieldValue); + } + + private static final OfInt internal_distance_dtype$LAYOUT = (OfInt)$LAYOUT.select(groupElement("internal_distance_dtype")); + + /** + * Layout for field: + * {@snippet lang=c : + * cudaDataType_t internal_distance_dtype + * } + */ + public static final OfInt internal_distance_dtype$layout() { + return internal_distance_dtype$LAYOUT; + } + + private static final long internal_distance_dtype$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * cudaDataType_t internal_distance_dtype + * } + */ + public static final long internal_distance_dtype$offset() { + return internal_distance_dtype$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * cudaDataType_t internal_distance_dtype + * } + */ + public static int internal_distance_dtype(MemorySegment struct) { + return struct.get(internal_distance_dtype$LAYOUT, internal_distance_dtype$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * cudaDataType_t internal_distance_dtype + * } + */ + public static void internal_distance_dtype(MemorySegment struct, int fieldValue) { + struct.set(internal_distance_dtype$LAYOUT, internal_distance_dtype$OFFSET, fieldValue); + } + + private static final OfDouble preferred_shmem_carveout$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("preferred_shmem_carveout")); + + /** + * Layout for field: + * {@snippet lang=c : + * double preferred_shmem_carveout + * } + */ + public static final OfDouble preferred_shmem_carveout$layout() { + return preferred_shmem_carveout$LAYOUT; + } + + private static final long preferred_shmem_carveout$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * double preferred_shmem_carveout + * } + */ + public static final long preferred_shmem_carveout$offset() { + return preferred_shmem_carveout$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double preferred_shmem_carveout + * } + */ + public static double preferred_shmem_carveout(MemorySegment struct) { + return struct.get(preferred_shmem_carveout$LAYOUT, preferred_shmem_carveout$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double preferred_shmem_carveout + * } + */ + public static void preferred_shmem_carveout(MemorySegment struct, double fieldValue) { + struct.set(preferred_shmem_carveout$LAYOUT, preferred_shmem_carveout$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/dim3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/dim3.java new file mode 100644 index 0000000000..94a23f5118 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/dim3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct dim3 { + * unsigned int x; + * unsigned int y; + * unsigned int z; + * } + * } + */ +public class dim3 { + + dim3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x"), + PanamaFFMAPI.C_INT.withName("y"), + PanamaFFMAPI.C_INT.withName("z") + ).withName("dim3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static final OfInt y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static int y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static void y(MemorySegment struct, int fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static final OfInt z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static int z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static void z(MemorySegment struct, int fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double1.java new file mode 100644 index 0000000000..575b919417 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct double1 { + * double x; + * } + * } + */ +public class double1 { + + double1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_DOUBLE.withName("x") + ).withName("double1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfDouble x$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * double x + * } + */ + public static final OfDouble x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * double x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double x + * } + */ + public static double x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double x + * } + */ + public static void x(MemorySegment struct, double fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double2.java new file mode 100644 index 0000000000..98122f39fd --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct double2 { + * double x; + * double y; + * } + * } + */ +public class double2 { + + double2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_DOUBLE.withName("x"), + PanamaFFMAPI.C_DOUBLE.withName("y") + ).withName("double2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfDouble x$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * double x + * } + */ + public static final OfDouble x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * double x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double x + * } + */ + public static double x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double x + * } + */ + public static void x(MemorySegment struct, double fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfDouble y$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * double y + * } + */ + public static final OfDouble y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * double y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double y + * } + */ + public static double y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double y + * } + */ + public static void y(MemorySegment struct, double fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double3.java new file mode 100644 index 0000000000..75aef9d92a --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct double3 { + * double x; + * double y; + * double z; + * } + * } + */ +public class double3 { + + double3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_DOUBLE.withName("x"), + PanamaFFMAPI.C_DOUBLE.withName("y"), + PanamaFFMAPI.C_DOUBLE.withName("z") + ).withName("double3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfDouble x$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * double x + * } + */ + public static final OfDouble x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * double x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double x + * } + */ + public static double x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double x + * } + */ + public static void x(MemorySegment struct, double fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfDouble y$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * double y + * } + */ + public static final OfDouble y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * double y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double y + * } + */ + public static double y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double y + * } + */ + public static void y(MemorySegment struct, double fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfDouble z$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * double z + * } + */ + public static final OfDouble z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * double z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double z + * } + */ + public static double z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double z + * } + */ + public static void z(MemorySegment struct, double fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double4.java new file mode 100644 index 0000000000..6760aa5d8a --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct double4 { + * double x; + * double y; + * double z; + * double w; + * } + * } + */ +public class double4 { + + double4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_DOUBLE.withName("x"), + PanamaFFMAPI.C_DOUBLE.withName("y"), + PanamaFFMAPI.C_DOUBLE.withName("z"), + PanamaFFMAPI.C_DOUBLE.withName("w") + ).withName("double4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfDouble x$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * double x + * } + */ + public static final OfDouble x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * double x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double x + * } + */ + public static double x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double x + * } + */ + public static void x(MemorySegment struct, double fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfDouble y$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * double y + * } + */ + public static final OfDouble y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * double y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double y + * } + */ + public static double y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double y + * } + */ + public static void y(MemorySegment struct, double fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfDouble z$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * double z + * } + */ + public static final OfDouble z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * double z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double z + * } + */ + public static double z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double z + * } + */ + public static void z(MemorySegment struct, double fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfDouble w$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * double w + * } + */ + public static final OfDouble w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * double w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * double w + * } + */ + public static double w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * double w + * } + */ + public static void w(MemorySegment struct, double fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float1.java new file mode 100644 index 0000000000..dc3270e28f --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct float1 { + * float x; + * } + * } + */ +public class float1 { + + float1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_FLOAT.withName("x") + ).withName("float1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfFloat x$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * float x + * } + */ + public static final OfFloat x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * float x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float x + * } + */ + public static float x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float x + * } + */ + public static void x(MemorySegment struct, float fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float2.java new file mode 100644 index 0000000000..8362997ea8 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct float2 { + * float x; + * float y; + * } + * } + */ +public class float2 { + + float2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_FLOAT.withName("x"), + PanamaFFMAPI.C_FLOAT.withName("y") + ).withName("float2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfFloat x$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * float x + * } + */ + public static final OfFloat x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * float x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float x + * } + */ + public static float x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float x + * } + */ + public static void x(MemorySegment struct, float fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfFloat y$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * float y + * } + */ + public static final OfFloat y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * float y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float y + * } + */ + public static float y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float y + * } + */ + public static void y(MemorySegment struct, float fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float3.java new file mode 100644 index 0000000000..c10ce7b533 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct float3 { + * float x; + * float y; + * float z; + * } + * } + */ +public class float3 { + + float3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_FLOAT.withName("x"), + PanamaFFMAPI.C_FLOAT.withName("y"), + PanamaFFMAPI.C_FLOAT.withName("z") + ).withName("float3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfFloat x$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * float x + * } + */ + public static final OfFloat x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * float x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float x + * } + */ + public static float x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float x + * } + */ + public static void x(MemorySegment struct, float fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfFloat y$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * float y + * } + */ + public static final OfFloat y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * float y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float y + * } + */ + public static float y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float y + * } + */ + public static void y(MemorySegment struct, float fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfFloat z$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * float z + * } + */ + public static final OfFloat z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * float z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float z + * } + */ + public static float z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float z + * } + */ + public static void z(MemorySegment struct, float fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float4.java new file mode 100644 index 0000000000..327bc75734 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct float4 { + * float x; + * float y; + * float z; + * float w; + * } + * } + */ +public class float4 { + + float4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_FLOAT.withName("x"), + PanamaFFMAPI.C_FLOAT.withName("y"), + PanamaFFMAPI.C_FLOAT.withName("z"), + PanamaFFMAPI.C_FLOAT.withName("w") + ).withName("float4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfFloat x$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * float x + * } + */ + public static final OfFloat x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * float x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float x + * } + */ + public static float x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float x + * } + */ + public static void x(MemorySegment struct, float fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfFloat y$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * float y + * } + */ + public static final OfFloat y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * float y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float y + * } + */ + public static float y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float y + * } + */ + public static void y(MemorySegment struct, float fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfFloat z$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * float z + * } + */ + public static final OfFloat z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * float z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float z + * } + */ + public static float z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float z + * } + */ + public static void z(MemorySegment struct, float fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfFloat w$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * float w + * } + */ + public static final OfFloat w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * float w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * float w + * } + */ + public static float w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * float w + * } + */ + public static void w(MemorySegment struct, float fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int1.java new file mode 100644 index 0000000000..46a454be8b --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct int1 { + * int x; + * } + * } + */ +public class int1 { + + int1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x") + ).withName("int1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int2.java new file mode 100644 index 0000000000..a435e99805 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct int2 { + * int x; + * int y; + * } + * } + */ +public class int2 { + + int2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x"), + PanamaFFMAPI.C_INT.withName("y") + ).withName("int2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * int y + * } + */ + public static final OfInt y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int y + * } + */ + public static int y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int y + * } + */ + public static void y(MemorySegment struct, int fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int3.java new file mode 100644 index 0000000000..6d538c47b2 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct int3 { + * int x; + * int y; + * int z; + * } + * } + */ +public class int3 { + + int3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x"), + PanamaFFMAPI.C_INT.withName("y"), + PanamaFFMAPI.C_INT.withName("z") + ).withName("int3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * int y + * } + */ + public static final OfInt y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int y + * } + */ + public static int y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int y + * } + */ + public static void y(MemorySegment struct, int fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * int z + * } + */ + public static final OfInt z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * int z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int z + * } + */ + public static int z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int z + * } + */ + public static void z(MemorySegment struct, int fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int4.java new file mode 100644 index 0000000000..79b7f4a4ec --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct int4 { + * int x; + * int y; + * int z; + * int w; + * } + * } + */ +public class int4 { + + int4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x"), + PanamaFFMAPI.C_INT.withName("y"), + PanamaFFMAPI.C_INT.withName("z"), + PanamaFFMAPI.C_INT.withName("w") + ).withName("int4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * int y + * } + */ + public static final OfInt y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * int y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int y + * } + */ + public static int y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int y + * } + */ + public static void y(MemorySegment struct, int fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * int z + * } + */ + public static final OfInt z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * int z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int z + * } + */ + public static int z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int z + * } + */ + public static void z(MemorySegment struct, int fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfInt w$LAYOUT = (OfInt)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * int w + * } + */ + public static final OfInt w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * int w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * int w + * } + */ + public static int w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * int w + * } + */ + public static void w(MemorySegment struct, int fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long1.java new file mode 100644 index 0000000000..3803bbd7d3 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct long1 { + * long x; + * } + * } + */ +public class long1 { + + long1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("x") + ).withName("long1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long2.java new file mode 100644 index 0000000000..1570cf2f74 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct long2 { + * long x; + * long y; + * } + * } + */ +public class long2 { + + long2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("x"), + PanamaFFMAPI.C_LONG.withName("y") + ).withName("long2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long3.java new file mode 100644 index 0000000000..da4fe39901 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct long3 { + * long x; + * long y; + * long z; + * } + * } + */ +public class long3 { + + long3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("x"), + PanamaFFMAPI.C_LONG.withName("y"), + PanamaFFMAPI.C_LONG.withName("z") + ).withName("long3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * long z + * } + */ + public static final OfLong z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * long z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long z + * } + */ + public static long z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long z + * } + */ + public static void z(MemorySegment struct, long fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long4.java new file mode 100644 index 0000000000..43095d882d --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct long4 { + * long x; + * long y; + * long z; + * long w; + * } + * } + */ +public class long4 { + + long4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("x"), + PanamaFFMAPI.C_LONG.withName("y"), + PanamaFFMAPI.C_LONG.withName("z"), + PanamaFFMAPI.C_LONG.withName("w") + ).withName("long4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * long z + * } + */ + public static final OfLong z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * long z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long z + * } + */ + public static long z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long z + * } + */ + public static void z(MemorySegment struct, long fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfLong w$LAYOUT = (OfLong)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * long w + * } + */ + public static final OfLong w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * long w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long w + * } + */ + public static long w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long w + * } + */ + public static void w(MemorySegment struct, long fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong1.java new file mode 100644 index 0000000000..d1c3dcbcfd --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct longlong1 { + * long long x; + * } + * } + */ +public class longlong1 { + + longlong1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("x") + ).withName("longlong1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong2.java new file mode 100644 index 0000000000..ec97651d98 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct longlong2 { + * long long x; + * long long y; + * } + * } + */ +public class longlong2 { + + longlong2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("x"), + PanamaFFMAPI.C_LONG_LONG.withName("y") + ).withName("longlong2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * long long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong3.java new file mode 100644 index 0000000000..24be48e3f4 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct longlong3 { + * long long x; + * long long y; + * long long z; + * } + * } + */ +public class longlong3 { + + longlong3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("x"), + PanamaFFMAPI.C_LONG_LONG.withName("y"), + PanamaFFMAPI.C_LONG_LONG.withName("z") + ).withName("longlong3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * long long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long z + * } + */ + public static final OfLong z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * long long z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long z + * } + */ + public static long z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long z + * } + */ + public static void z(MemorySegment struct, long fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong4.java new file mode 100644 index 0000000000..7aa417c7c4 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct longlong4 { + * long long x; + * long long y; + * long long z; + * long long w; + * } + * } + */ +public class longlong4 { + + longlong4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("x"), + PanamaFFMAPI.C_LONG_LONG.withName("y"), + PanamaFFMAPI.C_LONG_LONG.withName("z"), + PanamaFFMAPI.C_LONG_LONG.withName("w") + ).withName("longlong4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * long long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * long long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long z + * } + */ + public static final OfLong z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * long long z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long z + * } + */ + public static long z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long z + * } + */ + public static void z(MemorySegment struct, long fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfLong w$LAYOUT = (OfLong)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * long long w + * } + */ + public static final OfLong w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * long long w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * long long w + * } + */ + public static long w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * long long w + * } + */ + public static void w(MemorySegment struct, long fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/MaxAlignT.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/max_align_t.java similarity index 90% rename from java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/MaxAlignT.java rename to java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/max_align_t.java index d07c524dbe..5bad1b4e79 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/MaxAlignT.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/max_align_t.java @@ -14,17 +14,20 @@ * limitations under the License. */ +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + package com.nvidia.cuvs.internal.panama; -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout.OfLong; -import java.util.function.Consumer; +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; /** * {@snippet lang=c : @@ -34,14 +37,14 @@ * } * } */ -public class MaxAlignT { +public class max_align_t { - MaxAlignT() { + max_align_t() { // Should not be called directly } private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - DlpackH.C_LONG_LONG.withName("__clang_max_align_nonce1"), + PanamaFFMAPI.C_LONG_LONG.withName("__clang_max_align_nonce1"), MemoryLayout.paddingLayout(24) ).withName("$anon$19:9"); diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short1.java new file mode 100644 index 0000000000..97507bc89d --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct short1 { + * short x; + * } + * } + */ +public class short1 { + + short1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_SHORT.withName("x") + ).withName("short1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * short x + * } + */ + public static final OfShort x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * short x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short x + * } + */ + public static short x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short x + * } + */ + public static void x(MemorySegment struct, short fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short2.java new file mode 100644 index 0000000000..a28a7daf36 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct short2 { + * short x; + * short y; + * } + * } + */ +public class short2 { + + short2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_SHORT.withName("x"), + PanamaFFMAPI.C_SHORT.withName("y") + ).withName("short2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * short x + * } + */ + public static final OfShort x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * short x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short x + * } + */ + public static short x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short x + * } + */ + public static void x(MemorySegment struct, short fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * short y + * } + */ + public static final OfShort y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * short y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short y + * } + */ + public static short y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short y + * } + */ + public static void y(MemorySegment struct, short fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short3.java new file mode 100644 index 0000000000..cc90c7d1de --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct short3 { + * short x; + * short y; + * short z; + * } + * } + */ +public class short3 { + + short3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_SHORT.withName("x"), + PanamaFFMAPI.C_SHORT.withName("y"), + PanamaFFMAPI.C_SHORT.withName("z") + ).withName("short3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * short x + * } + */ + public static final OfShort x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * short x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short x + * } + */ + public static short x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short x + * } + */ + public static void x(MemorySegment struct, short fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * short y + * } + */ + public static final OfShort y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * short y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short y + * } + */ + public static short y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short y + * } + */ + public static void y(MemorySegment struct, short fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfShort z$LAYOUT = (OfShort)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * short z + * } + */ + public static final OfShort z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * short z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short z + * } + */ + public static short z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short z + * } + */ + public static void z(MemorySegment struct, short fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short4.java new file mode 100644 index 0000000000..de94846397 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct short4 { + * short x; + * short y; + * short z; + * short w; + * } + * } + */ +public class short4 { + + short4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_SHORT.withName("x"), + PanamaFFMAPI.C_SHORT.withName("y"), + PanamaFFMAPI.C_SHORT.withName("z"), + PanamaFFMAPI.C_SHORT.withName("w") + ).withName("short4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * short x + * } + */ + public static final OfShort x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * short x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short x + * } + */ + public static short x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short x + * } + */ + public static void x(MemorySegment struct, short fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * short y + * } + */ + public static final OfShort y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * short y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short y + * } + */ + public static short y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short y + * } + */ + public static void y(MemorySegment struct, short fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfShort z$LAYOUT = (OfShort)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * short z + * } + */ + public static final OfShort z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * short z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short z + * } + */ + public static short z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short z + * } + */ + public static void z(MemorySegment struct, short fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfShort w$LAYOUT = (OfShort)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * short w + * } + */ + public static final OfShort w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 6; + + /** + * Offset for field: + * {@snippet lang=c : + * short w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * short w + * } + */ + public static short w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * short w + * } + */ + public static void w(MemorySegment struct, short fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar1.java new file mode 100644 index 0000000000..efbae3cabc --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct uchar1 { + * unsigned char x; + * } + * } + */ +public class uchar1 { + + uchar1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_CHAR.withName("x") + ).withName("uchar1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static final OfByte x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static byte x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static void x(MemorySegment struct, byte fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar2.java new file mode 100644 index 0000000000..45a30f3017 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct uchar2 { + * unsigned char x; + * unsigned char y; + * } + * } + */ +public class uchar2 { + + uchar2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_CHAR.withName("x"), + PanamaFFMAPI.C_CHAR.withName("y") + ).withName("uchar2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static final OfByte x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static byte x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static void x(MemorySegment struct, byte fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static final OfByte y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static byte y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static void y(MemorySegment struct, byte fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar3.java new file mode 100644 index 0000000000..5d25e05701 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct uchar3 { + * unsigned char x; + * unsigned char y; + * unsigned char z; + * } + * } + */ +public class uchar3 { + + uchar3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_CHAR.withName("x"), + PanamaFFMAPI.C_CHAR.withName("y"), + PanamaFFMAPI.C_CHAR.withName("z") + ).withName("uchar3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static final OfByte x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static byte x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static void x(MemorySegment struct, byte fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static final OfByte y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static byte y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static void y(MemorySegment struct, byte fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfByte z$LAYOUT = (OfByte)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char z + * } + */ + public static final OfByte z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char z + * } + */ + public static byte z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char z + * } + */ + public static void z(MemorySegment struct, byte fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar4.java new file mode 100644 index 0000000000..02de3c8418 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct uchar4 { + * unsigned char x; + * unsigned char y; + * unsigned char z; + * unsigned char w; + * } + * } + */ +public class uchar4 { + + uchar4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_CHAR.withName("x"), + PanamaFFMAPI.C_CHAR.withName("y"), + PanamaFFMAPI.C_CHAR.withName("z"), + PanamaFFMAPI.C_CHAR.withName("w") + ).withName("uchar4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static final OfByte x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static byte x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char x + * } + */ + public static void x(MemorySegment struct, byte fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static final OfByte y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 1; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static byte y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char y + * } + */ + public static void y(MemorySegment struct, byte fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfByte z$LAYOUT = (OfByte)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char z + * } + */ + public static final OfByte z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char z + * } + */ + public static byte z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char z + * } + */ + public static void z(MemorySegment struct, byte fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfByte w$LAYOUT = (OfByte)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned char w + * } + */ + public static final OfByte w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 3; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned char w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned char w + * } + */ + public static byte w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned char w + * } + */ + public static void w(MemorySegment struct, byte fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint1.java new file mode 100644 index 0000000000..8fee0dd4c7 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct uint1 { + * unsigned int x; + * } + * } + */ +public class uint1 { + + uint1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x") + ).withName("uint1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint2.java new file mode 100644 index 0000000000..ead3d501b5 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct uint2 { + * unsigned int x; + * unsigned int y; + * } + * } + */ +public class uint2 { + + uint2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x"), + PanamaFFMAPI.C_INT.withName("y") + ).withName("uint2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static final OfInt y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static int y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static void y(MemorySegment struct, int fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint3.java new file mode 100644 index 0000000000..b27b5be9fa --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct uint3 { + * unsigned int x; + * unsigned int y; + * unsigned int z; + * } + * } + */ +public class uint3 { + + uint3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x"), + PanamaFFMAPI.C_INT.withName("y"), + PanamaFFMAPI.C_INT.withName("z") + ).withName("uint3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static final OfInt y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static int y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static void y(MemorySegment struct, int fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static final OfInt z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static int z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static void z(MemorySegment struct, int fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint4.java new file mode 100644 index 0000000000..271644377f --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct uint4 { + * unsigned int x; + * unsigned int y; + * unsigned int z; + * unsigned int w; + * } + * } + */ +public class uint4 { + + uint4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_INT.withName("x"), + PanamaFFMAPI.C_INT.withName("y"), + PanamaFFMAPI.C_INT.withName("z"), + PanamaFFMAPI.C_INT.withName("w") + ).withName("uint4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final OfInt x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static int x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int x + * } + */ + public static void x(MemorySegment struct, int fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static final OfInt y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static int y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int y + * } + */ + public static void y(MemorySegment struct, int fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static final OfInt z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static int z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int z + * } + */ + public static void z(MemorySegment struct, int fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfInt w$LAYOUT = (OfInt)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned int w + * } + */ + public static final OfInt w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 12; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned int w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned int w + * } + */ + public static int w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned int w + * } + */ + public static void w(MemorySegment struct, int fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong1.java new file mode 100644 index 0000000000..5d620bd467 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ulong1 { + * unsigned long x; + * } + * } + */ +public class ulong1 { + + ulong1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("x") + ).withName("ulong1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong2.java new file mode 100644 index 0000000000..bb442743d2 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ulong2 { + * unsigned long x; + * unsigned long y; + * } + * } + */ +public class ulong2 { + + ulong2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("x"), + PanamaFFMAPI.C_LONG.withName("y") + ).withName("ulong2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong3.java new file mode 100644 index 0000000000..983e694b6f --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ulong3 { + * unsigned long x; + * unsigned long y; + * unsigned long z; + * } + * } + */ +public class ulong3 { + + ulong3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("x"), + PanamaFFMAPI.C_LONG.withName("y"), + PanamaFFMAPI.C_LONG.withName("z") + ).withName("ulong3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long z + * } + */ + public static final OfLong z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long z + * } + */ + public static long z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long z + * } + */ + public static void z(MemorySegment struct, long fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong4.java new file mode 100644 index 0000000000..19f33badbd --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ulong4 { + * unsigned long x; + * unsigned long y; + * unsigned long z; + * unsigned long w; + * } + * } + */ +public class ulong4 { + + ulong4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG.withName("x"), + PanamaFFMAPI.C_LONG.withName("y"), + PanamaFFMAPI.C_LONG.withName("z"), + PanamaFFMAPI.C_LONG.withName("w") + ).withName("ulong4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long z + * } + */ + public static final OfLong z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long z + * } + */ + public static long z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long z + * } + */ + public static void z(MemorySegment struct, long fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfLong w$LAYOUT = (OfLong)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long w + * } + */ + public static final OfLong w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long w + * } + */ + public static long w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long w + * } + */ + public static void w(MemorySegment struct, long fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong1.java new file mode 100644 index 0000000000..8b2918012b --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ulonglong1 { + * unsigned long long x; + * } + * } + */ +public class ulonglong1 { + + ulonglong1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("x") + ).withName("ulonglong1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong2.java new file mode 100644 index 0000000000..276af59c3a --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ulonglong2 { + * unsigned long long x; + * unsigned long long y; + * } + * } + */ +public class ulonglong2 { + + ulonglong2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("x"), + PanamaFFMAPI.C_LONG_LONG.withName("y") + ).withName("ulonglong2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong3.java new file mode 100644 index 0000000000..3fefbeaa8a --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ulonglong3 { + * unsigned long long x; + * unsigned long long y; + * unsigned long long z; + * } + * } + */ +public class ulonglong3 { + + ulonglong3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("x"), + PanamaFFMAPI.C_LONG_LONG.withName("y"), + PanamaFFMAPI.C_LONG_LONG.withName("z") + ).withName("ulonglong3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long z + * } + */ + public static final OfLong z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long z + * } + */ + public static long z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long z + * } + */ + public static void z(MemorySegment struct, long fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong4.java new file mode 100644 index 0000000000..8eed05a1fa --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ulonglong4 { + * unsigned long long x; + * unsigned long long y; + * unsigned long long z; + * unsigned long long w; + * } + * } + */ +public class ulonglong4 { + + ulonglong4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_LONG_LONG.withName("x"), + PanamaFFMAPI.C_LONG_LONG.withName("y"), + PanamaFFMAPI.C_LONG_LONG.withName("z"), + PanamaFFMAPI.C_LONG_LONG.withName("w") + ).withName("ulonglong4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static final OfLong x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static long x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long x + * } + */ + public static void x(MemorySegment struct, long fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static final OfLong y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 8; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static long y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long y + * } + */ + public static void y(MemorySegment struct, long fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long z + * } + */ + public static final OfLong z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 16; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long z + * } + */ + public static long z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long z + * } + */ + public static void z(MemorySegment struct, long fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfLong w$LAYOUT = (OfLong)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned long long w + * } + */ + public static final OfLong w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 24; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned long long w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned long long w + * } + */ + public static long w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned long long w + * } + */ + public static void w(MemorySegment struct, long fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort1.java new file mode 100644 index 0000000000..db70a8acc9 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort1.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ushort1 { + * unsigned short x; + * } + * } + */ +public class ushort1 { + + ushort1() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_SHORT.withName("x") + ).withName("ushort1"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static final OfShort x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static short x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static void x(MemorySegment struct, short fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort2.java new file mode 100644 index 0000000000..d3fe7461b7 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort2.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ushort2 { + * unsigned short x; + * unsigned short y; + * } + * } + */ +public class ushort2 { + + ushort2() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_SHORT.withName("x"), + PanamaFFMAPI.C_SHORT.withName("y") + ).withName("ushort2"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static final OfShort x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static short x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static void x(MemorySegment struct, short fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static final OfShort y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static short y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static void y(MemorySegment struct, short fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort3.java new file mode 100644 index 0000000000..fec929d453 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort3.java @@ -0,0 +1,235 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ushort3 { + * unsigned short x; + * unsigned short y; + * unsigned short z; + * } + * } + */ +public class ushort3 { + + ushort3() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_SHORT.withName("x"), + PanamaFFMAPI.C_SHORT.withName("y"), + PanamaFFMAPI.C_SHORT.withName("z") + ).withName("ushort3"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static final OfShort x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static short x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static void x(MemorySegment struct, short fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static final OfShort y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static short y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static void y(MemorySegment struct, short fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfShort z$LAYOUT = (OfShort)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short z + * } + */ + public static final OfShort z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short z + * } + */ + public static short z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short z + * } + */ + public static void z(MemorySegment struct, short fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort4.java new file mode 100644 index 0000000000..c39c84b334 --- /dev/null +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort4.java @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY +// Generated by jextract + +package com.nvidia.cuvs.internal.panama; + +import java.lang.invoke.*; +import java.lang.foreign.*; +import java.nio.ByteOrder; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.MemoryLayout.PathElement.*; + +/** + * {@snippet lang=c : + * struct ushort4 { + * unsigned short x; + * unsigned short y; + * unsigned short z; + * unsigned short w; + * } + * } + */ +public class ushort4 { + + ushort4() { + // Should not be called directly + } + + private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( + PanamaFFMAPI.C_SHORT.withName("x"), + PanamaFFMAPI.C_SHORT.withName("y"), + PanamaFFMAPI.C_SHORT.withName("z"), + PanamaFFMAPI.C_SHORT.withName("w") + ).withName("ushort4"); + + /** + * The layout of this struct + */ + public static final GroupLayout layout() { + return $LAYOUT; + } + + private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static final OfShort x$layout() { + return x$LAYOUT; + } + + private static final long x$OFFSET = 0; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static final long x$offset() { + return x$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static short x(MemorySegment struct) { + return struct.get(x$LAYOUT, x$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short x + * } + */ + public static void x(MemorySegment struct, short fieldValue) { + struct.set(x$LAYOUT, x$OFFSET, fieldValue); + } + + private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static final OfShort y$layout() { + return y$LAYOUT; + } + + private static final long y$OFFSET = 2; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static final long y$offset() { + return y$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static short y(MemorySegment struct) { + return struct.get(y$LAYOUT, y$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short y + * } + */ + public static void y(MemorySegment struct, short fieldValue) { + struct.set(y$LAYOUT, y$OFFSET, fieldValue); + } + + private static final OfShort z$LAYOUT = (OfShort)$LAYOUT.select(groupElement("z")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short z + * } + */ + public static final OfShort z$layout() { + return z$LAYOUT; + } + + private static final long z$OFFSET = 4; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short z + * } + */ + public static final long z$offset() { + return z$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short z + * } + */ + public static short z(MemorySegment struct) { + return struct.get(z$LAYOUT, z$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short z + * } + */ + public static void z(MemorySegment struct, short fieldValue) { + struct.set(z$LAYOUT, z$OFFSET, fieldValue); + } + + private static final OfShort w$LAYOUT = (OfShort)$LAYOUT.select(groupElement("w")); + + /** + * Layout for field: + * {@snippet lang=c : + * unsigned short w + * } + */ + public static final OfShort w$layout() { + return w$LAYOUT; + } + + private static final long w$OFFSET = 6; + + /** + * Offset for field: + * {@snippet lang=c : + * unsigned short w + * } + */ + public static final long w$offset() { + return w$OFFSET; + } + + /** + * Getter for field: + * {@snippet lang=c : + * unsigned short w + * } + */ + public static short w(MemorySegment struct) { + return struct.get(w$LAYOUT, w$OFFSET); + } + + /** + * Setter for field: + * {@snippet lang=c : + * unsigned short w + * } + */ + public static void w(MemorySegment struct, short fieldValue) { + struct.set(w$LAYOUT, w$OFFSET, fieldValue); + } + + /** + * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. + * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} + */ + public static MemorySegment asSlice(MemorySegment array, long index) { + return array.asSlice(layout().byteSize() * index); + } + + /** + * The size (in bytes) of this struct + */ + public static long sizeof() { return layout().byteSize(); } + + /** + * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} + */ + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(layout()); + } + + /** + * Allocate an array of size {@code elementCount} using {@code allocator}. + * The returned segment has size {@code elementCount * layout().byteSize()}. + */ + public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { + return reinterpret(addr, 1, arena, cleanup); + } + + /** + * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). + * The returned segment has size {@code elementCount * layout().byteSize()} + */ + public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { + return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); + } +} From cc745b7749445392632e65480eba01f6ee9bf1f4 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Fri, 11 Apr 2025 16:59:06 -0400 Subject: [PATCH 12/26] plug in new binding classes --- .../cuvs/internal/BruteForceIndexImpl.java | 21 +++-- .../nvidia/cuvs/internal/CagraIndexImpl.java | 76 +++++++++---------- .../nvidia/cuvs/internal/HnswIndexImpl.java | 34 ++++----- 3 files changed, 64 insertions(+), 67 deletions(-) diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/BruteForceIndexImpl.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/BruteForceIndexImpl.java index decb13133c..6798f4d2ee 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/BruteForceIndexImpl.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/BruteForceIndexImpl.java @@ -16,6 +16,13 @@ package com.nvidia.cuvs.internal; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_FLOAT; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_INT; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_LONG; +import static com.nvidia.cuvs.internal.common.LinkerHelper.downcallHandle; +import static com.nvidia.cuvs.internal.common.Util.checkError; +import static java.lang.foreign.ValueLayout.ADDRESS; + import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; @@ -26,11 +33,8 @@ import java.lang.foreign.MemorySegment; import java.lang.foreign.SequenceLayout; import java.lang.invoke.MethodHandle; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; import java.util.BitSet; import java.util.Objects; import java.util.UUID; @@ -41,14 +45,7 @@ import com.nvidia.cuvs.CuVSResources; import com.nvidia.cuvs.SearchResults; import com.nvidia.cuvs.internal.common.Util; -import com.nvidia.cuvs.internal.panama.CuVSBruteForceIndex; - -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_FLOAT; -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_INT; -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_LONG; -import static com.nvidia.cuvs.internal.common.LinkerHelper.downcallHandle; -import static com.nvidia.cuvs.internal.common.Util.checkError; -import static java.lang.foreign.ValueLayout.ADDRESS; +import com.nvidia.cuvs.internal.panama.cuvsBruteForceIndex; /** * @@ -366,7 +363,7 @@ protected static class IndexReference { * Constructs CagraIndexReference and allocate the MemorySegment. */ protected IndexReference(CuVSResourcesImpl resources) { - memorySegment = CuVSBruteForceIndex.allocate(resources.getArena()); + memorySegment = cuvsBruteForceIndex.allocate(resources.getArena()); } /** diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java index 0577276d34..09ea7cf669 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java @@ -16,6 +16,13 @@ package com.nvidia.cuvs.internal; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_FLOAT; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_INT; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_LONG; +import static com.nvidia.cuvs.internal.common.LinkerHelper.downcallHandle; +import static com.nvidia.cuvs.internal.common.Util.checkError; +import static java.lang.foreign.ValueLayout.ADDRESS; + import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; @@ -39,17 +46,10 @@ import com.nvidia.cuvs.CuVSResources; import com.nvidia.cuvs.SearchResults; import com.nvidia.cuvs.internal.common.Util; -import com.nvidia.cuvs.internal.panama.CuVSCagraCompressionParams; -import com.nvidia.cuvs.internal.panama.CuVSCagraIndex; -import com.nvidia.cuvs.internal.panama.CuVSCagraIndexParams; -import com.nvidia.cuvs.internal.panama.CuVSCagraSearchParams; - -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_FLOAT; -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_INT; -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_LONG; -import static com.nvidia.cuvs.internal.common.LinkerHelper.downcallHandle; -import static com.nvidia.cuvs.internal.common.Util.checkError; -import static java.lang.foreign.ValueLayout.ADDRESS; +import com.nvidia.cuvs.internal.panama.cuvsCagraCompressionParams; +import com.nvidia.cuvs.internal.panama.cuvsCagraIndex; +import com.nvidia.cuvs.internal.panama.cuvsCagraIndexParams; +import com.nvidia.cuvs.internal.panama.cuvsCagraSearchParams; /** * {@link CagraIndex} encapsulates a CAGRA index, along with methods to interact @@ -374,13 +374,13 @@ public CuVSResourcesImpl getCuVSResources() { * Allocates the configured compression parameters in the MemorySegment. */ private MemorySegment segmentFromCompressionParams(CagraCompressionParams params) { - MemorySegment seg = CuVSCagraCompressionParams.allocate(resources.getArena()); - CuVSCagraCompressionParams.pq_bits(seg, params.getPqBits()); - CuVSCagraCompressionParams.pq_dim(seg, params.getPqDim()); - CuVSCagraCompressionParams.vq_n_centers(seg, params.getVqNCenters()); - CuVSCagraCompressionParams.kmeans_n_iters(seg, params.getKmeansNIters()); - CuVSCagraCompressionParams.vq_kmeans_trainset_fraction(seg, params.getVqKmeansTrainsetFraction()); - CuVSCagraCompressionParams.pq_kmeans_trainset_fraction(seg, params.getPqKmeansTrainsetFraction()); + MemorySegment seg = cuvsCagraCompressionParams.allocate(resources.getArena()); + cuvsCagraCompressionParams.pq_bits(seg, params.getPqBits()); + cuvsCagraCompressionParams.pq_dim(seg, params.getPqDim()); + cuvsCagraCompressionParams.vq_n_centers(seg, params.getVqNCenters()); + cuvsCagraCompressionParams.kmeans_n_iters(seg, params.getKmeansNIters()); + cuvsCagraCompressionParams.vq_kmeans_trainset_fraction(seg, params.getVqKmeansTrainsetFraction()); + cuvsCagraCompressionParams.pq_kmeans_trainset_fraction(seg, params.getPqKmeansTrainsetFraction()); return seg; } @@ -388,12 +388,12 @@ private MemorySegment segmentFromCompressionParams(CagraCompressionParams params * Allocates the configured index parameters in the MemorySegment. */ private MemorySegment segmentFromIndexParams(CagraIndexParams params) { - MemorySegment seg = CuVSCagraIndexParams.allocate(resources.getArena()); - CuVSCagraIndexParams.intermediate_graph_degree(seg, params.getIntermediateGraphDegree()); - CuVSCagraIndexParams.graph_degree(seg, params.getGraphDegree()); - CuVSCagraIndexParams.build_algo(seg, params.getCagraGraphBuildAlgo().value); - CuVSCagraIndexParams.nn_descent_niter(seg, params.getNNDescentNumIterations()); - CuVSCagraIndexParams.metric(seg, params.getCuvsDistanceType().value); + MemorySegment seg = cuvsCagraIndexParams.allocate(resources.getArena()); + cuvsCagraIndexParams.intermediate_graph_degree(seg, params.getIntermediateGraphDegree()); + cuvsCagraIndexParams.graph_degree(seg, params.getGraphDegree()); + cuvsCagraIndexParams.build_algo(seg, params.getCagraGraphBuildAlgo().value); + cuvsCagraIndexParams.nn_descent_niter(seg, params.getNNDescentNumIterations()); + cuvsCagraIndexParams.metric(seg, params.getCuvsDistanceType().value); return seg; } @@ -401,23 +401,23 @@ private MemorySegment segmentFromIndexParams(CagraIndexParams params) { * Allocates the configured search parameters in the MemorySegment. */ private MemorySegment segmentFromSearchParams(CagraSearchParams params) { - MemorySegment seg = CuVSCagraSearchParams.allocate(resources.getArena()); - CuVSCagraSearchParams.max_queries(seg, params.getMaxQueries()); - CuVSCagraSearchParams.itopk_size(seg, params.getITopKSize()); - CuVSCagraSearchParams.max_iterations(seg, params.getMaxIterations()); + MemorySegment seg = cuvsCagraSearchParams.allocate(resources.getArena()); + cuvsCagraSearchParams.max_queries(seg, params.getMaxQueries()); + cuvsCagraSearchParams.itopk_size(seg, params.getITopKSize()); + cuvsCagraSearchParams.max_iterations(seg, params.getMaxIterations()); if (params.getCagraSearchAlgo() != null) { - CuVSCagraSearchParams.algo(seg, params.getCagraSearchAlgo().value); + cuvsCagraSearchParams.algo(seg, params.getCagraSearchAlgo().value); } - CuVSCagraSearchParams.team_size(seg, params.getTeamSize()); - CuVSCagraSearchParams.search_width(seg, params.getSearchWidth()); - CuVSCagraSearchParams.min_iterations(seg, params.getMinIterations()); - CuVSCagraSearchParams.thread_block_size(seg, params.getThreadBlockSize()); + cuvsCagraSearchParams.team_size(seg, params.getTeamSize()); + cuvsCagraSearchParams.search_width(seg, params.getSearchWidth()); + cuvsCagraSearchParams.min_iterations(seg, params.getMinIterations()); + cuvsCagraSearchParams.thread_block_size(seg, params.getThreadBlockSize()); if (params.getHashMapMode() != null) { - CuVSCagraSearchParams.hashmap_mode(seg, params.getHashMapMode().value); + cuvsCagraSearchParams.hashmap_mode(seg, params.getHashMapMode().value); } - CuVSCagraSearchParams.hashmap_max_fill_rate(seg, params.getHashMapMaxFillRate()); - CuVSCagraSearchParams.num_random_samplings(seg, params.getNumRandomSamplings()); - CuVSCagraSearchParams.rand_xor_mask(seg, params.getRandXORMask()); + cuvsCagraSearchParams.hashmap_max_fill_rate(seg, params.getHashMapMaxFillRate()); + cuvsCagraSearchParams.num_random_samplings(seg, params.getNumRandomSamplings()); + cuvsCagraSearchParams.rand_xor_mask(seg, params.getRandXORMask()); return seg; } @@ -489,7 +489,7 @@ protected static class IndexReference { * Constructs CagraIndexReference and allocate the MemorySegment. */ protected IndexReference(CuVSResourcesImpl resources) { - memorySegment = CuVSCagraIndex.allocate(resources.getArena()); + memorySegment = cuvsCagraIndex.allocate(resources.getArena()); } /** diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/HnswIndexImpl.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/HnswIndexImpl.java index bb9553e255..97dab9f27a 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/HnswIndexImpl.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/HnswIndexImpl.java @@ -16,6 +16,13 @@ package com.nvidia.cuvs.internal; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_FLOAT; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_INT; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_LONG; +import static com.nvidia.cuvs.internal.common.LinkerHelper.downcallHandle; +import static com.nvidia.cuvs.internal.common.Util.checkError; +import static java.lang.foreign.ValueLayout.ADDRESS; + import java.io.FileOutputStream; import java.io.InputStream; import java.lang.foreign.Arena; @@ -36,16 +43,9 @@ import com.nvidia.cuvs.HnswSearchParams; import com.nvidia.cuvs.SearchResults; import com.nvidia.cuvs.internal.common.Util; -import com.nvidia.cuvs.internal.panama.CuVSHnswIndex; -import com.nvidia.cuvs.internal.panama.CuVSHnswIndexParams; -import com.nvidia.cuvs.internal.panama.CuVSHnswSearchParams; - -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_FLOAT; -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_INT; -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_LONG; -import static com.nvidia.cuvs.internal.common.LinkerHelper.downcallHandle; -import static com.nvidia.cuvs.internal.common.Util.checkError; -import static java.lang.foreign.ValueLayout.ADDRESS; +import com.nvidia.cuvs.internal.panama.cuvsHnswIndex; +import com.nvidia.cuvs.internal.panama.cuvsHnswIndexParams; +import com.nvidia.cuvs.internal.panama.cuvsHnswSearchParams; /** * {@link HnswIndex} encapsulates a HNSW index, along with methods to interact @@ -187,9 +187,9 @@ private IndexReference deserialize(InputStream inputStream, int bufferLength) th * Allocates the configured search parameters in the MemorySegment. */ private MemorySegment segmentFromIndexParams(HnswIndexParams params) { - MemorySegment seg = CuVSHnswIndexParams.allocate(resources.getArena()); - CuVSHnswIndexParams.ef_construction(seg, params.getEfConstruction()); - CuVSHnswIndexParams.num_threads(seg, params.getNumThreads()); + MemorySegment seg = cuvsHnswIndexParams.allocate(resources.getArena()); + cuvsHnswIndexParams.ef_construction(seg, params.getEfConstruction()); + cuvsHnswIndexParams.num_threads(seg, params.getNumThreads()); return seg; } @@ -197,9 +197,9 @@ private MemorySegment segmentFromIndexParams(HnswIndexParams params) { * Allocates the configured search parameters in the MemorySegment. */ private MemorySegment segmentFromSearchParams(HnswSearchParams params) { - MemorySegment seg = CuVSHnswSearchParams.allocate(resources.getArena()); - CuVSHnswSearchParams.ef(seg, params.ef()); - CuVSHnswSearchParams.num_threads(seg, params.numThreads()); + MemorySegment seg = cuvsHnswSearchParams.allocate(resources.getArena()); + cuvsHnswSearchParams.ef(seg, params.ef()); + cuvsHnswSearchParams.num_threads(seg, params.numThreads()); return seg; } @@ -277,7 +277,7 @@ protected static class IndexReference { * Constructs CagraIndexReference and allocate the MemorySegment. */ protected IndexReference(CuVSResourcesImpl resources) { - memorySegment = CuVSHnswIndex.allocate(resources.getArena()); + memorySegment = cuvsHnswIndex.allocate(resources.getArena()); } /** From d347610df660c6076ec9dfa6d379fa6f6c5c9433 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Sat, 19 Apr 2025 20:13:07 +0530 Subject: [PATCH 13/26] bump up javadoc plugin version and fix javadoc --- java/cuvs-java/pom.xml | 5 +---- .../src/main/java/com/nvidia/cuvs/BruteForceQuery.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/java/cuvs-java/pom.xml b/java/cuvs-java/pom.xml index 835fb6eaf2..7e492167c3 100644 --- a/java/cuvs-java/pom.xml +++ b/java/cuvs-java/pom.xml @@ -258,7 +258,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 3.11.2 attach-javadocs @@ -298,7 +298,4 @@ - - - diff --git a/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java b/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java index 019e27dcd8..f99fca11a3 100644 --- a/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java +++ b/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java @@ -40,7 +40,7 @@ public class BruteForceQuery { * @param queryVectors 2D float query vector array * @param mapping an instance of ID mapping * @param topK the top k results to return - * @param prefilter the prefilter data to use while searching the BRUTEFORCE + * @param prefilters the prefilters data to use while searching the BRUTEFORCE * index * @param numDocs Maximum of bits in each prefilter, representing number of documents in this index. * Used only when prefilter(s) is/are passed. From 6021c097d0e619ff4f145d5e7003b2de321e7a54 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Sat, 19 Apr 2025 20:26:17 +0530 Subject: [PATCH 14/26] update readme and simplify logging in examples --- java/README.md | 30 +++++++++++++------ java/examples/README.md | 29 ++++++++++++++---- java/examples/pom.xml | 11 ------- .../cuvs/examples/BruteForceExample.java | 9 ++---- .../nvidia/cuvs/examples/CagraExample.java | 9 ++---- .../com/nvidia/cuvs/examples/HnswExample.java | 9 ++---- java/examples/src/main/resources/.gitkeep | 0 java/examples/src/main/resources/log4j2.xml | 14 --------- 8 files changed, 54 insertions(+), 57 deletions(-) create mode 100644 java/examples/src/main/resources/.gitkeep delete mode 100644 java/examples/src/main/resources/log4j2.xml diff --git a/java/README.md b/java/README.md index e5676146a2..bc9c27f638 100644 --- a/java/README.md +++ b/java/README.md @@ -1,14 +1,26 @@ -Prerequisites -------------- +# CuVS Java API -* JDK 22 -* Maven 3.9.6 or later -To build this API, please do `./build.sh java` in the top level directory. Since this API is dependent on `libcuvs` it must be noted that `libcuvs` gets built automatically before building this API. +CuVS Java API provides a Java based simple, efficient, and a robust vector search API. -Alternatively, please build libcuvs (`./build.sh libcuvs` from top level directory) before building the Java API with `./build.sh` from this directory. +> [!CAUTION] +> CuVS 25.06 contains an experimental version and updates to this API are expected in the coming release. -Building --------- +## Prerequisites -`./build.sh` will generate the `libcuvs_java.so` file in the `internal/` directory, and then build the final jar file for the cuVS Java API in the `cuvs-java/` directory. +- [CuVS libraries](https://docs.rapids.ai/api/cuvs/stable/build/#build-from-source) +- [maven 3.9.6 or above](https://maven.apache.org/download.cgi) +- [JDK 22](https://openjdk.org/projects/jdk/22/) + + +## Building + +The libcuvs C and C++ libraries are needed for this API. If libcuvs libraries have not been built and installed, use `./build.sh libcuvs java` in the top level directory to build this API. + +Alternatively, if libcuvs libraries are already built and you just want to build this API, please +do `./build.sh java` in the top level directory or just do `./build.sh` in this directory. + + +## Examples + +A few starter examples of CAGRA, HNSW, and Bruteforce index are provided in the `examples` directory. diff --git a/java/examples/README.md b/java/examples/README.md index d05d7b9117..b8e03608e2 100644 --- a/java/examples/README.md +++ b/java/examples/README.md @@ -1,8 +1,27 @@ -Building and Running --------------------- +# CuVS Java API Examples -Make sure to have JDK 22 and Maven 3.9.6+. +This maven project contains examples for CAGRA, HNSW, and Bruteforce algorithms. - mvn clean compile assembly:single +## Prerequisites +- [CuVS libraries](https://docs.rapids.ai/api/cuvs/stable/build/#build-from-source) +- Build the CuVS-Java API - java --enable-native-access=ALL-UNNAMED -jar ./target/cagra-sample-1.0-SNAPSHOT-jar-with-dependencies.jar +## Run Examples + +### CAGRA Example +In the current directory do: +``` +mvn package && java --enable-native-access=ALL-UNNAMED -cp target/cuvs-java-examples-25.06.0.jar:$HOME/.m2/repository/com/nvidia/cuvs/cuvs-java/25.06.0/cuvs-java-25.06.0.jar com.nvidia.cuvs.examples.CagraExample +``` + +### HNSW Example +In the current directory do: +``` +mvn package && java --enable-native-access=ALL-UNNAMED -cp target/cuvs-java-examples-25.06.0.jar:$HOME/.m2/repository/com/nvidia/cuvs/cuvs-java/25.06.0/cuvs-java-25.06.0.jar com.nvidia.cuvs.examples.HnswExample +``` + +### Bruteforce Example +In the current directory do: +``` +mvn package && java --enable-native-access=ALL-UNNAMED -cp target/cuvs-java-examples-25.06.0.jar:$HOME/.m2/repository/com/nvidia/cuvs/cuvs-java/25.06.0/cuvs-java-25.06.0.jar com.nvidia.cuvs.examples.BruteForceExample +``` diff --git a/java/examples/pom.xml b/java/examples/pom.xml index c5798864ce..9a86a99b39 100644 --- a/java/examples/pom.xml +++ b/java/examples/pom.xml @@ -20,17 +20,6 @@ 25.06.0 - - org.slf4j - slf4j-api - 2.0.13 - - - org.slf4j - slf4j-simple - 2.0.13 - runtime - diff --git a/java/examples/src/main/java/com/nvidia/cuvs/examples/BruteForceExample.java b/java/examples/src/main/java/com/nvidia/cuvs/examples/BruteForceExample.java index c859129418..72924779ed 100644 --- a/java/examples/src/main/java/com/nvidia/cuvs/examples/BruteForceExample.java +++ b/java/examples/src/main/java/com/nvidia/cuvs/examples/BruteForceExample.java @@ -4,21 +4,18 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; -import java.lang.invoke.MethodHandles; import java.util.UUID; - -import com.nvidia.cuvs.SearchResults; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.logging.Logger; import com.nvidia.cuvs.BruteForceIndex; import com.nvidia.cuvs.BruteForceIndexParams; import com.nvidia.cuvs.BruteForceQuery; import com.nvidia.cuvs.CuVSResources; +import com.nvidia.cuvs.SearchResults; public class BruteForceExample { - private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + private static final Logger log = Logger.getLogger(BruteForceExample.class.getName()); public static void main(String[] args) throws Throwable { diff --git a/java/examples/src/main/java/com/nvidia/cuvs/examples/CagraExample.java b/java/examples/src/main/java/com/nvidia/cuvs/examples/CagraExample.java index 9dabcc6bca..76767fc4c0 100644 --- a/java/examples/src/main/java/com/nvidia/cuvs/examples/CagraExample.java +++ b/java/examples/src/main/java/com/nvidia/cuvs/examples/CagraExample.java @@ -4,12 +4,8 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; -import java.lang.invoke.MethodHandles; import java.util.UUID; - -import com.nvidia.cuvs.SearchResults; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.logging.Logger; import com.nvidia.cuvs.CagraIndex; import com.nvidia.cuvs.CagraIndexParams; @@ -18,10 +14,11 @@ import com.nvidia.cuvs.CagraQuery; import com.nvidia.cuvs.CagraSearchParams; import com.nvidia.cuvs.CuVSResources; +import com.nvidia.cuvs.SearchResults; public class CagraExample { - private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + private static final Logger log = Logger.getLogger(CagraExample.class.getName()); public static void main(String[] args) throws Throwable { diff --git a/java/examples/src/main/java/com/nvidia/cuvs/examples/HnswExample.java b/java/examples/src/main/java/com/nvidia/cuvs/examples/HnswExample.java index 7fbbccf643..c8d3724382 100644 --- a/java/examples/src/main/java/com/nvidia/cuvs/examples/HnswExample.java +++ b/java/examples/src/main/java/com/nvidia/cuvs/examples/HnswExample.java @@ -4,12 +4,8 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; -import java.lang.invoke.MethodHandles; import java.util.UUID; - -import com.nvidia.cuvs.SearchResults; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import java.util.logging.Logger; import com.nvidia.cuvs.CagraIndex; import com.nvidia.cuvs.CagraIndexParams; @@ -20,10 +16,11 @@ import com.nvidia.cuvs.HnswIndexParams; import com.nvidia.cuvs.HnswQuery; import com.nvidia.cuvs.HnswSearchParams; +import com.nvidia.cuvs.SearchResults; public class HnswExample { - private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + private static final Logger log = Logger.getLogger(HnswExample.class.getName()); public static void main(String[] args) throws Throwable { diff --git a/java/examples/src/main/resources/.gitkeep b/java/examples/src/main/resources/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/java/examples/src/main/resources/log4j2.xml b/java/examples/src/main/resources/log4j2.xml deleted file mode 100644 index bf0eb598c1..0000000000 --- a/java/examples/src/main/resources/log4j2.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - From df1f6f2755675cf3a5a5e0b2605c9fc7c2600c66 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Sun, 20 Apr 2025 16:42:29 +0530 Subject: [PATCH 15/26] Enable ivf-pq index and search parameter configuration via the cuvs-java api, updated example, formatting and cleanup --- java/cuvs-java/.gitignore | 1 + .../java/com/nvidia/cuvs/BruteForceIndex.java | 5 +- .../main/java/com/nvidia/cuvs/CagraIndex.java | 1 - .../com/nvidia/cuvs/CagraIndexParams.java | 127 ++++- .../com/nvidia/cuvs/CuVSIvfPqIndexParams.java | 513 ++++++++++++++++++ .../java/com/nvidia/cuvs/CuVSIvfPqParams.java | 126 +++++ .../nvidia/cuvs/CuVSIvfPqSearchParams.java | 231 ++++++++ .../cuvs/internal/BruteForceIndexImpl.java | 1 - .../nvidia/cuvs/internal/CagraIndexImpl.java | 36 ++ .../com/nvidia/cuvs/internal/common/Util.java | 41 +- .../com/nvidia/cuvs/examples/HnswExample.java | 18 + java/internal/src/cuvs_java.c | 6 + 12 files changed, 1073 insertions(+), 33 deletions(-) create mode 100644 java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqIndexParams.java create mode 100644 java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqParams.java create mode 100644 java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqSearchParams.java diff --git a/java/cuvs-java/.gitignore b/java/cuvs-java/.gitignore index b83d22266a..0f630157f4 100644 --- a/java/cuvs-java/.gitignore +++ b/java/cuvs-java/.gitignore @@ -1 +1,2 @@ /target/ +/bin/ diff --git a/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java b/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java index e09c0228fb..511d4279f9 100644 --- a/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java +++ b/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceIndex.java @@ -16,13 +16,12 @@ package com.nvidia.cuvs; -import com.nvidia.cuvs.spi.CuVSProvider; - import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Path; import java.util.Objects; -import java.util.UUID; + +import com.nvidia.cuvs.spi.CuVSProvider; /** * diff --git a/java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java b/java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java index f92d97edd5..d0d7b5ceb8 100644 --- a/java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java +++ b/java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndex.java @@ -20,7 +20,6 @@ import java.io.OutputStream; import java.nio.file.Path; import java.util.Objects; -import java.util.UUID; import com.nvidia.cuvs.spi.CuVSProvider; diff --git a/java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndexParams.java b/java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndexParams.java index 11b4f4b90a..6959938cea 100644 --- a/java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndexParams.java +++ b/java/cuvs-java/src/main/java/com/nvidia/cuvs/CagraIndexParams.java @@ -29,6 +29,7 @@ public class CagraIndexParams { private final int graphDegree; private final int nnDescentNiter; private final int numWriterThreads; + private final CuVSIvfPqParams cuVSIvfPqParams; /** * Enum that denotes which ANN algorithm is used to build CAGRA graph. @@ -158,15 +159,106 @@ private CuvsDistanceType(int value) { } - private CagraIndexParams(int intermediateGraphDegree, int graphDegree, - CagraGraphBuildAlgo CuvsCagraGraphBuildAlgo, int nnDescentNiter, int writerThreads, - CuvsDistanceType cuvsDistanceType) { + /** + * Enum that denotes codebook gen options. + */ + public enum CodebookGen { + + PER_SUBSPACE(0), + + PER_CLUSTER(1); + + /** + * The value for the enum choice. + */ + public final int value; + + private CodebookGen(int value) { + this.value = value; + } + } + + /** + * Enum that denotes cuda datatypes. + */ + public enum CudaDataType { + + CUDA_R_16F(2), + + CUDA_C_16F(6), + + CUDA_R_16BF(14), + + CUDA_C_16BF(15), + + CUDA_R_32F(0), + + CUDA_C_32F(4), + + CUDA_R_64F(1), + + CUDA_C_64F(5), + + CUDA_R_4I(16), + + CUDA_C_4I(17), + + CUDA_R_4U(18), + + CUDA_C_4U(19), + + CUDA_R_8I(3), + + CUDA_C_8I(7), + + CUDA_R_8U(8), + + CUDA_C_8U(9), + + CUDA_R_16I(20), + + CUDA_C_16I(21), + + CUDA_R_16U(22), + + CUDA_C_16U(23), + + CUDA_R_32I(10), + + CUDA_C_32I(11), + + CUDA_R_32U(12), + + CUDA_C_32U(13), + + CUDA_R_64I(24), + + CUDA_C_64I(25), + + CUDA_R_64U(26), + + CUDA_C_64U(27), + + CUDA_R_8F_E4M3(28), + + CUDA_R_8F_E5M2(29); + + public final int value; + + private CudaDataType(int value) { + this.value = value; + } + } + + private CagraIndexParams(int intermediateGraphDegree, int graphDegree, CagraGraphBuildAlgo CuvsCagraGraphBuildAlgo, + int nnDescentNiter, int writerThreads, CuvsDistanceType cuvsDistanceType, CuVSIvfPqParams cuVSIvfPqParams) { this.intermediateGraphDegree = intermediateGraphDegree; this.graphDegree = graphDegree; this.cuvsCagraGraphBuildAlgo = CuvsCagraGraphBuildAlgo; this.nnDescentNiter = nnDescentNiter; this.numWriterThreads = writerThreads; this.cuvsDistanceType = cuvsDistanceType; + this.cuVSIvfPqParams = cuVSIvfPqParams; } /** @@ -216,11 +308,19 @@ public int getNumWriterThreads() { return numWriterThreads; } + /** + * Gets the IVF_PQ parameters. + */ + public CuVSIvfPqParams getCuVSIvfPqParams() { + return cuVSIvfPqParams; + } + @Override public String toString() { return "CagraIndexParams [cuvsCagraGraphBuildAlgo=" + cuvsCagraGraphBuildAlgo + ", cuvsDistanceType=" + cuvsDistanceType + ", intermediateGraphDegree=" + intermediateGraphDegree + ", graphDegree=" + graphDegree - + ", nnDescentNiter=" + nnDescentNiter + ", numWriterThreads=" + numWriterThreads + "]"; + + ", nnDescentNiter=" + nnDescentNiter + ", numWriterThreads=" + numWriterThreads + ", cuVSIvfPqParams=" + + cuVSIvfPqParams + "]"; } /** @@ -234,8 +334,10 @@ public static class Builder { private int graphDegree = 64; private int nnDescentNumIterations = 20; private int numWriterThreads = 2; + private CuVSIvfPqParams cuVSIvfPqParams = new CuVSIvfPqParams.Builder().build(); - public Builder() { } + public Builder() { + } /** * Sets the degree of input graph for pruning. @@ -305,14 +407,25 @@ public Builder withNumWriterThreads(int numWriterThreads) { return this; } + /** + * Sets the IVF_PQ index parameters. + * + * @param cuVSIvfPqParams the IVF_PQ index parameters + * @return an instance of Builder + */ + public Builder withCuVSIvfPqParams(CuVSIvfPqParams cuVSIvfPqParams) { + this.cuVSIvfPqParams = cuVSIvfPqParams; + return this; + } + /** * Builds an instance of {@link CagraIndexParams}. * * @return an instance of {@link CagraIndexParams} */ public CagraIndexParams build() { - return new CagraIndexParams(intermediateGraphDegree, graphDegree, cuvsCagraGraphBuildAlgo, - nnDescentNumIterations, numWriterThreads, cuvsDistanceType); + return new CagraIndexParams(intermediateGraphDegree, graphDegree, cuvsCagraGraphBuildAlgo, nnDescentNumIterations, + numWriterThreads, cuvsDistanceType, cuVSIvfPqParams); } } } diff --git a/java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqIndexParams.java b/java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqIndexParams.java new file mode 100644 index 0000000000..1ce1d96568 --- /dev/null +++ b/java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqIndexParams.java @@ -0,0 +1,513 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.nvidia.cuvs; + +import com.nvidia.cuvs.CagraIndexParams.CodebookGen; +import com.nvidia.cuvs.CagraIndexParams.CuvsDistanceType; + +public class CuVSIvfPqIndexParams { + + /** Distance type. */ + private final CuvsDistanceType metric; + + /** How PQ codebooks are created. */ + private final CodebookGen codebookKind; + + /** The argument used by some distance metrics. */ + private final float metricArg; + + /** The fraction of data to use during iterative kmeans building. */ + private final double kmeansTrainsetFraction; + + /** + * The number of inverted lists (clusters) + * + * Hint: the number of vectors per cluster (`n_rows/n_lists`) should be + * approximately 1,000 to 10,000. + */ + private final int nLists; + + /** The number of iterations searching for kmeans centers (index building). */ + private final int kmeansNIters; + + /** + * The bit length of the vector element after compression by PQ. + * + * Possible values: [4, 5, 6, 7, 8]. + * + * Hint: the smaller the 'pq_bits', the smaller the index size and the better + * the search performance, but the lower the recall. + */ + private final int pqBits; + + /** + * The dimensionality of the vector after compression by PQ. When zero, an + * optimal value is selected using a heuristic. + * + * NB: `pq_dim * pq_bits` must be a multiple of 8. + * + * Hint: a smaller 'pq_dim' results in a smaller index size and better search + * performance, but lower recall. If 'pq_bits' is 8, 'pq_dim' can be set to any + * number, but multiple of 8 are desirable for good performance. If 'pq_bits' is + * not 8, 'pq_dim' should be a multiple of 8. For good performance, it is + * desirable that 'pq_dim' is a multiple of 32. Ideally, 'pq_dim' should be also + * a divisor of the dataset dim. + */ + private final int pqDim; + + /** + * Whether to add the dataset content to the index, i.e.: + * + * - `true` means the index is filled with the dataset vectors and ready to + * search after calling `build`. - `false` means `build` only trains the + * underlying model (e.g. quantizer or clustering), but the index is left empty; + * you'd need to call `extend` on the index afterwards to populate it. + */ + private final boolean addDataOnBuild; + + /** + * Apply a random rotation matrix on the input data and queries even if `dim % + * pq_dim == 0`. + * + * Note: if `dim` is not multiple of `pq_dim`, a random rotation is always + * applied to the input data and queries to transform the working space from + * `dim` to `rot_dim`, which may be slightly larger than the original space and + * and is a multiple of `pq_dim` (`rot_dim % pq_dim == 0`). However, this + * transform is not necessary when `dim` is multiple of `pq_dim` (`dim == + * rot_dim`, hence no need in adding "extra" data columns / features). + * + * By default, if `dim == rot_dim`, the rotation transform is initialized with + * the identity matrix. When `force_random_rotation == true`, a random + * orthogonal transform matrix is generated regardless of the values of `dim` + * and `pq_dim`. + */ + private final boolean forceRandomRotation; + + /** + * By default, the algorithm allocates more space than necessary for individual + * clusters (`list_data`). This allows to amortize the cost of memory allocation + * and reduce the number of data copies during repeated calls to `extend` + * (extending the database). + * + * The alternative is the conservative allocation behavior; when enabled, the + * algorithm always allocates the minimum amount of memory required to store the + * given number of records. Set this flag to `true` if you prefer to use as + * little GPU memory for the database as possible. + */ + private final boolean conservativeMemoryAllocation; + + /** + * The max number of data points to use per PQ code during PQ codebook training. + * Using more data points per PQ code may increase the quality of PQ codebook + * but may also increase the build time. The parameter is applied to both PQ + * codebook generation methods, i.e., PER_SUBSPACE and PER_CLUSTER. In both + * cases, we will use `pq_book_size * max_train_points_per_pq_code` training + * points to train each codebook. + */ + private final int maxTrainPointsPerPqCode; + + private CuVSIvfPqIndexParams(CuvsDistanceType metric, CodebookGen codebookKind, float metricArg, + double kmeansTrainsetFraction, int nLists, int kmeansNIters, int pqBits, int pqDim, boolean addDataOnBuild, + boolean forceRandomRotation, boolean conservativeMemoryAllocation, int maxTrainPointsPerPqCode) { + super(); + this.metric = metric; + this.codebookKind = codebookKind; + this.metricArg = metricArg; + this.kmeansTrainsetFraction = kmeansTrainsetFraction; + this.nLists = nLists; + this.kmeansNIters = kmeansNIters; + this.pqBits = pqBits; + this.pqDim = pqDim; + this.addDataOnBuild = addDataOnBuild; + this.forceRandomRotation = forceRandomRotation; + this.conservativeMemoryAllocation = conservativeMemoryAllocation; + this.maxTrainPointsPerPqCode = maxTrainPointsPerPqCode; + } + + /** + * Gets the distance type. + * + * @return the distance type + */ + public CuvsDistanceType getMetric() { + return metric; + } + + /** + * Gets how PQ codebooks are created + * + * @return how PQ codebooks are created + */ + public CodebookGen getCodebookKind() { + return codebookKind; + } + + /** + * Gets the argument used by some distance metrics + * + * @return the argument used by some distance metrics + */ + public float getMetricArg() { + return metricArg; + } + + /** + * Gets the fraction of data to use during iterative kmeans building + * + * @return the fraction of data to use during iterative kmeans building + */ + public double getKmeansTrainsetFraction() { + return kmeansTrainsetFraction; + } + + /** + * Gets the number of inverted lists (clusters) + * + * @return the number of inverted lists (clusters) + */ + public int getnLists() { + return nLists; + } + + /** + * Gets the number of iterations searching for kmeans centers + * + * @return the number of iterations searching for kmeans centers + */ + public int getKmeansNIters() { + return kmeansNIters; + } + + /** + * Gets the bit length of the vector element after compression by PQ + * + * @return the bit length of the vector element after compression by PQ + */ + public int getPqBits() { + return pqBits; + } + + /** + * Gets the dimensionality of the vector after compression by PQ + * + * @return the dimensionality of the vector after compression by PQ + */ + public int getPqDim() { + return pqDim; + } + + /** + * Gets whether the dataset content is added to the index + * + * @return whether the dataset content is added to the index + */ + public boolean isAddDataOnBuild() { + return addDataOnBuild; + } + + /** + * Gets the random rotation matrix on the input data and queries + * + * @return the random rotation matrix on the input data and queries + */ + public boolean isForceRandomRotation() { + return forceRandomRotation; + } + + /** + * Gets if conservative allocation behavior is set + * + * @return if conservative allocation behavior is set + */ + public boolean isConservativeMemoryAllocation() { + return conservativeMemoryAllocation; + } + + /** + * Gets whether max number of data points to use per PQ code during PQ codebook + * training is set + * + * @return whether max number of data points to use per PQ code during PQ + * codebook training is set + */ + public int getMaxTrainPointsPerPqCode() { + return maxTrainPointsPerPqCode; + } + + @Override + public String toString() { + return "CuVSIvfPqIndexParams [metric=" + metric + ", codebookKind=" + codebookKind + ", metricArg=" + metricArg + + ", kmeansTrainsetFraction=" + kmeansTrainsetFraction + ", nLists=" + nLists + ", kmeansNIters=" + kmeansNIters + + ", pqBits=" + pqBits + ", pqDim=" + pqDim + ", addDataOnBuild=" + addDataOnBuild + ", forceRandomRotation=" + + forceRandomRotation + ", conservativeMemoryAllocation=" + conservativeMemoryAllocation + + ", maxTrainPointsPerPqCode=" + maxTrainPointsPerPqCode + "]"; + } + + /** + * Builder configures and creates an instance of {@link CuVSIvfPqIndexParams}. + */ + public static class Builder { + + /** Distance type. */ + private CuvsDistanceType metric = CuvsDistanceType.L2Expanded; + + /** How PQ codebooks are created. */ + private CodebookGen codebookKind = CodebookGen.PER_SUBSPACE; + + /** The argument used by some distance metrics. */ + private float metricArg = 2.0f; + + /** The fraction of data to use during iterative kmeans building. */ + private double kmeansTrainsetFraction = 0.5; + + /** + * The number of inverted lists (clusters) + * + * Hint: the number of vectors per cluster (`n_rows/n_lists`) should be + * approximately 1,000 to 10,000. + */ + private int nLists = 1024; + + /** The number of iterations searching for kmeans centers (index building). */ + private int kmeansNIters = 20; + + /** + * The bit length of the vector element after compression by PQ. + * + * Possible values: [4, 5, 6, 7, 8]. + * + * Hint: the smaller the 'pq_bits', the smaller the index size and the better + * the search performance, but the lower the recall. + */ + private int pqBits = 8; + + /** + * The dimensionality of the vector after compression by PQ. When zero, an + * optimal value is selected using a heuristic. + * + * NB: `pq_dim * pq_bits` must be a multiple of 8. + * + * Hint: a smaller 'pq_dim' results in a smaller index size and better search + * performance, but lower recall. If 'pq_bits' is 8, 'pq_dim' can be set to any + * number, but multiple of 8 are desirable for good performance. If 'pq_bits' is + * not 8, 'pq_dim' should be a multiple of 8. For good performance, it is + * desirable that 'pq_dim' is a multiple of 32. Ideally, 'pq_dim' should be also + * a divisor of the dataset dim. + */ + private int pqDim = 0; + + /** + * Whether to add the dataset content to the index, i.e.: + * + * - `true` means the index is filled with the dataset vectors and ready to + * search after calling `build`. - `false` means `build` only trains the + * underlying model (e.g. quantizer or clustering), but the index is left empty; + * you'd need to call `extend` on the index afterwards to populate it. + */ + private boolean addDataOnBuild = true; + + /** + * Apply a random rotation matrix on the input data and queries even if `dim % + * pq_dim == 0`. + * + * Note: if `dim` is not multiple of `pq_dim`, a random rotation is always + * applied to the input data and queries to transform the working space from + * `dim` to `rot_dim`, which may be slightly larger than the original space and + * and is a multiple of `pq_dim` (`rot_dim % pq_dim == 0`). However, this + * transform is not necessary when `dim` is multiple of `pq_dim` (`dim == + * rot_dim`, hence no need in adding "extra" data columns / features). + * + * By default, if `dim == rot_dim`, the rotation transform is initialized with + * the identity matrix. When `force_random_rotation == true`, a random + * orthogonal transform matrix is generated regardless of the values of `dim` + * and `pq_dim`. + */ + private boolean forceRandomRotation = false; + + /** + * By default, the algorithm allocates more space than necessary for individual + * clusters (`list_data`). This allows to amortize the cost of memory allocation + * and reduce the number of data copies during repeated calls to `extend` + * (extending the database). + * + * The alternative is the conservative allocation behavior; when enabled, the + * algorithm always allocates the minimum amount of memory required to store the + * given number of records. Set this flag to `true` if you prefer to use as + * little GPU memory for the database as possible. + */ + private boolean conservativeMemoryAllocation = false; + + /** + * The max number of data points to use per PQ code during PQ codebook training. + * Using more data points per PQ code may increase the quality of PQ codebook + * but may also increase the build time. The parameter is applied to both PQ + * codebook generation methods, i.e., PER_SUBSPACE and PER_CLUSTER. In both + * cases, we will use `pq_book_size * max_train_points_per_pq_code` training + * points to train each codebook. + */ + private int maxTrainPointsPerPqCode = 256; + + public Builder() { + } + + /** + * Sets the distance type. + * + * @param metric distance type + * @return an instance of Builder + */ + public Builder withMetric(CuvsDistanceType metric) { + this.metric = metric; + return this; + } + + /** + * Sets the argument used by some distance metrics. + * + * @param metricArg argument used by some distance metrics + * @return an instance of Builder + */ + public Builder withMetricArg(float metricArg) { + this.metricArg = metricArg; + return this; + } + + /** + * Sets whether to add the dataset content to the index. + * + * @param addDataOnBuild whether to add the dataset content to the index + * @return an instance of Builder + */ + public Builder withAddDataOnBuild(boolean addDataOnBuild) { + this.addDataOnBuild = addDataOnBuild; + return this; + } + + /** + * Sets the number of inverted lists (clusters) + * + * @param nLists number of inverted lists (clusters) + * @return an instance of Builder + */ + public Builder withNLists(int nLists) { + this.nLists = nLists; + return this; + } + + /** + * Sets the number of iterations searching for kmeans centers + * + * @param kmeansNIters number of iterations searching for kmeans centers + * @return an instance of Builder + */ + public Builder withKmeansNIters(int kmeansNIters) { + this.kmeansNIters = kmeansNIters; + return this; + } + + /** + * Sets the fraction of data to use during iterative kmeans building. + * + * @param kmeansTrainsetFraction fraction of data to use during iterative kmeans + * building + * @return an instance of Builder + */ + public Builder withKmeansTrainsetFraction(double kmeansTrainsetFraction) { + this.kmeansTrainsetFraction = kmeansTrainsetFraction; + return this; + } + + /** + * Sets the bit length of the vector element after compression by PQ. + * + * @param pqBits bit length of the vector element after compression by PQ + * @return an instance of Builder + */ + public Builder withPqBits(int pqBits) { + this.pqBits = pqBits; + return this; + } + + /** + * Sets the dimensionality of the vector after compression by PQ. + * + * @param pqDim dimensionality of the vector after compression by PQ + * @return an instance of Builder + */ + public Builder withPqDim(int pqDim) { + this.pqDim = pqDim; + return this; + } + + /** + * Sets how PQ codebooks are created. + * + * @param codebookKind how PQ codebooks are created + * @return an instance of Builder + */ + public Builder withCodebookKind(CodebookGen codebookKind) { + this.codebookKind = codebookKind; + return this; + } + + /** + * Sets the random rotation matrix on the input data and queries. + * + * @param forceRandomRotation random rotation matrix on the input data and + * queries + * @return an instance of Builder + */ + public Builder withForceRandomRotation(boolean forceRandomRotation) { + this.forceRandomRotation = forceRandomRotation; + return this; + } + + /** + * Sets the conservative allocation behavior + * + * @param conservativeMemoryAllocation conservative allocation behavior + * @return an instance of Builder + */ + public Builder withConservativeMemoryAllocation(boolean conservativeMemoryAllocation) { + this.conservativeMemoryAllocation = conservativeMemoryAllocation; + return this; + } + + /** + * Sets the max number of data points to use per PQ code during PQ codebook + * training + * + * @param maxTrainPointsPerPqCode max number of data points to use per PQ code + * during PQ codebook training + * @return an instance of Builder + */ + public Builder withMaxTrainPointsPerPqCode(int maxTrainPointsPerPqCode) { + this.maxTrainPointsPerPqCode = maxTrainPointsPerPqCode; + return this; + } + + /** + * Builds an instance of {@link CuVSIvfPqIndexParams}. + * + * @return an instance of {@link CuVSIvfPqIndexParams} + */ + public CuVSIvfPqIndexParams build() { + return new CuVSIvfPqIndexParams(metric, codebookKind, metricArg, kmeansTrainsetFraction, nLists, kmeansNIters, + pqBits, pqDim, addDataOnBuild, forceRandomRotation, conservativeMemoryAllocation, maxTrainPointsPerPqCode); + } + } +} diff --git a/java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqParams.java b/java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqParams.java new file mode 100644 index 0000000000..1b6dfca149 --- /dev/null +++ b/java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqParams.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.nvidia.cuvs; + +public class CuVSIvfPqParams { + + /** CuVS IVF_PQ index parameters */ + private final CuVSIvfPqIndexParams indexParams; + + /** CuVS IVF_PQ search parameters */ + private final CuVSIvfPqSearchParams searchParams; + + /** refinement rate */ + private final float refinementRate; + + private CuVSIvfPqParams(CuVSIvfPqIndexParams indexParams, CuVSIvfPqSearchParams searchParams, float refinementRate) { + super(); + this.indexParams = indexParams; + this.searchParams = searchParams; + this.refinementRate = refinementRate; + } + + /** + * + * @return + */ + public CuVSIvfPqIndexParams getIndexParams() { + return indexParams; + } + + /** + * + * @return + */ + public CuVSIvfPqSearchParams getSearchParams() { + return searchParams; + } + + /** + * + * @return + */ + public float getRefinementRate() { + return refinementRate; + } + + @Override + public String toString() { + return "CuVSIvfPqParams [indexParams=" + indexParams + ", searchParams=" + searchParams + ", refinementRate=" + + refinementRate + "]"; + } + + /** + * Builder configures and creates an instance of {@link CuVSIvfPqParams}. + */ + public static class Builder { + + /** CuVS IVF_PQ index parameters */ + private CuVSIvfPqIndexParams cuVSIvfPqIndexParams = new CuVSIvfPqIndexParams.Builder().build(); + + /** CuVS IVF_PQ search parameters */ + private CuVSIvfPqSearchParams cuVSIvfPqSearchParams = new CuVSIvfPqSearchParams.Builder().build(); + + /** refinement rate */ + private float refinementRate = 2.0f; + + public Builder() { + } + + /** + * Sets the CuVS IVF_PQ index parameters. + * + * @param cuVSIvfPqIndexParams the CuVS IVF_PQ index parameters + * @return an instance of Builder + */ + public Builder withCuVSIvfPqIndexParams(CuVSIvfPqIndexParams cuVSIvfPqIndexParams) { + this.cuVSIvfPqIndexParams = cuVSIvfPqIndexParams; + return this; + } + + /** + * Sets the CuVS IVF_PQ search parameters. + * + * @param cuVSIvfPqSearchParams the CuVS IVF_PQ search parameters + * @return an instance of Builder + */ + public Builder withCuVSIvfPqSearchParams(CuVSIvfPqSearchParams cuVSIvfPqSearchParams) { + this.cuVSIvfPqSearchParams = cuVSIvfPqSearchParams; + return this; + } + + /** + * Sets the refinement rate, default 2.0. + * + * @param refinementRate the refinement rate + * @return an instance of Builder + */ + public Builder withRefinementRate(float refinementRate) { + this.refinementRate = refinementRate; + return this; + } + + /** + * Builds an instance of {@link CuVSIvfPqParams}. + * + * @return an instance of {@link CuVSIvfPqParams} + */ + public CuVSIvfPqParams build() { + return new CuVSIvfPqParams(cuVSIvfPqIndexParams, cuVSIvfPqSearchParams, refinementRate); + } + } +} diff --git a/java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqSearchParams.java b/java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqSearchParams.java new file mode 100644 index 0000000000..2dab8dcb3f --- /dev/null +++ b/java/cuvs-java/src/main/java/com/nvidia/cuvs/CuVSIvfPqSearchParams.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.nvidia.cuvs; + +import com.nvidia.cuvs.CagraIndexParams.CudaDataType; + +public class CuVSIvfPqSearchParams { + + /** The number of clusters to search. */ + private final int nProbes; + + /** + * Data type of look up table to be created dynamically at search time. + * + * Possible values: [CUDA_R_32F, CUDA_R_16F, CUDA_R_8U] + * + * The use of low-precision types reduces the amount of shared memory required + * at search time, so fast shared memory kernels can be used even for datasets + * with large dimansionality. Note that the recall is slightly degraded when + * low-precision type is selected. + */ + private final CudaDataType lutDtype; + + /** + * Storage data type for distance/similarity computed at search time. + * + * Possible values: [CUDA_R_16F, CUDA_R_32F] + * + * If the performance limiter at search time is device memory access, selecting + * FP16 will improve performance slightly. + */ + private final CudaDataType internalDistanceDtype; + + /** + * Preferred fraction of SM's unified memory / L1 cache to be used as shared + * memory. + * + * Possible values: [0.0 - 1.0] as a fraction of the + * `sharedMemPerMultiprocessor`. + * + * One wants to increase the carveout to make sure a good GPU occupancy for the + * main search kernel, but not to keep it too high to leave some memory to be + * used as L1 cache. Note, this value is interpreted only as a hint. Moreover, a + * GPU usually allows only a fixed set of cache configurations, so the provided + * value is rounded up to the nearest configuration. Refer to the NVIDIA tuning + * guide for the target GPU architecture. + * + * Note, this is a low-level tuning parameter that can have drastic negative + * effects on the search performance if tweaked incorrectly. + */ + private final double preferredShmemCarveout; + + private CuVSIvfPqSearchParams(int nProbes, CudaDataType lutDtype, CudaDataType internalDistanceDtype, + double preferredShmemCarveout) { + super(); + this.nProbes = nProbes; + this.lutDtype = lutDtype; + this.internalDistanceDtype = internalDistanceDtype; + this.preferredShmemCarveout = preferredShmemCarveout; + } + + /** + * Gets the number of clusters to search + * + * @return the number of clusters to search + */ + public int getnProbes() { + return nProbes; + } + + /** + * Gets the data type of look up table to be created dynamically at search time + * + * @return the data type of look up table to be created dynamically at search + * time + */ + public CudaDataType getLutDtype() { + return lutDtype; + } + + /** + * Gets the storage data type for distance/similarity computed at search time + * + * @return the storage data type for distance/similarity computed at search time + */ + public CudaDataType getInternalDistanceDtype() { + return internalDistanceDtype; + } + + /** + * Gets the preferred fraction of SM's unified memory / L1 cache to be used as + * shared memory + * + * @return the preferred fraction of SM's unified memory / L1 cache to be used + * as shared memory + */ + public double getPreferredShmemCarveout() { + return preferredShmemCarveout; + } + + @Override + public String toString() { + return "CuVSIvfPqSearchParams [nProbes=" + nProbes + ", lutDtype=" + lutDtype + ", internalDistanceDtype=" + + internalDistanceDtype + ", preferredShmemCarveout=" + preferredShmemCarveout + "]"; + } + + /** + * Builder configures and creates an instance of {@link CuVSIvfPqSearchParams}. + */ + public static class Builder { + + /** The number of clusters to search. */ + private int nProbes = 20; + + /** + * Data type of look up table to be created dynamically at search time. + * + * Possible values: [CUDA_R_32F, CUDA_R_16F, CUDA_R_8U] + * + * The use of low-precision types reduces the amount of shared memory required + * at search time, so fast shared memory kernels can be used even for datasets + * with large dimansionality. Note that the recall is slightly degraded when + * low-precision type is selected. + */ + private CudaDataType lutDtype = CudaDataType.CUDA_R_32F; + + /** + * Storage data type for distance/similarity computed at search time. + * + * Possible values: [CUDA_R_16F, CUDA_R_32F] + * + * If the performance limiter at search time is device memory access, selecting + * FP16 will improve performance slightly. + */ + private CudaDataType internalDistanceDtype = CudaDataType.CUDA_R_32F; + + /** + * Preferred fraction of SM's unified memory / L1 cache to be used as shared + * memory. + * + * Possible values: [0.0 - 1.0] as a fraction of the + * `sharedMemPerMultiprocessor`. + * + * One wants to increase the carveout to make sure a good GPU occupancy for the + * main search kernel, but not to keep it too high to leave some memory to be + * used as L1 cache. Note, this value is interpreted only as a hint. Moreover, a + * GPU usually allows only a fixed set of cache configurations, so the provided + * value is rounded up to the nearest configuration. Refer to the NVIDIA tuning + * guide for the target GPU architecture. + * + * Note, this is a low-level tuning parameter that can have drastic negative + * effects on the search performance if tweaked incorrectly. + */ + private double preferredShmemCarveout = 1.0; + + public Builder() { + } + + /** + * Sets the number of clusters to search. + * + * @param nProbes the number of clusters to search + * @return an instance of Builder + */ + public Builder withNProbes(int nProbes) { + this.nProbes = nProbes; + return this; + } + + /** + * Sets the the data type of look up table to be created dynamically at search + * time. + * + * @param lutDtype the data type of look up table to be created dynamically at + * search time + * @return an instance of Builder + */ + public Builder withLutDtype(CudaDataType lutDtype) { + this.lutDtype = lutDtype; + return this; + } + + /** + * Sets the storage data type for distance/similarity computed at search time. + * + * @param internalDistanceDtype storage data type for distance/similarity + * computed at search time + * @return an instance of Builder + */ + public Builder withInternalDistanceDtype(CudaDataType internalDistanceDtype) { + this.internalDistanceDtype = internalDistanceDtype; + return this; + } + + /** + * Sets the preferred fraction of SM's unified memory / L1 cache to be used as + * shared memory. + * + * @param preferredShmemCarveout preferred fraction of SM's unified memory / L1 + * cache to be used as shared memory + * @return an instance of Builder + */ + public Builder withPreferredShmemCarveout(double preferredShmemCarveout) { + this.preferredShmemCarveout = preferredShmemCarveout; + return this; + } + + /** + * Builds an instance of {@link CuVSIvfPqSearchParams}. + * + * @return an instance of {@link CuVSIvfPqSearchParams} + */ + public CuVSIvfPqSearchParams build() { + return new CuVSIvfPqSearchParams(nProbes, lutDtype, internalDistanceDtype, preferredShmemCarveout); + } + } +} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/BruteForceIndexImpl.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/BruteForceIndexImpl.java index 6798f4d2ee..a96f633ffd 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/BruteForceIndexImpl.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/BruteForceIndexImpl.java @@ -170,7 +170,6 @@ public SearchResults search(BruteForceQuery cuvsQuery) throws Throwable { long numQueries = cuvsQuery.getQueryVectors().length; long numBlocks = cuvsQuery.getTopK() * numQueries; int vectorDimension = numQueries > 0 ? cuvsQuery.getQueryVectors()[0].length : 0; - long numRows = dataset != null ? dataset.length : 0; SequenceLayout neighborsSequenceLayout = MemoryLayout.sequenceLayout(numBlocks, C_LONG); SequenceLayout distancesSequenceLayout = MemoryLayout.sequenceLayout(numBlocks, C_FLOAT); diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java index 09ea7cf669..7788354022 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/CagraIndexImpl.java @@ -41,6 +41,7 @@ import com.nvidia.cuvs.CagraCompressionParams; import com.nvidia.cuvs.CagraIndex; import com.nvidia.cuvs.CagraIndexParams; +import com.nvidia.cuvs.CagraIndexParams.CagraGraphBuildAlgo; import com.nvidia.cuvs.CagraQuery; import com.nvidia.cuvs.CagraSearchParams; import com.nvidia.cuvs.CuVSResources; @@ -50,6 +51,9 @@ import com.nvidia.cuvs.internal.panama.cuvsCagraIndex; import com.nvidia.cuvs.internal.panama.cuvsCagraIndexParams; import com.nvidia.cuvs.internal.panama.cuvsCagraSearchParams; +import com.nvidia.cuvs.internal.panama.cuvsIvfPqIndexParams; +import com.nvidia.cuvs.internal.panama.cuvsIvfPqParams; +import com.nvidia.cuvs.internal.panama.cuvsIvfPqSearchParams; /** * {@link CagraIndex} encapsulates a CAGRA index, along with methods to interact @@ -394,6 +398,38 @@ private MemorySegment segmentFromIndexParams(CagraIndexParams params) { cuvsCagraIndexParams.build_algo(seg, params.getCagraGraphBuildAlgo().value); cuvsCagraIndexParams.nn_descent_niter(seg, params.getNNDescentNumIterations()); cuvsCagraIndexParams.metric(seg, params.getCuvsDistanceType().value); + + + if (params.getCagraGraphBuildAlgo().equals(CagraGraphBuildAlgo.IVF_PQ)) { + + MemorySegment ivfpqIndexParamsMemorySegment = cuvsIvfPqIndexParams.allocate(resources.getArena()); + cuvsIvfPqIndexParams.metric(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().getMetric().value); + cuvsIvfPqIndexParams.metric_arg(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().getMetricArg()); + cuvsIvfPqIndexParams.add_data_on_build(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().isAddDataOnBuild()); + cuvsIvfPqIndexParams.n_lists(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().getnLists()); + cuvsIvfPqIndexParams.kmeans_n_iters(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().getKmeansNIters()); + cuvsIvfPqIndexParams.kmeans_trainset_fraction(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().getKmeansTrainsetFraction()); + cuvsIvfPqIndexParams.pq_bits(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().getPqBits()); + cuvsIvfPqIndexParams.pq_dim(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().getPqDim()); + cuvsIvfPqIndexParams.codebook_kind(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().getCodebookKind().value); + cuvsIvfPqIndexParams.force_random_rotation(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().isForceRandomRotation()); + cuvsIvfPqIndexParams.conservative_memory_allocation(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().isConservativeMemoryAllocation()); + cuvsIvfPqIndexParams.max_train_points_per_pq_code(ivfpqIndexParamsMemorySegment, params.getCuVSIvfPqParams().getIndexParams().getMaxTrainPointsPerPqCode()); + + MemorySegment ivfpqSearchParamsMemorySegment = cuvsIvfPqSearchParams.allocate(resources.getArena()); + cuvsIvfPqSearchParams.n_probes(ivfpqSearchParamsMemorySegment, params.getCuVSIvfPqParams().getSearchParams().getnProbes()); + cuvsIvfPqSearchParams.lut_dtype(ivfpqSearchParamsMemorySegment, params.getCuVSIvfPqParams().getSearchParams().getLutDtype().value); + cuvsIvfPqSearchParams.internal_distance_dtype(ivfpqSearchParamsMemorySegment, params.getCuVSIvfPqParams().getSearchParams().getInternalDistanceDtype().value); + cuvsIvfPqSearchParams.preferred_shmem_carveout(ivfpqSearchParamsMemorySegment, params.getCuVSIvfPqParams().getSearchParams().getPreferredShmemCarveout()); + + MemorySegment cuvsIvfPqParamsMemorySegment = cuvsIvfPqParams.allocate(resources.getArena()); + cuvsIvfPqParams.ivf_pq_build_params(cuvsIvfPqParamsMemorySegment, ivfpqIndexParamsMemorySegment); + cuvsIvfPqParams.ivf_pq_search_params(cuvsIvfPqParamsMemorySegment, ivfpqSearchParamsMemorySegment); + cuvsIvfPqParams.refinement_rate(cuvsIvfPqParamsMemorySegment, params.getCuVSIvfPqParams().getRefinementRate()); + + cuvsCagraIndexParams.graph_build_params(seg, cuvsIvfPqParamsMemorySegment); + } + return seg; } diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/common/Util.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/common/Util.java index bc8f3bbcc4..d628ea34ad 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/common/Util.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/common/Util.java @@ -16,6 +16,13 @@ package com.nvidia.cuvs.internal.common; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_CHAR; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_FLOAT; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_INT; +import static com.nvidia.cuvs.internal.common.LinkerHelper.C_LONG; +import static com.nvidia.cuvs.internal.common.LinkerHelper.downcallHandle; +import static java.lang.foreign.ValueLayout.ADDRESS; + import java.lang.foreign.Arena; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.MemoryLayout; @@ -25,36 +32,29 @@ import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; import java.util.ArrayList; -import java.util.Arrays; import java.util.BitSet; import java.util.List; import com.nvidia.cuvs.GPUInfo; import com.nvidia.cuvs.internal.panama.GpuInfo; -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_CHAR; -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_FLOAT; -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_INT; -import static com.nvidia.cuvs.internal.common.LinkerHelper.C_LONG; -import static com.nvidia.cuvs.internal.common.LinkerHelper.downcallHandle; -import static java.lang.foreign.ValueLayout.ADDRESS; - public class Util { public static final int CUVS_SUCCESS = 1; private static final MethodHandle getGpuInfoMethodHandle = downcallHandle("get_gpu_info", - FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS)); + FunctionDescriptor.ofVoid(ADDRESS, ADDRESS, ADDRESS)); private static final MethodHandle getLastErrorTextMethodHandle = downcallHandle("cuvsGetLastErrorText", - FunctionDescriptor.of(ADDRESS)); + FunctionDescriptor.of(ADDRESS)); - private Util() {} + private Util() { + } /** * Checks the result value of a native method handle call. * - * @param value the return value + * @param value the return value * @param caller the native method handle that was called */ public static void checkError(int value, String caller) { @@ -130,24 +130,24 @@ public static List availableGPUs() throws Throwable { for (int i = 0; i < numGPUs; i++) { VarHandle gpuIdVarHandle = ml.varHandle(PathElement.sequenceElement(i), PathElement.groupElement("gpu_id")); VarHandle freeMemoryVarHandle = ml.varHandle(PathElement.sequenceElement(i), - PathElement.groupElement("free_memory")); + PathElement.groupElement("free_memory")); VarHandle totalMemoryVarHandle = ml.varHandle(PathElement.sequenceElement(i), - PathElement.groupElement("total_memory")); + PathElement.groupElement("total_memory")); VarHandle ComputeCapabilityVarHandle = ml.varHandle(PathElement.sequenceElement(i), - PathElement.groupElement("compute_capability")); + PathElement.groupElement("compute_capability")); StringBuilder gpuName = new StringBuilder(); char b = 1; int p = 0; while (b != 0x00) { VarHandle gpuNameVarHandle = ml.varHandle(PathElement.sequenceElement(i), PathElement.groupElement("name"), - PathElement.sequenceElement(p++)); + PathElement.sequenceElement(p++)); b = (char) (byte) gpuNameVarHandle.get(GpuInfoArrayMemorySegment, 0L); gpuName.append(b); } results.add(new GPUInfo((int) gpuIdVarHandle.get(GpuInfoArrayMemorySegment, 0L), gpuName.toString().trim(), - (long) freeMemoryVarHandle.get(GpuInfoArrayMemorySegment, 0L), - (long) totalMemoryVarHandle.get(GpuInfoArrayMemorySegment, 0L), - (float) ComputeCapabilityVarHandle.get(GpuInfoArrayMemorySegment, 0L))); + (long) freeMemoryVarHandle.get(GpuInfoArrayMemorySegment, 0L), + (long) totalMemoryVarHandle.get(GpuInfoArrayMemorySegment, 0L), + (float) ComputeCapabilityVarHandle.get(GpuInfoArrayMemorySegment, 0L))); } return results; } @@ -206,8 +206,7 @@ public static MemorySegment buildMemorySegment(Arena arena, float[][] data) { MemoryLayout dataMemoryLayout = MemoryLayout.sequenceLayout(rows * cols, C_FLOAT); MemorySegment dataMemorySegment = arena.allocate(dataMemoryLayout); for (int r = 0; r < rows; r++) { - MemorySegment.copy(data[r], 0, dataMemorySegment, C_FLOAT, (r * cols * C_FLOAT.byteSize()), - (int) cols); + MemorySegment.copy(data[r], 0, dataMemorySegment, C_FLOAT, (r * cols * C_FLOAT.byteSize()), (int) cols); } return dataMemorySegment; } diff --git a/java/examples/src/main/java/com/nvidia/cuvs/examples/HnswExample.java b/java/examples/src/main/java/com/nvidia/cuvs/examples/HnswExample.java index c8d3724382..0268ff62ee 100644 --- a/java/examples/src/main/java/com/nvidia/cuvs/examples/HnswExample.java +++ b/java/examples/src/main/java/com/nvidia/cuvs/examples/HnswExample.java @@ -11,6 +11,9 @@ import com.nvidia.cuvs.CagraIndexParams; import com.nvidia.cuvs.CagraIndexParams.CagraGraphBuildAlgo; import com.nvidia.cuvs.CagraIndexParams.CuvsDistanceType; +import com.nvidia.cuvs.CuVSIvfPqIndexParams; +import com.nvidia.cuvs.CuVSIvfPqParams; +import com.nvidia.cuvs.CuVSIvfPqSearchParams; import com.nvidia.cuvs.CuVSResources; import com.nvidia.cuvs.HnswIndex; import com.nvidia.cuvs.HnswIndexParams; @@ -41,6 +44,20 @@ public static void main(String[] args) throws Throwable { try (CuVSResources resources = CuVSResources.create()) { + // Configure IVF_PQ index parameters (optional - default values set when not defined) + CuVSIvfPqIndexParams cuVSIvfPqIndexParams = new CuVSIvfPqIndexParams.Builder() + .build(); + + // Configure IVF_PQ search parameters (optional - default values set when not defined) + CuVSIvfPqSearchParams cuVSIvfPqSearchParams = new CuVSIvfPqSearchParams.Builder() + .build(); + + // Configure IVF_PQ search parameters (used when build algo is IVF_PQ, optional otherwise) + CuVSIvfPqParams cuVSIvfPqParams = new CuVSIvfPqParams.Builder() + .withCuVSIvfPqIndexParams(cuVSIvfPqIndexParams) + .withCuVSIvfPqSearchParams(cuVSIvfPqSearchParams) + .build(); + // Configure index parameters CagraIndexParams indexParams = new CagraIndexParams.Builder() .withCagraGraphBuildAlgo(CagraGraphBuildAlgo.IVF_PQ) @@ -48,6 +65,7 @@ public static void main(String[] args) throws Throwable { .withIntermediateGraphDegree(128) .withNumWriterThreads(32) .withMetric(CuvsDistanceType.L2Expanded) + .withCuVSIvfPqParams(cuVSIvfPqParams) .build(); // Create the index with the dataset diff --git a/java/internal/src/cuvs_java.c b/java/internal/src/cuvs_java.c index 025b0f6e98..0b9c2f794e 100644 --- a/java/internal/src/cuvs_java.c +++ b/java/internal/src/cuvs_java.c @@ -103,6 +103,12 @@ cuvsCagraIndex_t build_cagra_index(float *dataset, long rows, long dimensions, c cuvsCagraIndex_t index; cuvsCagraIndexCreate(&index); + if (index_params->build_algo == 1) { // when build algo is IVF_PQ + uint32_t n_lists = index_params->graph_build_params->ivf_pq_build_params->n_lists; + // As rows cannot be less than n_lists value so trim down. + index_params->graph_build_params->ivf_pq_build_params->n_lists = rows < n_lists ? rows : n_lists; + } + index_params->compression = compression_params; cuvsStreamSync(cuvs_resources); *return_value = cuvsCagraBuild(cuvs_resources, index_params, &dataset_tensor, index); From 064760df299065f898acabfcd09a58aacdef4e17 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Mon, 21 Apr 2025 11:23:54 +0530 Subject: [PATCH 16/26] remove panama bindings --- .../nvidia/cuvs/internal/panama/CUuuid.java | 44 - .../cuvs/internal/panama/CUuuid_st.java | 176 - .../cuvs/internal/panama/DLDataType.java | 235 - .../nvidia/cuvs/internal/panama/DLDevice.java | 189 - .../cuvs/internal/panama/DLManagedTensor.java | 288 - .../nvidia/cuvs/internal/panama/DLTensor.java | 419 - .../nvidia/cuvs/internal/panama/GpuInfo.java | 342 - .../nvidia/cuvs/internal/panama/GpuInfoH.java | 86 - .../cuvs/internal/panama/PanamaFFMAPI.java | 13904 ------------ .../cuvs/internal/panama/PanamaFFMAPI_1.java | 17672 ---------------- .../nvidia/cuvs/internal/panama/__fsid_t.java | 176 - .../nvidia/cuvs/internal/panama/char1.java | 143 - .../nvidia/cuvs/internal/panama/char2.java | 189 - .../nvidia/cuvs/internal/panama/char3.java | 235 - .../nvidia/cuvs/internal/panama/char4.java | 281 - .../panama/cudaAccessPolicyWindow.java | 328 - .../panama/cudaArrayMemoryRequirements.java | 268 - .../panama/cudaArraySparseProperties.java | 586 - .../internal/panama/cudaAsyncCallback.java | 85 - .../panama/cudaAsyncNotificationInfo.java | 446 - .../panama/cudaAsyncNotificationInfo_t.java | 49 - .../panama/cudaChannelFormatDesc.java | 327 - .../panama/cudaChildGraphNodeParams.java | 143 - .../panama/cudaConditionalNodeParams.java | 281 - .../cuvs/internal/panama/cudaDeviceProp.java | 5207 ----- .../panama/cudaEventRecordNodeParams.java | 143 - .../panama/cudaEventWaitNodeParams.java | 143 - .../cuvs/internal/panama/cudaExtent.java | 235 - .../panama/cudaExternalMemoryBufferDesc.java | 236 - .../panama/cudaExternalMemoryHandleDesc.java | 697 - .../cudaExternalMemoryMipmappedArrayDesc.java | 328 - .../cudaExternalSemaphoreHandleDesc.java | 651 - ...cudaExternalSemaphoreSignalNodeParams.java | 236 - ...daExternalSemaphoreSignalNodeParamsV2.java | 236 - .../cudaExternalSemaphoreSignalParams.java | 1033 - .../cudaExternalSemaphoreSignalParams_v1.java | 870 - .../cudaExternalSemaphoreWaitNodeParams.java | 236 - ...cudaExternalSemaphoreWaitNodeParamsV2.java | 236 - .../cudaExternalSemaphoreWaitParams.java | 1090 - .../cudaExternalSemaphoreWaitParams_v1.java | 927 - .../internal/panama/cudaFuncAttributes.java | 913 - .../internal/panama/cudaGraphEdgeData.java | 47 - .../internal/panama/cudaGraphEdgeData_st.java | 314 - .../panama/cudaGraphExecUpdateResultInfo.java | 46 - .../cudaGraphExecUpdateResultInfo_st.java | 236 - .../panama/cudaGraphInstantiateParams.java | 47 - .../panama/cudaGraphInstantiateParams_st.java | 282 - .../panama/cudaGraphKernelNodeUpdate.java | 706 - .../internal/panama/cudaGraphNodeParams.java | 903 - .../cuvs/internal/panama/cudaHostFn_t.java | 83 - .../internal/panama/cudaHostNodeParams.java | 189 - .../internal/panama/cudaHostNodeParamsV2.java | 189 - .../panama/cudaIpcEventHandle_st.java | 176 - .../internal/panama/cudaIpcEventHandle_t.java | 44 - .../internal/panama/cudaIpcMemHandle_st.java | 176 - .../internal/panama/cudaIpcMemHandle_t.java | 44 - .../internal/panama/cudaKernelNodeParams.java | 374 - .../panama/cudaKernelNodeParamsV2.java | 374 - .../internal/panama/cudaLaunchAttribute.java | 46 - .../panama/cudaLaunchAttributeValue.java | 1574 -- .../panama/cudaLaunchAttribute_st.java | 268 - .../internal/panama/cudaLaunchConfig_st.java | 374 - .../internal/panama/cudaLaunchConfig_t.java | 49 - .../panama/cudaLaunchMemSyncDomainMap.java | 45 - .../panama/cudaLaunchMemSyncDomainMap_st.java | 189 - .../internal/panama/cudaLaunchParams.java | 373 - .../internal/panama/cudaMemAccessDesc.java | 189 - .../panama/cudaMemAllocNodeParams.java | 327 - .../panama/cudaMemAllocNodeParamsV2.java | 327 - .../panama/cudaMemFabricHandle_st.java | 176 - .../panama/cudaMemFabricHandle_t.java | 44 - .../panama/cudaMemFreeNodeParams.java | 143 - .../cuvs/internal/panama/cudaMemLocation.java | 189 - .../internal/panama/cudaMemPoolProps.java | 452 - .../panama/cudaMemPoolPtrExportData.java | 176 - .../internal/panama/cudaMemcpy3DParms.java | 466 - .../panama/cudaMemcpy3DPeerParms.java | 513 - .../internal/panama/cudaMemcpyNodeParams.java | 268 - .../internal/panama/cudaMemsetParams.java | 373 - .../internal/panama/cudaMemsetParamsV2.java | 373 - .../cuvs/internal/panama/cudaPitchedPtr.java | 281 - .../panama/cudaPointerAttributes.java | 281 - .../nvidia/cuvs/internal/panama/cudaPos.java | 235 - .../internal/panama/cudaResourceDesc.java | 1336 -- .../internal/panama/cudaResourceViewDesc.java | 466 - .../internal/panama/cudaStreamCallback_t.java | 85 - .../cuvs/internal/panama/cudaTextureDesc.java | 761 - .../cuvs/internal/panama/cudaUUID_t.java | 44 - .../internal/panama/cuvsBruteForceIndex.java | 190 - .../panama/cuvsCagraCompressionParams.java | 373 - .../panama/cuvsCagraExtendParams.java | 143 - .../cuvs/internal/panama/cuvsCagraIndex.java | 190 - .../internal/panama/cuvsCagraIndexParams.java | 421 - .../panama/cuvsCagraSearchParams.java | 697 - .../cuvs/internal/panama/cuvsFilter.java | 190 - .../internal/panama/cuvsHnswExtendParams.java | 143 - .../cuvs/internal/panama/cuvsHnswIndex.java | 190 - .../internal/panama/cuvsHnswIndexParams.java | 235 - .../internal/panama/cuvsHnswSearchParams.java | 189 - .../cuvs/internal/panama/cuvsIvfPqIndex.java | 190 - .../internal/panama/cuvsIvfPqIndexParams.java | 653 - .../cuvs/internal/panama/cuvsIvfPqParams.java | 236 - .../panama/cuvsIvfPqSearchParams.java | 282 - .../com/nvidia/cuvs/internal/panama/dim3.java | 235 - .../nvidia/cuvs/internal/panama/double1.java | 143 - .../nvidia/cuvs/internal/panama/double2.java | 189 - .../nvidia/cuvs/internal/panama/double3.java | 235 - .../nvidia/cuvs/internal/panama/double4.java | 281 - .../nvidia/cuvs/internal/panama/float1.java | 143 - .../nvidia/cuvs/internal/panama/float2.java | 189 - .../nvidia/cuvs/internal/panama/float3.java | 235 - .../nvidia/cuvs/internal/panama/float4.java | 281 - .../com/nvidia/cuvs/internal/panama/int1.java | 143 - .../com/nvidia/cuvs/internal/panama/int2.java | 189 - .../com/nvidia/cuvs/internal/panama/int3.java | 235 - .../com/nvidia/cuvs/internal/panama/int4.java | 281 - .../nvidia/cuvs/internal/panama/long1.java | 143 - .../nvidia/cuvs/internal/panama/long2.java | 189 - .../nvidia/cuvs/internal/panama/long3.java | 235 - .../nvidia/cuvs/internal/panama/long4.java | 281 - .../cuvs/internal/panama/longlong1.java | 143 - .../cuvs/internal/panama/longlong2.java | 189 - .../cuvs/internal/panama/longlong3.java | 235 - .../cuvs/internal/panama/longlong4.java | 281 - .../cuvs/internal/panama/max_align_t.java | 145 - .../nvidia/cuvs/internal/panama/short1.java | 143 - .../nvidia/cuvs/internal/panama/short2.java | 189 - .../nvidia/cuvs/internal/panama/short3.java | 235 - .../nvidia/cuvs/internal/panama/short4.java | 281 - .../nvidia/cuvs/internal/panama/uchar1.java | 143 - .../nvidia/cuvs/internal/panama/uchar2.java | 189 - .../nvidia/cuvs/internal/panama/uchar3.java | 235 - .../nvidia/cuvs/internal/panama/uchar4.java | 281 - .../nvidia/cuvs/internal/panama/uint1.java | 143 - .../nvidia/cuvs/internal/panama/uint2.java | 189 - .../nvidia/cuvs/internal/panama/uint3.java | 235 - .../nvidia/cuvs/internal/panama/uint4.java | 281 - .../nvidia/cuvs/internal/panama/ulong1.java | 143 - .../nvidia/cuvs/internal/panama/ulong2.java | 189 - .../nvidia/cuvs/internal/panama/ulong3.java | 235 - .../nvidia/cuvs/internal/panama/ulong4.java | 281 - .../cuvs/internal/panama/ulonglong1.java | 143 - .../cuvs/internal/panama/ulonglong2.java | 189 - .../cuvs/internal/panama/ulonglong3.java | 235 - .../cuvs/internal/panama/ulonglong4.java | 281 - .../nvidia/cuvs/internal/panama/ushort1.java | 143 - .../nvidia/cuvs/internal/panama/ushort2.java | 189 - .../nvidia/cuvs/internal/panama/ushort3.java | 235 - .../nvidia/cuvs/internal/panama/ushort4.java | 281 - 149 files changed, 78992 deletions(-) delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDataType.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDevice.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensor.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLTensor.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/GpuInfo.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/GpuInfoH.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI_1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/__fsid_t.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAccessPolicyWindow.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArrayMemoryRequirements.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArraySparseProperties.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncCallback.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo_t.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChannelFormatDesc.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChildGraphNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaConditionalNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaDeviceProp.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventRecordNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventWaitNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExtent.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryBufferDesc.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryHandleDesc.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryMipmappedArrayDesc.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreHandleDesc.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParamsV2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams_v1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParamsV2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams_v1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaFuncAttributes.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphKernelNodeUpdate.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostFn_t.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParamsV2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_t.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_t.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParamsV2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttributeValue.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_t.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAccessDesc.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParamsV2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_st.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_t.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFreeNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemLocation.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolProps.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolPtrExportData.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DParms.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DPeerParms.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpyNodeParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParamsV2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPitchedPtr.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPointerAttributes.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPos.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceDesc.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceViewDesc.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaStreamCallback_t.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaTextureDesc.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaUUID_t.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsBruteForceIndex.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraCompressionParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraExtendParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndex.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndexParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraSearchParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsFilter.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswExtendParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndex.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndexParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswSearchParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndex.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndexParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqSearchParams.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/dim3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/max_align_t.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong4.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort1.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort2.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort3.java delete mode 100644 java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort4.java diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid.java deleted file mode 100644 index 2c65af5646..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct CUuuid_st { - * char bytes[16]; - * } CUuuid - * } - */ -public class CUuuid extends CUuuid_st { - - CUuuid() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid_st.java deleted file mode 100644 index 163b87ea3d..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/CUuuid_st.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct CUuuid_st { - * char bytes[16]; - * } - * } - */ -public class CUuuid_st { - - CUuuid_st() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.sequenceLayout(16, PanamaFFMAPI.C_CHAR).withName("bytes") - ).withName("CUuuid_st"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout bytes$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("bytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * char bytes[16] - * } - */ - public static final SequenceLayout bytes$layout() { - return bytes$LAYOUT; - } - - private static final long bytes$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * char bytes[16] - * } - */ - public static final long bytes$offset() { - return bytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char bytes[16] - * } - */ - public static MemorySegment bytes(MemorySegment struct) { - return struct.asSlice(bytes$OFFSET, bytes$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char bytes[16] - * } - */ - public static void bytes(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, bytes$OFFSET, bytes$LAYOUT.byteSize()); - } - - private static long[] bytes$DIMS = { 16 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char bytes[16] - * } - */ - public static long[] bytes$dimensions() { - return bytes$DIMS; - } - private static final VarHandle bytes$ELEM_HANDLE = bytes$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char bytes[16] - * } - */ - public static byte bytes(MemorySegment struct, long index0) { - return (byte)bytes$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char bytes[16] - * } - */ - public static void bytes(MemorySegment struct, long index0, byte fieldValue) { - bytes$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDataType.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDataType.java deleted file mode 100644 index 7f5ec97847..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDataType.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct { - * uint8_t code; - * uint8_t bits; - * uint16_t lanes; - * } - * } - */ -public class DLDataType { - - DLDataType() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("code"), - PanamaFFMAPI.C_CHAR.withName("bits"), - PanamaFFMAPI.C_SHORT.withName("lanes") - ).withName("$anon$145:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte code$LAYOUT = (OfByte)$LAYOUT.select(groupElement("code")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint8_t code - * } - */ - public static final OfByte code$layout() { - return code$LAYOUT; - } - - private static final long code$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * uint8_t code - * } - */ - public static final long code$offset() { - return code$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint8_t code - * } - */ - public static byte code(MemorySegment struct) { - return struct.get(code$LAYOUT, code$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint8_t code - * } - */ - public static void code(MemorySegment struct, byte fieldValue) { - struct.set(code$LAYOUT, code$OFFSET, fieldValue); - } - - private static final OfByte bits$LAYOUT = (OfByte)$LAYOUT.select(groupElement("bits")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint8_t bits - * } - */ - public static final OfByte bits$layout() { - return bits$LAYOUT; - } - - private static final long bits$OFFSET = 1; - - /** - * Offset for field: - * {@snippet lang=c : - * uint8_t bits - * } - */ - public static final long bits$offset() { - return bits$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint8_t bits - * } - */ - public static byte bits(MemorySegment struct) { - return struct.get(bits$LAYOUT, bits$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint8_t bits - * } - */ - public static void bits(MemorySegment struct, byte fieldValue) { - struct.set(bits$LAYOUT, bits$OFFSET, fieldValue); - } - - private static final OfShort lanes$LAYOUT = (OfShort)$LAYOUT.select(groupElement("lanes")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint16_t lanes - * } - */ - public static final OfShort lanes$layout() { - return lanes$LAYOUT; - } - - private static final long lanes$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * uint16_t lanes - * } - */ - public static final long lanes$offset() { - return lanes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint16_t lanes - * } - */ - public static short lanes(MemorySegment struct) { - return struct.get(lanes$LAYOUT, lanes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint16_t lanes - * } - */ - public static void lanes(MemorySegment struct, short fieldValue) { - struct.set(lanes$LAYOUT, lanes$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDevice.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDevice.java deleted file mode 100644 index e51f370618..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLDevice.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct { - * DLDeviceType device_type; - * int32_t device_id; - * } - * } - */ -public class DLDevice { - - DLDevice() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("device_type"), - PanamaFFMAPI.C_INT.withName("device_id") - ).withName("$anon$97:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt device_type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("device_type")); - - /** - * Layout for field: - * {@snippet lang=c : - * DLDeviceType device_type - * } - */ - public static final OfInt device_type$layout() { - return device_type$LAYOUT; - } - - private static final long device_type$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * DLDeviceType device_type - * } - */ - public static final long device_type$offset() { - return device_type$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DLDeviceType device_type - * } - */ - public static int device_type(MemorySegment struct) { - return struct.get(device_type$LAYOUT, device_type$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DLDeviceType device_type - * } - */ - public static void device_type(MemorySegment struct, int fieldValue) { - struct.set(device_type$LAYOUT, device_type$OFFSET, fieldValue); - } - - private static final OfInt device_id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("device_id")); - - /** - * Layout for field: - * {@snippet lang=c : - * int32_t device_id - * } - */ - public static final OfInt device_id$layout() { - return device_id$LAYOUT; - } - - private static final long device_id$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int32_t device_id - * } - */ - public static final long device_id$offset() { - return device_id$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int32_t device_id - * } - */ - public static int device_id(MemorySegment struct) { - return struct.get(device_id$LAYOUT, device_id$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int32_t device_id - * } - */ - public static void device_id(MemorySegment struct, int fieldValue) { - struct.set(device_id$LAYOUT, device_id$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensor.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensor.java deleted file mode 100644 index 170349b81b..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLManagedTensor.java +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct DLManagedTensor { - * DLTensor dl_tensor; - * void *manager_ctx; - * void (*deleter)(struct DLManagedTensor *); - * } - * } - */ -public class DLManagedTensor { - - DLManagedTensor() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - DLTensor.layout().withName("dl_tensor"), - PanamaFFMAPI.C_POINTER.withName("manager_ctx"), - PanamaFFMAPI.C_POINTER.withName("deleter") - ).withName("DLManagedTensor"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final GroupLayout dl_tensor$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dl_tensor")); - - /** - * Layout for field: - * {@snippet lang=c : - * DLTensor dl_tensor - * } - */ - public static final GroupLayout dl_tensor$layout() { - return dl_tensor$LAYOUT; - } - - private static final long dl_tensor$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * DLTensor dl_tensor - * } - */ - public static final long dl_tensor$offset() { - return dl_tensor$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DLTensor dl_tensor - * } - */ - public static MemorySegment dl_tensor(MemorySegment struct) { - return struct.asSlice(dl_tensor$OFFSET, dl_tensor$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DLTensor dl_tensor - * } - */ - public static void dl_tensor(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dl_tensor$OFFSET, dl_tensor$LAYOUT.byteSize()); - } - - private static final AddressLayout manager_ctx$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("manager_ctx")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *manager_ctx - * } - */ - public static final AddressLayout manager_ctx$layout() { - return manager_ctx$LAYOUT; - } - - private static final long manager_ctx$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * void *manager_ctx - * } - */ - public static final long manager_ctx$offset() { - return manager_ctx$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *manager_ctx - * } - */ - public static MemorySegment manager_ctx(MemorySegment struct) { - return struct.get(manager_ctx$LAYOUT, manager_ctx$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *manager_ctx - * } - */ - public static void manager_ctx(MemorySegment struct, MemorySegment fieldValue) { - struct.set(manager_ctx$LAYOUT, manager_ctx$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * void (*deleter)(struct DLManagedTensor *) - * } - */ - public static class deleter { - - deleter() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - void apply(MemorySegment _x0); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( - PanamaFFMAPI.C_POINTER - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = PanamaFFMAPI.upcallHandle(deleter.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(deleter.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static void invoke(MemorySegment funcPtr,MemorySegment _x0) { - try { - DOWN$MH.invokeExact(funcPtr, _x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static final AddressLayout deleter$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("deleter")); - - /** - * Layout for field: - * {@snippet lang=c : - * void (*deleter)(struct DLManagedTensor *) - * } - */ - public static final AddressLayout deleter$layout() { - return deleter$LAYOUT; - } - - private static final long deleter$OFFSET = 56; - - /** - * Offset for field: - * {@snippet lang=c : - * void (*deleter)(struct DLManagedTensor *) - * } - */ - public static final long deleter$offset() { - return deleter$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void (*deleter)(struct DLManagedTensor *) - * } - */ - public static MemorySegment deleter(MemorySegment struct) { - return struct.get(deleter$LAYOUT, deleter$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void (*deleter)(struct DLManagedTensor *) - * } - */ - public static void deleter(MemorySegment struct, MemorySegment fieldValue) { - struct.set(deleter$LAYOUT, deleter$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLTensor.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLTensor.java deleted file mode 100644 index 248c1046d0..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/DLTensor.java +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct { - * void *data; - * DLDevice device; - * int32_t ndim; - * DLDataType dtype; - * int64_t *shape; - * int64_t *strides; - * uint64_t byte_offset; - * } - * } - */ -public class DLTensor { - - DLTensor() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("data"), - DLDevice.layout().withName("device"), - PanamaFFMAPI.C_INT.withName("ndim"), - DLDataType.layout().withName("dtype"), - PanamaFFMAPI.C_POINTER.withName("shape"), - PanamaFFMAPI.C_POINTER.withName("strides"), - PanamaFFMAPI.C_LONG.withName("byte_offset") - ).withName("$anon$163:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout data$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("data")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *data - * } - */ - public static final AddressLayout data$layout() { - return data$LAYOUT; - } - - private static final long data$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *data - * } - */ - public static final long data$offset() { - return data$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *data - * } - */ - public static MemorySegment data(MemorySegment struct) { - return struct.get(data$LAYOUT, data$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *data - * } - */ - public static void data(MemorySegment struct, MemorySegment fieldValue) { - struct.set(data$LAYOUT, data$OFFSET, fieldValue); - } - - private static final GroupLayout device$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("device")); - - /** - * Layout for field: - * {@snippet lang=c : - * DLDevice device - * } - */ - public static final GroupLayout device$layout() { - return device$LAYOUT; - } - - private static final long device$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * DLDevice device - * } - */ - public static final long device$offset() { - return device$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DLDevice device - * } - */ - public static MemorySegment device(MemorySegment struct) { - return struct.asSlice(device$OFFSET, device$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DLDevice device - * } - */ - public static void device(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, device$OFFSET, device$LAYOUT.byteSize()); - } - - private static final OfInt ndim$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ndim")); - - /** - * Layout for field: - * {@snippet lang=c : - * int32_t ndim - * } - */ - public static final OfInt ndim$layout() { - return ndim$LAYOUT; - } - - private static final long ndim$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * int32_t ndim - * } - */ - public static final long ndim$offset() { - return ndim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int32_t ndim - * } - */ - public static int ndim(MemorySegment struct) { - return struct.get(ndim$LAYOUT, ndim$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int32_t ndim - * } - */ - public static void ndim(MemorySegment struct, int fieldValue) { - struct.set(ndim$LAYOUT, ndim$OFFSET, fieldValue); - } - - private static final GroupLayout dtype$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dtype")); - - /** - * Layout for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static final GroupLayout dtype$layout() { - return dtype$LAYOUT; - } - - private static final long dtype$OFFSET = 20; - - /** - * Offset for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static final long dtype$offset() { - return dtype$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static MemorySegment dtype(MemorySegment struct) { - return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static void dtype(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - private static final AddressLayout shape$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("shape")); - - /** - * Layout for field: - * {@snippet lang=c : - * int64_t *shape - * } - */ - public static final AddressLayout shape$layout() { - return shape$LAYOUT; - } - - private static final long shape$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * int64_t *shape - * } - */ - public static final long shape$offset() { - return shape$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int64_t *shape - * } - */ - public static MemorySegment shape(MemorySegment struct) { - return struct.get(shape$LAYOUT, shape$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int64_t *shape - * } - */ - public static void shape(MemorySegment struct, MemorySegment fieldValue) { - struct.set(shape$LAYOUT, shape$OFFSET, fieldValue); - } - - private static final AddressLayout strides$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("strides")); - - /** - * Layout for field: - * {@snippet lang=c : - * int64_t *strides - * } - */ - public static final AddressLayout strides$layout() { - return strides$LAYOUT; - } - - private static final long strides$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * int64_t *strides - * } - */ - public static final long strides$offset() { - return strides$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int64_t *strides - * } - */ - public static MemorySegment strides(MemorySegment struct) { - return struct.get(strides$LAYOUT, strides$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int64_t *strides - * } - */ - public static void strides(MemorySegment struct, MemorySegment fieldValue) { - struct.set(strides$LAYOUT, strides$OFFSET, fieldValue); - } - - private static final OfLong byte_offset$LAYOUT = (OfLong)$LAYOUT.select(groupElement("byte_offset")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint64_t byte_offset - * } - */ - public static final OfLong byte_offset$layout() { - return byte_offset$LAYOUT; - } - - private static final long byte_offset$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * uint64_t byte_offset - * } - */ - public static final long byte_offset$offset() { - return byte_offset$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint64_t byte_offset - * } - */ - public static long byte_offset(MemorySegment struct) { - return struct.get(byte_offset$LAYOUT, byte_offset$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint64_t byte_offset - * } - */ - public static void byte_offset(MemorySegment struct, long fieldValue) { - struct.set(byte_offset$LAYOUT, byte_offset$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/GpuInfo.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/GpuInfo.java deleted file mode 100644 index eb8aba2235..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/GpuInfo.java +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.MemoryLayout.PathElement.groupElement; -import static java.lang.foreign.MemoryLayout.PathElement.sequenceElement; - -import java.lang.foreign.Arena; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.SequenceLayout; -import java.lang.foreign.ValueLayout.OfFloat; -import java.lang.foreign.ValueLayout.OfInt; -import java.lang.foreign.ValueLayout.OfLong; -import java.lang.invoke.VarHandle; -import java.util.function.Consumer; - -/** - * {@snippet lang = c : - * struct gpuInfo { - * int gpu_id; - * char name[256]; - * long free_memory; - * long total_memory; - * float compute_capability; - * } - * } - */ -public class GpuInfo { - GpuInfo() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(GpuInfoH.C_INT.withName("gpu_id"), - MemoryLayout.sequenceLayout(256, GpuInfoH.C_CHAR).withName("name"), MemoryLayout.paddingLayout(4), - GpuInfoH.C_LONG.withName("free_memory"), GpuInfoH.C_LONG.withName("total_memory"), - GpuInfoH.C_FLOAT.withName("compute_capability"), MemoryLayout.paddingLayout(4)).withName("gpuInfo"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt gpu_id$LAYOUT = (OfInt) $LAYOUT.select(groupElement("gpu_id")); - - /** - * Layout for field: - * {@snippet lang = c : * int gpu_id - * } - */ - public static final OfInt gpu_id$layout() { - return gpu_id$LAYOUT; - } - - private static final long gpu_id$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang = c : * int gpu_id - * } - */ - public static final long gpu_id$offset() { - return gpu_id$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * int gpu_id - * } - */ - public static int gpu_id(MemorySegment struct) { - return struct.get(gpu_id$LAYOUT, gpu_id$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * int gpu_id - * } - */ - public static void gpu_id(MemorySegment struct, int fieldValue) { - struct.set(gpu_id$LAYOUT, gpu_id$OFFSET, fieldValue); - } - - private static final SequenceLayout name$LAYOUT = (SequenceLayout) $LAYOUT.select(groupElement("name")); - - /** - * Layout for field: - * {@snippet lang = c : * char name[256] - * } - */ - public static final SequenceLayout name$layout() { - return name$LAYOUT; - } - - private static final long name$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang = c : * char name[256] - * } - */ - public static final long name$offset() { - return name$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * char name[256] - * } - */ - public static MemorySegment name(MemorySegment struct) { - return struct.asSlice(name$OFFSET, name$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang = c : * char name[256] - * } - */ - public static void name(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, name$OFFSET, name$LAYOUT.byteSize()); - } - - private static long[] name$DIMS = { 256 }; - - /** - * Dimensions for array field: - * {@snippet lang = c : * char name[256] - * } - */ - public static long[] name$dimensions() { - return name$DIMS; - } - - private static final VarHandle name$ELEM_HANDLE = name$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang = c : * char name[256] - * } - */ - public static byte name(MemorySegment struct, long index0) { - return (byte) name$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang = c : * char name[256] - * } - */ - public static void name(MemorySegment struct, long index0, byte fieldValue) { - name$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final OfLong free_memory$LAYOUT = (OfLong) $LAYOUT.select(groupElement("free_memory")); - - /** - * Layout for field: - * {@snippet lang = c : * long free_memory - * } - */ - public static final OfLong free_memory$layout() { - return free_memory$LAYOUT; - } - - private static final long free_memory$OFFSET = 264; - - /** - * Offset for field: - * {@snippet lang = c : * long free_memory - * } - */ - public static final long free_memory$offset() { - return free_memory$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long free_memory - * } - */ - public static long free_memory(MemorySegment struct) { - return struct.get(free_memory$LAYOUT, free_memory$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long free_memory - * } - */ - public static void free_memory(MemorySegment struct, long fieldValue) { - struct.set(free_memory$LAYOUT, free_memory$OFFSET, fieldValue); - } - - private static final OfLong total_memory$LAYOUT = (OfLong) $LAYOUT.select(groupElement("total_memory")); - - /** - * Layout for field: - * {@snippet lang = c : * long total_memory - * } - */ - public static final OfLong total_memory$layout() { - return total_memory$LAYOUT; - } - - private static final long total_memory$OFFSET = 272; - - /** - * Offset for field: - * {@snippet lang = c : * long total_memory - * } - */ - public static final long total_memory$offset() { - return total_memory$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * long total_memory - * } - */ - public static long total_memory(MemorySegment struct) { - return struct.get(total_memory$LAYOUT, total_memory$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * long total_memory - * } - */ - public static void total_memory(MemorySegment struct, long fieldValue) { - struct.set(total_memory$LAYOUT, total_memory$OFFSET, fieldValue); - } - - private static final OfFloat compute_capability$LAYOUT = (OfFloat) $LAYOUT.select(groupElement("compute_capability")); - - /** - * Layout for field: - * {@snippet lang = c : * float compute_capability - * } - */ - public static final OfFloat compute_capability$layout() { - return compute_capability$LAYOUT; - } - - private static final long compute_capability$OFFSET = 280; - - /** - * Offset for field: - * {@snippet lang = c : * float compute_capability - * } - */ - public static final long compute_capability$offset() { - return compute_capability$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang = c : * float compute_capability - * } - */ - public static float compute_capability(MemorySegment struct) { - return struct.get(compute_capability$LAYOUT, compute_capability$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang = c : * float compute_capability - * } - */ - public static void compute_capability(MemorySegment struct, float fieldValue) { - struct.set(compute_capability$LAYOUT, compute_capability$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at - * {@code index}. The returned segment has address - * {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { - return layout().byteSize(); - } - - /** - * Allocate a segment of size {@code layout().byteSize()} using - * {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. The - * returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and - * {@code cleanupAction} (if any). The returned segment has size - * {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, - Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/GpuInfoH.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/GpuInfoH.java deleted file mode 100644 index 0457d50be0..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/GpuInfoH.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.nvidia.cuvs.internal.panama; - -import static java.lang.foreign.ValueLayout.JAVA_BYTE; - -import java.lang.foreign.AddressLayout; -import java.lang.foreign.Arena; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.PaddingLayout; -import java.lang.foreign.SequenceLayout; -import java.lang.foreign.StructLayout; -import java.lang.foreign.SymbolLookup; -import java.lang.foreign.ValueLayout; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.util.Arrays; -import java.util.stream.Collectors; - -public class GpuInfoH { - GpuInfoH() { - // Should not be called directly - } - - static final Arena LIBRARY_ARENA = Arena.ofAuto(); - static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); - - static void traceDowncall(String name, Object... args) { - String traceArgs = Arrays.stream(args).map(Object::toString).collect(Collectors.joining(", ")); - System.out.printf("%s(%s)\n", name, traceArgs); - } - - static MemorySegment findOrThrow(String symbol) { - return SYMBOL_LOOKUP.find(symbol).orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); - } - - static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { - try { - return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); - } catch (ReflectiveOperationException ex) { - throw new AssertionError(ex); - } - } - - static MemoryLayout align(MemoryLayout layout, long align) { - return switch (layout) { - case PaddingLayout p -> p; - case ValueLayout v -> v.withByteAlignment(align); - case GroupLayout g -> { - MemoryLayout[] alignedMembers = g.memberLayouts().stream().map(m -> align(m, align)).toArray(MemoryLayout[]::new); - yield g instanceof StructLayout ? MemoryLayout.structLayout(alignedMembers) - : MemoryLayout.unionLayout(alignedMembers); - } - case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); - }; - } - - static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup().or(Linker.nativeLinker().defaultLookup()); - public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; - public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; - public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; - public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; - public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; - public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; - public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; - public static final AddressLayout C_POINTER = ValueLayout.ADDRESS - .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); - public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI.java deleted file mode 100644 index 57341923df..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI.java +++ /dev/null @@ -1,13904 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -public class PanamaFFMAPI extends PanamaFFMAPI_1 { - - PanamaFFMAPI() { - // Should not be called directly - } - - private static class cudaMemPoolSetAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolSetAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) - * } - */ - public static FunctionDescriptor cudaMemPoolSetAttribute$descriptor() { - return cudaMemPoolSetAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) - * } - */ - public static MethodHandle cudaMemPoolSetAttribute$handle() { - return cudaMemPoolSetAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) - * } - */ - public static MemorySegment cudaMemPoolSetAttribute$address() { - return cudaMemPoolSetAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolSetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) - * } - */ - public static int cudaMemPoolSetAttribute(MemorySegment memPool, int attr, MemorySegment value) { - var mh$ = cudaMemPoolSetAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolSetAttribute", memPool, attr, value); - } - return (int)mh$.invokeExact(memPool, attr, value); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPoolGetAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolGetAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) - * } - */ - public static FunctionDescriptor cudaMemPoolGetAttribute$descriptor() { - return cudaMemPoolGetAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) - * } - */ - public static MethodHandle cudaMemPoolGetAttribute$handle() { - return cudaMemPoolGetAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) - * } - */ - public static MemorySegment cudaMemPoolGetAttribute$address() { - return cudaMemPoolGetAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolGetAttribute(cudaMemPool_t memPool, enum cudaMemPoolAttr attr, void *value) - * } - */ - public static int cudaMemPoolGetAttribute(MemorySegment memPool, int attr, MemorySegment value) { - var mh$ = cudaMemPoolGetAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolGetAttribute", memPool, attr, value); - } - return (int)mh$.invokeExact(memPool, attr, value); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPoolSetAccess { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolSetAccess"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const struct cudaMemAccessDesc *descList, size_t count) - * } - */ - public static FunctionDescriptor cudaMemPoolSetAccess$descriptor() { - return cudaMemPoolSetAccess.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const struct cudaMemAccessDesc *descList, size_t count) - * } - */ - public static MethodHandle cudaMemPoolSetAccess$handle() { - return cudaMemPoolSetAccess.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const struct cudaMemAccessDesc *descList, size_t count) - * } - */ - public static MemorySegment cudaMemPoolSetAccess$address() { - return cudaMemPoolSetAccess.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolSetAccess(cudaMemPool_t memPool, const struct cudaMemAccessDesc *descList, size_t count) - * } - */ - public static int cudaMemPoolSetAccess(MemorySegment memPool, MemorySegment descList, long count) { - var mh$ = cudaMemPoolSetAccess.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolSetAccess", memPool, descList, count); - } - return (int)mh$.invokeExact(memPool, descList, count); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPoolGetAccess { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolGetAccess"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolGetAccess(enum cudaMemAccessFlags *flags, cudaMemPool_t memPool, struct cudaMemLocation *location) - * } - */ - public static FunctionDescriptor cudaMemPoolGetAccess$descriptor() { - return cudaMemPoolGetAccess.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolGetAccess(enum cudaMemAccessFlags *flags, cudaMemPool_t memPool, struct cudaMemLocation *location) - * } - */ - public static MethodHandle cudaMemPoolGetAccess$handle() { - return cudaMemPoolGetAccess.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolGetAccess(enum cudaMemAccessFlags *flags, cudaMemPool_t memPool, struct cudaMemLocation *location) - * } - */ - public static MemorySegment cudaMemPoolGetAccess$address() { - return cudaMemPoolGetAccess.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolGetAccess(enum cudaMemAccessFlags *flags, cudaMemPool_t memPool, struct cudaMemLocation *location) - * } - */ - public static int cudaMemPoolGetAccess(MemorySegment flags, MemorySegment memPool, MemorySegment location) { - var mh$ = cudaMemPoolGetAccess.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolGetAccess", flags, memPool, location); - } - return (int)mh$.invokeExact(flags, memPool, location); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPoolCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolCreate(cudaMemPool_t *memPool, const struct cudaMemPoolProps *poolProps) - * } - */ - public static FunctionDescriptor cudaMemPoolCreate$descriptor() { - return cudaMemPoolCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolCreate(cudaMemPool_t *memPool, const struct cudaMemPoolProps *poolProps) - * } - */ - public static MethodHandle cudaMemPoolCreate$handle() { - return cudaMemPoolCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolCreate(cudaMemPool_t *memPool, const struct cudaMemPoolProps *poolProps) - * } - */ - public static MemorySegment cudaMemPoolCreate$address() { - return cudaMemPoolCreate.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolCreate(cudaMemPool_t *memPool, const struct cudaMemPoolProps *poolProps) - * } - */ - public static int cudaMemPoolCreate(MemorySegment memPool, MemorySegment poolProps) { - var mh$ = cudaMemPoolCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolCreate", memPool, poolProps); - } - return (int)mh$.invokeExact(memPool, poolProps); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPoolDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) - * } - */ - public static FunctionDescriptor cudaMemPoolDestroy$descriptor() { - return cudaMemPoolDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) - * } - */ - public static MethodHandle cudaMemPoolDestroy$handle() { - return cudaMemPoolDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) - * } - */ - public static MemorySegment cudaMemPoolDestroy$address() { - return cudaMemPoolDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolDestroy(cudaMemPool_t memPool) - * } - */ - public static int cudaMemPoolDestroy(MemorySegment memPool) { - var mh$ = cudaMemPoolDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolDestroy", memPool); - } - return (int)mh$.invokeExact(memPool); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMallocFromPoolAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocFromPoolAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocFromPoolAsync(void **ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMallocFromPoolAsync$descriptor() { - return cudaMallocFromPoolAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocFromPoolAsync(void **ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMallocFromPoolAsync$handle() { - return cudaMallocFromPoolAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocFromPoolAsync(void **ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMallocFromPoolAsync$address() { - return cudaMallocFromPoolAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMallocFromPoolAsync(void **ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream) - * } - */ - public static int cudaMallocFromPoolAsync(MemorySegment ptr, long size, MemorySegment memPool, MemorySegment stream) { - var mh$ = cudaMallocFromPoolAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMallocFromPoolAsync", ptr, size, memPool, stream); - } - return (int)mh$.invokeExact(ptr, size, memPool, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPoolExportToShareableHandle { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolExportToShareableHandle"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolExportToShareableHandle(void *shareableHandle, cudaMemPool_t memPool, enum cudaMemAllocationHandleType handleType, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaMemPoolExportToShareableHandle$descriptor() { - return cudaMemPoolExportToShareableHandle.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolExportToShareableHandle(void *shareableHandle, cudaMemPool_t memPool, enum cudaMemAllocationHandleType handleType, unsigned int flags) - * } - */ - public static MethodHandle cudaMemPoolExportToShareableHandle$handle() { - return cudaMemPoolExportToShareableHandle.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolExportToShareableHandle(void *shareableHandle, cudaMemPool_t memPool, enum cudaMemAllocationHandleType handleType, unsigned int flags) - * } - */ - public static MemorySegment cudaMemPoolExportToShareableHandle$address() { - return cudaMemPoolExportToShareableHandle.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolExportToShareableHandle(void *shareableHandle, cudaMemPool_t memPool, enum cudaMemAllocationHandleType handleType, unsigned int flags) - * } - */ - public static int cudaMemPoolExportToShareableHandle(MemorySegment shareableHandle, MemorySegment memPool, int handleType, int flags) { - var mh$ = cudaMemPoolExportToShareableHandle.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolExportToShareableHandle", shareableHandle, memPool, handleType, flags); - } - return (int)mh$.invokeExact(shareableHandle, memPool, handleType, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPoolImportFromShareableHandle { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolImportFromShareableHandle"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t *memPool, void *shareableHandle, enum cudaMemAllocationHandleType handleType, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaMemPoolImportFromShareableHandle$descriptor() { - return cudaMemPoolImportFromShareableHandle.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t *memPool, void *shareableHandle, enum cudaMemAllocationHandleType handleType, unsigned int flags) - * } - */ - public static MethodHandle cudaMemPoolImportFromShareableHandle$handle() { - return cudaMemPoolImportFromShareableHandle.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t *memPool, void *shareableHandle, enum cudaMemAllocationHandleType handleType, unsigned int flags) - * } - */ - public static MemorySegment cudaMemPoolImportFromShareableHandle$address() { - return cudaMemPoolImportFromShareableHandle.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolImportFromShareableHandle(cudaMemPool_t *memPool, void *shareableHandle, enum cudaMemAllocationHandleType handleType, unsigned int flags) - * } - */ - public static int cudaMemPoolImportFromShareableHandle(MemorySegment memPool, MemorySegment shareableHandle, int handleType, int flags) { - var mh$ = cudaMemPoolImportFromShareableHandle.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolImportFromShareableHandle", memPool, shareableHandle, handleType, flags); - } - return (int)mh$.invokeExact(memPool, shareableHandle, handleType, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPoolExportPointer { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolExportPointer"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolExportPointer(struct cudaMemPoolPtrExportData *exportData, void *ptr) - * } - */ - public static FunctionDescriptor cudaMemPoolExportPointer$descriptor() { - return cudaMemPoolExportPointer.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolExportPointer(struct cudaMemPoolPtrExportData *exportData, void *ptr) - * } - */ - public static MethodHandle cudaMemPoolExportPointer$handle() { - return cudaMemPoolExportPointer.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolExportPointer(struct cudaMemPoolPtrExportData *exportData, void *ptr) - * } - */ - public static MemorySegment cudaMemPoolExportPointer$address() { - return cudaMemPoolExportPointer.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolExportPointer(struct cudaMemPoolPtrExportData *exportData, void *ptr) - * } - */ - public static int cudaMemPoolExportPointer(MemorySegment exportData, MemorySegment ptr) { - var mh$ = cudaMemPoolExportPointer.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolExportPointer", exportData, ptr); - } - return (int)mh$.invokeExact(exportData, ptr); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPoolImportPointer { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolImportPointer"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolImportPointer(void **ptr, cudaMemPool_t memPool, struct cudaMemPoolPtrExportData *exportData) - * } - */ - public static FunctionDescriptor cudaMemPoolImportPointer$descriptor() { - return cudaMemPoolImportPointer.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolImportPointer(void **ptr, cudaMemPool_t memPool, struct cudaMemPoolPtrExportData *exportData) - * } - */ - public static MethodHandle cudaMemPoolImportPointer$handle() { - return cudaMemPoolImportPointer.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolImportPointer(void **ptr, cudaMemPool_t memPool, struct cudaMemPoolPtrExportData *exportData) - * } - */ - public static MemorySegment cudaMemPoolImportPointer$address() { - return cudaMemPoolImportPointer.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolImportPointer(void **ptr, cudaMemPool_t memPool, struct cudaMemPoolPtrExportData *exportData) - * } - */ - public static int cudaMemPoolImportPointer(MemorySegment ptr, MemorySegment memPool, MemorySegment exportData) { - var mh$ = cudaMemPoolImportPointer.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolImportPointer", ptr, memPool, exportData); - } - return (int)mh$.invokeExact(ptr, memPool, exportData); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaPointerGetAttributes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaPointerGetAttributes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaPointerGetAttributes(struct cudaPointerAttributes *attributes, const void *ptr) - * } - */ - public static FunctionDescriptor cudaPointerGetAttributes$descriptor() { - return cudaPointerGetAttributes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaPointerGetAttributes(struct cudaPointerAttributes *attributes, const void *ptr) - * } - */ - public static MethodHandle cudaPointerGetAttributes$handle() { - return cudaPointerGetAttributes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaPointerGetAttributes(struct cudaPointerAttributes *attributes, const void *ptr) - * } - */ - public static MemorySegment cudaPointerGetAttributes$address() { - return cudaPointerGetAttributes.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaPointerGetAttributes(struct cudaPointerAttributes *attributes, const void *ptr) - * } - */ - public static int cudaPointerGetAttributes(MemorySegment attributes, MemorySegment ptr) { - var mh$ = cudaPointerGetAttributes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaPointerGetAttributes", attributes, ptr); - } - return (int)mh$.invokeExact(attributes, ptr); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceCanAccessPeer { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceCanAccessPeer"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice) - * } - */ - public static FunctionDescriptor cudaDeviceCanAccessPeer$descriptor() { - return cudaDeviceCanAccessPeer.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice) - * } - */ - public static MethodHandle cudaDeviceCanAccessPeer$handle() { - return cudaDeviceCanAccessPeer.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice) - * } - */ - public static MemorySegment cudaDeviceCanAccessPeer$address() { - return cudaDeviceCanAccessPeer.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceCanAccessPeer(int *canAccessPeer, int device, int peerDevice) - * } - */ - public static int cudaDeviceCanAccessPeer(MemorySegment canAccessPeer, int device, int peerDevice) { - var mh$ = cudaDeviceCanAccessPeer.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceCanAccessPeer", canAccessPeer, device, peerDevice); - } - return (int)mh$.invokeExact(canAccessPeer, device, peerDevice); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceEnablePeerAccess { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceEnablePeerAccess"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaDeviceEnablePeerAccess$descriptor() { - return cudaDeviceEnablePeerAccess.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) - * } - */ - public static MethodHandle cudaDeviceEnablePeerAccess$handle() { - return cudaDeviceEnablePeerAccess.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) - * } - */ - public static MemorySegment cudaDeviceEnablePeerAccess$address() { - return cudaDeviceEnablePeerAccess.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceEnablePeerAccess(int peerDevice, unsigned int flags) - * } - */ - public static int cudaDeviceEnablePeerAccess(int peerDevice, int flags) { - var mh$ = cudaDeviceEnablePeerAccess.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceEnablePeerAccess", peerDevice, flags); - } - return (int)mh$.invokeExact(peerDevice, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceDisablePeerAccess { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceDisablePeerAccess"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) - * } - */ - public static FunctionDescriptor cudaDeviceDisablePeerAccess$descriptor() { - return cudaDeviceDisablePeerAccess.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) - * } - */ - public static MethodHandle cudaDeviceDisablePeerAccess$handle() { - return cudaDeviceDisablePeerAccess.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) - * } - */ - public static MemorySegment cudaDeviceDisablePeerAccess$address() { - return cudaDeviceDisablePeerAccess.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceDisablePeerAccess(int peerDevice) - * } - */ - public static int cudaDeviceDisablePeerAccess(int peerDevice) { - var mh$ = cudaDeviceDisablePeerAccess.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceDisablePeerAccess", peerDevice); - } - return (int)mh$.invokeExact(peerDevice); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphicsUnregisterResource { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsUnregisterResource"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) - * } - */ - public static FunctionDescriptor cudaGraphicsUnregisterResource$descriptor() { - return cudaGraphicsUnregisterResource.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) - * } - */ - public static MethodHandle cudaGraphicsUnregisterResource$handle() { - return cudaGraphicsUnregisterResource.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) - * } - */ - public static MemorySegment cudaGraphicsUnregisterResource$address() { - return cudaGraphicsUnregisterResource.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsUnregisterResource(cudaGraphicsResource_t resource) - * } - */ - public static int cudaGraphicsUnregisterResource(MemorySegment resource) { - var mh$ = cudaGraphicsUnregisterResource.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphicsUnregisterResource", resource); - } - return (int)mh$.invokeExact(resource); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphicsResourceSetMapFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsResourceSetMapFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaGraphicsResourceSetMapFlags$descriptor() { - return cudaGraphicsResourceSetMapFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) - * } - */ - public static MethodHandle cudaGraphicsResourceSetMapFlags$handle() { - return cudaGraphicsResourceSetMapFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) - * } - */ - public static MemorySegment cudaGraphicsResourceSetMapFlags$address() { - return cudaGraphicsResourceSetMapFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceSetMapFlags(cudaGraphicsResource_t resource, unsigned int flags) - * } - */ - public static int cudaGraphicsResourceSetMapFlags(MemorySegment resource, int flags) { - var mh$ = cudaGraphicsResourceSetMapFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphicsResourceSetMapFlags", resource, flags); - } - return (int)mh$.invokeExact(resource, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphicsMapResources { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsMapResources"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaGraphicsMapResources$descriptor() { - return cudaGraphicsMapResources.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) - * } - */ - public static MethodHandle cudaGraphicsMapResources$handle() { - return cudaGraphicsMapResources.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) - * } - */ - public static MemorySegment cudaGraphicsMapResources$address() { - return cudaGraphicsMapResources.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsMapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) - * } - */ - public static int cudaGraphicsMapResources(int count, MemorySegment resources, MemorySegment stream) { - var mh$ = cudaGraphicsMapResources.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphicsMapResources", count, resources, stream); - } - return (int)mh$.invokeExact(count, resources, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphicsUnmapResources { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsUnmapResources"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaGraphicsUnmapResources$descriptor() { - return cudaGraphicsUnmapResources.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) - * } - */ - public static MethodHandle cudaGraphicsUnmapResources$handle() { - return cudaGraphicsUnmapResources.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) - * } - */ - public static MemorySegment cudaGraphicsUnmapResources$address() { - return cudaGraphicsUnmapResources.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsUnmapResources(int count, cudaGraphicsResource_t *resources, cudaStream_t stream) - * } - */ - public static int cudaGraphicsUnmapResources(int count, MemorySegment resources, MemorySegment stream) { - var mh$ = cudaGraphicsUnmapResources.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphicsUnmapResources", count, resources, stream); - } - return (int)mh$.invokeExact(count, resources, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphicsResourceGetMappedPointer { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsResourceGetMappedPointer"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceGetMappedPointer(void **devPtr, size_t *size, cudaGraphicsResource_t resource) - * } - */ - public static FunctionDescriptor cudaGraphicsResourceGetMappedPointer$descriptor() { - return cudaGraphicsResourceGetMappedPointer.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceGetMappedPointer(void **devPtr, size_t *size, cudaGraphicsResource_t resource) - * } - */ - public static MethodHandle cudaGraphicsResourceGetMappedPointer$handle() { - return cudaGraphicsResourceGetMappedPointer.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceGetMappedPointer(void **devPtr, size_t *size, cudaGraphicsResource_t resource) - * } - */ - public static MemorySegment cudaGraphicsResourceGetMappedPointer$address() { - return cudaGraphicsResourceGetMappedPointer.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceGetMappedPointer(void **devPtr, size_t *size, cudaGraphicsResource_t resource) - * } - */ - public static int cudaGraphicsResourceGetMappedPointer(MemorySegment devPtr, MemorySegment size, MemorySegment resource) { - var mh$ = cudaGraphicsResourceGetMappedPointer.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphicsResourceGetMappedPointer", devPtr, size, resource); - } - return (int)mh$.invokeExact(devPtr, size, resource); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphicsSubResourceGetMappedArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsSubResourceGetMappedArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t *array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) - * } - */ - public static FunctionDescriptor cudaGraphicsSubResourceGetMappedArray$descriptor() { - return cudaGraphicsSubResourceGetMappedArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t *array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) - * } - */ - public static MethodHandle cudaGraphicsSubResourceGetMappedArray$handle() { - return cudaGraphicsSubResourceGetMappedArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t *array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) - * } - */ - public static MemorySegment cudaGraphicsSubResourceGetMappedArray$address() { - return cudaGraphicsSubResourceGetMappedArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsSubResourceGetMappedArray(cudaArray_t *array, cudaGraphicsResource_t resource, unsigned int arrayIndex, unsigned int mipLevel) - * } - */ - public static int cudaGraphicsSubResourceGetMappedArray(MemorySegment array, MemorySegment resource, int arrayIndex, int mipLevel) { - var mh$ = cudaGraphicsSubResourceGetMappedArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphicsSubResourceGetMappedArray", array, resource, arrayIndex, mipLevel); - } - return (int)mh$.invokeExact(array, resource, arrayIndex, mipLevel); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphicsResourceGetMappedMipmappedArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphicsResourceGetMappedMipmappedArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t *mipmappedArray, cudaGraphicsResource_t resource) - * } - */ - public static FunctionDescriptor cudaGraphicsResourceGetMappedMipmappedArray$descriptor() { - return cudaGraphicsResourceGetMappedMipmappedArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t *mipmappedArray, cudaGraphicsResource_t resource) - * } - */ - public static MethodHandle cudaGraphicsResourceGetMappedMipmappedArray$handle() { - return cudaGraphicsResourceGetMappedMipmappedArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t *mipmappedArray, cudaGraphicsResource_t resource) - * } - */ - public static MemorySegment cudaGraphicsResourceGetMappedMipmappedArray$address() { - return cudaGraphicsResourceGetMappedMipmappedArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphicsResourceGetMappedMipmappedArray(cudaMipmappedArray_t *mipmappedArray, cudaGraphicsResource_t resource) - * } - */ - public static int cudaGraphicsResourceGetMappedMipmappedArray(MemorySegment mipmappedArray, MemorySegment resource) { - var mh$ = cudaGraphicsResourceGetMappedMipmappedArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphicsResourceGetMappedMipmappedArray", mipmappedArray, resource); - } - return (int)mh$.invokeExact(mipmappedArray, resource); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetChannelDesc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetChannelDesc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetChannelDesc(struct cudaChannelFormatDesc *desc, cudaArray_const_t array) - * } - */ - public static FunctionDescriptor cudaGetChannelDesc$descriptor() { - return cudaGetChannelDesc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetChannelDesc(struct cudaChannelFormatDesc *desc, cudaArray_const_t array) - * } - */ - public static MethodHandle cudaGetChannelDesc$handle() { - return cudaGetChannelDesc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetChannelDesc(struct cudaChannelFormatDesc *desc, cudaArray_const_t array) - * } - */ - public static MemorySegment cudaGetChannelDesc$address() { - return cudaGetChannelDesc.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetChannelDesc(struct cudaChannelFormatDesc *desc, cudaArray_const_t array) - * } - */ - public static int cudaGetChannelDesc(MemorySegment desc, MemorySegment array) { - var mh$ = cudaGetChannelDesc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetChannelDesc", desc, array); - } - return (int)mh$.invokeExact(desc, array); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaCreateChannelDesc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - cudaChannelFormatDesc.layout(), - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaCreateChannelDesc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern struct cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, enum cudaChannelFormatKind f) - * } - */ - public static FunctionDescriptor cudaCreateChannelDesc$descriptor() { - return cudaCreateChannelDesc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern struct cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, enum cudaChannelFormatKind f) - * } - */ - public static MethodHandle cudaCreateChannelDesc$handle() { - return cudaCreateChannelDesc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern struct cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, enum cudaChannelFormatKind f) - * } - */ - public static MemorySegment cudaCreateChannelDesc$address() { - return cudaCreateChannelDesc.ADDR; - } - - /** - * {@snippet lang=c : - * extern struct cudaChannelFormatDesc cudaCreateChannelDesc(int x, int y, int z, int w, enum cudaChannelFormatKind f) - * } - */ - public static MemorySegment cudaCreateChannelDesc(SegmentAllocator allocator, int x, int y, int z, int w, int f) { - var mh$ = cudaCreateChannelDesc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaCreateChannelDesc", allocator, x, y, z, w, f); - } - return (MemorySegment)mh$.invokeExact(allocator, x, y, z, w, f); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaCreateTextureObject { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaCreateTextureObject"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaCreateTextureObject(cudaTextureObject_t *pTexObject, const struct cudaResourceDesc *pResDesc, const struct cudaTextureDesc *pTexDesc, const struct cudaResourceViewDesc *pResViewDesc) - * } - */ - public static FunctionDescriptor cudaCreateTextureObject$descriptor() { - return cudaCreateTextureObject.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaCreateTextureObject(cudaTextureObject_t *pTexObject, const struct cudaResourceDesc *pResDesc, const struct cudaTextureDesc *pTexDesc, const struct cudaResourceViewDesc *pResViewDesc) - * } - */ - public static MethodHandle cudaCreateTextureObject$handle() { - return cudaCreateTextureObject.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaCreateTextureObject(cudaTextureObject_t *pTexObject, const struct cudaResourceDesc *pResDesc, const struct cudaTextureDesc *pTexDesc, const struct cudaResourceViewDesc *pResViewDesc) - * } - */ - public static MemorySegment cudaCreateTextureObject$address() { - return cudaCreateTextureObject.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaCreateTextureObject(cudaTextureObject_t *pTexObject, const struct cudaResourceDesc *pResDesc, const struct cudaTextureDesc *pTexDesc, const struct cudaResourceViewDesc *pResViewDesc) - * } - */ - public static int cudaCreateTextureObject(MemorySegment pTexObject, MemorySegment pResDesc, MemorySegment pTexDesc, MemorySegment pResViewDesc) { - var mh$ = cudaCreateTextureObject.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaCreateTextureObject", pTexObject, pResDesc, pTexDesc, pResViewDesc); - } - return (int)mh$.invokeExact(pTexObject, pResDesc, pTexDesc, pResViewDesc); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDestroyTextureObject { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDestroyTextureObject"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) - * } - */ - public static FunctionDescriptor cudaDestroyTextureObject$descriptor() { - return cudaDestroyTextureObject.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) - * } - */ - public static MethodHandle cudaDestroyTextureObject$handle() { - return cudaDestroyTextureObject.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) - * } - */ - public static MemorySegment cudaDestroyTextureObject$address() { - return cudaDestroyTextureObject.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDestroyTextureObject(cudaTextureObject_t texObject) - * } - */ - public static int cudaDestroyTextureObject(long texObject) { - var mh$ = cudaDestroyTextureObject.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDestroyTextureObject", texObject); - } - return (int)mh$.invokeExact(texObject); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetTextureObjectResourceDesc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetTextureObjectResourceDesc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaTextureObject_t texObject) - * } - */ - public static FunctionDescriptor cudaGetTextureObjectResourceDesc$descriptor() { - return cudaGetTextureObjectResourceDesc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaTextureObject_t texObject) - * } - */ - public static MethodHandle cudaGetTextureObjectResourceDesc$handle() { - return cudaGetTextureObjectResourceDesc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaTextureObject_t texObject) - * } - */ - public static MemorySegment cudaGetTextureObjectResourceDesc$address() { - return cudaGetTextureObjectResourceDesc.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaTextureObject_t texObject) - * } - */ - public static int cudaGetTextureObjectResourceDesc(MemorySegment pResDesc, long texObject) { - var mh$ = cudaGetTextureObjectResourceDesc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetTextureObjectResourceDesc", pResDesc, texObject); - } - return (int)mh$.invokeExact(pResDesc, texObject); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetTextureObjectTextureDesc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetTextureObjectTextureDesc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectTextureDesc(struct cudaTextureDesc *pTexDesc, cudaTextureObject_t texObject) - * } - */ - public static FunctionDescriptor cudaGetTextureObjectTextureDesc$descriptor() { - return cudaGetTextureObjectTextureDesc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectTextureDesc(struct cudaTextureDesc *pTexDesc, cudaTextureObject_t texObject) - * } - */ - public static MethodHandle cudaGetTextureObjectTextureDesc$handle() { - return cudaGetTextureObjectTextureDesc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectTextureDesc(struct cudaTextureDesc *pTexDesc, cudaTextureObject_t texObject) - * } - */ - public static MemorySegment cudaGetTextureObjectTextureDesc$address() { - return cudaGetTextureObjectTextureDesc.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectTextureDesc(struct cudaTextureDesc *pTexDesc, cudaTextureObject_t texObject) - * } - */ - public static int cudaGetTextureObjectTextureDesc(MemorySegment pTexDesc, long texObject) { - var mh$ = cudaGetTextureObjectTextureDesc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetTextureObjectTextureDesc", pTexDesc, texObject); - } - return (int)mh$.invokeExact(pTexDesc, texObject); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetTextureObjectResourceViewDesc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetTextureObjectResourceViewDesc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectResourceViewDesc(struct cudaResourceViewDesc *pResViewDesc, cudaTextureObject_t texObject) - * } - */ - public static FunctionDescriptor cudaGetTextureObjectResourceViewDesc$descriptor() { - return cudaGetTextureObjectResourceViewDesc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectResourceViewDesc(struct cudaResourceViewDesc *pResViewDesc, cudaTextureObject_t texObject) - * } - */ - public static MethodHandle cudaGetTextureObjectResourceViewDesc$handle() { - return cudaGetTextureObjectResourceViewDesc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectResourceViewDesc(struct cudaResourceViewDesc *pResViewDesc, cudaTextureObject_t texObject) - * } - */ - public static MemorySegment cudaGetTextureObjectResourceViewDesc$address() { - return cudaGetTextureObjectResourceViewDesc.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetTextureObjectResourceViewDesc(struct cudaResourceViewDesc *pResViewDesc, cudaTextureObject_t texObject) - * } - */ - public static int cudaGetTextureObjectResourceViewDesc(MemorySegment pResViewDesc, long texObject) { - var mh$ = cudaGetTextureObjectResourceViewDesc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetTextureObjectResourceViewDesc", pResViewDesc, texObject); - } - return (int)mh$.invokeExact(pResViewDesc, texObject); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaCreateSurfaceObject { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaCreateSurfaceObject"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t *pSurfObject, const struct cudaResourceDesc *pResDesc) - * } - */ - public static FunctionDescriptor cudaCreateSurfaceObject$descriptor() { - return cudaCreateSurfaceObject.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t *pSurfObject, const struct cudaResourceDesc *pResDesc) - * } - */ - public static MethodHandle cudaCreateSurfaceObject$handle() { - return cudaCreateSurfaceObject.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t *pSurfObject, const struct cudaResourceDesc *pResDesc) - * } - */ - public static MemorySegment cudaCreateSurfaceObject$address() { - return cudaCreateSurfaceObject.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaCreateSurfaceObject(cudaSurfaceObject_t *pSurfObject, const struct cudaResourceDesc *pResDesc) - * } - */ - public static int cudaCreateSurfaceObject(MemorySegment pSurfObject, MemorySegment pResDesc) { - var mh$ = cudaCreateSurfaceObject.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaCreateSurfaceObject", pSurfObject, pResDesc); - } - return (int)mh$.invokeExact(pSurfObject, pResDesc); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDestroySurfaceObject { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDestroySurfaceObject"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) - * } - */ - public static FunctionDescriptor cudaDestroySurfaceObject$descriptor() { - return cudaDestroySurfaceObject.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) - * } - */ - public static MethodHandle cudaDestroySurfaceObject$handle() { - return cudaDestroySurfaceObject.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) - * } - */ - public static MemorySegment cudaDestroySurfaceObject$address() { - return cudaDestroySurfaceObject.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDestroySurfaceObject(cudaSurfaceObject_t surfObject) - * } - */ - public static int cudaDestroySurfaceObject(long surfObject) { - var mh$ = cudaDestroySurfaceObject.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDestroySurfaceObject", surfObject); - } - return (int)mh$.invokeExact(surfObject); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetSurfaceObjectResourceDesc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetSurfaceObjectResourceDesc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetSurfaceObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaSurfaceObject_t surfObject) - * } - */ - public static FunctionDescriptor cudaGetSurfaceObjectResourceDesc$descriptor() { - return cudaGetSurfaceObjectResourceDesc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetSurfaceObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaSurfaceObject_t surfObject) - * } - */ - public static MethodHandle cudaGetSurfaceObjectResourceDesc$handle() { - return cudaGetSurfaceObjectResourceDesc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetSurfaceObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaSurfaceObject_t surfObject) - * } - */ - public static MemorySegment cudaGetSurfaceObjectResourceDesc$address() { - return cudaGetSurfaceObjectResourceDesc.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetSurfaceObjectResourceDesc(struct cudaResourceDesc *pResDesc, cudaSurfaceObject_t surfObject) - * } - */ - public static int cudaGetSurfaceObjectResourceDesc(MemorySegment pResDesc, long surfObject) { - var mh$ = cudaGetSurfaceObjectResourceDesc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetSurfaceObjectResourceDesc", pResDesc, surfObject); - } - return (int)mh$.invokeExact(pResDesc, surfObject); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDriverGetVersion { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDriverGetVersion"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDriverGetVersion(int *driverVersion) - * } - */ - public static FunctionDescriptor cudaDriverGetVersion$descriptor() { - return cudaDriverGetVersion.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDriverGetVersion(int *driverVersion) - * } - */ - public static MethodHandle cudaDriverGetVersion$handle() { - return cudaDriverGetVersion.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDriverGetVersion(int *driverVersion) - * } - */ - public static MemorySegment cudaDriverGetVersion$address() { - return cudaDriverGetVersion.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDriverGetVersion(int *driverVersion) - * } - */ - public static int cudaDriverGetVersion(MemorySegment driverVersion) { - var mh$ = cudaDriverGetVersion.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDriverGetVersion", driverVersion); - } - return (int)mh$.invokeExact(driverVersion); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaRuntimeGetVersion { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaRuntimeGetVersion"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaRuntimeGetVersion(int *runtimeVersion) - * } - */ - public static FunctionDescriptor cudaRuntimeGetVersion$descriptor() { - return cudaRuntimeGetVersion.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaRuntimeGetVersion(int *runtimeVersion) - * } - */ - public static MethodHandle cudaRuntimeGetVersion$handle() { - return cudaRuntimeGetVersion.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaRuntimeGetVersion(int *runtimeVersion) - * } - */ - public static MemorySegment cudaRuntimeGetVersion$address() { - return cudaRuntimeGetVersion.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaRuntimeGetVersion(int *runtimeVersion) - * } - */ - public static int cudaRuntimeGetVersion(MemorySegment runtimeVersion) { - var mh$ = cudaRuntimeGetVersion.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaRuntimeGetVersion", runtimeVersion); - } - return (int)mh$.invokeExact(runtimeVersion); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphCreate(cudaGraph_t *pGraph, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaGraphCreate$descriptor() { - return cudaGraphCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphCreate(cudaGraph_t *pGraph, unsigned int flags) - * } - */ - public static MethodHandle cudaGraphCreate$handle() { - return cudaGraphCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphCreate(cudaGraph_t *pGraph, unsigned int flags) - * } - */ - public static MemorySegment cudaGraphCreate$address() { - return cudaGraphCreate.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphCreate(cudaGraph_t *pGraph, unsigned int flags) - * } - */ - public static int cudaGraphCreate(MemorySegment pGraph, int flags) { - var mh$ = cudaGraphCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphCreate", pGraph, flags); - } - return (int)mh$.invokeExact(pGraph, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddKernelNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddKernelNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphAddKernelNode$descriptor() { - return cudaGraphAddKernelNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphAddKernelNode$handle() { - return cudaGraphAddKernelNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphAddKernelNode$address() { - return cudaGraphAddKernelNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddKernelNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static int cudaGraphAddKernelNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment pNodeParams) { - var mh$ = cudaGraphAddKernelNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddKernelNode", pGraphNode, graph, pDependencies, numDependencies, pNodeParams); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphKernelNodeGetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphKernelNodeGetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphKernelNodeGetParams$descriptor() { - return cudaGraphKernelNodeGetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphKernelNodeGetParams$handle() { - return cudaGraphKernelNodeGetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphKernelNodeGetParams$address() { - return cudaGraphKernelNodeGetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeGetParams(cudaGraphNode_t node, struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static int cudaGraphKernelNodeGetParams(MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphKernelNodeGetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphKernelNodeGetParams", node, pNodeParams); - } - return (int)mh$.invokeExact(node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphKernelNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphKernelNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphKernelNodeSetParams$descriptor() { - return cudaGraphKernelNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphKernelNodeSetParams$handle() { - return cudaGraphKernelNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphKernelNodeSetParams$address() { - return cudaGraphKernelNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeSetParams(cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static int cudaGraphKernelNodeSetParams(MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphKernelNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphKernelNodeSetParams", node, pNodeParams); - } - return (int)mh$.invokeExact(node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphKernelNodeCopyAttributes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphKernelNodeCopyAttributes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) - * } - */ - public static FunctionDescriptor cudaGraphKernelNodeCopyAttributes$descriptor() { - return cudaGraphKernelNodeCopyAttributes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) - * } - */ - public static MethodHandle cudaGraphKernelNodeCopyAttributes$handle() { - return cudaGraphKernelNodeCopyAttributes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) - * } - */ - public static MemorySegment cudaGraphKernelNodeCopyAttributes$address() { - return cudaGraphKernelNodeCopyAttributes.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeCopyAttributes(cudaGraphNode_t hSrc, cudaGraphNode_t hDst) - * } - */ - public static int cudaGraphKernelNodeCopyAttributes(MemorySegment hSrc, MemorySegment hDst) { - var mh$ = cudaGraphKernelNodeCopyAttributes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphKernelNodeCopyAttributes", hSrc, hDst); - } - return (int)mh$.invokeExact(hSrc, hDst); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphKernelNodeGetAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphKernelNodeGetAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) - * } - */ - public static FunctionDescriptor cudaGraphKernelNodeGetAttribute$descriptor() { - return cudaGraphKernelNodeGetAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) - * } - */ - public static MethodHandle cudaGraphKernelNodeGetAttribute$handle() { - return cudaGraphKernelNodeGetAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) - * } - */ - public static MemorySegment cudaGraphKernelNodeGetAttribute$address() { - return cudaGraphKernelNodeGetAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeGetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) - * } - */ - public static int cudaGraphKernelNodeGetAttribute(MemorySegment hNode, int attr, MemorySegment value_out) { - var mh$ = cudaGraphKernelNodeGetAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphKernelNodeGetAttribute", hNode, attr, value_out); - } - return (int)mh$.invokeExact(hNode, attr, value_out); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphKernelNodeSetAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphKernelNodeSetAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) - * } - */ - public static FunctionDescriptor cudaGraphKernelNodeSetAttribute$descriptor() { - return cudaGraphKernelNodeSetAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) - * } - */ - public static MethodHandle cudaGraphKernelNodeSetAttribute$handle() { - return cudaGraphKernelNodeSetAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) - * } - */ - public static MemorySegment cudaGraphKernelNodeSetAttribute$address() { - return cudaGraphKernelNodeSetAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphKernelNodeSetAttribute(cudaGraphNode_t hNode, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) - * } - */ - public static int cudaGraphKernelNodeSetAttribute(MemorySegment hNode, int attr, MemorySegment value) { - var mh$ = cudaGraphKernelNodeSetAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphKernelNodeSetAttribute", hNode, attr, value); - } - return (int)mh$.invokeExact(hNode, attr, value); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddMemcpyNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemcpyNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemcpy3DParms *pCopyParams) - * } - */ - public static FunctionDescriptor cudaGraphAddMemcpyNode$descriptor() { - return cudaGraphAddMemcpyNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemcpy3DParms *pCopyParams) - * } - */ - public static MethodHandle cudaGraphAddMemcpyNode$handle() { - return cudaGraphAddMemcpyNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemcpy3DParms *pCopyParams) - * } - */ - public static MemorySegment cudaGraphAddMemcpyNode$address() { - return cudaGraphAddMemcpyNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemcpy3DParms *pCopyParams) - * } - */ - public static int cudaGraphAddMemcpyNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment pCopyParams) { - var mh$ = cudaGraphAddMemcpyNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddMemcpyNode", pGraphNode, graph, pDependencies, numDependencies, pCopyParams); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, pCopyParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddMemcpyNodeToSymbol { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemcpyNodeToSymbol"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNodeToSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaGraphAddMemcpyNodeToSymbol$descriptor() { - return cudaGraphAddMemcpyNodeToSymbol.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNodeToSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaGraphAddMemcpyNodeToSymbol$handle() { - return cudaGraphAddMemcpyNodeToSymbol.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNodeToSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaGraphAddMemcpyNodeToSymbol$address() { - return cudaGraphAddMemcpyNodeToSymbol.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNodeToSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static int cudaGraphAddMemcpyNodeToSymbol(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment symbol, MemorySegment src, long count, long offset, int kind) { - var mh$ = cudaGraphAddMemcpyNodeToSymbol.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddMemcpyNodeToSymbol", pGraphNode, graph, pDependencies, numDependencies, symbol, src, count, offset, kind); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, symbol, src, count, offset, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddMemcpyNodeFromSymbol { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemcpyNodeFromSymbol"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNodeFromSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaGraphAddMemcpyNodeFromSymbol$descriptor() { - return cudaGraphAddMemcpyNodeFromSymbol.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNodeFromSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaGraphAddMemcpyNodeFromSymbol$handle() { - return cudaGraphAddMemcpyNodeFromSymbol.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNodeFromSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaGraphAddMemcpyNodeFromSymbol$address() { - return cudaGraphAddMemcpyNodeFromSymbol.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNodeFromSymbol(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static int cudaGraphAddMemcpyNodeFromSymbol(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment dst, MemorySegment symbol, long count, long offset, int kind) { - var mh$ = cudaGraphAddMemcpyNodeFromSymbol.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddMemcpyNodeFromSymbol", pGraphNode, graph, pDependencies, numDependencies, dst, symbol, count, offset, kind); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, dst, symbol, count, offset, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddMemcpyNode1D { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemcpyNode1D"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaGraphAddMemcpyNode1D$descriptor() { - return cudaGraphAddMemcpyNode1D.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaGraphAddMemcpyNode1D$handle() { - return cudaGraphAddMemcpyNode1D.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaGraphAddMemcpyNode1D$address() { - return cudaGraphAddMemcpyNode1D.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemcpyNode1D(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static int cudaGraphAddMemcpyNode1D(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment dst, MemorySegment src, long count, int kind) { - var mh$ = cudaGraphAddMemcpyNode1D.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddMemcpyNode1D", pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, dst, src, count, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphMemcpyNodeGetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemcpyNodeGetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphMemcpyNodeGetParams$descriptor() { - return cudaGraphMemcpyNodeGetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static MethodHandle cudaGraphMemcpyNodeGetParams$handle() { - return cudaGraphMemcpyNodeGetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static MemorySegment cudaGraphMemcpyNodeGetParams$address() { - return cudaGraphMemcpyNodeGetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeGetParams(cudaGraphNode_t node, struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static int cudaGraphMemcpyNodeGetParams(MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphMemcpyNodeGetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphMemcpyNodeGetParams", node, pNodeParams); - } - return (int)mh$.invokeExact(node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphMemcpyNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemcpyNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphMemcpyNodeSetParams$descriptor() { - return cudaGraphMemcpyNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static MethodHandle cudaGraphMemcpyNodeSetParams$handle() { - return cudaGraphMemcpyNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static MemorySegment cudaGraphMemcpyNodeSetParams$address() { - return cudaGraphMemcpyNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParams(cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static int cudaGraphMemcpyNodeSetParams(MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphMemcpyNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphMemcpyNodeSetParams", node, pNodeParams); - } - return (int)mh$.invokeExact(node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphMemcpyNodeSetParamsToSymbol { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemcpyNodeSetParamsToSymbol"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParamsToSymbol(cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaGraphMemcpyNodeSetParamsToSymbol$descriptor() { - return cudaGraphMemcpyNodeSetParamsToSymbol.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParamsToSymbol(cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaGraphMemcpyNodeSetParamsToSymbol$handle() { - return cudaGraphMemcpyNodeSetParamsToSymbol.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParamsToSymbol(cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaGraphMemcpyNodeSetParamsToSymbol$address() { - return cudaGraphMemcpyNodeSetParamsToSymbol.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParamsToSymbol(cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static int cudaGraphMemcpyNodeSetParamsToSymbol(MemorySegment node, MemorySegment symbol, MemorySegment src, long count, long offset, int kind) { - var mh$ = cudaGraphMemcpyNodeSetParamsToSymbol.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphMemcpyNodeSetParamsToSymbol", node, symbol, src, count, offset, kind); - } - return (int)mh$.invokeExact(node, symbol, src, count, offset, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphMemcpyNodeSetParamsFromSymbol { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemcpyNodeSetParamsFromSymbol"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParamsFromSymbol(cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaGraphMemcpyNodeSetParamsFromSymbol$descriptor() { - return cudaGraphMemcpyNodeSetParamsFromSymbol.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParamsFromSymbol(cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaGraphMemcpyNodeSetParamsFromSymbol$handle() { - return cudaGraphMemcpyNodeSetParamsFromSymbol.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParamsFromSymbol(cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaGraphMemcpyNodeSetParamsFromSymbol$address() { - return cudaGraphMemcpyNodeSetParamsFromSymbol.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParamsFromSymbol(cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static int cudaGraphMemcpyNodeSetParamsFromSymbol(MemorySegment node, MemorySegment dst, MemorySegment symbol, long count, long offset, int kind) { - var mh$ = cudaGraphMemcpyNodeSetParamsFromSymbol.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphMemcpyNodeSetParamsFromSymbol", node, dst, symbol, count, offset, kind); - } - return (int)mh$.invokeExact(node, dst, symbol, count, offset, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphMemcpyNodeSetParams1D { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemcpyNodeSetParams1D"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaGraphMemcpyNodeSetParams1D$descriptor() { - return cudaGraphMemcpyNodeSetParams1D.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaGraphMemcpyNodeSetParams1D$handle() { - return cudaGraphMemcpyNodeSetParams1D.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaGraphMemcpyNodeSetParams1D$address() { - return cudaGraphMemcpyNodeSetParams1D.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemcpyNodeSetParams1D(cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static int cudaGraphMemcpyNodeSetParams1D(MemorySegment node, MemorySegment dst, MemorySegment src, long count, int kind) { - var mh$ = cudaGraphMemcpyNodeSetParams1D.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphMemcpyNodeSetParams1D", node, dst, src, count, kind); - } - return (int)mh$.invokeExact(node, dst, src, count, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddMemsetNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemsetNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemsetParams *pMemsetParams) - * } - */ - public static FunctionDescriptor cudaGraphAddMemsetNode$descriptor() { - return cudaGraphAddMemsetNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemsetParams *pMemsetParams) - * } - */ - public static MethodHandle cudaGraphAddMemsetNode$handle() { - return cudaGraphAddMemsetNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemsetParams *pMemsetParams) - * } - */ - public static MemorySegment cudaGraphAddMemsetNode$address() { - return cudaGraphAddMemsetNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemsetNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaMemsetParams *pMemsetParams) - * } - */ - public static int cudaGraphAddMemsetNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment pMemsetParams) { - var mh$ = cudaGraphAddMemsetNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddMemsetNode", pGraphNode, graph, pDependencies, numDependencies, pMemsetParams); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, pMemsetParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphMemsetNodeGetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemsetNodeGetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, struct cudaMemsetParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphMemsetNodeGetParams$descriptor() { - return cudaGraphMemsetNodeGetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, struct cudaMemsetParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphMemsetNodeGetParams$handle() { - return cudaGraphMemsetNodeGetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, struct cudaMemsetParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphMemsetNodeGetParams$address() { - return cudaGraphMemsetNodeGetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemsetNodeGetParams(cudaGraphNode_t node, struct cudaMemsetParams *pNodeParams) - * } - */ - public static int cudaGraphMemsetNodeGetParams(MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphMemsetNodeGetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphMemsetNodeGetParams", node, pNodeParams); - } - return (int)mh$.invokeExact(node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphMemsetNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemsetNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphMemsetNodeSetParams$descriptor() { - return cudaGraphMemsetNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphMemsetNodeSetParams$handle() { - return cudaGraphMemsetNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphMemsetNodeSetParams$address() { - return cudaGraphMemsetNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemsetNodeSetParams(cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) - * } - */ - public static int cudaGraphMemsetNodeSetParams(MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphMemsetNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphMemsetNodeSetParams", node, pNodeParams); - } - return (int)mh$.invokeExact(node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddHostNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddHostNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddHostNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphAddHostNode$descriptor() { - return cudaGraphAddHostNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddHostNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphAddHostNode$handle() { - return cudaGraphAddHostNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddHostNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphAddHostNode$address() { - return cudaGraphAddHostNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddHostNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static int cudaGraphAddHostNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment pNodeParams) { - var mh$ = cudaGraphAddHostNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddHostNode", pGraphNode, graph, pDependencies, numDependencies, pNodeParams); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphHostNodeGetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphHostNodeGetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, struct cudaHostNodeParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphHostNodeGetParams$descriptor() { - return cudaGraphHostNodeGetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, struct cudaHostNodeParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphHostNodeGetParams$handle() { - return cudaGraphHostNodeGetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, struct cudaHostNodeParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphHostNodeGetParams$address() { - return cudaGraphHostNodeGetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphHostNodeGetParams(cudaGraphNode_t node, struct cudaHostNodeParams *pNodeParams) - * } - */ - public static int cudaGraphHostNodeGetParams(MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphHostNodeGetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphHostNodeGetParams", node, pNodeParams); - } - return (int)mh$.invokeExact(node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphHostNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphHostNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphHostNodeSetParams$descriptor() { - return cudaGraphHostNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphHostNodeSetParams$handle() { - return cudaGraphHostNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphHostNodeSetParams$address() { - return cudaGraphHostNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphHostNodeSetParams(cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static int cudaGraphHostNodeSetParams(MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphHostNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphHostNodeSetParams", node, pNodeParams); - } - return (int)mh$.invokeExact(node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddChildGraphNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddChildGraphNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaGraph_t childGraph) - * } - */ - public static FunctionDescriptor cudaGraphAddChildGraphNode$descriptor() { - return cudaGraphAddChildGraphNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaGraph_t childGraph) - * } - */ - public static MethodHandle cudaGraphAddChildGraphNode$handle() { - return cudaGraphAddChildGraphNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaGraph_t childGraph) - * } - */ - public static MemorySegment cudaGraphAddChildGraphNode$address() { - return cudaGraphAddChildGraphNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddChildGraphNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaGraph_t childGraph) - * } - */ - public static int cudaGraphAddChildGraphNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment childGraph) { - var mh$ = cudaGraphAddChildGraphNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddChildGraphNode", pGraphNode, graph, pDependencies, numDependencies, childGraph); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, childGraph); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphChildGraphNodeGetGraph { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphChildGraphNodeGetGraph"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t *pGraph) - * } - */ - public static FunctionDescriptor cudaGraphChildGraphNodeGetGraph$descriptor() { - return cudaGraphChildGraphNodeGetGraph.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t *pGraph) - * } - */ - public static MethodHandle cudaGraphChildGraphNodeGetGraph$handle() { - return cudaGraphChildGraphNodeGetGraph.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t *pGraph) - * } - */ - public static MemorySegment cudaGraphChildGraphNodeGetGraph$address() { - return cudaGraphChildGraphNodeGetGraph.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphChildGraphNodeGetGraph(cudaGraphNode_t node, cudaGraph_t *pGraph) - * } - */ - public static int cudaGraphChildGraphNodeGetGraph(MemorySegment node, MemorySegment pGraph) { - var mh$ = cudaGraphChildGraphNodeGetGraph.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphChildGraphNodeGetGraph", node, pGraph); - } - return (int)mh$.invokeExact(node, pGraph); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddEmptyNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddEmptyNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies) - * } - */ - public static FunctionDescriptor cudaGraphAddEmptyNode$descriptor() { - return cudaGraphAddEmptyNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies) - * } - */ - public static MethodHandle cudaGraphAddEmptyNode$handle() { - return cudaGraphAddEmptyNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies) - * } - */ - public static MemorySegment cudaGraphAddEmptyNode$address() { - return cudaGraphAddEmptyNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEmptyNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies) - * } - */ - public static int cudaGraphAddEmptyNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies) { - var mh$ = cudaGraphAddEmptyNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddEmptyNode", pGraphNode, graph, pDependencies, numDependencies); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddEventRecordNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddEventRecordNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) - * } - */ - public static FunctionDescriptor cudaGraphAddEventRecordNode$descriptor() { - return cudaGraphAddEventRecordNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) - * } - */ - public static MethodHandle cudaGraphAddEventRecordNode$handle() { - return cudaGraphAddEventRecordNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) - * } - */ - public static MemorySegment cudaGraphAddEventRecordNode$address() { - return cudaGraphAddEventRecordNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEventRecordNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) - * } - */ - public static int cudaGraphAddEventRecordNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment event) { - var mh$ = cudaGraphAddEventRecordNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddEventRecordNode", pGraphNode, graph, pDependencies, numDependencies, event); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphEventRecordNodeGetEvent { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphEventRecordNodeGetEvent"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) - * } - */ - public static FunctionDescriptor cudaGraphEventRecordNodeGetEvent$descriptor() { - return cudaGraphEventRecordNodeGetEvent.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) - * } - */ - public static MethodHandle cudaGraphEventRecordNodeGetEvent$handle() { - return cudaGraphEventRecordNodeGetEvent.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) - * } - */ - public static MemorySegment cudaGraphEventRecordNodeGetEvent$address() { - return cudaGraphEventRecordNodeGetEvent.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventRecordNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) - * } - */ - public static int cudaGraphEventRecordNodeGetEvent(MemorySegment node, MemorySegment event_out) { - var mh$ = cudaGraphEventRecordNodeGetEvent.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphEventRecordNodeGetEvent", node, event_out); - } - return (int)mh$.invokeExact(node, event_out); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphEventRecordNodeSetEvent { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphEventRecordNodeSetEvent"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) - * } - */ - public static FunctionDescriptor cudaGraphEventRecordNodeSetEvent$descriptor() { - return cudaGraphEventRecordNodeSetEvent.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) - * } - */ - public static MethodHandle cudaGraphEventRecordNodeSetEvent$handle() { - return cudaGraphEventRecordNodeSetEvent.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) - * } - */ - public static MemorySegment cudaGraphEventRecordNodeSetEvent$address() { - return cudaGraphEventRecordNodeSetEvent.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventRecordNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) - * } - */ - public static int cudaGraphEventRecordNodeSetEvent(MemorySegment node, MemorySegment event) { - var mh$ = cudaGraphEventRecordNodeSetEvent.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphEventRecordNodeSetEvent", node, event); - } - return (int)mh$.invokeExact(node, event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddEventWaitNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddEventWaitNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) - * } - */ - public static FunctionDescriptor cudaGraphAddEventWaitNode$descriptor() { - return cudaGraphAddEventWaitNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) - * } - */ - public static MethodHandle cudaGraphAddEventWaitNode$handle() { - return cudaGraphAddEventWaitNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) - * } - */ - public static MemorySegment cudaGraphAddEventWaitNode$address() { - return cudaGraphAddEventWaitNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddEventWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, cudaEvent_t event) - * } - */ - public static int cudaGraphAddEventWaitNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment event) { - var mh$ = cudaGraphAddEventWaitNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddEventWaitNode", pGraphNode, graph, pDependencies, numDependencies, event); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphEventWaitNodeGetEvent { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphEventWaitNodeGetEvent"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) - * } - */ - public static FunctionDescriptor cudaGraphEventWaitNodeGetEvent$descriptor() { - return cudaGraphEventWaitNodeGetEvent.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) - * } - */ - public static MethodHandle cudaGraphEventWaitNodeGetEvent$handle() { - return cudaGraphEventWaitNodeGetEvent.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) - * } - */ - public static MemorySegment cudaGraphEventWaitNodeGetEvent$address() { - return cudaGraphEventWaitNodeGetEvent.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventWaitNodeGetEvent(cudaGraphNode_t node, cudaEvent_t *event_out) - * } - */ - public static int cudaGraphEventWaitNodeGetEvent(MemorySegment node, MemorySegment event_out) { - var mh$ = cudaGraphEventWaitNodeGetEvent.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphEventWaitNodeGetEvent", node, event_out); - } - return (int)mh$.invokeExact(node, event_out); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphEventWaitNodeSetEvent { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphEventWaitNodeSetEvent"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) - * } - */ - public static FunctionDescriptor cudaGraphEventWaitNodeSetEvent$descriptor() { - return cudaGraphEventWaitNodeSetEvent.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) - * } - */ - public static MethodHandle cudaGraphEventWaitNodeSetEvent$handle() { - return cudaGraphEventWaitNodeSetEvent.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) - * } - */ - public static MemorySegment cudaGraphEventWaitNodeSetEvent$address() { - return cudaGraphEventWaitNodeSetEvent.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphEventWaitNodeSetEvent(cudaGraphNode_t node, cudaEvent_t event) - * } - */ - public static int cudaGraphEventWaitNodeSetEvent(MemorySegment node, MemorySegment event) { - var mh$ = cudaGraphEventWaitNodeSetEvent.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphEventWaitNodeSetEvent", node, event); - } - return (int)mh$.invokeExact(node, event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddExternalSemaphoresSignalNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddExternalSemaphoresSignalNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphAddExternalSemaphoresSignalNode$descriptor() { - return cudaGraphAddExternalSemaphoresSignalNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphAddExternalSemaphoresSignalNode$handle() { - return cudaGraphAddExternalSemaphoresSignalNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphAddExternalSemaphoresSignalNode$address() { - return cudaGraphAddExternalSemaphoresSignalNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddExternalSemaphoresSignalNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static int cudaGraphAddExternalSemaphoresSignalNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment nodeParams) { - var mh$ = cudaGraphAddExternalSemaphoresSignalNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddExternalSemaphoresSignalNode", pGraphNode, graph, pDependencies, numDependencies, nodeParams); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExternalSemaphoresSignalNodeGetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExternalSemaphoresSignalNodeGetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreSignalNodeParams *params_out) - * } - */ - public static FunctionDescriptor cudaGraphExternalSemaphoresSignalNodeGetParams$descriptor() { - return cudaGraphExternalSemaphoresSignalNodeGetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreSignalNodeParams *params_out) - * } - */ - public static MethodHandle cudaGraphExternalSemaphoresSignalNodeGetParams$handle() { - return cudaGraphExternalSemaphoresSignalNodeGetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreSignalNodeParams *params_out) - * } - */ - public static MemorySegment cudaGraphExternalSemaphoresSignalNodeGetParams$address() { - return cudaGraphExternalSemaphoresSignalNodeGetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreSignalNodeParams *params_out) - * } - */ - public static int cudaGraphExternalSemaphoresSignalNodeGetParams(MemorySegment hNode, MemorySegment params_out) { - var mh$ = cudaGraphExternalSemaphoresSignalNodeGetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExternalSemaphoresSignalNodeGetParams", hNode, params_out); - } - return (int)mh$.invokeExact(hNode, params_out); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExternalSemaphoresSignalNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExternalSemaphoresSignalNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphExternalSemaphoresSignalNodeSetParams$descriptor() { - return cudaGraphExternalSemaphoresSignalNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphExternalSemaphoresSignalNodeSetParams$handle() { - return cudaGraphExternalSemaphoresSignalNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphExternalSemaphoresSignalNodeSetParams$address() { - return cudaGraphExternalSemaphoresSignalNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresSignalNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static int cudaGraphExternalSemaphoresSignalNodeSetParams(MemorySegment hNode, MemorySegment nodeParams) { - var mh$ = cudaGraphExternalSemaphoresSignalNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExternalSemaphoresSignalNodeSetParams", hNode, nodeParams); - } - return (int)mh$.invokeExact(hNode, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddExternalSemaphoresWaitNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddExternalSemaphoresWaitNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphAddExternalSemaphoresWaitNode$descriptor() { - return cudaGraphAddExternalSemaphoresWaitNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphAddExternalSemaphoresWaitNode$handle() { - return cudaGraphAddExternalSemaphoresWaitNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphAddExternalSemaphoresWaitNode$address() { - return cudaGraphAddExternalSemaphoresWaitNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddExternalSemaphoresWaitNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static int cudaGraphAddExternalSemaphoresWaitNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment nodeParams) { - var mh$ = cudaGraphAddExternalSemaphoresWaitNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddExternalSemaphoresWaitNode", pGraphNode, graph, pDependencies, numDependencies, nodeParams); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExternalSemaphoresWaitNodeGetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExternalSemaphoresWaitNodeGetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreWaitNodeParams *params_out) - * } - */ - public static FunctionDescriptor cudaGraphExternalSemaphoresWaitNodeGetParams$descriptor() { - return cudaGraphExternalSemaphoresWaitNodeGetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreWaitNodeParams *params_out) - * } - */ - public static MethodHandle cudaGraphExternalSemaphoresWaitNodeGetParams$handle() { - return cudaGraphExternalSemaphoresWaitNodeGetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreWaitNodeParams *params_out) - * } - */ - public static MemorySegment cudaGraphExternalSemaphoresWaitNodeGetParams$address() { - return cudaGraphExternalSemaphoresWaitNodeGetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeGetParams(cudaGraphNode_t hNode, struct cudaExternalSemaphoreWaitNodeParams *params_out) - * } - */ - public static int cudaGraphExternalSemaphoresWaitNodeGetParams(MemorySegment hNode, MemorySegment params_out) { - var mh$ = cudaGraphExternalSemaphoresWaitNodeGetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExternalSemaphoresWaitNodeGetParams", hNode, params_out); - } - return (int)mh$.invokeExact(hNode, params_out); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExternalSemaphoresWaitNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExternalSemaphoresWaitNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphExternalSemaphoresWaitNodeSetParams$descriptor() { - return cudaGraphExternalSemaphoresWaitNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphExternalSemaphoresWaitNodeSetParams$handle() { - return cudaGraphExternalSemaphoresWaitNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphExternalSemaphoresWaitNodeSetParams$address() { - return cudaGraphExternalSemaphoresWaitNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExternalSemaphoresWaitNodeSetParams(cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static int cudaGraphExternalSemaphoresWaitNodeSetParams(MemorySegment hNode, MemorySegment nodeParams) { - var mh$ = cudaGraphExternalSemaphoresWaitNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExternalSemaphoresWaitNodeSetParams", hNode, nodeParams); - } - return (int)mh$.invokeExact(hNode, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddMemAllocNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemAllocNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaMemAllocNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphAddMemAllocNode$descriptor() { - return cudaGraphAddMemAllocNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaMemAllocNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphAddMemAllocNode$handle() { - return cudaGraphAddMemAllocNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaMemAllocNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphAddMemAllocNode$address() { - return cudaGraphAddMemAllocNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemAllocNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaMemAllocNodeParams *nodeParams) - * } - */ - public static int cudaGraphAddMemAllocNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment nodeParams) { - var mh$ = cudaGraphAddMemAllocNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddMemAllocNode", pGraphNode, graph, pDependencies, numDependencies, nodeParams); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphMemAllocNodeGetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemAllocNodeGetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, struct cudaMemAllocNodeParams *params_out) - * } - */ - public static FunctionDescriptor cudaGraphMemAllocNodeGetParams$descriptor() { - return cudaGraphMemAllocNodeGetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, struct cudaMemAllocNodeParams *params_out) - * } - */ - public static MethodHandle cudaGraphMemAllocNodeGetParams$handle() { - return cudaGraphMemAllocNodeGetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, struct cudaMemAllocNodeParams *params_out) - * } - */ - public static MemorySegment cudaGraphMemAllocNodeGetParams$address() { - return cudaGraphMemAllocNodeGetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemAllocNodeGetParams(cudaGraphNode_t node, struct cudaMemAllocNodeParams *params_out) - * } - */ - public static int cudaGraphMemAllocNodeGetParams(MemorySegment node, MemorySegment params_out) { - var mh$ = cudaGraphMemAllocNodeGetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphMemAllocNodeGetParams", node, params_out); - } - return (int)mh$.invokeExact(node, params_out); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddMemFreeNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddMemFreeNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dptr) - * } - */ - public static FunctionDescriptor cudaGraphAddMemFreeNode$descriptor() { - return cudaGraphAddMemFreeNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dptr) - * } - */ - public static MethodHandle cudaGraphAddMemFreeNode$handle() { - return cudaGraphAddMemFreeNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dptr) - * } - */ - public static MemorySegment cudaGraphAddMemFreeNode$address() { - return cudaGraphAddMemFreeNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddMemFreeNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, void *dptr) - * } - */ - public static int cudaGraphAddMemFreeNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment dptr) { - var mh$ = cudaGraphAddMemFreeNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddMemFreeNode", pGraphNode, graph, pDependencies, numDependencies, dptr); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, dptr); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphMemFreeNodeGetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphMemFreeNodeGetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void *dptr_out) - * } - */ - public static FunctionDescriptor cudaGraphMemFreeNodeGetParams$descriptor() { - return cudaGraphMemFreeNodeGetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void *dptr_out) - * } - */ - public static MethodHandle cudaGraphMemFreeNodeGetParams$handle() { - return cudaGraphMemFreeNodeGetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void *dptr_out) - * } - */ - public static MemorySegment cudaGraphMemFreeNodeGetParams$address() { - return cudaGraphMemFreeNodeGetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphMemFreeNodeGetParams(cudaGraphNode_t node, void *dptr_out) - * } - */ - public static int cudaGraphMemFreeNodeGetParams(MemorySegment node, MemorySegment dptr_out) { - var mh$ = cudaGraphMemFreeNodeGetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphMemFreeNodeGetParams", node, dptr_out); - } - return (int)mh$.invokeExact(node, dptr_out); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGraphMemTrim { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGraphMemTrim"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGraphMemTrim(int device) - * } - */ - public static FunctionDescriptor cudaDeviceGraphMemTrim$descriptor() { - return cudaDeviceGraphMemTrim.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGraphMemTrim(int device) - * } - */ - public static MethodHandle cudaDeviceGraphMemTrim$handle() { - return cudaDeviceGraphMemTrim.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGraphMemTrim(int device) - * } - */ - public static MemorySegment cudaDeviceGraphMemTrim$address() { - return cudaDeviceGraphMemTrim.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGraphMemTrim(int device) - * } - */ - public static int cudaDeviceGraphMemTrim(int device) { - var mh$ = cudaDeviceGraphMemTrim.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGraphMemTrim", device); - } - return (int)mh$.invokeExact(device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetGraphMemAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetGraphMemAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) - * } - */ - public static FunctionDescriptor cudaDeviceGetGraphMemAttribute$descriptor() { - return cudaDeviceGetGraphMemAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) - * } - */ - public static MethodHandle cudaDeviceGetGraphMemAttribute$handle() { - return cudaDeviceGetGraphMemAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) - * } - */ - public static MemorySegment cudaDeviceGetGraphMemAttribute$address() { - return cudaDeviceGetGraphMemAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) - * } - */ - public static int cudaDeviceGetGraphMemAttribute(int device, int attr, MemorySegment value) { - var mh$ = cudaDeviceGetGraphMemAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetGraphMemAttribute", device, attr, value); - } - return (int)mh$.invokeExact(device, attr, value); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceSetGraphMemAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSetGraphMemAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) - * } - */ - public static FunctionDescriptor cudaDeviceSetGraphMemAttribute$descriptor() { - return cudaDeviceSetGraphMemAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) - * } - */ - public static MethodHandle cudaDeviceSetGraphMemAttribute$handle() { - return cudaDeviceSetGraphMemAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) - * } - */ - public static MemorySegment cudaDeviceSetGraphMemAttribute$address() { - return cudaDeviceSetGraphMemAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetGraphMemAttribute(int device, enum cudaGraphMemAttributeType attr, void *value) - * } - */ - public static int cudaDeviceSetGraphMemAttribute(int device, int attr, MemorySegment value) { - var mh$ = cudaDeviceSetGraphMemAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceSetGraphMemAttribute", device, attr, value); - } - return (int)mh$.invokeExact(device, attr, value); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphClone { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphClone"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphClone(cudaGraph_t *pGraphClone, cudaGraph_t originalGraph) - * } - */ - public static FunctionDescriptor cudaGraphClone$descriptor() { - return cudaGraphClone.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphClone(cudaGraph_t *pGraphClone, cudaGraph_t originalGraph) - * } - */ - public static MethodHandle cudaGraphClone$handle() { - return cudaGraphClone.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphClone(cudaGraph_t *pGraphClone, cudaGraph_t originalGraph) - * } - */ - public static MemorySegment cudaGraphClone$address() { - return cudaGraphClone.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphClone(cudaGraph_t *pGraphClone, cudaGraph_t originalGraph) - * } - */ - public static int cudaGraphClone(MemorySegment pGraphClone, MemorySegment originalGraph) { - var mh$ = cudaGraphClone.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphClone", pGraphClone, originalGraph); - } - return (int)mh$.invokeExact(pGraphClone, originalGraph); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphNodeFindInClone { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeFindInClone"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t *pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) - * } - */ - public static FunctionDescriptor cudaGraphNodeFindInClone$descriptor() { - return cudaGraphNodeFindInClone.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t *pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) - * } - */ - public static MethodHandle cudaGraphNodeFindInClone$handle() { - return cudaGraphNodeFindInClone.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t *pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) - * } - */ - public static MemorySegment cudaGraphNodeFindInClone$address() { - return cudaGraphNodeFindInClone.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeFindInClone(cudaGraphNode_t *pNode, cudaGraphNode_t originalNode, cudaGraph_t clonedGraph) - * } - */ - public static int cudaGraphNodeFindInClone(MemorySegment pNode, MemorySegment originalNode, MemorySegment clonedGraph) { - var mh$ = cudaGraphNodeFindInClone.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphNodeFindInClone", pNode, originalNode, clonedGraph); - } - return (int)mh$.invokeExact(pNode, originalNode, clonedGraph); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphNodeGetType { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetType"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, enum cudaGraphNodeType *pType) - * } - */ - public static FunctionDescriptor cudaGraphNodeGetType$descriptor() { - return cudaGraphNodeGetType.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, enum cudaGraphNodeType *pType) - * } - */ - public static MethodHandle cudaGraphNodeGetType$handle() { - return cudaGraphNodeGetType.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, enum cudaGraphNodeType *pType) - * } - */ - public static MemorySegment cudaGraphNodeGetType$address() { - return cudaGraphNodeGetType.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetType(cudaGraphNode_t node, enum cudaGraphNodeType *pType) - * } - */ - public static int cudaGraphNodeGetType(MemorySegment node, MemorySegment pType) { - var mh$ = cudaGraphNodeGetType.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphNodeGetType", node, pType); - } - return (int)mh$.invokeExact(node, pType); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphGetNodes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphGetNodes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t *nodes, size_t *numNodes) - * } - */ - public static FunctionDescriptor cudaGraphGetNodes$descriptor() { - return cudaGraphGetNodes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t *nodes, size_t *numNodes) - * } - */ - public static MethodHandle cudaGraphGetNodes$handle() { - return cudaGraphGetNodes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t *nodes, size_t *numNodes) - * } - */ - public static MemorySegment cudaGraphGetNodes$address() { - return cudaGraphGetNodes.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetNodes(cudaGraph_t graph, cudaGraphNode_t *nodes, size_t *numNodes) - * } - */ - public static int cudaGraphGetNodes(MemorySegment graph, MemorySegment nodes, MemorySegment numNodes) { - var mh$ = cudaGraphGetNodes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphGetNodes", graph, nodes, numNodes); - } - return (int)mh$.invokeExact(graph, nodes, numNodes); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphGetRootNodes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphGetRootNodes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t *pRootNodes, size_t *pNumRootNodes) - * } - */ - public static FunctionDescriptor cudaGraphGetRootNodes$descriptor() { - return cudaGraphGetRootNodes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t *pRootNodes, size_t *pNumRootNodes) - * } - */ - public static MethodHandle cudaGraphGetRootNodes$handle() { - return cudaGraphGetRootNodes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t *pRootNodes, size_t *pNumRootNodes) - * } - */ - public static MemorySegment cudaGraphGetRootNodes$address() { - return cudaGraphGetRootNodes.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetRootNodes(cudaGraph_t graph, cudaGraphNode_t *pRootNodes, size_t *pNumRootNodes) - * } - */ - public static int cudaGraphGetRootNodes(MemorySegment graph, MemorySegment pRootNodes, MemorySegment pNumRootNodes) { - var mh$ = cudaGraphGetRootNodes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphGetRootNodes", graph, pRootNodes, pNumRootNodes); - } - return (int)mh$.invokeExact(graph, pRootNodes, pNumRootNodes); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphGetEdges { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphGetEdges"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, size_t *numEdges) - * } - */ - public static FunctionDescriptor cudaGraphGetEdges$descriptor() { - return cudaGraphGetEdges.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, size_t *numEdges) - * } - */ - public static MethodHandle cudaGraphGetEdges$handle() { - return cudaGraphGetEdges.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, size_t *numEdges) - * } - */ - public static MemorySegment cudaGraphGetEdges$address() { - return cudaGraphGetEdges.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetEdges(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, size_t *numEdges) - * } - */ - public static int cudaGraphGetEdges(MemorySegment graph, MemorySegment from, MemorySegment to, MemorySegment numEdges) { - var mh$ = cudaGraphGetEdges.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphGetEdges", graph, from, to, numEdges); - } - return (int)mh$.invokeExact(graph, from, to, numEdges); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphGetEdges_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphGetEdges_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, cudaGraphEdgeData *edgeData, size_t *numEdges) - * } - */ - public static FunctionDescriptor cudaGraphGetEdges_v2$descriptor() { - return cudaGraphGetEdges_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, cudaGraphEdgeData *edgeData, size_t *numEdges) - * } - */ - public static MethodHandle cudaGraphGetEdges_v2$handle() { - return cudaGraphGetEdges_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, cudaGraphEdgeData *edgeData, size_t *numEdges) - * } - */ - public static MemorySegment cudaGraphGetEdges_v2$address() { - return cudaGraphGetEdges_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphGetEdges_v2(cudaGraph_t graph, cudaGraphNode_t *from, cudaGraphNode_t *to, cudaGraphEdgeData *edgeData, size_t *numEdges) - * } - */ - public static int cudaGraphGetEdges_v2(MemorySegment graph, MemorySegment from, MemorySegment to, MemorySegment edgeData, MemorySegment numEdges) { - var mh$ = cudaGraphGetEdges_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphGetEdges_v2", graph, from, to, edgeData, numEdges); - } - return (int)mh$.invokeExact(graph, from, to, edgeData, numEdges); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphNodeGetDependencies { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetDependencies"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, size_t *pNumDependencies) - * } - */ - public static FunctionDescriptor cudaGraphNodeGetDependencies$descriptor() { - return cudaGraphNodeGetDependencies.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, size_t *pNumDependencies) - * } - */ - public static MethodHandle cudaGraphNodeGetDependencies$handle() { - return cudaGraphNodeGetDependencies.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, size_t *pNumDependencies) - * } - */ - public static MemorySegment cudaGraphNodeGetDependencies$address() { - return cudaGraphNodeGetDependencies.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependencies(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, size_t *pNumDependencies) - * } - */ - public static int cudaGraphNodeGetDependencies(MemorySegment node, MemorySegment pDependencies, MemorySegment pNumDependencies) { - var mh$ = cudaGraphNodeGetDependencies.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphNodeGetDependencies", node, pDependencies, pNumDependencies); - } - return (int)mh$.invokeExact(node, pDependencies, pNumDependencies); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphNodeGetDependencies_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetDependencies_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, cudaGraphEdgeData *edgeData, size_t *pNumDependencies) - * } - */ - public static FunctionDescriptor cudaGraphNodeGetDependencies_v2$descriptor() { - return cudaGraphNodeGetDependencies_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, cudaGraphEdgeData *edgeData, size_t *pNumDependencies) - * } - */ - public static MethodHandle cudaGraphNodeGetDependencies_v2$handle() { - return cudaGraphNodeGetDependencies_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, cudaGraphEdgeData *edgeData, size_t *pNumDependencies) - * } - */ - public static MemorySegment cudaGraphNodeGetDependencies_v2$address() { - return cudaGraphNodeGetDependencies_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependencies_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependencies, cudaGraphEdgeData *edgeData, size_t *pNumDependencies) - * } - */ - public static int cudaGraphNodeGetDependencies_v2(MemorySegment node, MemorySegment pDependencies, MemorySegment edgeData, MemorySegment pNumDependencies) { - var mh$ = cudaGraphNodeGetDependencies_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphNodeGetDependencies_v2", node, pDependencies, edgeData, pNumDependencies); - } - return (int)mh$.invokeExact(node, pDependencies, edgeData, pNumDependencies); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphNodeGetDependentNodes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetDependentNodes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, size_t *pNumDependentNodes) - * } - */ - public static FunctionDescriptor cudaGraphNodeGetDependentNodes$descriptor() { - return cudaGraphNodeGetDependentNodes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, size_t *pNumDependentNodes) - * } - */ - public static MethodHandle cudaGraphNodeGetDependentNodes$handle() { - return cudaGraphNodeGetDependentNodes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, size_t *pNumDependentNodes) - * } - */ - public static MemorySegment cudaGraphNodeGetDependentNodes$address() { - return cudaGraphNodeGetDependentNodes.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependentNodes(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, size_t *pNumDependentNodes) - * } - */ - public static int cudaGraphNodeGetDependentNodes(MemorySegment node, MemorySegment pDependentNodes, MemorySegment pNumDependentNodes) { - var mh$ = cudaGraphNodeGetDependentNodes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphNodeGetDependentNodes", node, pDependentNodes, pNumDependentNodes); - } - return (int)mh$.invokeExact(node, pDependentNodes, pNumDependentNodes); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphNodeGetDependentNodes_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetDependentNodes_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, cudaGraphEdgeData *edgeData, size_t *pNumDependentNodes) - * } - */ - public static FunctionDescriptor cudaGraphNodeGetDependentNodes_v2$descriptor() { - return cudaGraphNodeGetDependentNodes_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, cudaGraphEdgeData *edgeData, size_t *pNumDependentNodes) - * } - */ - public static MethodHandle cudaGraphNodeGetDependentNodes_v2$handle() { - return cudaGraphNodeGetDependentNodes_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, cudaGraphEdgeData *edgeData, size_t *pNumDependentNodes) - * } - */ - public static MemorySegment cudaGraphNodeGetDependentNodes_v2$address() { - return cudaGraphNodeGetDependentNodes_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetDependentNodes_v2(cudaGraphNode_t node, cudaGraphNode_t *pDependentNodes, cudaGraphEdgeData *edgeData, size_t *pNumDependentNodes) - * } - */ - public static int cudaGraphNodeGetDependentNodes_v2(MemorySegment node, MemorySegment pDependentNodes, MemorySegment edgeData, MemorySegment pNumDependentNodes) { - var mh$ = cudaGraphNodeGetDependentNodes_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphNodeGetDependentNodes_v2", node, pDependentNodes, edgeData, pNumDependentNodes); - } - return (int)mh$.invokeExact(node, pDependentNodes, edgeData, pNumDependentNodes); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddDependencies { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddDependencies"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) - * } - */ - public static FunctionDescriptor cudaGraphAddDependencies$descriptor() { - return cudaGraphAddDependencies.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) - * } - */ - public static MethodHandle cudaGraphAddDependencies$handle() { - return cudaGraphAddDependencies.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) - * } - */ - public static MemorySegment cudaGraphAddDependencies$address() { - return cudaGraphAddDependencies.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) - * } - */ - public static int cudaGraphAddDependencies(MemorySegment graph, MemorySegment from, MemorySegment to, long numDependencies) { - var mh$ = cudaGraphAddDependencies.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddDependencies", graph, from, to, numDependencies); - } - return (int)mh$.invokeExact(graph, from, to, numDependencies); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddDependencies_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddDependencies_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) - * } - */ - public static FunctionDescriptor cudaGraphAddDependencies_v2$descriptor() { - return cudaGraphAddDependencies_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) - * } - */ - public static MethodHandle cudaGraphAddDependencies_v2$handle() { - return cudaGraphAddDependencies_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) - * } - */ - public static MemorySegment cudaGraphAddDependencies_v2$address() { - return cudaGraphAddDependencies_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) - * } - */ - public static int cudaGraphAddDependencies_v2(MemorySegment graph, MemorySegment from, MemorySegment to, MemorySegment edgeData, long numDependencies) { - var mh$ = cudaGraphAddDependencies_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddDependencies_v2", graph, from, to, edgeData, numDependencies); - } - return (int)mh$.invokeExact(graph, from, to, edgeData, numDependencies); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphRemoveDependencies { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphRemoveDependencies"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) - * } - */ - public static FunctionDescriptor cudaGraphRemoveDependencies$descriptor() { - return cudaGraphRemoveDependencies.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) - * } - */ - public static MethodHandle cudaGraphRemoveDependencies$handle() { - return cudaGraphRemoveDependencies.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) - * } - */ - public static MemorySegment cudaGraphRemoveDependencies$address() { - return cudaGraphRemoveDependencies.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphRemoveDependencies(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, size_t numDependencies) - * } - */ - public static int cudaGraphRemoveDependencies(MemorySegment graph, MemorySegment from, MemorySegment to, long numDependencies) { - var mh$ = cudaGraphRemoveDependencies.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphRemoveDependencies", graph, from, to, numDependencies); - } - return (int)mh$.invokeExact(graph, from, to, numDependencies); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphRemoveDependencies_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphRemoveDependencies_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) - * } - */ - public static FunctionDescriptor cudaGraphRemoveDependencies_v2$descriptor() { - return cudaGraphRemoveDependencies_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) - * } - */ - public static MethodHandle cudaGraphRemoveDependencies_v2$handle() { - return cudaGraphRemoveDependencies_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) - * } - */ - public static MemorySegment cudaGraphRemoveDependencies_v2$address() { - return cudaGraphRemoveDependencies_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphRemoveDependencies_v2(cudaGraph_t graph, const cudaGraphNode_t *from, const cudaGraphNode_t *to, const cudaGraphEdgeData *edgeData, size_t numDependencies) - * } - */ - public static int cudaGraphRemoveDependencies_v2(MemorySegment graph, MemorySegment from, MemorySegment to, MemorySegment edgeData, long numDependencies) { - var mh$ = cudaGraphRemoveDependencies_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphRemoveDependencies_v2", graph, from, to, edgeData, numDependencies); - } - return (int)mh$.invokeExact(graph, from, to, edgeData, numDependencies); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphDestroyNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphDestroyNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) - * } - */ - public static FunctionDescriptor cudaGraphDestroyNode$descriptor() { - return cudaGraphDestroyNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) - * } - */ - public static MethodHandle cudaGraphDestroyNode$handle() { - return cudaGraphDestroyNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) - * } - */ - public static MemorySegment cudaGraphDestroyNode$address() { - return cudaGraphDestroyNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphDestroyNode(cudaGraphNode_t node) - * } - */ - public static int cudaGraphDestroyNode(MemorySegment node) { - var mh$ = cudaGraphDestroyNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphDestroyNode", node); - } - return (int)mh$.invokeExact(node); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphInstantiate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphInstantiate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiate(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) - * } - */ - public static FunctionDescriptor cudaGraphInstantiate$descriptor() { - return cudaGraphInstantiate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiate(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) - * } - */ - public static MethodHandle cudaGraphInstantiate$handle() { - return cudaGraphInstantiate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiate(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) - * } - */ - public static MemorySegment cudaGraphInstantiate$address() { - return cudaGraphInstantiate.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiate(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) - * } - */ - public static int cudaGraphInstantiate(MemorySegment pGraphExec, MemorySegment graph, long flags) { - var mh$ = cudaGraphInstantiate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphInstantiate", pGraphExec, graph, flags); - } - return (int)mh$.invokeExact(pGraphExec, graph, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphInstantiateWithFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphInstantiateWithFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) - * } - */ - public static FunctionDescriptor cudaGraphInstantiateWithFlags$descriptor() { - return cudaGraphInstantiateWithFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) - * } - */ - public static MethodHandle cudaGraphInstantiateWithFlags$handle() { - return cudaGraphInstantiateWithFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) - * } - */ - public static MemorySegment cudaGraphInstantiateWithFlags$address() { - return cudaGraphInstantiateWithFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiateWithFlags(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, unsigned long long flags) - * } - */ - public static int cudaGraphInstantiateWithFlags(MemorySegment pGraphExec, MemorySegment graph, long flags) { - var mh$ = cudaGraphInstantiateWithFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphInstantiateWithFlags", pGraphExec, graph, flags); - } - return (int)mh$.invokeExact(pGraphExec, graph, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphInstantiateWithParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphInstantiateWithParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams *instantiateParams) - * } - */ - public static FunctionDescriptor cudaGraphInstantiateWithParams$descriptor() { - return cudaGraphInstantiateWithParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams *instantiateParams) - * } - */ - public static MethodHandle cudaGraphInstantiateWithParams$handle() { - return cudaGraphInstantiateWithParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams *instantiateParams) - * } - */ - public static MemorySegment cudaGraphInstantiateWithParams$address() { - return cudaGraphInstantiateWithParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphInstantiateWithParams(cudaGraphExec_t *pGraphExec, cudaGraph_t graph, cudaGraphInstantiateParams *instantiateParams) - * } - */ - public static int cudaGraphInstantiateWithParams(MemorySegment pGraphExec, MemorySegment graph, MemorySegment instantiateParams) { - var mh$ = cudaGraphInstantiateWithParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphInstantiateWithParams", pGraphExec, graph, instantiateParams); - } - return (int)mh$.invokeExact(pGraphExec, graph, instantiateParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecGetFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecGetFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long *flags) - * } - */ - public static FunctionDescriptor cudaGraphExecGetFlags$descriptor() { - return cudaGraphExecGetFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long *flags) - * } - */ - public static MethodHandle cudaGraphExecGetFlags$handle() { - return cudaGraphExecGetFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long *flags) - * } - */ - public static MemorySegment cudaGraphExecGetFlags$address() { - return cudaGraphExecGetFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecGetFlags(cudaGraphExec_t graphExec, unsigned long long *flags) - * } - */ - public static int cudaGraphExecGetFlags(MemorySegment graphExec, MemorySegment flags) { - var mh$ = cudaGraphExecGetFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecGetFlags", graphExec, flags); - } - return (int)mh$.invokeExact(graphExec, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecKernelNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecKernelNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphExecKernelNodeSetParams$descriptor() { - return cudaGraphExecKernelNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphExecKernelNodeSetParams$handle() { - return cudaGraphExecKernelNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphExecKernelNodeSetParams$address() { - return cudaGraphExecKernelNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecKernelNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaKernelNodeParams *pNodeParams) - * } - */ - public static int cudaGraphExecKernelNodeSetParams(MemorySegment hGraphExec, MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphExecKernelNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecKernelNodeSetParams", hGraphExec, node, pNodeParams); - } - return (int)mh$.invokeExact(hGraphExec, node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecMemcpyNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecMemcpyNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphExecMemcpyNodeSetParams$descriptor() { - return cudaGraphExecMemcpyNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static MethodHandle cudaGraphExecMemcpyNodeSetParams$handle() { - return cudaGraphExecMemcpyNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static MemorySegment cudaGraphExecMemcpyNodeSetParams$address() { - return cudaGraphExecMemcpyNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemcpy3DParms *pNodeParams) - * } - */ - public static int cudaGraphExecMemcpyNodeSetParams(MemorySegment hGraphExec, MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphExecMemcpyNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecMemcpyNodeSetParams", hGraphExec, node, pNodeParams); - } - return (int)mh$.invokeExact(hGraphExec, node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecMemcpyNodeSetParamsToSymbol { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecMemcpyNodeSetParamsToSymbol"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsToSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaGraphExecMemcpyNodeSetParamsToSymbol$descriptor() { - return cudaGraphExecMemcpyNodeSetParamsToSymbol.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsToSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaGraphExecMemcpyNodeSetParamsToSymbol$handle() { - return cudaGraphExecMemcpyNodeSetParamsToSymbol.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsToSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaGraphExecMemcpyNodeSetParamsToSymbol$address() { - return cudaGraphExecMemcpyNodeSetParamsToSymbol.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsToSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static int cudaGraphExecMemcpyNodeSetParamsToSymbol(MemorySegment hGraphExec, MemorySegment node, MemorySegment symbol, MemorySegment src, long count, long offset, int kind) { - var mh$ = cudaGraphExecMemcpyNodeSetParamsToSymbol.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecMemcpyNodeSetParamsToSymbol", hGraphExec, node, symbol, src, count, offset, kind); - } - return (int)mh$.invokeExact(hGraphExec, node, symbol, src, count, offset, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecMemcpyNodeSetParamsFromSymbol { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecMemcpyNodeSetParamsFromSymbol"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsFromSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaGraphExecMemcpyNodeSetParamsFromSymbol$descriptor() { - return cudaGraphExecMemcpyNodeSetParamsFromSymbol.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsFromSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaGraphExecMemcpyNodeSetParamsFromSymbol$handle() { - return cudaGraphExecMemcpyNodeSetParamsFromSymbol.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsFromSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaGraphExecMemcpyNodeSetParamsFromSymbol$address() { - return cudaGraphExecMemcpyNodeSetParamsFromSymbol.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParamsFromSymbol(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static int cudaGraphExecMemcpyNodeSetParamsFromSymbol(MemorySegment hGraphExec, MemorySegment node, MemorySegment dst, MemorySegment symbol, long count, long offset, int kind) { - var mh$ = cudaGraphExecMemcpyNodeSetParamsFromSymbol.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecMemcpyNodeSetParamsFromSymbol", hGraphExec, node, dst, symbol, count, offset, kind); - } - return (int)mh$.invokeExact(hGraphExec, node, dst, symbol, count, offset, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecMemcpyNodeSetParams1D { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecMemcpyNodeSetParams1D"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaGraphExecMemcpyNodeSetParams1D$descriptor() { - return cudaGraphExecMemcpyNodeSetParams1D.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaGraphExecMemcpyNodeSetParams1D$handle() { - return cudaGraphExecMemcpyNodeSetParams1D.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaGraphExecMemcpyNodeSetParams1D$address() { - return cudaGraphExecMemcpyNodeSetParams1D.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemcpyNodeSetParams1D(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static int cudaGraphExecMemcpyNodeSetParams1D(MemorySegment hGraphExec, MemorySegment node, MemorySegment dst, MemorySegment src, long count, int kind) { - var mh$ = cudaGraphExecMemcpyNodeSetParams1D.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecMemcpyNodeSetParams1D", hGraphExec, node, dst, src, count, kind); - } - return (int)mh$.invokeExact(hGraphExec, node, dst, src, count, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecMemsetNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecMemsetNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphExecMemsetNodeSetParams$descriptor() { - return cudaGraphExecMemsetNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphExecMemsetNodeSetParams$handle() { - return cudaGraphExecMemsetNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphExecMemsetNodeSetParams$address() { - return cudaGraphExecMemsetNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecMemsetNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaMemsetParams *pNodeParams) - * } - */ - public static int cudaGraphExecMemsetNodeSetParams(MemorySegment hGraphExec, MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphExecMemsetNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecMemsetNodeSetParams", hGraphExec, node, pNodeParams); - } - return (int)mh$.invokeExact(hGraphExec, node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecHostNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecHostNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static FunctionDescriptor cudaGraphExecHostNodeSetParams$descriptor() { - return cudaGraphExecHostNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static MethodHandle cudaGraphExecHostNodeSetParams$handle() { - return cudaGraphExecHostNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static MemorySegment cudaGraphExecHostNodeSetParams$address() { - return cudaGraphExecHostNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecHostNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, const struct cudaHostNodeParams *pNodeParams) - * } - */ - public static int cudaGraphExecHostNodeSetParams(MemorySegment hGraphExec, MemorySegment node, MemorySegment pNodeParams) { - var mh$ = cudaGraphExecHostNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecHostNodeSetParams", hGraphExec, node, pNodeParams); - } - return (int)mh$.invokeExact(hGraphExec, node, pNodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecChildGraphNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecChildGraphNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) - * } - */ - public static FunctionDescriptor cudaGraphExecChildGraphNodeSetParams$descriptor() { - return cudaGraphExecChildGraphNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) - * } - */ - public static MethodHandle cudaGraphExecChildGraphNodeSetParams$handle() { - return cudaGraphExecChildGraphNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) - * } - */ - public static MemorySegment cudaGraphExecChildGraphNodeSetParams$address() { - return cudaGraphExecChildGraphNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecChildGraphNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t node, cudaGraph_t childGraph) - * } - */ - public static int cudaGraphExecChildGraphNodeSetParams(MemorySegment hGraphExec, MemorySegment node, MemorySegment childGraph) { - var mh$ = cudaGraphExecChildGraphNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecChildGraphNodeSetParams", hGraphExec, node, childGraph); - } - return (int)mh$.invokeExact(hGraphExec, node, childGraph); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecEventRecordNodeSetEvent { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecEventRecordNodeSetEvent"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) - * } - */ - public static FunctionDescriptor cudaGraphExecEventRecordNodeSetEvent$descriptor() { - return cudaGraphExecEventRecordNodeSetEvent.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) - * } - */ - public static MethodHandle cudaGraphExecEventRecordNodeSetEvent$handle() { - return cudaGraphExecEventRecordNodeSetEvent.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) - * } - */ - public static MemorySegment cudaGraphExecEventRecordNodeSetEvent$address() { - return cudaGraphExecEventRecordNodeSetEvent.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecEventRecordNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) - * } - */ - public static int cudaGraphExecEventRecordNodeSetEvent(MemorySegment hGraphExec, MemorySegment hNode, MemorySegment event) { - var mh$ = cudaGraphExecEventRecordNodeSetEvent.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecEventRecordNodeSetEvent", hGraphExec, hNode, event); - } - return (int)mh$.invokeExact(hGraphExec, hNode, event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecEventWaitNodeSetEvent { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecEventWaitNodeSetEvent"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) - * } - */ - public static FunctionDescriptor cudaGraphExecEventWaitNodeSetEvent$descriptor() { - return cudaGraphExecEventWaitNodeSetEvent.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) - * } - */ - public static MethodHandle cudaGraphExecEventWaitNodeSetEvent$handle() { - return cudaGraphExecEventWaitNodeSetEvent.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) - * } - */ - public static MemorySegment cudaGraphExecEventWaitNodeSetEvent$address() { - return cudaGraphExecEventWaitNodeSetEvent.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecEventWaitNodeSetEvent(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, cudaEvent_t event) - * } - */ - public static int cudaGraphExecEventWaitNodeSetEvent(MemorySegment hGraphExec, MemorySegment hNode, MemorySegment event) { - var mh$ = cudaGraphExecEventWaitNodeSetEvent.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecEventWaitNodeSetEvent", hGraphExec, hNode, event); - } - return (int)mh$.invokeExact(hGraphExec, hNode, event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecExternalSemaphoresSignalNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecExternalSemaphoresSignalNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphExecExternalSemaphoresSignalNodeSetParams$descriptor() { - return cudaGraphExecExternalSemaphoresSignalNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphExecExternalSemaphoresSignalNodeSetParams$handle() { - return cudaGraphExecExternalSemaphoresSignalNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphExecExternalSemaphoresSignalNodeSetParams$address() { - return cudaGraphExecExternalSemaphoresSignalNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecExternalSemaphoresSignalNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreSignalNodeParams *nodeParams) - * } - */ - public static int cudaGraphExecExternalSemaphoresSignalNodeSetParams(MemorySegment hGraphExec, MemorySegment hNode, MemorySegment nodeParams) { - var mh$ = cudaGraphExecExternalSemaphoresSignalNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecExternalSemaphoresSignalNodeSetParams", hGraphExec, hNode, nodeParams); - } - return (int)mh$.invokeExact(hGraphExec, hNode, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecExternalSemaphoresWaitNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecExternalSemaphoresWaitNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphExecExternalSemaphoresWaitNodeSetParams$descriptor() { - return cudaGraphExecExternalSemaphoresWaitNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphExecExternalSemaphoresWaitNodeSetParams$handle() { - return cudaGraphExecExternalSemaphoresWaitNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphExecExternalSemaphoresWaitNodeSetParams$address() { - return cudaGraphExecExternalSemaphoresWaitNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecExternalSemaphoresWaitNodeSetParams(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, const struct cudaExternalSemaphoreWaitNodeParams *nodeParams) - * } - */ - public static int cudaGraphExecExternalSemaphoresWaitNodeSetParams(MemorySegment hGraphExec, MemorySegment hNode, MemorySegment nodeParams) { - var mh$ = cudaGraphExecExternalSemaphoresWaitNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecExternalSemaphoresWaitNodeSetParams", hGraphExec, hNode, nodeParams); - } - return (int)mh$.invokeExact(hGraphExec, hNode, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphNodeSetEnabled { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeSetEnabled"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) - * } - */ - public static FunctionDescriptor cudaGraphNodeSetEnabled$descriptor() { - return cudaGraphNodeSetEnabled.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) - * } - */ - public static MethodHandle cudaGraphNodeSetEnabled$handle() { - return cudaGraphNodeSetEnabled.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) - * } - */ - public static MemorySegment cudaGraphNodeSetEnabled$address() { - return cudaGraphNodeSetEnabled.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeSetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int isEnabled) - * } - */ - public static int cudaGraphNodeSetEnabled(MemorySegment hGraphExec, MemorySegment hNode, int isEnabled) { - var mh$ = cudaGraphNodeSetEnabled.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphNodeSetEnabled", hGraphExec, hNode, isEnabled); - } - return (int)mh$.invokeExact(hGraphExec, hNode, isEnabled); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphNodeGetEnabled { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeGetEnabled"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int *isEnabled) - * } - */ - public static FunctionDescriptor cudaGraphNodeGetEnabled$descriptor() { - return cudaGraphNodeGetEnabled.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int *isEnabled) - * } - */ - public static MethodHandle cudaGraphNodeGetEnabled$handle() { - return cudaGraphNodeGetEnabled.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int *isEnabled) - * } - */ - public static MemorySegment cudaGraphNodeGetEnabled$address() { - return cudaGraphNodeGetEnabled.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeGetEnabled(cudaGraphExec_t hGraphExec, cudaGraphNode_t hNode, unsigned int *isEnabled) - * } - */ - public static int cudaGraphNodeGetEnabled(MemorySegment hGraphExec, MemorySegment hNode, MemorySegment isEnabled) { - var mh$ = cudaGraphNodeGetEnabled.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphNodeGetEnabled", hGraphExec, hNode, isEnabled); - } - return (int)mh$.invokeExact(hGraphExec, hNode, isEnabled); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecUpdate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecUpdate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo *resultInfo) - * } - */ - public static FunctionDescriptor cudaGraphExecUpdate$descriptor() { - return cudaGraphExecUpdate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo *resultInfo) - * } - */ - public static MethodHandle cudaGraphExecUpdate$handle() { - return cudaGraphExecUpdate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo *resultInfo) - * } - */ - public static MemorySegment cudaGraphExecUpdate$address() { - return cudaGraphExecUpdate.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecUpdate(cudaGraphExec_t hGraphExec, cudaGraph_t hGraph, cudaGraphExecUpdateResultInfo *resultInfo) - * } - */ - public static int cudaGraphExecUpdate(MemorySegment hGraphExec, MemorySegment hGraph, MemorySegment resultInfo) { - var mh$ = cudaGraphExecUpdate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecUpdate", hGraphExec, hGraph, resultInfo); - } - return (int)mh$.invokeExact(hGraphExec, hGraph, resultInfo); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphUpload { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphUpload"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaGraphUpload$descriptor() { - return cudaGraphUpload.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) - * } - */ - public static MethodHandle cudaGraphUpload$handle() { - return cudaGraphUpload.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) - * } - */ - public static MemorySegment cudaGraphUpload$address() { - return cudaGraphUpload.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphUpload(cudaGraphExec_t graphExec, cudaStream_t stream) - * } - */ - public static int cudaGraphUpload(MemorySegment graphExec, MemorySegment stream) { - var mh$ = cudaGraphUpload.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphUpload", graphExec, stream); - } - return (int)mh$.invokeExact(graphExec, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphLaunch { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphLaunch"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaGraphLaunch$descriptor() { - return cudaGraphLaunch.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) - * } - */ - public static MethodHandle cudaGraphLaunch$handle() { - return cudaGraphLaunch.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) - * } - */ - public static MemorySegment cudaGraphLaunch$address() { - return cudaGraphLaunch.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphLaunch(cudaGraphExec_t graphExec, cudaStream_t stream) - * } - */ - public static int cudaGraphLaunch(MemorySegment graphExec, MemorySegment stream) { - var mh$ = cudaGraphLaunch.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphLaunch", graphExec, stream); - } - return (int)mh$.invokeExact(graphExec, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) - * } - */ - public static FunctionDescriptor cudaGraphExecDestroy$descriptor() { - return cudaGraphExecDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) - * } - */ - public static MethodHandle cudaGraphExecDestroy$handle() { - return cudaGraphExecDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) - * } - */ - public static MemorySegment cudaGraphExecDestroy$address() { - return cudaGraphExecDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecDestroy(cudaGraphExec_t graphExec) - * } - */ - public static int cudaGraphExecDestroy(MemorySegment graphExec) { - var mh$ = cudaGraphExecDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecDestroy", graphExec); - } - return (int)mh$.invokeExact(graphExec); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphDestroy(cudaGraph_t graph) - * } - */ - public static FunctionDescriptor cudaGraphDestroy$descriptor() { - return cudaGraphDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphDestroy(cudaGraph_t graph) - * } - */ - public static MethodHandle cudaGraphDestroy$handle() { - return cudaGraphDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphDestroy(cudaGraph_t graph) - * } - */ - public static MemorySegment cudaGraphDestroy$address() { - return cudaGraphDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphDestroy(cudaGraph_t graph) - * } - */ - public static int cudaGraphDestroy(MemorySegment graph) { - var mh$ = cudaGraphDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphDestroy", graph); - } - return (int)mh$.invokeExact(graph); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphDebugDotPrint { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphDebugDotPrint"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char *path, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaGraphDebugDotPrint$descriptor() { - return cudaGraphDebugDotPrint.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char *path, unsigned int flags) - * } - */ - public static MethodHandle cudaGraphDebugDotPrint$handle() { - return cudaGraphDebugDotPrint.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char *path, unsigned int flags) - * } - */ - public static MemorySegment cudaGraphDebugDotPrint$address() { - return cudaGraphDebugDotPrint.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphDebugDotPrint(cudaGraph_t graph, const char *path, unsigned int flags) - * } - */ - public static int cudaGraphDebugDotPrint(MemorySegment graph, MemorySegment path, int flags) { - var mh$ = cudaGraphDebugDotPrint.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphDebugDotPrint", graph, path, flags); - } - return (int)mh$.invokeExact(graph, path, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaUserObjectCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaUserObjectCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectCreate(cudaUserObject_t *object_out, void *ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaUserObjectCreate$descriptor() { - return cudaUserObjectCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectCreate(cudaUserObject_t *object_out, void *ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) - * } - */ - public static MethodHandle cudaUserObjectCreate$handle() { - return cudaUserObjectCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectCreate(cudaUserObject_t *object_out, void *ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) - * } - */ - public static MemorySegment cudaUserObjectCreate$address() { - return cudaUserObjectCreate.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectCreate(cudaUserObject_t *object_out, void *ptr, cudaHostFn_t destroy, unsigned int initialRefcount, unsigned int flags) - * } - */ - public static int cudaUserObjectCreate(MemorySegment object_out, MemorySegment ptr, MemorySegment destroy, int initialRefcount, int flags) { - var mh$ = cudaUserObjectCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaUserObjectCreate", object_out, ptr, destroy, initialRefcount, flags); - } - return (int)mh$.invokeExact(object_out, ptr, destroy, initialRefcount, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaUserObjectRetain { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaUserObjectRetain"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) - * } - */ - public static FunctionDescriptor cudaUserObjectRetain$descriptor() { - return cudaUserObjectRetain.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) - * } - */ - public static MethodHandle cudaUserObjectRetain$handle() { - return cudaUserObjectRetain.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) - * } - */ - public static MemorySegment cudaUserObjectRetain$address() { - return cudaUserObjectRetain.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectRetain(cudaUserObject_t object, unsigned int count) - * } - */ - public static int cudaUserObjectRetain(MemorySegment object, int count) { - var mh$ = cudaUserObjectRetain.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaUserObjectRetain", object, count); - } - return (int)mh$.invokeExact(object, count); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaUserObjectRelease { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaUserObjectRelease"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) - * } - */ - public static FunctionDescriptor cudaUserObjectRelease$descriptor() { - return cudaUserObjectRelease.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) - * } - */ - public static MethodHandle cudaUserObjectRelease$handle() { - return cudaUserObjectRelease.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) - * } - */ - public static MemorySegment cudaUserObjectRelease$address() { - return cudaUserObjectRelease.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaUserObjectRelease(cudaUserObject_t object, unsigned int count) - * } - */ - public static int cudaUserObjectRelease(MemorySegment object, int count) { - var mh$ = cudaUserObjectRelease.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaUserObjectRelease", object, count); - } - return (int)mh$.invokeExact(object, count); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphRetainUserObject { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphRetainUserObject"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaGraphRetainUserObject$descriptor() { - return cudaGraphRetainUserObject.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) - * } - */ - public static MethodHandle cudaGraphRetainUserObject$handle() { - return cudaGraphRetainUserObject.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) - * } - */ - public static MemorySegment cudaGraphRetainUserObject$address() { - return cudaGraphRetainUserObject.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphRetainUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count, unsigned int flags) - * } - */ - public static int cudaGraphRetainUserObject(MemorySegment graph, MemorySegment object, int count, int flags) { - var mh$ = cudaGraphRetainUserObject.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphRetainUserObject", graph, object, count, flags); - } - return (int)mh$.invokeExact(graph, object, count, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphReleaseUserObject { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphReleaseUserObject"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) - * } - */ - public static FunctionDescriptor cudaGraphReleaseUserObject$descriptor() { - return cudaGraphReleaseUserObject.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) - * } - */ - public static MethodHandle cudaGraphReleaseUserObject$handle() { - return cudaGraphReleaseUserObject.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) - * } - */ - public static MemorySegment cudaGraphReleaseUserObject$address() { - return cudaGraphReleaseUserObject.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphReleaseUserObject(cudaGraph_t graph, cudaUserObject_t object, unsigned int count) - * } - */ - public static int cudaGraphReleaseUserObject(MemorySegment graph, MemorySegment object, int count) { - var mh$ = cudaGraphReleaseUserObject.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphReleaseUserObject", graph, object, count); - } - return (int)mh$.invokeExact(graph, object, count); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddNode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddNode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphAddNode$descriptor() { - return cudaGraphAddNode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphAddNode$handle() { - return cudaGraphAddNode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphAddNode$address() { - return cudaGraphAddNode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddNode(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static int cudaGraphAddNode(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, long numDependencies, MemorySegment nodeParams) { - var mh$ = cudaGraphAddNode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddNode", pGraphNode, graph, pDependencies, numDependencies, nodeParams); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, numDependencies, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphAddNode_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphAddNode_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphAddNode_v2$descriptor() { - return cudaGraphAddNode_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphAddNode_v2$handle() { - return cudaGraphAddNode_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphAddNode_v2$address() { - return cudaGraphAddNode_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphAddNode_v2(cudaGraphNode_t *pGraphNode, cudaGraph_t graph, const cudaGraphNode_t *pDependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static int cudaGraphAddNode_v2(MemorySegment pGraphNode, MemorySegment graph, MemorySegment pDependencies, MemorySegment dependencyData, long numDependencies, MemorySegment nodeParams) { - var mh$ = cudaGraphAddNode_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphAddNode_v2", pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams); - } - return (int)mh$.invokeExact(pGraphNode, graph, pDependencies, dependencyData, numDependencies, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphNodeSetParams$descriptor() { - return cudaGraphNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphNodeSetParams$handle() { - return cudaGraphNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphNodeSetParams$address() { - return cudaGraphNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphNodeSetParams(cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static int cudaGraphNodeSetParams(MemorySegment node, MemorySegment nodeParams) { - var mh$ = cudaGraphNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphNodeSetParams", node, nodeParams); - } - return (int)mh$.invokeExact(node, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphExecNodeSetParams { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphExecNodeSetParams"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static FunctionDescriptor cudaGraphExecNodeSetParams$descriptor() { - return cudaGraphExecNodeSetParams.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static MethodHandle cudaGraphExecNodeSetParams$handle() { - return cudaGraphExecNodeSetParams.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static MemorySegment cudaGraphExecNodeSetParams$address() { - return cudaGraphExecNodeSetParams.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphExecNodeSetParams(cudaGraphExec_t graphExec, cudaGraphNode_t node, struct cudaGraphNodeParams *nodeParams) - * } - */ - public static int cudaGraphExecNodeSetParams(MemorySegment graphExec, MemorySegment node, MemorySegment nodeParams) { - var mh$ = cudaGraphExecNodeSetParams.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphExecNodeSetParams", graphExec, node, nodeParams); - } - return (int)mh$.invokeExact(graphExec, node, nodeParams); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGraphConditionalHandleCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGraphConditionalHandleCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle *pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaGraphConditionalHandleCreate$descriptor() { - return cudaGraphConditionalHandleCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle *pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) - * } - */ - public static MethodHandle cudaGraphConditionalHandleCreate$handle() { - return cudaGraphConditionalHandleCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle *pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) - * } - */ - public static MemorySegment cudaGraphConditionalHandleCreate$address() { - return cudaGraphConditionalHandleCreate.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGraphConditionalHandleCreate(cudaGraphConditionalHandle *pHandle_out, cudaGraph_t graph, unsigned int defaultLaunchValue, unsigned int flags) - * } - */ - public static int cudaGraphConditionalHandleCreate(MemorySegment pHandle_out, MemorySegment graph, int defaultLaunchValue, int flags) { - var mh$ = cudaGraphConditionalHandleCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGraphConditionalHandleCreate", pHandle_out, graph, defaultLaunchValue, flags); - } - return (int)mh$.invokeExact(pHandle_out, graph, defaultLaunchValue, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetDriverEntryPoint { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDriverEntryPoint"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDriverEntryPoint(const char *symbol, void **funcPtr, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) - * } - */ - public static FunctionDescriptor cudaGetDriverEntryPoint$descriptor() { - return cudaGetDriverEntryPoint.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDriverEntryPoint(const char *symbol, void **funcPtr, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) - * } - */ - public static MethodHandle cudaGetDriverEntryPoint$handle() { - return cudaGetDriverEntryPoint.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDriverEntryPoint(const char *symbol, void **funcPtr, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) - * } - */ - public static MemorySegment cudaGetDriverEntryPoint$address() { - return cudaGetDriverEntryPoint.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetDriverEntryPoint(const char *symbol, void **funcPtr, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) - * } - */ - public static int cudaGetDriverEntryPoint(MemorySegment symbol, MemorySegment funcPtr, long flags, MemorySegment driverStatus) { - var mh$ = cudaGetDriverEntryPoint.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetDriverEntryPoint", symbol, funcPtr, flags, driverStatus); - } - return (int)mh$.invokeExact(symbol, funcPtr, flags, driverStatus); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetDriverEntryPointByVersion { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDriverEntryPointByVersion"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDriverEntryPointByVersion(const char *symbol, void **funcPtr, unsigned int cudaVersion, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) - * } - */ - public static FunctionDescriptor cudaGetDriverEntryPointByVersion$descriptor() { - return cudaGetDriverEntryPointByVersion.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDriverEntryPointByVersion(const char *symbol, void **funcPtr, unsigned int cudaVersion, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) - * } - */ - public static MethodHandle cudaGetDriverEntryPointByVersion$handle() { - return cudaGetDriverEntryPointByVersion.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDriverEntryPointByVersion(const char *symbol, void **funcPtr, unsigned int cudaVersion, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) - * } - */ - public static MemorySegment cudaGetDriverEntryPointByVersion$address() { - return cudaGetDriverEntryPointByVersion.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetDriverEntryPointByVersion(const char *symbol, void **funcPtr, unsigned int cudaVersion, unsigned long long flags, enum cudaDriverEntryPointQueryResult *driverStatus) - * } - */ - public static int cudaGetDriverEntryPointByVersion(MemorySegment symbol, MemorySegment funcPtr, int cudaVersion, long flags, MemorySegment driverStatus) { - var mh$ = cudaGetDriverEntryPointByVersion.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetDriverEntryPointByVersion", symbol, funcPtr, cudaVersion, flags, driverStatus); - } - return (int)mh$.invokeExact(symbol, funcPtr, cudaVersion, flags, driverStatus); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetExportTable { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetExportTable"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetExportTable(const void **ppExportTable, const cudaUUID_t *pExportTableId) - * } - */ - public static FunctionDescriptor cudaGetExportTable$descriptor() { - return cudaGetExportTable.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetExportTable(const void **ppExportTable, const cudaUUID_t *pExportTableId) - * } - */ - public static MethodHandle cudaGetExportTable$handle() { - return cudaGetExportTable.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetExportTable(const void **ppExportTable, const cudaUUID_t *pExportTableId) - * } - */ - public static MemorySegment cudaGetExportTable$address() { - return cudaGetExportTable.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetExportTable(const void **ppExportTable, const cudaUUID_t *pExportTableId) - * } - */ - public static int cudaGetExportTable(MemorySegment ppExportTable, MemorySegment pExportTableId) { - var mh$ = cudaGetExportTable.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetExportTable", ppExportTable, pExportTableId); - } - return (int)mh$.invokeExact(ppExportTable, pExportTableId); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetFuncBySymbol { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetFuncBySymbol"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetFuncBySymbol(cudaFunction_t *functionPtr, const void *symbolPtr) - * } - */ - public static FunctionDescriptor cudaGetFuncBySymbol$descriptor() { - return cudaGetFuncBySymbol.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetFuncBySymbol(cudaFunction_t *functionPtr, const void *symbolPtr) - * } - */ - public static MethodHandle cudaGetFuncBySymbol$handle() { - return cudaGetFuncBySymbol.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetFuncBySymbol(cudaFunction_t *functionPtr, const void *symbolPtr) - * } - */ - public static MemorySegment cudaGetFuncBySymbol$address() { - return cudaGetFuncBySymbol.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetFuncBySymbol(cudaFunction_t *functionPtr, const void *symbolPtr) - * } - */ - public static int cudaGetFuncBySymbol(MemorySegment functionPtr, MemorySegment symbolPtr) { - var mh$ = cudaGetFuncBySymbol.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetFuncBySymbol", functionPtr, symbolPtr); - } - return (int)mh$.invokeExact(functionPtr, symbolPtr); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetKernel { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetKernel"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetKernel(cudaKernel_t *kernelPtr, const void *entryFuncAddr) - * } - */ - public static FunctionDescriptor cudaGetKernel$descriptor() { - return cudaGetKernel.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetKernel(cudaKernel_t *kernelPtr, const void *entryFuncAddr) - * } - */ - public static MethodHandle cudaGetKernel$handle() { - return cudaGetKernel.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetKernel(cudaKernel_t *kernelPtr, const void *entryFuncAddr) - * } - */ - public static MemorySegment cudaGetKernel$address() { - return cudaGetKernel.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetKernel(cudaKernel_t *kernelPtr, const void *entryFuncAddr) - * } - */ - public static int cudaGetKernel(MemorySegment kernelPtr, MemorySegment entryFuncAddr) { - var mh$ = cudaGetKernel.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetKernel", kernelPtr, entryFuncAddr); - } - return (int)mh$.invokeExact(kernelPtr, entryFuncAddr); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef unsigned char __u_char - * } - */ - public static final OfByte __u_char = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned short __u_short - * } - */ - public static final OfShort __u_short = PanamaFFMAPI.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned int __u_int - * } - */ - public static final OfInt __u_int = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long __u_long - * } - */ - public static final OfLong __u_long = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef signed char __int8_t - * } - */ - public static final OfByte __int8_t = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned char __uint8_t - * } - */ - public static final OfByte __uint8_t = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef short __int16_t - * } - */ - public static final OfShort __int16_t = PanamaFFMAPI.C_SHORT; - /** - * {@snippet lang=c : - * typedef unsigned short __uint16_t - * } - */ - public static final OfShort __uint16_t = PanamaFFMAPI.C_SHORT; - /** - * {@snippet lang=c : - * typedef int __int32_t - * } - */ - public static final OfInt __int32_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned int __uint32_t - * } - */ - public static final OfInt __uint32_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef long __int64_t - * } - */ - public static final OfLong __int64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __uint64_t - * } - */ - public static final OfLong __uint64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef __int8_t __int_least8_t - * } - */ - public static final OfByte __int_least8_t = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef __uint8_t __uint_least8_t - * } - */ - public static final OfByte __uint_least8_t = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef __int16_t __int_least16_t - * } - */ - public static final OfShort __int_least16_t = PanamaFFMAPI.C_SHORT; - /** - * {@snippet lang=c : - * typedef __uint16_t __uint_least16_t - * } - */ - public static final OfShort __uint_least16_t = PanamaFFMAPI.C_SHORT; - /** - * {@snippet lang=c : - * typedef __int32_t __int_least32_t - * } - */ - public static final OfInt __int_least32_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef __uint32_t __uint_least32_t - * } - */ - public static final OfInt __uint_least32_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef __int64_t __int_least64_t - * } - */ - public static final OfLong __int_least64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef __uint64_t __uint_least64_t - * } - */ - public static final OfLong __uint_least64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long __quad_t - * } - */ - public static final OfLong __quad_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __u_quad_t - * } - */ - public static final OfLong __u_quad_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long __intmax_t - * } - */ - public static final OfLong __intmax_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __uintmax_t - * } - */ - public static final OfLong __uintmax_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __dev_t - * } - */ - public static final OfLong __dev_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __uid_t - * } - */ - public static final OfInt __uid_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned int __gid_t - * } - */ - public static final OfInt __gid_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long __ino_t - * } - */ - public static final OfLong __ino_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __ino64_t - * } - */ - public static final OfLong __ino64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __mode_t - * } - */ - public static final OfInt __mode_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef unsigned long __nlink_t - * } - */ - public static final OfLong __nlink_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long __off_t - * } - */ - public static final OfLong __off_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long __off64_t - * } - */ - public static final OfLong __off64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef int __pid_t - * } - */ - public static final OfInt __pid_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef long __clock_t - * } - */ - public static final OfLong __clock_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __rlim_t - * } - */ - public static final OfLong __rlim_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __rlim64_t - * } - */ - public static final OfLong __rlim64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __id_t - * } - */ - public static final OfInt __id_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef long __time_t - * } - */ - public static final OfLong __time_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __useconds_t - * } - */ - public static final OfInt __useconds_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef long __suseconds_t - * } - */ - public static final OfLong __suseconds_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long __suseconds64_t - * } - */ - public static final OfLong __suseconds64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef int __daddr_t - * } - */ - public static final OfInt __daddr_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef int __key_t - * } - */ - public static final OfInt __key_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef int __clockid_t - * } - */ - public static final OfInt __clockid_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef void *__timer_t - * } - */ - public static final AddressLayout __timer_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef long __blksize_t - * } - */ - public static final OfLong __blksize_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long __blkcnt_t - * } - */ - public static final OfLong __blkcnt_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long __blkcnt64_t - * } - */ - public static final OfLong __blkcnt64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __fsblkcnt_t - * } - */ - public static final OfLong __fsblkcnt_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __fsblkcnt64_t - * } - */ - public static final OfLong __fsblkcnt64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __fsfilcnt_t - * } - */ - public static final OfLong __fsfilcnt_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __fsfilcnt64_t - * } - */ - public static final OfLong __fsfilcnt64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long __fsword_t - * } - */ - public static final OfLong __fsword_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long __ssize_t - * } - */ - public static final OfLong __ssize_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long __syscall_slong_t - * } - */ - public static final OfLong __syscall_slong_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long __syscall_ulong_t - * } - */ - public static final OfLong __syscall_ulong_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef __off64_t __loff_t - * } - */ - public static final OfLong __loff_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef char *__caddr_t - * } - */ - public static final AddressLayout __caddr_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef long __intptr_t - * } - */ - public static final OfLong __intptr_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned int __socklen_t - * } - */ - public static final OfInt __socklen_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef int __sig_atomic_t - * } - */ - public static final OfInt __sig_atomic_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef __int8_t int8_t - * } - */ - public static final OfByte int8_t = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef __int16_t int16_t - * } - */ - public static final OfShort int16_t = PanamaFFMAPI.C_SHORT; - /** - * {@snippet lang=c : - * typedef __int32_t int32_t - * } - */ - public static final OfInt int32_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef __int64_t int64_t - * } - */ - public static final OfLong int64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef __uint8_t uint8_t - * } - */ - public static final OfByte uint8_t = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef __uint16_t uint16_t - * } - */ - public static final OfShort uint16_t = PanamaFFMAPI.C_SHORT; - /** - * {@snippet lang=c : - * typedef __uint32_t uint32_t - * } - */ - public static final OfInt uint32_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef __uint64_t uint64_t - * } - */ - public static final OfLong uint64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef __int_least8_t int_least8_t - * } - */ - public static final OfByte int_least8_t = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef __int_least16_t int_least16_t - * } - */ - public static final OfShort int_least16_t = PanamaFFMAPI.C_SHORT; - /** - * {@snippet lang=c : - * typedef __int_least32_t int_least32_t - * } - */ - public static final OfInt int_least32_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef __int_least64_t int_least64_t - * } - */ - public static final OfLong int_least64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef __uint_least8_t uint_least8_t - * } - */ - public static final OfByte uint_least8_t = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef __uint_least16_t uint_least16_t - * } - */ - public static final OfShort uint_least16_t = PanamaFFMAPI.C_SHORT; - /** - * {@snippet lang=c : - * typedef __uint_least32_t uint_least32_t - * } - */ - public static final OfInt uint_least32_t = PanamaFFMAPI.C_INT; - /** - * {@snippet lang=c : - * typedef __uint_least64_t uint_least64_t - * } - */ - public static final OfLong uint_least64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef signed char int_fast8_t - * } - */ - public static final OfByte int_fast8_t = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef long int_fast16_t - * } - */ - public static final OfLong int_fast16_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long int_fast32_t - * } - */ - public static final OfLong int_fast32_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long int_fast64_t - * } - */ - public static final OfLong int_fast64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned char uint_fast8_t - * } - */ - public static final OfByte uint_fast8_t = PanamaFFMAPI.C_CHAR; - /** - * {@snippet lang=c : - * typedef unsigned long uint_fast16_t - * } - */ - public static final OfLong uint_fast16_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uint_fast32_t - * } - */ - public static final OfLong uint_fast32_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uint_fast64_t - * } - */ - public static final OfLong uint_fast64_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef long intptr_t - * } - */ - public static final OfLong intptr_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long uintptr_t - * } - */ - public static final OfLong uintptr_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef __intmax_t intmax_t - * } - */ - public static final OfLong intmax_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef __uintmax_t uintmax_t - * } - */ - public static final OfLong uintmax_t = PanamaFFMAPI.C_LONG; - private static final int CUVS_ERROR = (int)0L; - /** - * {@snippet lang=c : - * enum .CUVS_ERROR = 0 - * } - */ - public static int CUVS_ERROR() { - return CUVS_ERROR; - } - private static final int CUVS_SUCCESS = (int)1L; - /** - * {@snippet lang=c : - * enum .CUVS_SUCCESS = 1 - * } - */ - public static int CUVS_SUCCESS() { - return CUVS_SUCCESS; - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * const char *cuvsGetLastErrorText() - * } - */ - public static class cuvsGetLastErrorText { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_POINTER ); - private static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsGetLastErrorText"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private cuvsGetLastErrorText(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * const char *cuvsGetLastErrorText() - * } - */ - public static cuvsGetLastErrorText makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new cuvsGetLastErrorText(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public MemorySegment apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsGetLastErrorText", x0); - } - return (MemorySegment)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class cuvsSetLastErrorText { - public static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid( - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsSetLastErrorText"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * void cuvsSetLastErrorText(const char *error) - * } - */ - public static FunctionDescriptor cuvsSetLastErrorText$descriptor() { - return cuvsSetLastErrorText.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * void cuvsSetLastErrorText(const char *error) - * } - */ - public static MethodHandle cuvsSetLastErrorText$handle() { - return cuvsSetLastErrorText.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * void cuvsSetLastErrorText(const char *error) - * } - */ - public static MemorySegment cuvsSetLastErrorText$address() { - return cuvsSetLastErrorText.ADDR; - } - - /** - * {@snippet lang=c : - * void cuvsSetLastErrorText(const char *error) - * } - */ - public static void cuvsSetLastErrorText(MemorySegment error) { - var mh$ = cuvsSetLastErrorText.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsSetLastErrorText", error); - } - mh$.invokeExact(error); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef uintptr_t cuvsResources_t - * } - */ - public static final OfLong cuvsResources_t = PanamaFFMAPI.C_LONG; - - private static class cuvsResourcesCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsResourcesCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsResourcesCreate(cuvsResources_t *res) - * } - */ - public static FunctionDescriptor cuvsResourcesCreate$descriptor() { - return cuvsResourcesCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsResourcesCreate(cuvsResources_t *res) - * } - */ - public static MethodHandle cuvsResourcesCreate$handle() { - return cuvsResourcesCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsResourcesCreate(cuvsResources_t *res) - * } - */ - public static MemorySegment cuvsResourcesCreate$address() { - return cuvsResourcesCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsResourcesCreate(cuvsResources_t *res) - * } - */ - public static int cuvsResourcesCreate(MemorySegment res) { - var mh$ = cuvsResourcesCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsResourcesCreate", res); - } - return (int)mh$.invokeExact(res); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsResourcesDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsResourcesDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsResourcesDestroy(cuvsResources_t res) - * } - */ - public static FunctionDescriptor cuvsResourcesDestroy$descriptor() { - return cuvsResourcesDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsResourcesDestroy(cuvsResources_t res) - * } - */ - public static MethodHandle cuvsResourcesDestroy$handle() { - return cuvsResourcesDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsResourcesDestroy(cuvsResources_t res) - * } - */ - public static MemorySegment cuvsResourcesDestroy$address() { - return cuvsResourcesDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsResourcesDestroy(cuvsResources_t res) - * } - */ - public static int cuvsResourcesDestroy(long res) { - var mh$ = cuvsResourcesDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsResourcesDestroy", res); - } - return (int)mh$.invokeExact(res); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsStreamSet { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsStreamSet"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsStreamSet(cuvsResources_t res, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cuvsStreamSet$descriptor() { - return cuvsStreamSet.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsStreamSet(cuvsResources_t res, cudaStream_t stream) - * } - */ - public static MethodHandle cuvsStreamSet$handle() { - return cuvsStreamSet.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsStreamSet(cuvsResources_t res, cudaStream_t stream) - * } - */ - public static MemorySegment cuvsStreamSet$address() { - return cuvsStreamSet.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsStreamSet(cuvsResources_t res, cudaStream_t stream) - * } - */ - public static int cuvsStreamSet(long res, MemorySegment stream) { - var mh$ = cuvsStreamSet.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsStreamSet", res, stream); - } - return (int)mh$.invokeExact(res, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsStreamGet { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsStreamGet"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsStreamGet(cuvsResources_t res, cudaStream_t *stream) - * } - */ - public static FunctionDescriptor cuvsStreamGet$descriptor() { - return cuvsStreamGet.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsStreamGet(cuvsResources_t res, cudaStream_t *stream) - * } - */ - public static MethodHandle cuvsStreamGet$handle() { - return cuvsStreamGet.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsStreamGet(cuvsResources_t res, cudaStream_t *stream) - * } - */ - public static MemorySegment cuvsStreamGet$address() { - return cuvsStreamGet.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsStreamGet(cuvsResources_t res, cudaStream_t *stream) - * } - */ - public static int cuvsStreamGet(long res, MemorySegment stream) { - var mh$ = cuvsStreamGet.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsStreamGet", res, stream); - } - return (int)mh$.invokeExact(res, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsStreamSync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsStreamSync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsStreamSync(cuvsResources_t res) - * } - */ - public static FunctionDescriptor cuvsStreamSync$descriptor() { - return cuvsStreamSync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsStreamSync(cuvsResources_t res) - * } - */ - public static MethodHandle cuvsStreamSync$handle() { - return cuvsStreamSync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsStreamSync(cuvsResources_t res) - * } - */ - public static MemorySegment cuvsStreamSync$address() { - return cuvsStreamSync.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsStreamSync(cuvsResources_t res) - * } - */ - public static int cuvsStreamSync(long res) { - var mh$ = cuvsStreamSync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsStreamSync", res); - } - return (int)mh$.invokeExact(res); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsRMMAlloc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMAlloc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMAlloc(cuvsResources_t res, void **ptr, size_t bytes) - * } - */ - public static FunctionDescriptor cuvsRMMAlloc$descriptor() { - return cuvsRMMAlloc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMAlloc(cuvsResources_t res, void **ptr, size_t bytes) - * } - */ - public static MethodHandle cuvsRMMAlloc$handle() { - return cuvsRMMAlloc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMAlloc(cuvsResources_t res, void **ptr, size_t bytes) - * } - */ - public static MemorySegment cuvsRMMAlloc$address() { - return cuvsRMMAlloc.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsRMMAlloc(cuvsResources_t res, void **ptr, size_t bytes) - * } - */ - public static int cuvsRMMAlloc(long res, MemorySegment ptr, long bytes) { - var mh$ = cuvsRMMAlloc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsRMMAlloc", res, ptr, bytes); - } - return (int)mh$.invokeExact(res, ptr, bytes); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsRMMFree { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMFree"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMFree(cuvsResources_t res, void *ptr, size_t bytes) - * } - */ - public static FunctionDescriptor cuvsRMMFree$descriptor() { - return cuvsRMMFree.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMFree(cuvsResources_t res, void *ptr, size_t bytes) - * } - */ - public static MethodHandle cuvsRMMFree$handle() { - return cuvsRMMFree.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMFree(cuvsResources_t res, void *ptr, size_t bytes) - * } - */ - public static MemorySegment cuvsRMMFree$address() { - return cuvsRMMFree.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsRMMFree(cuvsResources_t res, void *ptr, size_t bytes) - * } - */ - public static int cuvsRMMFree(long res, MemorySegment ptr, long bytes) { - var mh$ = cuvsRMMFree.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsRMMFree", res, ptr, bytes); - } - return (int)mh$.invokeExact(res, ptr, bytes); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsRMMPoolMemoryResourceEnable { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_BOOL - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMPoolMemoryResourceEnable"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMPoolMemoryResourceEnable(int initial_pool_size_percent, int max_pool_size_percent, bool managed) - * } - */ - public static FunctionDescriptor cuvsRMMPoolMemoryResourceEnable$descriptor() { - return cuvsRMMPoolMemoryResourceEnable.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMPoolMemoryResourceEnable(int initial_pool_size_percent, int max_pool_size_percent, bool managed) - * } - */ - public static MethodHandle cuvsRMMPoolMemoryResourceEnable$handle() { - return cuvsRMMPoolMemoryResourceEnable.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMPoolMemoryResourceEnable(int initial_pool_size_percent, int max_pool_size_percent, bool managed) - * } - */ - public static MemorySegment cuvsRMMPoolMemoryResourceEnable$address() { - return cuvsRMMPoolMemoryResourceEnable.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsRMMPoolMemoryResourceEnable(int initial_pool_size_percent, int max_pool_size_percent, bool managed) - * } - */ - public static int cuvsRMMPoolMemoryResourceEnable(int initial_pool_size_percent, int max_pool_size_percent, boolean managed) { - var mh$ = cuvsRMMPoolMemoryResourceEnable.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsRMMPoolMemoryResourceEnable", initial_pool_size_percent, max_pool_size_percent, managed); - } - return (int)mh$.invokeExact(initial_pool_size_percent, max_pool_size_percent, managed); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - /** - * Variadic invoker class for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMMemoryResourceReset() - * } - */ - public static class cuvsRMMMemoryResourceReset { - private static final FunctionDescriptor BASE_DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT ); - private static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMMemoryResourceReset"); - - private final MethodHandle handle; - private final FunctionDescriptor descriptor; - private final MethodHandle spreader; - - private cuvsRMMMemoryResourceReset(MethodHandle handle, FunctionDescriptor descriptor, MethodHandle spreader) { - this.handle = handle; - this.descriptor = descriptor; - this.spreader = spreader; - } - - /** - * Variadic invoker factory for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMMemoryResourceReset() - * } - */ - public static cuvsRMMMemoryResourceReset makeInvoker(MemoryLayout... layouts) { - FunctionDescriptor desc$ = BASE_DESC.appendArgumentLayouts(layouts); - Linker.Option fva$ = Linker.Option.firstVariadicArg(BASE_DESC.argumentLayouts().size()); - var mh$ = Linker.nativeLinker().downcallHandle(ADDR, desc$, fva$); - var spreader$ = mh$.asSpreader(Object[].class, layouts.length); - return new cuvsRMMMemoryResourceReset(mh$, desc$, spreader$); - } - - /** - * {@return the address} - */ - public static MemorySegment address() { - return ADDR; - } - - /** - * {@return the specialized method handle} - */ - public MethodHandle handle() { - return handle; - } - - /** - * {@return the specialized descriptor} - */ - public FunctionDescriptor descriptor() { - return descriptor; - } - - public int apply(Object... x0) { - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsRMMMemoryResourceReset", x0); - } - return (int)spreader.invokeExact(x0); - } catch(IllegalArgumentException | ClassCastException ex$) { - throw ex$; // rethrow IAE from passing wrong number/type of args - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - } - - private static class cuvsRMMHostAlloc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMHostAlloc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMHostAlloc(void **ptr, size_t bytes) - * } - */ - public static FunctionDescriptor cuvsRMMHostAlloc$descriptor() { - return cuvsRMMHostAlloc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMHostAlloc(void **ptr, size_t bytes) - * } - */ - public static MethodHandle cuvsRMMHostAlloc$handle() { - return cuvsRMMHostAlloc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMHostAlloc(void **ptr, size_t bytes) - * } - */ - public static MemorySegment cuvsRMMHostAlloc$address() { - return cuvsRMMHostAlloc.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsRMMHostAlloc(void **ptr, size_t bytes) - * } - */ - public static int cuvsRMMHostAlloc(MemorySegment ptr, long bytes) { - var mh$ = cuvsRMMHostAlloc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsRMMHostAlloc", ptr, bytes); - } - return (int)mh$.invokeExact(ptr, bytes); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsRMMHostFree { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsRMMHostFree"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMHostFree(void *ptr, size_t bytes) - * } - */ - public static FunctionDescriptor cuvsRMMHostFree$descriptor() { - return cuvsRMMHostFree.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMHostFree(void *ptr, size_t bytes) - * } - */ - public static MethodHandle cuvsRMMHostFree$handle() { - return cuvsRMMHostFree.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsRMMHostFree(void *ptr, size_t bytes) - * } - */ - public static MemorySegment cuvsRMMHostFree$address() { - return cuvsRMMHostFree.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsRMMHostFree(void *ptr, size_t bytes) - * } - */ - public static int cuvsRMMHostFree(MemorySegment ptr, long bytes) { - var mh$ = cuvsRMMHostFree.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsRMMHostFree", ptr, bytes); - } - return (int)mh$.invokeExact(ptr, bytes); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static final int L2Expanded = (int)0L; - /** - * {@snippet lang=c : - * enum .L2Expanded = 0 - * } - */ - public static int L2Expanded() { - return L2Expanded; - } - private static final int L2SqrtExpanded = (int)1L; - /** - * {@snippet lang=c : - * enum .L2SqrtExpanded = 1 - * } - */ - public static int L2SqrtExpanded() { - return L2SqrtExpanded; - } - private static final int CosineExpanded = (int)2L; - /** - * {@snippet lang=c : - * enum .CosineExpanded = 2 - * } - */ - public static int CosineExpanded() { - return CosineExpanded; - } - private static final int L1 = (int)3L; - /** - * {@snippet lang=c : - * enum .L1 = 3 - * } - */ - public static int L1() { - return L1; - } - private static final int L2Unexpanded = (int)4L; - /** - * {@snippet lang=c : - * enum .L2Unexpanded = 4 - * } - */ - public static int L2Unexpanded() { - return L2Unexpanded; - } - private static final int L2SqrtUnexpanded = (int)5L; - /** - * {@snippet lang=c : - * enum .L2SqrtUnexpanded = 5 - * } - */ - public static int L2SqrtUnexpanded() { - return L2SqrtUnexpanded; - } - private static final int InnerProduct = (int)6L; - /** - * {@snippet lang=c : - * enum .InnerProduct = 6 - * } - */ - public static int InnerProduct() { - return InnerProduct; - } - private static final int Linf = (int)7L; - /** - * {@snippet lang=c : - * enum .Linf = 7 - * } - */ - public static int Linf() { - return Linf; - } - private static final int Canberra = (int)8L; - /** - * {@snippet lang=c : - * enum .Canberra = 8 - * } - */ - public static int Canberra() { - return Canberra; - } - private static final int LpUnexpanded = (int)9L; - /** - * {@snippet lang=c : - * enum .LpUnexpanded = 9 - * } - */ - public static int LpUnexpanded() { - return LpUnexpanded; - } - private static final int CorrelationExpanded = (int)10L; - /** - * {@snippet lang=c : - * enum .CorrelationExpanded = 10 - * } - */ - public static int CorrelationExpanded() { - return CorrelationExpanded; - } - private static final int JaccardExpanded = (int)11L; - /** - * {@snippet lang=c : - * enum .JaccardExpanded = 11 - * } - */ - public static int JaccardExpanded() { - return JaccardExpanded; - } - private static final int HellingerExpanded = (int)12L; - /** - * {@snippet lang=c : - * enum .HellingerExpanded = 12 - * } - */ - public static int HellingerExpanded() { - return HellingerExpanded; - } - private static final int Haversine = (int)13L; - /** - * {@snippet lang=c : - * enum .Haversine = 13 - * } - */ - public static int Haversine() { - return Haversine; - } - private static final int BrayCurtis = (int)14L; - /** - * {@snippet lang=c : - * enum .BrayCurtis = 14 - * } - */ - public static int BrayCurtis() { - return BrayCurtis; - } - private static final int JensenShannon = (int)15L; - /** - * {@snippet lang=c : - * enum .JensenShannon = 15 - * } - */ - public static int JensenShannon() { - return JensenShannon; - } - private static final int HammingUnexpanded = (int)16L; - /** - * {@snippet lang=c : - * enum .HammingUnexpanded = 16 - * } - */ - public static int HammingUnexpanded() { - return HammingUnexpanded; - } - private static final int KLDivergence = (int)17L; - /** - * {@snippet lang=c : - * enum .KLDivergence = 17 - * } - */ - public static int KLDivergence() { - return KLDivergence; - } - private static final int RusselRaoExpanded = (int)18L; - /** - * {@snippet lang=c : - * enum .RusselRaoExpanded = 18 - * } - */ - public static int RusselRaoExpanded() { - return RusselRaoExpanded; - } - private static final int DiceExpanded = (int)19L; - /** - * {@snippet lang=c : - * enum .DiceExpanded = 19 - * } - */ - public static int DiceExpanded() { - return DiceExpanded; - } - private static final int BitwiseHamming = (int)20L; - /** - * {@snippet lang=c : - * enum .BitwiseHamming = 20 - * } - */ - public static int BitwiseHamming() { - return BitwiseHamming; - } - private static final int Precomputed = (int)100L; - /** - * {@snippet lang=c : - * enum .Precomputed = 100 - * } - */ - public static int Precomputed() { - return Precomputed; - } - private static final int kDLCPU = (int)1L; - /** - * {@snippet lang=c : - * enum .kDLCPU = 1 - * } - */ - public static int kDLCPU() { - return kDLCPU; - } - private static final int kDLCUDA = (int)2L; - /** - * {@snippet lang=c : - * enum .kDLCUDA = 2 - * } - */ - public static int kDLCUDA() { - return kDLCUDA; - } - private static final int kDLCUDAHost = (int)3L; - /** - * {@snippet lang=c : - * enum .kDLCUDAHost = 3 - * } - */ - public static int kDLCUDAHost() { - return kDLCUDAHost; - } - private static final int kDLOpenCL = (int)4L; - /** - * {@snippet lang=c : - * enum .kDLOpenCL = 4 - * } - */ - public static int kDLOpenCL() { - return kDLOpenCL; - } - private static final int kDLVulkan = (int)7L; - /** - * {@snippet lang=c : - * enum .kDLVulkan = 7 - * } - */ - public static int kDLVulkan() { - return kDLVulkan; - } - private static final int kDLMetal = (int)8L; - /** - * {@snippet lang=c : - * enum .kDLMetal = 8 - * } - */ - public static int kDLMetal() { - return kDLMetal; - } - private static final int kDLVPI = (int)9L; - /** - * {@snippet lang=c : - * enum .kDLVPI = 9 - * } - */ - public static int kDLVPI() { - return kDLVPI; - } - private static final int kDLROCM = (int)10L; - /** - * {@snippet lang=c : - * enum .kDLROCM = 10 - * } - */ - public static int kDLROCM() { - return kDLROCM; - } - private static final int kDLROCMHost = (int)11L; - /** - * {@snippet lang=c : - * enum .kDLROCMHost = 11 - * } - */ - public static int kDLROCMHost() { - return kDLROCMHost; - } - private static final int kDLExtDev = (int)12L; - /** - * {@snippet lang=c : - * enum .kDLExtDev = 12 - * } - */ - public static int kDLExtDev() { - return kDLExtDev; - } - private static final int kDLCUDAManaged = (int)13L; - /** - * {@snippet lang=c : - * enum .kDLCUDAManaged = 13 - * } - */ - public static int kDLCUDAManaged() { - return kDLCUDAManaged; - } - private static final int kDLOneAPI = (int)14L; - /** - * {@snippet lang=c : - * enum .kDLOneAPI = 14 - * } - */ - public static int kDLOneAPI() { - return kDLOneAPI; - } - private static final int kDLWebGPU = (int)15L; - /** - * {@snippet lang=c : - * enum .kDLWebGPU = 15 - * } - */ - public static int kDLWebGPU() { - return kDLWebGPU; - } - private static final int kDLHexagon = (int)16L; - /** - * {@snippet lang=c : - * enum .kDLHexagon = 16 - * } - */ - public static int kDLHexagon() { - return kDLHexagon; - } - private static final int kDLInt = (int)0L; - /** - * {@snippet lang=c : - * enum .kDLInt = 0 - * } - */ - public static int kDLInt() { - return kDLInt; - } - private static final int kDLUInt = (int)1L; - /** - * {@snippet lang=c : - * enum .kDLUInt = 1 - * } - */ - public static int kDLUInt() { - return kDLUInt; - } - private static final int kDLFloat = (int)2L; - /** - * {@snippet lang=c : - * enum .kDLFloat = 2 - * } - */ - public static int kDLFloat() { - return kDLFloat; - } - private static final int kDLOpaqueHandle = (int)3L; - /** - * {@snippet lang=c : - * enum .kDLOpaqueHandle = 3 - * } - */ - public static int kDLOpaqueHandle() { - return kDLOpaqueHandle; - } - private static final int kDLBfloat = (int)4L; - /** - * {@snippet lang=c : - * enum .kDLBfloat = 4 - * } - */ - public static int kDLBfloat() { - return kDLBfloat; - } - private static final int kDLComplex = (int)5L; - /** - * {@snippet lang=c : - * enum .kDLComplex = 5 - * } - */ - public static int kDLComplex() { - return kDLComplex; - } - private static final int kDLBool = (int)6L; - /** - * {@snippet lang=c : - * enum .kDLBool = 6 - * } - */ - public static int kDLBool() { - return kDLBool; - } - private static final int NO_FILTER = (int)0L; - /** - * {@snippet lang=c : - * enum cuvsFilterType.NO_FILTER = 0 - * } - */ - public static int NO_FILTER() { - return NO_FILTER; - } - private static final int BITSET = (int)1L; - /** - * {@snippet lang=c : - * enum cuvsFilterType.BITSET = 1 - * } - */ - public static int BITSET() { - return BITSET; - } - private static final int BITMAP = (int)2L; - /** - * {@snippet lang=c : - * enum cuvsFilterType.BITMAP = 2 - * } - */ - public static int BITMAP() { - return BITMAP; - } - private static final int PER_SUBSPACE = (int)0L; - /** - * {@snippet lang=c : - * enum codebook_gen.PER_SUBSPACE = 0 - * } - */ - public static int PER_SUBSPACE() { - return PER_SUBSPACE; - } - private static final int PER_CLUSTER = (int)1L; - /** - * {@snippet lang=c : - * enum codebook_gen.PER_CLUSTER = 1 - * } - */ - public static int PER_CLUSTER() { - return PER_CLUSTER; - } - /** - * {@snippet lang=c : - * typedef struct cuvsIvfPqIndexParams { - * cuvsDistanceType metric; - * float metric_arg; - * bool add_data_on_build; - * uint32_t n_lists; - * uint32_t kmeans_n_iters; - * double kmeans_trainset_fraction; - * uint32_t pq_bits; - * uint32_t pq_dim; - * enum codebook_gen codebook_kind; - * bool force_random_rotation; - * bool conservative_memory_allocation; - * uint32_t max_train_points_per_pq_code; - * } *cuvsIvfPqIndexParams_t - * } - */ - public static final AddressLayout cuvsIvfPqIndexParams_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsIvfPqIndexParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqIndexParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) - * } - */ - public static FunctionDescriptor cuvsIvfPqIndexParamsCreate$descriptor() { - return cuvsIvfPqIndexParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) - * } - */ - public static MethodHandle cuvsIvfPqIndexParamsCreate$handle() { - return cuvsIvfPqIndexParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) - * } - */ - public static MemorySegment cuvsIvfPqIndexParamsCreate$address() { - return cuvsIvfPqIndexParamsCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexParamsCreate(cuvsIvfPqIndexParams_t *index_params) - * } - */ - public static int cuvsIvfPqIndexParamsCreate(MemorySegment index_params) { - var mh$ = cuvsIvfPqIndexParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqIndexParamsCreate", index_params); - } - return (int)mh$.invokeExact(index_params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqIndexParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqIndexParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) - * } - */ - public static FunctionDescriptor cuvsIvfPqIndexParamsDestroy$descriptor() { - return cuvsIvfPqIndexParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) - * } - */ - public static MethodHandle cuvsIvfPqIndexParamsDestroy$handle() { - return cuvsIvfPqIndexParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) - * } - */ - public static MemorySegment cuvsIvfPqIndexParamsDestroy$address() { - return cuvsIvfPqIndexParamsDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexParamsDestroy(cuvsIvfPqIndexParams_t index_params) - * } - */ - public static int cuvsIvfPqIndexParamsDestroy(MemorySegment index_params) { - var mh$ = cuvsIvfPqIndexParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqIndexParamsDestroy", index_params); - } - return (int)mh$.invokeExact(index_params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef struct cuvsIvfPqSearchParams { - * uint32_t n_probes; - * cudaDataType_t lut_dtype; - * cudaDataType_t internal_distance_dtype; - * double preferred_shmem_carveout; - * } *cuvsIvfPqSearchParams_t - * } - */ - public static final AddressLayout cuvsIvfPqSearchParams_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsIvfPqSearchParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqSearchParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) - * } - */ - public static FunctionDescriptor cuvsIvfPqSearchParamsCreate$descriptor() { - return cuvsIvfPqSearchParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) - * } - */ - public static MethodHandle cuvsIvfPqSearchParamsCreate$handle() { - return cuvsIvfPqSearchParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) - * } - */ - public static MemorySegment cuvsIvfPqSearchParamsCreate$address() { - return cuvsIvfPqSearchParamsCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearchParamsCreate(cuvsIvfPqSearchParams_t *params) - * } - */ - public static int cuvsIvfPqSearchParamsCreate(MemorySegment params) { - var mh$ = cuvsIvfPqSearchParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqSearchParamsCreate", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqSearchParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqSearchParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) - * } - */ - public static FunctionDescriptor cuvsIvfPqSearchParamsDestroy$descriptor() { - return cuvsIvfPqSearchParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) - * } - */ - public static MethodHandle cuvsIvfPqSearchParamsDestroy$handle() { - return cuvsIvfPqSearchParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) - * } - */ - public static MemorySegment cuvsIvfPqSearchParamsDestroy$address() { - return cuvsIvfPqSearchParamsDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearchParamsDestroy(cuvsIvfPqSearchParams_t params) - * } - */ - public static int cuvsIvfPqSearchParamsDestroy(MemorySegment params) { - var mh$ = cuvsIvfPqSearchParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqSearchParamsDestroy", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef cuvsIvfPqIndex *cuvsIvfPqIndex_t - * } - */ - public static final AddressLayout cuvsIvfPqIndex_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsIvfPqIndexCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqIndexCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) - * } - */ - public static FunctionDescriptor cuvsIvfPqIndexCreate$descriptor() { - return cuvsIvfPqIndexCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) - * } - */ - public static MethodHandle cuvsIvfPqIndexCreate$handle() { - return cuvsIvfPqIndexCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) - * } - */ - public static MemorySegment cuvsIvfPqIndexCreate$address() { - return cuvsIvfPqIndexCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexCreate(cuvsIvfPqIndex_t *index) - * } - */ - public static int cuvsIvfPqIndexCreate(MemorySegment index) { - var mh$ = cuvsIvfPqIndexCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqIndexCreate", index); - } - return (int)mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqIndexDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqIndexDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfPqIndexDestroy$descriptor() { - return cuvsIvfPqIndexDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) - * } - */ - public static MethodHandle cuvsIvfPqIndexDestroy$handle() { - return cuvsIvfPqIndexDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) - * } - */ - public static MemorySegment cuvsIvfPqIndexDestroy$address() { - return cuvsIvfPqIndexDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqIndexDestroy(cuvsIvfPqIndex_t index) - * } - */ - public static int cuvsIvfPqIndexDestroy(MemorySegment index) { - var mh$ = cuvsIvfPqIndexDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqIndexDestroy", index); - } - return (int)mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqBuild { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqBuild"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfPqBuild$descriptor() { - return cuvsIvfPqBuild.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) - * } - */ - public static MethodHandle cuvsIvfPqBuild$handle() { - return cuvsIvfPqBuild.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) - * } - */ - public static MemorySegment cuvsIvfPqBuild$address() { - return cuvsIvfPqBuild.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqBuild(cuvsResources_t res, cuvsIvfPqIndexParams_t params, DLManagedTensor *dataset, cuvsIvfPqIndex_t index) - * } - */ - public static int cuvsIvfPqBuild(long res, MemorySegment params, MemorySegment dataset, MemorySegment index) { - var mh$ = cuvsIvfPqBuild.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqBuild", res, params, dataset, index); - } - return (int)mh$.invokeExact(res, params, dataset, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqSearch { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqSearch"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static FunctionDescriptor cuvsIvfPqSearch$descriptor() { - return cuvsIvfPqSearch.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static MethodHandle cuvsIvfPqSearch$handle() { - return cuvsIvfPqSearch.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static MemorySegment cuvsIvfPqSearch$address() { - return cuvsIvfPqSearch.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSearch(cuvsResources_t res, cuvsIvfPqSearchParams_t search_params, cuvsIvfPqIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static int cuvsIvfPqSearch(long res, MemorySegment search_params, MemorySegment index, MemorySegment queries, MemorySegment neighbors, MemorySegment distances) { - var mh$ = cuvsIvfPqSearch.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqSearch", res, search_params, index, queries, neighbors, distances); - } - return (int)mh$.invokeExact(res, search_params, index, queries, neighbors, distances); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqSerialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqSerialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfPqSerialize$descriptor() { - return cuvsIvfPqSerialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static MethodHandle cuvsIvfPqSerialize$handle() { - return cuvsIvfPqSerialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static MemorySegment cuvsIvfPqSerialize$address() { - return cuvsIvfPqSerialize.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqSerialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static int cuvsIvfPqSerialize(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsIvfPqSerialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqSerialize", res, filename, index); - } - return (int)mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqDeserialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqDeserialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfPqDeserialize$descriptor() { - return cuvsIvfPqDeserialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static MethodHandle cuvsIvfPqDeserialize$handle() { - return cuvsIvfPqDeserialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static MemorySegment cuvsIvfPqDeserialize$address() { - return cuvsIvfPqDeserialize.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqDeserialize(cuvsResources_t res, const char *filename, cuvsIvfPqIndex_t index) - * } - */ - public static int cuvsIvfPqDeserialize(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsIvfPqDeserialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqDeserialize", res, filename, index); - } - return (int)mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsIvfPqExtend { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsIvfPqExtend"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) - * } - */ - public static FunctionDescriptor cuvsIvfPqExtend$descriptor() { - return cuvsIvfPqExtend.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) - * } - */ - public static MethodHandle cuvsIvfPqExtend$handle() { - return cuvsIvfPqExtend.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) - * } - */ - public static MemorySegment cuvsIvfPqExtend$address() { - return cuvsIvfPqExtend.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsIvfPqExtend(cuvsResources_t res, DLManagedTensor *new_vectors, DLManagedTensor *new_indices, cuvsIvfPqIndex_t index) - * } - */ - public static int cuvsIvfPqExtend(long res, MemorySegment new_vectors, MemorySegment new_indices, MemorySegment index) { - var mh$ = cuvsIvfPqExtend.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsIvfPqExtend", res, new_vectors, new_indices, index); - } - return (int)mh$.invokeExact(res, new_vectors, new_indices, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static final int AUTO_SELECT = (int)0L; - /** - * {@snippet lang=c : - * enum cuvsCagraGraphBuildAlgo.AUTO_SELECT = 0 - * } - */ - public static int AUTO_SELECT() { - return AUTO_SELECT; - } - private static final int IVF_PQ = (int)1L; - /** - * {@snippet lang=c : - * enum cuvsCagraGraphBuildAlgo.IVF_PQ = 1 - * } - */ - public static int IVF_PQ() { - return IVF_PQ; - } - private static final int NN_DESCENT = (int)2L; - /** - * {@snippet lang=c : - * enum cuvsCagraGraphBuildAlgo.NN_DESCENT = 2 - * } - */ - public static int NN_DESCENT() { - return NN_DESCENT; - } - private static final int ITERATIVE_CAGRA_SEARCH = (int)3L; - /** - * {@snippet lang=c : - * enum cuvsCagraGraphBuildAlgo.ITERATIVE_CAGRA_SEARCH = 3 - * } - */ - public static int ITERATIVE_CAGRA_SEARCH() { - return ITERATIVE_CAGRA_SEARCH; - } - /** - * {@snippet lang=c : - * typedef struct cuvsCagraCompressionParams { - * uint32_t pq_bits; - * uint32_t pq_dim; - * uint32_t vq_n_centers; - * uint32_t kmeans_n_iters; - * double vq_kmeans_trainset_fraction; - * double pq_kmeans_trainset_fraction; - * } *cuvsCagraCompressionParams_t - * } - */ - public static final AddressLayout cuvsCagraCompressionParams_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct cuvsIvfPqParams { - * cuvsIvfPqIndexParams_t ivf_pq_build_params; - * cuvsIvfPqSearchParams_t ivf_pq_search_params; - * float refinement_rate; - * } *cuvsIvfPqParams_t - * } - */ - public static final AddressLayout cuvsIvfPqParams_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct cuvsCagraIndexParams { - * cuvsDistanceType metric; - * size_t intermediate_graph_degree; - * size_t graph_degree; - * enum cuvsCagraGraphBuildAlgo build_algo; - * size_t nn_descent_niter; - * cuvsCagraCompressionParams_t compression; - * cuvsIvfPqParams_t graph_build_params; - * } *cuvsCagraIndexParams_t - * } - */ - public static final AddressLayout cuvsCagraIndexParams_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsCagraIndexParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraIndexParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexParamsCreate(cuvsCagraIndexParams_t *params) - * } - */ - public static FunctionDescriptor cuvsCagraIndexParamsCreate$descriptor() { - return cuvsCagraIndexParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexParamsCreate(cuvsCagraIndexParams_t *params) - * } - */ - public static MethodHandle cuvsCagraIndexParamsCreate$handle() { - return cuvsCagraIndexParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexParamsCreate(cuvsCagraIndexParams_t *params) - * } - */ - public static MemorySegment cuvsCagraIndexParamsCreate$address() { - return cuvsCagraIndexParamsCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexParamsCreate(cuvsCagraIndexParams_t *params) - * } - */ - public static int cuvsCagraIndexParamsCreate(MemorySegment params) { - var mh$ = cuvsCagraIndexParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraIndexParamsCreate", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraIndexParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraIndexParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexParamsDestroy(cuvsCagraIndexParams_t params) - * } - */ - public static FunctionDescriptor cuvsCagraIndexParamsDestroy$descriptor() { - return cuvsCagraIndexParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexParamsDestroy(cuvsCagraIndexParams_t params) - * } - */ - public static MethodHandle cuvsCagraIndexParamsDestroy$handle() { - return cuvsCagraIndexParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexParamsDestroy(cuvsCagraIndexParams_t params) - * } - */ - public static MemorySegment cuvsCagraIndexParamsDestroy$address() { - return cuvsCagraIndexParamsDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexParamsDestroy(cuvsCagraIndexParams_t params) - * } - */ - public static int cuvsCagraIndexParamsDestroy(MemorySegment params) { - var mh$ = cuvsCagraIndexParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraIndexParamsDestroy", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraCompressionParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraCompressionParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraCompressionParamsCreate(cuvsCagraCompressionParams_t *params) - * } - */ - public static FunctionDescriptor cuvsCagraCompressionParamsCreate$descriptor() { - return cuvsCagraCompressionParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraCompressionParamsCreate(cuvsCagraCompressionParams_t *params) - * } - */ - public static MethodHandle cuvsCagraCompressionParamsCreate$handle() { - return cuvsCagraCompressionParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraCompressionParamsCreate(cuvsCagraCompressionParams_t *params) - * } - */ - public static MemorySegment cuvsCagraCompressionParamsCreate$address() { - return cuvsCagraCompressionParamsCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraCompressionParamsCreate(cuvsCagraCompressionParams_t *params) - * } - */ - public static int cuvsCagraCompressionParamsCreate(MemorySegment params) { - var mh$ = cuvsCagraCompressionParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraCompressionParamsCreate", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraCompressionParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraCompressionParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraCompressionParamsDestroy(cuvsCagraCompressionParams_t params) - * } - */ - public static FunctionDescriptor cuvsCagraCompressionParamsDestroy$descriptor() { - return cuvsCagraCompressionParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraCompressionParamsDestroy(cuvsCagraCompressionParams_t params) - * } - */ - public static MethodHandle cuvsCagraCompressionParamsDestroy$handle() { - return cuvsCagraCompressionParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraCompressionParamsDestroy(cuvsCagraCompressionParams_t params) - * } - */ - public static MemorySegment cuvsCagraCompressionParamsDestroy$address() { - return cuvsCagraCompressionParamsDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraCompressionParamsDestroy(cuvsCagraCompressionParams_t params) - * } - */ - public static int cuvsCagraCompressionParamsDestroy(MemorySegment params) { - var mh$ = cuvsCagraCompressionParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraCompressionParamsDestroy", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef struct cuvsCagraExtendParams { - * uint32_t max_chunk_size; - * } *cuvsCagraExtendParams_t - * } - */ - public static final AddressLayout cuvsCagraExtendParams_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsCagraExtendParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraExtendParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtendParamsCreate(cuvsCagraExtendParams_t *params) - * } - */ - public static FunctionDescriptor cuvsCagraExtendParamsCreate$descriptor() { - return cuvsCagraExtendParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtendParamsCreate(cuvsCagraExtendParams_t *params) - * } - */ - public static MethodHandle cuvsCagraExtendParamsCreate$handle() { - return cuvsCagraExtendParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtendParamsCreate(cuvsCagraExtendParams_t *params) - * } - */ - public static MemorySegment cuvsCagraExtendParamsCreate$address() { - return cuvsCagraExtendParamsCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtendParamsCreate(cuvsCagraExtendParams_t *params) - * } - */ - public static int cuvsCagraExtendParamsCreate(MemorySegment params) { - var mh$ = cuvsCagraExtendParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraExtendParamsCreate", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraExtendParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraExtendParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtendParamsDestroy(cuvsCagraExtendParams_t params) - * } - */ - public static FunctionDescriptor cuvsCagraExtendParamsDestroy$descriptor() { - return cuvsCagraExtendParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtendParamsDestroy(cuvsCagraExtendParams_t params) - * } - */ - public static MethodHandle cuvsCagraExtendParamsDestroy$handle() { - return cuvsCagraExtendParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtendParamsDestroy(cuvsCagraExtendParams_t params) - * } - */ - public static MemorySegment cuvsCagraExtendParamsDestroy$address() { - return cuvsCagraExtendParamsDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtendParamsDestroy(cuvsCagraExtendParams_t params) - * } - */ - public static int cuvsCagraExtendParamsDestroy(MemorySegment params) { - var mh$ = cuvsCagraExtendParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraExtendParamsDestroy", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static final int SINGLE_CTA = (int)0L; - /** - * {@snippet lang=c : - * enum cuvsCagraSearchAlgo.SINGLE_CTA = 0 - * } - */ - public static int SINGLE_CTA() { - return SINGLE_CTA; - } - private static final int MULTI_CTA = (int)1L; - /** - * {@snippet lang=c : - * enum cuvsCagraSearchAlgo.MULTI_CTA = 1 - * } - */ - public static int MULTI_CTA() { - return MULTI_CTA; - } - private static final int MULTI_KERNEL = (int)2L; - /** - * {@snippet lang=c : - * enum cuvsCagraSearchAlgo.MULTI_KERNEL = 2 - * } - */ - public static int MULTI_KERNEL() { - return MULTI_KERNEL; - } - private static final int AUTO = (int)3L; - /** - * {@snippet lang=c : - * enum cuvsCagraSearchAlgo.AUTO = 3 - * } - */ - public static int AUTO() { - return AUTO; - } - private static final int HASH = (int)0L; - /** - * {@snippet lang=c : - * enum cuvsCagraHashMode.HASH = 0 - * } - */ - public static int HASH() { - return HASH; - } - private static final int SMALL = (int)1L; - /** - * {@snippet lang=c : - * enum cuvsCagraHashMode.SMALL = 1 - * } - */ - public static int SMALL() { - return SMALL; - } - private static final int AUTO_HASH = (int)2L; - /** - * {@snippet lang=c : - * enum cuvsCagraHashMode.AUTO_HASH = 2 - * } - */ - public static int AUTO_HASH() { - return AUTO_HASH; - } - /** - * {@snippet lang=c : - * typedef struct cuvsCagraSearchParams { - * size_t max_queries; - * size_t itopk_size; - * size_t max_iterations; - * enum cuvsCagraSearchAlgo algo; - * size_t team_size; - * size_t search_width; - * size_t min_iterations; - * size_t thread_block_size; - * enum cuvsCagraHashMode hashmap_mode; - * size_t hashmap_min_bitlen; - * float hashmap_max_fill_rate; - * uint32_t num_random_samplings; - * uint64_t rand_xor_mask; - * } *cuvsCagraSearchParams_t - * } - */ - public static final AddressLayout cuvsCagraSearchParams_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsCagraSearchParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraSearchParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearchParamsCreate(cuvsCagraSearchParams_t *params) - * } - */ - public static FunctionDescriptor cuvsCagraSearchParamsCreate$descriptor() { - return cuvsCagraSearchParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearchParamsCreate(cuvsCagraSearchParams_t *params) - * } - */ - public static MethodHandle cuvsCagraSearchParamsCreate$handle() { - return cuvsCagraSearchParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearchParamsCreate(cuvsCagraSearchParams_t *params) - * } - */ - public static MemorySegment cuvsCagraSearchParamsCreate$address() { - return cuvsCagraSearchParamsCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearchParamsCreate(cuvsCagraSearchParams_t *params) - * } - */ - public static int cuvsCagraSearchParamsCreate(MemorySegment params) { - var mh$ = cuvsCagraSearchParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraSearchParamsCreate", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraSearchParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraSearchParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearchParamsDestroy(cuvsCagraSearchParams_t params) - * } - */ - public static FunctionDescriptor cuvsCagraSearchParamsDestroy$descriptor() { - return cuvsCagraSearchParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearchParamsDestroy(cuvsCagraSearchParams_t params) - * } - */ - public static MethodHandle cuvsCagraSearchParamsDestroy$handle() { - return cuvsCagraSearchParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearchParamsDestroy(cuvsCagraSearchParams_t params) - * } - */ - public static MemorySegment cuvsCagraSearchParamsDestroy$address() { - return cuvsCagraSearchParamsDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearchParamsDestroy(cuvsCagraSearchParams_t params) - * } - */ - public static int cuvsCagraSearchParamsDestroy(MemorySegment params) { - var mh$ = cuvsCagraSearchParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraSearchParamsDestroy", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef cuvsCagraIndex *cuvsCagraIndex_t - * } - */ - public static final AddressLayout cuvsCagraIndex_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsCagraIndexCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraIndexCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexCreate(cuvsCagraIndex_t *index) - * } - */ - public static FunctionDescriptor cuvsCagraIndexCreate$descriptor() { - return cuvsCagraIndexCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexCreate(cuvsCagraIndex_t *index) - * } - */ - public static MethodHandle cuvsCagraIndexCreate$handle() { - return cuvsCagraIndexCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexCreate(cuvsCagraIndex_t *index) - * } - */ - public static MemorySegment cuvsCagraIndexCreate$address() { - return cuvsCagraIndexCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexCreate(cuvsCagraIndex_t *index) - * } - */ - public static int cuvsCagraIndexCreate(MemorySegment index) { - var mh$ = cuvsCagraIndexCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraIndexCreate", index); - } - return (int)mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraIndexDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraIndexDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index) - * } - */ - public static FunctionDescriptor cuvsCagraIndexDestroy$descriptor() { - return cuvsCagraIndexDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index) - * } - */ - public static MethodHandle cuvsCagraIndexDestroy$handle() { - return cuvsCagraIndexDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index) - * } - */ - public static MemorySegment cuvsCagraIndexDestroy$address() { - return cuvsCagraIndexDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexDestroy(cuvsCagraIndex_t index) - * } - */ - public static int cuvsCagraIndexDestroy(MemorySegment index) { - var mh$ = cuvsCagraIndexDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraIndexDestroy", index); - } - return (int)mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraIndexGetDims { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraIndexGetDims"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int *dim) - * } - */ - public static FunctionDescriptor cuvsCagraIndexGetDims$descriptor() { - return cuvsCagraIndexGetDims.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int *dim) - * } - */ - public static MethodHandle cuvsCagraIndexGetDims$handle() { - return cuvsCagraIndexGetDims.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int *dim) - * } - */ - public static MemorySegment cuvsCagraIndexGetDims$address() { - return cuvsCagraIndexGetDims.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraIndexGetDims(cuvsCagraIndex_t index, int *dim) - * } - */ - public static int cuvsCagraIndexGetDims(MemorySegment index, MemorySegment dim) { - var mh$ = cuvsCagraIndexGetDims.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraIndexGetDims", index, dim); - } - return (int)mh$.invokeExact(index, dim); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraBuild { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraBuild"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraBuild(cuvsResources_t res, cuvsCagraIndexParams_t params, DLManagedTensor *dataset, cuvsCagraIndex_t index) - * } - */ - public static FunctionDescriptor cuvsCagraBuild$descriptor() { - return cuvsCagraBuild.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraBuild(cuvsResources_t res, cuvsCagraIndexParams_t params, DLManagedTensor *dataset, cuvsCagraIndex_t index) - * } - */ - public static MethodHandle cuvsCagraBuild$handle() { - return cuvsCagraBuild.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraBuild(cuvsResources_t res, cuvsCagraIndexParams_t params, DLManagedTensor *dataset, cuvsCagraIndex_t index) - * } - */ - public static MemorySegment cuvsCagraBuild$address() { - return cuvsCagraBuild.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraBuild(cuvsResources_t res, cuvsCagraIndexParams_t params, DLManagedTensor *dataset, cuvsCagraIndex_t index) - * } - */ - public static int cuvsCagraBuild(long res, MemorySegment params, MemorySegment dataset, MemorySegment index) { - var mh$ = cuvsCagraBuild.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraBuild", res, params, dataset, index); - } - return (int)mh$.invokeExact(res, params, dataset, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraExtend { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraExtend"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtend(cuvsResources_t res, cuvsCagraExtendParams_t params, DLManagedTensor *additional_dataset, cuvsCagraIndex_t index, DLManagedTensor *return_dataset) - * } - */ - public static FunctionDescriptor cuvsCagraExtend$descriptor() { - return cuvsCagraExtend.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtend(cuvsResources_t res, cuvsCagraExtendParams_t params, DLManagedTensor *additional_dataset, cuvsCagraIndex_t index, DLManagedTensor *return_dataset) - * } - */ - public static MethodHandle cuvsCagraExtend$handle() { - return cuvsCagraExtend.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtend(cuvsResources_t res, cuvsCagraExtendParams_t params, DLManagedTensor *additional_dataset, cuvsCagraIndex_t index, DLManagedTensor *return_dataset) - * } - */ - public static MemorySegment cuvsCagraExtend$address() { - return cuvsCagraExtend.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraExtend(cuvsResources_t res, cuvsCagraExtendParams_t params, DLManagedTensor *additional_dataset, cuvsCagraIndex_t index, DLManagedTensor *return_dataset) - * } - */ - public static int cuvsCagraExtend(long res, MemorySegment params, MemorySegment additional_dataset, MemorySegment index, MemorySegment return_dataset) { - var mh$ = cuvsCagraExtend.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraExtend", res, params, additional_dataset, index, return_dataset); - } - return (int)mh$.invokeExact(res, params, additional_dataset, index, return_dataset); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraSearch { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - cuvsFilter.layout() - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraSearch"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearch(cuvsResources_t res, cuvsCagraSearchParams_t params, cuvsCagraIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter filter) - * } - */ - public static FunctionDescriptor cuvsCagraSearch$descriptor() { - return cuvsCagraSearch.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearch(cuvsResources_t res, cuvsCagraSearchParams_t params, cuvsCagraIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter filter) - * } - */ - public static MethodHandle cuvsCagraSearch$handle() { - return cuvsCagraSearch.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearch(cuvsResources_t res, cuvsCagraSearchParams_t params, cuvsCagraIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter filter) - * } - */ - public static MemorySegment cuvsCagraSearch$address() { - return cuvsCagraSearch.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraSearch(cuvsResources_t res, cuvsCagraSearchParams_t params, cuvsCagraIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter filter) - * } - */ - public static int cuvsCagraSearch(long res, MemorySegment params, MemorySegment index, MemorySegment queries, MemorySegment neighbors, MemorySegment distances, MemorySegment filter) { - var mh$ = cuvsCagraSearch.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraSearch", res, params, index, queries, neighbors, distances, filter); - } - return (int)mh$.invokeExact(res, params, index, queries, neighbors, distances, filter); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraSerialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_BOOL - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraSerialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSerialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index, bool include_dataset) - * } - */ - public static FunctionDescriptor cuvsCagraSerialize$descriptor() { - return cuvsCagraSerialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSerialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index, bool include_dataset) - * } - */ - public static MethodHandle cuvsCagraSerialize$handle() { - return cuvsCagraSerialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSerialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index, bool include_dataset) - * } - */ - public static MemorySegment cuvsCagraSerialize$address() { - return cuvsCagraSerialize.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraSerialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index, bool include_dataset) - * } - */ - public static int cuvsCagraSerialize(long res, MemorySegment filename, MemorySegment index, boolean include_dataset) { - var mh$ = cuvsCagraSerialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraSerialize", res, filename, index, include_dataset); - } - return (int)mh$.invokeExact(res, filename, index, include_dataset); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraSerializeToHnswlib { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraSerializeToHnswlib"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) - * } - */ - public static FunctionDescriptor cuvsCagraSerializeToHnswlib$descriptor() { - return cuvsCagraSerializeToHnswlib.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) - * } - */ - public static MethodHandle cuvsCagraSerializeToHnswlib$handle() { - return cuvsCagraSerializeToHnswlib.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) - * } - */ - public static MemorySegment cuvsCagraSerializeToHnswlib$address() { - return cuvsCagraSerializeToHnswlib.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraSerializeToHnswlib(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) - * } - */ - public static int cuvsCagraSerializeToHnswlib(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsCagraSerializeToHnswlib.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraSerializeToHnswlib", res, filename, index); - } - return (int)mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsCagraDeserialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsCagraDeserialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraDeserialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) - * } - */ - public static FunctionDescriptor cuvsCagraDeserialize$descriptor() { - return cuvsCagraDeserialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraDeserialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) - * } - */ - public static MethodHandle cuvsCagraDeserialize$handle() { - return cuvsCagraDeserialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsCagraDeserialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) - * } - */ - public static MemorySegment cuvsCagraDeserialize$address() { - return cuvsCagraDeserialize.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsCagraDeserialize(cuvsResources_t res, const char *filename, cuvsCagraIndex_t index) - * } - */ - public static int cuvsCagraDeserialize(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsCagraDeserialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsCagraDeserialize", res, filename, index); - } - return (int)mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef cuvsBruteForceIndex *cuvsBruteForceIndex_t - * } - */ - public static final AddressLayout cuvsBruteForceIndex_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsBruteForceIndexCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceIndexCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceIndexCreate(cuvsBruteForceIndex_t *index) - * } - */ - public static FunctionDescriptor cuvsBruteForceIndexCreate$descriptor() { - return cuvsBruteForceIndexCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceIndexCreate(cuvsBruteForceIndex_t *index) - * } - */ - public static MethodHandle cuvsBruteForceIndexCreate$handle() { - return cuvsBruteForceIndexCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceIndexCreate(cuvsBruteForceIndex_t *index) - * } - */ - public static MemorySegment cuvsBruteForceIndexCreate$address() { - return cuvsBruteForceIndexCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceIndexCreate(cuvsBruteForceIndex_t *index) - * } - */ - public static int cuvsBruteForceIndexCreate(MemorySegment index) { - var mh$ = cuvsBruteForceIndexCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsBruteForceIndexCreate", index); - } - return (int)mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsBruteForceIndexDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceIndexDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceIndexDestroy(cuvsBruteForceIndex_t index) - * } - */ - public static FunctionDescriptor cuvsBruteForceIndexDestroy$descriptor() { - return cuvsBruteForceIndexDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceIndexDestroy(cuvsBruteForceIndex_t index) - * } - */ - public static MethodHandle cuvsBruteForceIndexDestroy$handle() { - return cuvsBruteForceIndexDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceIndexDestroy(cuvsBruteForceIndex_t index) - * } - */ - public static MemorySegment cuvsBruteForceIndexDestroy$address() { - return cuvsBruteForceIndexDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceIndexDestroy(cuvsBruteForceIndex_t index) - * } - */ - public static int cuvsBruteForceIndexDestroy(MemorySegment index) { - var mh$ = cuvsBruteForceIndexDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsBruteForceIndexDestroy", index); - } - return (int)mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsBruteForceBuild { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_FLOAT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceBuild"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceBuild(cuvsResources_t res, DLManagedTensor *dataset, cuvsDistanceType metric, float metric_arg, cuvsBruteForceIndex_t index) - * } - */ - public static FunctionDescriptor cuvsBruteForceBuild$descriptor() { - return cuvsBruteForceBuild.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceBuild(cuvsResources_t res, DLManagedTensor *dataset, cuvsDistanceType metric, float metric_arg, cuvsBruteForceIndex_t index) - * } - */ - public static MethodHandle cuvsBruteForceBuild$handle() { - return cuvsBruteForceBuild.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceBuild(cuvsResources_t res, DLManagedTensor *dataset, cuvsDistanceType metric, float metric_arg, cuvsBruteForceIndex_t index) - * } - */ - public static MemorySegment cuvsBruteForceBuild$address() { - return cuvsBruteForceBuild.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceBuild(cuvsResources_t res, DLManagedTensor *dataset, cuvsDistanceType metric, float metric_arg, cuvsBruteForceIndex_t index) - * } - */ - public static int cuvsBruteForceBuild(long res, MemorySegment dataset, int metric, float metric_arg, MemorySegment index) { - var mh$ = cuvsBruteForceBuild.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsBruteForceBuild", res, dataset, metric, metric_arg, index); - } - return (int)mh$.invokeExact(res, dataset, metric, metric_arg, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsBruteForceSearch { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - cuvsFilter.layout() - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceSearch"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceSearch(cuvsResources_t res, cuvsBruteForceIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter prefilter) - * } - */ - public static FunctionDescriptor cuvsBruteForceSearch$descriptor() { - return cuvsBruteForceSearch.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceSearch(cuvsResources_t res, cuvsBruteForceIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter prefilter) - * } - */ - public static MethodHandle cuvsBruteForceSearch$handle() { - return cuvsBruteForceSearch.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceSearch(cuvsResources_t res, cuvsBruteForceIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter prefilter) - * } - */ - public static MemorySegment cuvsBruteForceSearch$address() { - return cuvsBruteForceSearch.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceSearch(cuvsResources_t res, cuvsBruteForceIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances, cuvsFilter prefilter) - * } - */ - public static int cuvsBruteForceSearch(long res, MemorySegment index, MemorySegment queries, MemorySegment neighbors, MemorySegment distances, MemorySegment prefilter) { - var mh$ = cuvsBruteForceSearch.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsBruteForceSearch", res, index, queries, neighbors, distances, prefilter); - } - return (int)mh$.invokeExact(res, index, queries, neighbors, distances, prefilter); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsBruteForceSerialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceSerialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceSerialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) - * } - */ - public static FunctionDescriptor cuvsBruteForceSerialize$descriptor() { - return cuvsBruteForceSerialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceSerialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) - * } - */ - public static MethodHandle cuvsBruteForceSerialize$handle() { - return cuvsBruteForceSerialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceSerialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) - * } - */ - public static MemorySegment cuvsBruteForceSerialize$address() { - return cuvsBruteForceSerialize.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceSerialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) - * } - */ - public static int cuvsBruteForceSerialize(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsBruteForceSerialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsBruteForceSerialize", res, filename, index); - } - return (int)mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsBruteForceDeserialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsBruteForceDeserialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceDeserialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) - * } - */ - public static FunctionDescriptor cuvsBruteForceDeserialize$descriptor() { - return cuvsBruteForceDeserialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceDeserialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) - * } - */ - public static MethodHandle cuvsBruteForceDeserialize$handle() { - return cuvsBruteForceDeserialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceDeserialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) - * } - */ - public static MemorySegment cuvsBruteForceDeserialize$address() { - return cuvsBruteForceDeserialize.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsBruteForceDeserialize(cuvsResources_t res, const char *filename, cuvsBruteForceIndex_t index) - * } - */ - public static int cuvsBruteForceDeserialize(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsBruteForceDeserialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsBruteForceDeserialize", res, filename, index); - } - return (int)mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static final int NONE = (int)0L; - /** - * {@snippet lang=c : - * enum cuvsHnswHierarchy.NONE = 0 - * } - */ - public static int NONE() { - return NONE; - } - private static final int CPU = (int)1L; - /** - * {@snippet lang=c : - * enum cuvsHnswHierarchy.CPU = 1 - * } - */ - public static int CPU() { - return CPU; - } - private static final int GPU = (int)2L; - /** - * {@snippet lang=c : - * enum cuvsHnswHierarchy.GPU = 2 - * } - */ - public static int GPU() { - return GPU; - } - /** - * {@snippet lang=c : - * typedef struct cuvsHnswIndexParams { - * enum cuvsHnswHierarchy hierarchy; - * int ef_construction; - * int num_threads; - * } *cuvsHnswIndexParams_t - * } - */ - public static final AddressLayout cuvsHnswIndexParams_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsHnswIndexParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswIndexParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexParamsCreate(cuvsHnswIndexParams_t *params) - * } - */ - public static FunctionDescriptor cuvsHnswIndexParamsCreate$descriptor() { - return cuvsHnswIndexParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexParamsCreate(cuvsHnswIndexParams_t *params) - * } - */ - public static MethodHandle cuvsHnswIndexParamsCreate$handle() { - return cuvsHnswIndexParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexParamsCreate(cuvsHnswIndexParams_t *params) - * } - */ - public static MemorySegment cuvsHnswIndexParamsCreate$address() { - return cuvsHnswIndexParamsCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexParamsCreate(cuvsHnswIndexParams_t *params) - * } - */ - public static int cuvsHnswIndexParamsCreate(MemorySegment params) { - var mh$ = cuvsHnswIndexParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswIndexParamsCreate", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsHnswIndexParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswIndexParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexParamsDestroy(cuvsHnswIndexParams_t params) - * } - */ - public static FunctionDescriptor cuvsHnswIndexParamsDestroy$descriptor() { - return cuvsHnswIndexParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexParamsDestroy(cuvsHnswIndexParams_t params) - * } - */ - public static MethodHandle cuvsHnswIndexParamsDestroy$handle() { - return cuvsHnswIndexParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexParamsDestroy(cuvsHnswIndexParams_t params) - * } - */ - public static MemorySegment cuvsHnswIndexParamsDestroy$address() { - return cuvsHnswIndexParamsDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexParamsDestroy(cuvsHnswIndexParams_t params) - * } - */ - public static int cuvsHnswIndexParamsDestroy(MemorySegment params) { - var mh$ = cuvsHnswIndexParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswIndexParamsDestroy", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef cuvsHnswIndex *cuvsHnswIndex_t - * } - */ - public static final AddressLayout cuvsHnswIndex_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsHnswIndexCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswIndexCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexCreate(cuvsHnswIndex_t *index) - * } - */ - public static FunctionDescriptor cuvsHnswIndexCreate$descriptor() { - return cuvsHnswIndexCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexCreate(cuvsHnswIndex_t *index) - * } - */ - public static MethodHandle cuvsHnswIndexCreate$handle() { - return cuvsHnswIndexCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexCreate(cuvsHnswIndex_t *index) - * } - */ - public static MemorySegment cuvsHnswIndexCreate$address() { - return cuvsHnswIndexCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexCreate(cuvsHnswIndex_t *index) - * } - */ - public static int cuvsHnswIndexCreate(MemorySegment index) { - var mh$ = cuvsHnswIndexCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswIndexCreate", index); - } - return (int)mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsHnswIndexDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswIndexDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexDestroy(cuvsHnswIndex_t index) - * } - */ - public static FunctionDescriptor cuvsHnswIndexDestroy$descriptor() { - return cuvsHnswIndexDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexDestroy(cuvsHnswIndex_t index) - * } - */ - public static MethodHandle cuvsHnswIndexDestroy$handle() { - return cuvsHnswIndexDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexDestroy(cuvsHnswIndex_t index) - * } - */ - public static MemorySegment cuvsHnswIndexDestroy$address() { - return cuvsHnswIndexDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswIndexDestroy(cuvsHnswIndex_t index) - * } - */ - public static int cuvsHnswIndexDestroy(MemorySegment index) { - var mh$ = cuvsHnswIndexDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswIndexDestroy", index); - } - return (int)mh$.invokeExact(index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef struct cuvsHnswExtendParams { - * int num_threads; - * } *cuvsHnswExtendParams_t - * } - */ - public static final AddressLayout cuvsHnswExtendParams_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsHnswExtendParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswExtendParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtendParamsCreate(cuvsHnswExtendParams_t *params) - * } - */ - public static FunctionDescriptor cuvsHnswExtendParamsCreate$descriptor() { - return cuvsHnswExtendParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtendParamsCreate(cuvsHnswExtendParams_t *params) - * } - */ - public static MethodHandle cuvsHnswExtendParamsCreate$handle() { - return cuvsHnswExtendParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtendParamsCreate(cuvsHnswExtendParams_t *params) - * } - */ - public static MemorySegment cuvsHnswExtendParamsCreate$address() { - return cuvsHnswExtendParamsCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtendParamsCreate(cuvsHnswExtendParams_t *params) - * } - */ - public static int cuvsHnswExtendParamsCreate(MemorySegment params) { - var mh$ = cuvsHnswExtendParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswExtendParamsCreate", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsHnswExtendParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswExtendParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtendParamsDestroy(cuvsHnswExtendParams_t params) - * } - */ - public static FunctionDescriptor cuvsHnswExtendParamsDestroy$descriptor() { - return cuvsHnswExtendParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtendParamsDestroy(cuvsHnswExtendParams_t params) - * } - */ - public static MethodHandle cuvsHnswExtendParamsDestroy$handle() { - return cuvsHnswExtendParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtendParamsDestroy(cuvsHnswExtendParams_t params) - * } - */ - public static MemorySegment cuvsHnswExtendParamsDestroy$address() { - return cuvsHnswExtendParamsDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtendParamsDestroy(cuvsHnswExtendParams_t params) - * } - */ - public static int cuvsHnswExtendParamsDestroy(MemorySegment params) { - var mh$ = cuvsHnswExtendParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswExtendParamsDestroy", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsHnswFromCagra { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswFromCagra"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswFromCagra(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index) - * } - */ - public static FunctionDescriptor cuvsHnswFromCagra$descriptor() { - return cuvsHnswFromCagra.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswFromCagra(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index) - * } - */ - public static MethodHandle cuvsHnswFromCagra$handle() { - return cuvsHnswFromCagra.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswFromCagra(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index) - * } - */ - public static MemorySegment cuvsHnswFromCagra$address() { - return cuvsHnswFromCagra.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswFromCagra(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index) - * } - */ - public static int cuvsHnswFromCagra(long res, MemorySegment params, MemorySegment cagra_index, MemorySegment hnsw_index) { - var mh$ = cuvsHnswFromCagra.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswFromCagra", res, params, cagra_index, hnsw_index); - } - return (int)mh$.invokeExact(res, params, cagra_index, hnsw_index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsHnswFromCagraWithDataset { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswFromCagraWithDataset"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswFromCagraWithDataset(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index, DLManagedTensor *dataset_tensor) - * } - */ - public static FunctionDescriptor cuvsHnswFromCagraWithDataset$descriptor() { - return cuvsHnswFromCagraWithDataset.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswFromCagraWithDataset(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index, DLManagedTensor *dataset_tensor) - * } - */ - public static MethodHandle cuvsHnswFromCagraWithDataset$handle() { - return cuvsHnswFromCagraWithDataset.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswFromCagraWithDataset(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index, DLManagedTensor *dataset_tensor) - * } - */ - public static MemorySegment cuvsHnswFromCagraWithDataset$address() { - return cuvsHnswFromCagraWithDataset.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswFromCagraWithDataset(cuvsResources_t res, cuvsHnswIndexParams_t params, cuvsCagraIndex_t cagra_index, cuvsHnswIndex_t hnsw_index, DLManagedTensor *dataset_tensor) - * } - */ - public static int cuvsHnswFromCagraWithDataset(long res, MemorySegment params, MemorySegment cagra_index, MemorySegment hnsw_index, MemorySegment dataset_tensor) { - var mh$ = cuvsHnswFromCagraWithDataset.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswFromCagraWithDataset", res, params, cagra_index, hnsw_index, dataset_tensor); - } - return (int)mh$.invokeExact(res, params, cagra_index, hnsw_index, dataset_tensor); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsHnswExtend { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswExtend"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtend(cuvsResources_t res, cuvsHnswExtendParams_t params, DLManagedTensor *additional_dataset, cuvsHnswIndex_t index) - * } - */ - public static FunctionDescriptor cuvsHnswExtend$descriptor() { - return cuvsHnswExtend.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtend(cuvsResources_t res, cuvsHnswExtendParams_t params, DLManagedTensor *additional_dataset, cuvsHnswIndex_t index) - * } - */ - public static MethodHandle cuvsHnswExtend$handle() { - return cuvsHnswExtend.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtend(cuvsResources_t res, cuvsHnswExtendParams_t params, DLManagedTensor *additional_dataset, cuvsHnswIndex_t index) - * } - */ - public static MemorySegment cuvsHnswExtend$address() { - return cuvsHnswExtend.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswExtend(cuvsResources_t res, cuvsHnswExtendParams_t params, DLManagedTensor *additional_dataset, cuvsHnswIndex_t index) - * } - */ - public static int cuvsHnswExtend(long res, MemorySegment params, MemorySegment additional_dataset, MemorySegment index) { - var mh$ = cuvsHnswExtend.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswExtend", res, params, additional_dataset, index); - } - return (int)mh$.invokeExact(res, params, additional_dataset, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - /** - * {@snippet lang=c : - * typedef struct cuvsHnswSearchParams { - * int32_t ef; - * int32_t num_threads; - * } *cuvsHnswSearchParams_t - * } - */ - public static final AddressLayout cuvsHnswSearchParams_t = PanamaFFMAPI.C_POINTER; - - private static class cuvsHnswSearchParamsCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswSearchParamsCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearchParamsCreate(cuvsHnswSearchParams_t *params) - * } - */ - public static FunctionDescriptor cuvsHnswSearchParamsCreate$descriptor() { - return cuvsHnswSearchParamsCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearchParamsCreate(cuvsHnswSearchParams_t *params) - * } - */ - public static MethodHandle cuvsHnswSearchParamsCreate$handle() { - return cuvsHnswSearchParamsCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearchParamsCreate(cuvsHnswSearchParams_t *params) - * } - */ - public static MemorySegment cuvsHnswSearchParamsCreate$address() { - return cuvsHnswSearchParamsCreate.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearchParamsCreate(cuvsHnswSearchParams_t *params) - * } - */ - public static int cuvsHnswSearchParamsCreate(MemorySegment params) { - var mh$ = cuvsHnswSearchParamsCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswSearchParamsCreate", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsHnswSearchParamsDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswSearchParamsDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearchParamsDestroy(cuvsHnswSearchParams_t params) - * } - */ - public static FunctionDescriptor cuvsHnswSearchParamsDestroy$descriptor() { - return cuvsHnswSearchParamsDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearchParamsDestroy(cuvsHnswSearchParams_t params) - * } - */ - public static MethodHandle cuvsHnswSearchParamsDestroy$handle() { - return cuvsHnswSearchParamsDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearchParamsDestroy(cuvsHnswSearchParams_t params) - * } - */ - public static MemorySegment cuvsHnswSearchParamsDestroy$address() { - return cuvsHnswSearchParamsDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearchParamsDestroy(cuvsHnswSearchParams_t params) - * } - */ - public static int cuvsHnswSearchParamsDestroy(MemorySegment params) { - var mh$ = cuvsHnswSearchParamsDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswSearchParamsDestroy", params); - } - return (int)mh$.invokeExact(params); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsHnswSearch { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswSearch"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearch(cuvsResources_t res, cuvsHnswSearchParams_t params, cuvsHnswIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static FunctionDescriptor cuvsHnswSearch$descriptor() { - return cuvsHnswSearch.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearch(cuvsResources_t res, cuvsHnswSearchParams_t params, cuvsHnswIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static MethodHandle cuvsHnswSearch$handle() { - return cuvsHnswSearch.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearch(cuvsResources_t res, cuvsHnswSearchParams_t params, cuvsHnswIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static MemorySegment cuvsHnswSearch$address() { - return cuvsHnswSearch.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswSearch(cuvsResources_t res, cuvsHnswSearchParams_t params, cuvsHnswIndex_t index, DLManagedTensor *queries, DLManagedTensor *neighbors, DLManagedTensor *distances) - * } - */ - public static int cuvsHnswSearch(long res, MemorySegment params, MemorySegment index, MemorySegment queries, MemorySegment neighbors, MemorySegment distances) { - var mh$ = cuvsHnswSearch.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswSearch", res, params, index, queries, neighbors, distances); - } - return (int)mh$.invokeExact(res, params, index, queries, neighbors, distances); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsHnswSerialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswSerialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSerialize(cuvsResources_t res, const char *filename, cuvsHnswIndex_t index) - * } - */ - public static FunctionDescriptor cuvsHnswSerialize$descriptor() { - return cuvsHnswSerialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSerialize(cuvsResources_t res, const char *filename, cuvsHnswIndex_t index) - * } - */ - public static MethodHandle cuvsHnswSerialize$handle() { - return cuvsHnswSerialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswSerialize(cuvsResources_t res, const char *filename, cuvsHnswIndex_t index) - * } - */ - public static MemorySegment cuvsHnswSerialize$address() { - return cuvsHnswSerialize.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswSerialize(cuvsResources_t res, const char *filename, cuvsHnswIndex_t index) - * } - */ - public static int cuvsHnswSerialize(long res, MemorySegment filename, MemorySegment index) { - var mh$ = cuvsHnswSerialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswSerialize", res, filename, index); - } - return (int)mh$.invokeExact(res, filename, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cuvsHnswDeserialize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cuvsHnswDeserialize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswDeserialize(cuvsResources_t res, cuvsHnswIndexParams_t params, const char *filename, int dim, cuvsDistanceType metric, cuvsHnswIndex_t index) - * } - */ - public static FunctionDescriptor cuvsHnswDeserialize$descriptor() { - return cuvsHnswDeserialize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswDeserialize(cuvsResources_t res, cuvsHnswIndexParams_t params, const char *filename, int dim, cuvsDistanceType metric, cuvsHnswIndex_t index) - * } - */ - public static MethodHandle cuvsHnswDeserialize$handle() { - return cuvsHnswDeserialize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * cuvsError_t cuvsHnswDeserialize(cuvsResources_t res, cuvsHnswIndexParams_t params, const char *filename, int dim, cuvsDistanceType metric, cuvsHnswIndex_t index) - * } - */ - public static MemorySegment cuvsHnswDeserialize$address() { - return cuvsHnswDeserialize.ADDR; - } - - /** - * {@snippet lang=c : - * cuvsError_t cuvsHnswDeserialize(cuvsResources_t res, cuvsHnswIndexParams_t params, const char *filename, int dim, cuvsDistanceType metric, cuvsHnswIndex_t index) - * } - */ - public static int cuvsHnswDeserialize(long res, MemorySegment params, MemorySegment filename, int dim, int metric, MemorySegment index) { - var mh$ = cuvsHnswDeserialize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cuvsHnswDeserialize", res, params, filename, dim, metric, index); - } - return (int)mh$.invokeExact(res, params, filename, dim, metric, index); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - private static final long _POSIX_C_SOURCE = 200809L; - /** - * {@snippet lang=c : - * #define _POSIX_C_SOURCE 200809 - * } - */ - public static long _POSIX_C_SOURCE() { - return _POSIX_C_SOURCE; - } - private static final int __TIMESIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __TIMESIZE 64 - * } - */ - public static int __TIMESIZE() { - return __TIMESIZE; - } - private static final long __STDC_IEC_60559_BFP__ = 201404L; - /** - * {@snippet lang=c : - * #define __STDC_IEC_60559_BFP__ 201404 - * } - */ - public static long __STDC_IEC_60559_BFP__() { - return __STDC_IEC_60559_BFP__; - } - private static final long __STDC_IEC_60559_COMPLEX__ = 201404L; - /** - * {@snippet lang=c : - * #define __STDC_IEC_60559_COMPLEX__ 201404 - * } - */ - public static long __STDC_IEC_60559_COMPLEX__() { - return __STDC_IEC_60559_COMPLEX__; - } - private static final long __STDC_ISO_10646__ = 201706L; - /** - * {@snippet lang=c : - * #define __STDC_ISO_10646__ 201706 - * } - */ - public static long __STDC_ISO_10646__() { - return __STDC_ISO_10646__; - } - private static final long LLONG_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define LLONG_MIN -9223372036854775808 - * } - */ - public static long LLONG_MIN() { - return LLONG_MIN; - } - private static final long LLONG_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define LLONG_MAX 9223372036854775807 - * } - */ - public static long LLONG_MAX() { - return LLONG_MAX; - } - private static final long ULLONG_MAX = -1L; - /** - * {@snippet lang=c : - * #define ULLONG_MAX -1 - * } - */ - public static long ULLONG_MAX() { - return ULLONG_MAX; - } - private static final int PTHREAD_DESTRUCTOR_ITERATIONS = (int)4L; - /** - * {@snippet lang=c : - * #define PTHREAD_DESTRUCTOR_ITERATIONS 4 - * } - */ - public static int PTHREAD_DESTRUCTOR_ITERATIONS() { - return PTHREAD_DESTRUCTOR_ITERATIONS; - } - private static final int SEM_VALUE_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define SEM_VALUE_MAX 2147483647 - * } - */ - public static int SEM_VALUE_MAX() { - return SEM_VALUE_MAX; - } - private static final long SSIZE_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define SSIZE_MAX 9223372036854775807 - * } - */ - public static long SSIZE_MAX() { - return SSIZE_MAX; - } - private static final int BC_BASE_MAX = (int)99L; - /** - * {@snippet lang=c : - * #define BC_BASE_MAX 99 - * } - */ - public static int BC_BASE_MAX() { - return BC_BASE_MAX; - } - private static final int BC_DIM_MAX = (int)2048L; - /** - * {@snippet lang=c : - * #define BC_DIM_MAX 2048 - * } - */ - public static int BC_DIM_MAX() { - return BC_DIM_MAX; - } - private static final int BC_SCALE_MAX = (int)99L; - /** - * {@snippet lang=c : - * #define BC_SCALE_MAX 99 - * } - */ - public static int BC_SCALE_MAX() { - return BC_SCALE_MAX; - } - private static final int BC_STRING_MAX = (int)1000L; - /** - * {@snippet lang=c : - * #define BC_STRING_MAX 1000 - * } - */ - public static int BC_STRING_MAX() { - return BC_STRING_MAX; - } - private static final int EXPR_NEST_MAX = (int)32L; - /** - * {@snippet lang=c : - * #define EXPR_NEST_MAX 32 - * } - */ - public static int EXPR_NEST_MAX() { - return EXPR_NEST_MAX; - } - private static final int LINE_MAX = (int)2048L; - /** - * {@snippet lang=c : - * #define LINE_MAX 2048 - * } - */ - public static int LINE_MAX() { - return LINE_MAX; - } - private static final int RE_DUP_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define RE_DUP_MAX 32767 - * } - */ - public static int RE_DUP_MAX() { - return RE_DUP_MAX; - } - private static final int SCHAR_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define SCHAR_MAX 127 - * } - */ - public static int SCHAR_MAX() { - return SCHAR_MAX; - } - private static final int SHRT_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define SHRT_MAX 32767 - * } - */ - public static int SHRT_MAX() { - return SHRT_MAX; - } - private static final int INT_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define INT_MAX 2147483647 - * } - */ - public static int INT_MAX() { - return INT_MAX; - } - private static final long LONG_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define LONG_MAX 9223372036854775807 - * } - */ - public static long LONG_MAX() { - return LONG_MAX; - } - private static final int SCHAR_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define SCHAR_MIN -128 - * } - */ - public static int SCHAR_MIN() { - return SCHAR_MIN; - } - private static final int SHRT_MIN = (int)-32768L; - /** - * {@snippet lang=c : - * #define SHRT_MIN -32768 - * } - */ - public static int SHRT_MIN() { - return SHRT_MIN; - } - private static final int INT_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define INT_MIN -2147483648 - * } - */ - public static int INT_MIN() { - return INT_MIN; - } - private static final long LONG_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define LONG_MIN -9223372036854775808 - * } - */ - public static long LONG_MIN() { - return LONG_MIN; - } - private static final int UCHAR_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UCHAR_MAX 255 - * } - */ - public static int UCHAR_MAX() { - return UCHAR_MAX; - } - private static final int USHRT_MAX = (int)65535L; - /** - * {@snippet lang=c : - * #define USHRT_MAX 65535 - * } - */ - public static int USHRT_MAX() { - return USHRT_MAX; - } - private static final int UINT_MAX = (int)4294967295L; - /** - * {@snippet lang=c : - * #define UINT_MAX 4294967295 - * } - */ - public static int UINT_MAX() { - return UINT_MAX; - } - private static final long ULONG_MAX = -1L; - /** - * {@snippet lang=c : - * #define ULONG_MAX -1 - * } - */ - public static long ULONG_MAX() { - return ULONG_MAX; - } - private static final int CHAR_BIT = (int)8L; - /** - * {@snippet lang=c : - * #define CHAR_BIT 8 - * } - */ - public static int CHAR_BIT() { - return CHAR_BIT; - } - private static final int CHAR_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define CHAR_MIN -128 - * } - */ - public static int CHAR_MIN() { - return CHAR_MIN; - } - private static final int CHAR_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define CHAR_MAX 127 - * } - */ - public static int CHAR_MAX() { - return CHAR_MAX; - } - private static final MemorySegment NULL = MemorySegment.ofAddress(0L); - /** - * {@snippet lang=c : - * #define NULL (void*) 0 - * } - */ - public static MemorySegment NULL() { - return NULL; - } - private static final MemorySegment cudaStreamLegacy = MemorySegment.ofAddress(1L); - /** - * {@snippet lang=c : - * #define cudaStreamLegacy (void*) 1 - * } - */ - public static MemorySegment cudaStreamLegacy() { - return cudaStreamLegacy; - } - private static final MemorySegment cudaStreamPerThread = MemorySegment.ofAddress(2L); - /** - * {@snippet lang=c : - * #define cudaStreamPerThread (void*) 2 - * } - */ - public static MemorySegment cudaStreamPerThread() { - return cudaStreamPerThread; - } - private static final int cudaCpuDeviceId = (int)-1L; - /** - * {@snippet lang=c : - * #define cudaCpuDeviceId -1 - * } - */ - public static int cudaCpuDeviceId() { - return cudaCpuDeviceId; - } - private static final int cudaInvalidDeviceId = (int)-2L; - /** - * {@snippet lang=c : - * #define cudaInvalidDeviceId -2 - * } - */ - public static int cudaInvalidDeviceId() { - return cudaInvalidDeviceId; - } - private static final int cudaStreamAttributeAccessPolicyWindow = (int)1L; - /** - * {@snippet lang=c : - * #define cudaStreamAttributeAccessPolicyWindow 1 - * } - */ - public static int cudaStreamAttributeAccessPolicyWindow() { - return cudaStreamAttributeAccessPolicyWindow; - } - private static final int cudaStreamAttributeSynchronizationPolicy = (int)3L; - /** - * {@snippet lang=c : - * #define cudaStreamAttributeSynchronizationPolicy 3 - * } - */ - public static int cudaStreamAttributeSynchronizationPolicy() { - return cudaStreamAttributeSynchronizationPolicy; - } - private static final int cudaStreamAttributeMemSyncDomainMap = (int)9L; - /** - * {@snippet lang=c : - * #define cudaStreamAttributeMemSyncDomainMap 9 - * } - */ - public static int cudaStreamAttributeMemSyncDomainMap() { - return cudaStreamAttributeMemSyncDomainMap; - } - private static final int cudaStreamAttributeMemSyncDomain = (int)10L; - /** - * {@snippet lang=c : - * #define cudaStreamAttributeMemSyncDomain 10 - * } - */ - public static int cudaStreamAttributeMemSyncDomain() { - return cudaStreamAttributeMemSyncDomain; - } - private static final int cudaStreamAttributePriority = (int)8L; - /** - * {@snippet lang=c : - * #define cudaStreamAttributePriority 8 - * } - */ - public static int cudaStreamAttributePriority() { - return cudaStreamAttributePriority; - } - private static final int cudaKernelNodeAttributeAccessPolicyWindow = (int)1L; - /** - * {@snippet lang=c : - * #define cudaKernelNodeAttributeAccessPolicyWindow 1 - * } - */ - public static int cudaKernelNodeAttributeAccessPolicyWindow() { - return cudaKernelNodeAttributeAccessPolicyWindow; - } - private static final int cudaKernelNodeAttributeCooperative = (int)2L; - /** - * {@snippet lang=c : - * #define cudaKernelNodeAttributeCooperative 2 - * } - */ - public static int cudaKernelNodeAttributeCooperative() { - return cudaKernelNodeAttributeCooperative; - } - private static final int cudaKernelNodeAttributePriority = (int)8L; - /** - * {@snippet lang=c : - * #define cudaKernelNodeAttributePriority 8 - * } - */ - public static int cudaKernelNodeAttributePriority() { - return cudaKernelNodeAttributePriority; - } - private static final int cudaKernelNodeAttributeClusterDimension = (int)4L; - /** - * {@snippet lang=c : - * #define cudaKernelNodeAttributeClusterDimension 4 - * } - */ - public static int cudaKernelNodeAttributeClusterDimension() { - return cudaKernelNodeAttributeClusterDimension; - } - private static final int cudaKernelNodeAttributeClusterSchedulingPolicyPreference = (int)5L; - /** - * {@snippet lang=c : - * #define cudaKernelNodeAttributeClusterSchedulingPolicyPreference 5 - * } - */ - public static int cudaKernelNodeAttributeClusterSchedulingPolicyPreference() { - return cudaKernelNodeAttributeClusterSchedulingPolicyPreference; - } - private static final int cudaKernelNodeAttributeMemSyncDomainMap = (int)9L; - /** - * {@snippet lang=c : - * #define cudaKernelNodeAttributeMemSyncDomainMap 9 - * } - */ - public static int cudaKernelNodeAttributeMemSyncDomainMap() { - return cudaKernelNodeAttributeMemSyncDomainMap; - } - private static final int cudaKernelNodeAttributeMemSyncDomain = (int)10L; - /** - * {@snippet lang=c : - * #define cudaKernelNodeAttributeMemSyncDomain 10 - * } - */ - public static int cudaKernelNodeAttributeMemSyncDomain() { - return cudaKernelNodeAttributeMemSyncDomain; - } - private static final int cudaKernelNodeAttributePreferredSharedMemoryCarveout = (int)14L; - /** - * {@snippet lang=c : - * #define cudaKernelNodeAttributePreferredSharedMemoryCarveout 14 - * } - */ - public static int cudaKernelNodeAttributePreferredSharedMemoryCarveout() { - return cudaKernelNodeAttributePreferredSharedMemoryCarveout; - } - private static final int cudaKernelNodeAttributeDeviceUpdatableKernelNode = (int)13L; - /** - * {@snippet lang=c : - * #define cudaKernelNodeAttributeDeviceUpdatableKernelNode 13 - * } - */ - public static int cudaKernelNodeAttributeDeviceUpdatableKernelNode() { - return cudaKernelNodeAttributeDeviceUpdatableKernelNode; - } - private static final int __CUDART_API_VERSION = (int)12060L; - /** - * {@snippet lang=c : - * #define __CUDART_API_VERSION 12060 - * } - */ - public static int __CUDART_API_VERSION() { - return __CUDART_API_VERSION; - } - private static final int __WCHAR_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define __WCHAR_MAX 2147483647 - * } - */ - public static int __WCHAR_MAX() { - return __WCHAR_MAX; - } - private static final int __WCHAR_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define __WCHAR_MIN -2147483648 - * } - */ - public static int __WCHAR_MIN() { - return __WCHAR_MIN; - } - private static final int INT8_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define INT8_MIN -128 - * } - */ - public static int INT8_MIN() { - return INT8_MIN; - } - private static final int INT16_MIN = (int)-32768L; - /** - * {@snippet lang=c : - * #define INT16_MIN -32768 - * } - */ - public static int INT16_MIN() { - return INT16_MIN; - } - private static final int INT32_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define INT32_MIN -2147483648 - * } - */ - public static int INT32_MIN() { - return INT32_MIN; - } - private static final long INT64_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT64_MIN -9223372036854775808 - * } - */ - public static long INT64_MIN() { - return INT64_MIN; - } - private static final int INT8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT8_MAX 127 - * } - */ - public static int INT8_MAX() { - return INT8_MAX; - } - private static final int INT16_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define INT16_MAX 32767 - * } - */ - public static int INT16_MAX() { - return INT16_MAX; - } - private static final int INT32_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define INT32_MAX 2147483647 - * } - */ - public static int INT32_MAX() { - return INT32_MAX; - } - private static final long INT64_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT64_MAX 9223372036854775807 - * } - */ - public static long INT64_MAX() { - return INT64_MAX; - } - private static final int UINT8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT8_MAX 255 - * } - */ - public static int UINT8_MAX() { - return UINT8_MAX; - } - private static final int UINT16_MAX = (int)65535L; - /** - * {@snippet lang=c : - * #define UINT16_MAX 65535 - * } - */ - public static int UINT16_MAX() { - return UINT16_MAX; - } - private static final int UINT32_MAX = (int)4294967295L; - /** - * {@snippet lang=c : - * #define UINT32_MAX 4294967295 - * } - */ - public static int UINT32_MAX() { - return UINT32_MAX; - } - private static final long UINT64_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT64_MAX -1 - * } - */ - public static long UINT64_MAX() { - return UINT64_MAX; - } - private static final int INT_LEAST8_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define INT_LEAST8_MIN -128 - * } - */ - public static int INT_LEAST8_MIN() { - return INT_LEAST8_MIN; - } - private static final int INT_LEAST16_MIN = (int)-32768L; - /** - * {@snippet lang=c : - * #define INT_LEAST16_MIN -32768 - * } - */ - public static int INT_LEAST16_MIN() { - return INT_LEAST16_MIN; - } - private static final int INT_LEAST32_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define INT_LEAST32_MIN -2147483648 - * } - */ - public static int INT_LEAST32_MIN() { - return INT_LEAST32_MIN; - } - private static final long INT_LEAST64_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT_LEAST64_MIN -9223372036854775808 - * } - */ - public static long INT_LEAST64_MIN() { - return INT_LEAST64_MIN; - } - private static final int INT_LEAST8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT_LEAST8_MAX 127 - * } - */ - public static int INT_LEAST8_MAX() { - return INT_LEAST8_MAX; - } - private static final int INT_LEAST16_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define INT_LEAST16_MAX 32767 - * } - */ - public static int INT_LEAST16_MAX() { - return INT_LEAST16_MAX; - } - private static final int INT_LEAST32_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define INT_LEAST32_MAX 2147483647 - * } - */ - public static int INT_LEAST32_MAX() { - return INT_LEAST32_MAX; - } - private static final long INT_LEAST64_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT_LEAST64_MAX 9223372036854775807 - * } - */ - public static long INT_LEAST64_MAX() { - return INT_LEAST64_MAX; - } - private static final int UINT_LEAST8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT_LEAST8_MAX 255 - * } - */ - public static int UINT_LEAST8_MAX() { - return UINT_LEAST8_MAX; - } - private static final int UINT_LEAST16_MAX = (int)65535L; - /** - * {@snippet lang=c : - * #define UINT_LEAST16_MAX 65535 - * } - */ - public static int UINT_LEAST16_MAX() { - return UINT_LEAST16_MAX; - } - private static final int UINT_LEAST32_MAX = (int)4294967295L; - /** - * {@snippet lang=c : - * #define UINT_LEAST32_MAX 4294967295 - * } - */ - public static int UINT_LEAST32_MAX() { - return UINT_LEAST32_MAX; - } - private static final long UINT_LEAST64_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT_LEAST64_MAX -1 - * } - */ - public static long UINT_LEAST64_MAX() { - return UINT_LEAST64_MAX; - } - private static final int INT_FAST8_MIN = (int)-128L; - /** - * {@snippet lang=c : - * #define INT_FAST8_MIN -128 - * } - */ - public static int INT_FAST8_MIN() { - return INT_FAST8_MIN; - } - private static final long INT_FAST16_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT_FAST16_MIN -9223372036854775808 - * } - */ - public static long INT_FAST16_MIN() { - return INT_FAST16_MIN; - } - private static final long INT_FAST32_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT_FAST32_MIN -9223372036854775808 - * } - */ - public static long INT_FAST32_MIN() { - return INT_FAST32_MIN; - } - private static final long INT_FAST64_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INT_FAST64_MIN -9223372036854775808 - * } - */ - public static long INT_FAST64_MIN() { - return INT_FAST64_MIN; - } - private static final int INT_FAST8_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define INT_FAST8_MAX 127 - * } - */ - public static int INT_FAST8_MAX() { - return INT_FAST8_MAX; - } - private static final long INT_FAST16_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT_FAST16_MAX 9223372036854775807 - * } - */ - public static long INT_FAST16_MAX() { - return INT_FAST16_MAX; - } - private static final long INT_FAST32_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT_FAST32_MAX 9223372036854775807 - * } - */ - public static long INT_FAST32_MAX() { - return INT_FAST32_MAX; - } - private static final long INT_FAST64_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INT_FAST64_MAX 9223372036854775807 - * } - */ - public static long INT_FAST64_MAX() { - return INT_FAST64_MAX; - } - private static final int UINT_FAST8_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define UINT_FAST8_MAX 255 - * } - */ - public static int UINT_FAST8_MAX() { - return UINT_FAST8_MAX; - } - private static final long UINT_FAST16_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT_FAST16_MAX -1 - * } - */ - public static long UINT_FAST16_MAX() { - return UINT_FAST16_MAX; - } - private static final long UINT_FAST32_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT_FAST32_MAX -1 - * } - */ - public static long UINT_FAST32_MAX() { - return UINT_FAST32_MAX; - } - private static final long UINT_FAST64_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINT_FAST64_MAX -1 - * } - */ - public static long UINT_FAST64_MAX() { - return UINT_FAST64_MAX; - } - private static final long INTPTR_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INTPTR_MIN -9223372036854775808 - * } - */ - public static long INTPTR_MIN() { - return INTPTR_MIN; - } - private static final long INTPTR_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INTPTR_MAX 9223372036854775807 - * } - */ - public static long INTPTR_MAX() { - return INTPTR_MAX; - } - private static final long UINTPTR_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINTPTR_MAX -1 - * } - */ - public static long UINTPTR_MAX() { - return UINTPTR_MAX; - } - private static final long INTMAX_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define INTMAX_MIN -9223372036854775808 - * } - */ - public static long INTMAX_MIN() { - return INTMAX_MIN; - } - private static final long INTMAX_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define INTMAX_MAX 9223372036854775807 - * } - */ - public static long INTMAX_MAX() { - return INTMAX_MAX; - } - private static final long UINTMAX_MAX = -1L; - /** - * {@snippet lang=c : - * #define UINTMAX_MAX -1 - * } - */ - public static long UINTMAX_MAX() { - return UINTMAX_MAX; - } - private static final long PTRDIFF_MIN = -9223372036854775808L; - /** - * {@snippet lang=c : - * #define PTRDIFF_MIN -9223372036854775808 - * } - */ - public static long PTRDIFF_MIN() { - return PTRDIFF_MIN; - } - private static final long PTRDIFF_MAX = 9223372036854775807L; - /** - * {@snippet lang=c : - * #define PTRDIFF_MAX 9223372036854775807 - * } - */ - public static long PTRDIFF_MAX() { - return PTRDIFF_MAX; - } - private static final int SIG_ATOMIC_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define SIG_ATOMIC_MIN -2147483648 - * } - */ - public static int SIG_ATOMIC_MIN() { - return SIG_ATOMIC_MIN; - } - private static final int SIG_ATOMIC_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define SIG_ATOMIC_MAX 2147483647 - * } - */ - public static int SIG_ATOMIC_MAX() { - return SIG_ATOMIC_MAX; - } - private static final long SIZE_MAX = -1L; - /** - * {@snippet lang=c : - * #define SIZE_MAX -1 - * } - */ - public static long SIZE_MAX() { - return SIZE_MAX; - } - private static final int WCHAR_MIN = (int)-2147483648L; - /** - * {@snippet lang=c : - * #define WCHAR_MIN -2147483648 - * } - */ - public static int WCHAR_MIN() { - return WCHAR_MIN; - } - private static final int WCHAR_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define WCHAR_MAX 2147483647 - * } - */ - public static int WCHAR_MAX() { - return WCHAR_MAX; - } - private static final int WINT_MIN = (int)0L; - /** - * {@snippet lang=c : - * #define WINT_MIN 0 - * } - */ - public static int WINT_MIN() { - return WINT_MIN; - } - private static final int WINT_MAX = (int)4294967295L; - /** - * {@snippet lang=c : - * #define WINT_MAX 4294967295 - * } - */ - public static int WINT_MAX() { - return WINT_MAX; - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI_1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI_1.java deleted file mode 100644 index 3860573f18..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/PanamaFFMAPI_1.java +++ /dev/null @@ -1,17672 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -public class PanamaFFMAPI_1 { - - PanamaFFMAPI_1() { - // Should not be called directly - } - - static final Arena LIBRARY_ARENA = Arena.ofAuto(); - static final boolean TRACE_DOWNCALLS = Boolean.getBoolean("jextract.trace.downcalls"); - - static void traceDowncall(String name, Object... args) { - String traceArgs = Arrays.stream(args) - .map(Object::toString) - .collect(Collectors.joining(", ")); - System.out.printf("%s(%s)\n", name, traceArgs); - } - - static MemorySegment findOrThrow(String symbol) { - return SYMBOL_LOOKUP.find(symbol) - .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol: " + symbol)); - } - - static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { - try { - return MethodHandles.lookup().findVirtual(fi, name, fdesc.toMethodType()); - } catch (ReflectiveOperationException ex) { - throw new AssertionError(ex); - } - } - - static MemoryLayout align(MemoryLayout layout, long align) { - return switch (layout) { - case PaddingLayout p -> p; - case ValueLayout v -> v.withByteAlignment(align); - case GroupLayout g -> { - MemoryLayout[] alignedMembers = g.memberLayouts().stream() - .map(m -> align(m, align)).toArray(MemoryLayout[]::new); - yield g instanceof StructLayout ? - MemoryLayout.structLayout(alignedMembers) : MemoryLayout.unionLayout(alignedMembers); - } - case SequenceLayout s -> MemoryLayout.sequenceLayout(s.elementCount(), align(s.elementLayout(), align)); - }; - } - - static final SymbolLookup SYMBOL_LOOKUP = SymbolLookup.loaderLookup() - .or(Linker.nativeLinker().defaultLookup()); - - public static final ValueLayout.OfBoolean C_BOOL = ValueLayout.JAVA_BOOLEAN; - public static final ValueLayout.OfByte C_CHAR = ValueLayout.JAVA_BYTE; - public static final ValueLayout.OfShort C_SHORT = ValueLayout.JAVA_SHORT; - public static final ValueLayout.OfInt C_INT = ValueLayout.JAVA_INT; - public static final ValueLayout.OfLong C_LONG_LONG = ValueLayout.JAVA_LONG; - public static final ValueLayout.OfFloat C_FLOAT = ValueLayout.JAVA_FLOAT; - public static final ValueLayout.OfDouble C_DOUBLE = ValueLayout.JAVA_DOUBLE; - public static final AddressLayout C_POINTER = ValueLayout.ADDRESS - .withTargetLayout(MemoryLayout.sequenceLayout(java.lang.Long.MAX_VALUE, JAVA_BYTE)); - public static final ValueLayout.OfLong C_LONG = ValueLayout.JAVA_LONG; - private static final int _LIBC_LIMITS_H_ = (int)1L; - /** - * {@snippet lang=c : - * #define _LIBC_LIMITS_H_ 1 - * } - */ - public static int _LIBC_LIMITS_H_() { - return _LIBC_LIMITS_H_; - } - private static final int _FEATURES_H = (int)1L; - /** - * {@snippet lang=c : - * #define _FEATURES_H 1 - * } - */ - public static int _FEATURES_H() { - return _FEATURES_H; - } - private static final int _DEFAULT_SOURCE = (int)1L; - /** - * {@snippet lang=c : - * #define _DEFAULT_SOURCE 1 - * } - */ - public static int _DEFAULT_SOURCE() { - return _DEFAULT_SOURCE; - } - private static final int __GLIBC_USE_ISOC2X = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_ISOC2X 0 - * } - */ - public static int __GLIBC_USE_ISOC2X() { - return __GLIBC_USE_ISOC2X; - } - private static final int __USE_ISOC11 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_ISOC11 1 - * } - */ - public static int __USE_ISOC11() { - return __USE_ISOC11; - } - private static final int __USE_ISOC99 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_ISOC99 1 - * } - */ - public static int __USE_ISOC99() { - return __USE_ISOC99; - } - private static final int __USE_ISOC95 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_ISOC95 1 - * } - */ - public static int __USE_ISOC95() { - return __USE_ISOC95; - } - private static final int __USE_POSIX_IMPLICITLY = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_POSIX_IMPLICITLY 1 - * } - */ - public static int __USE_POSIX_IMPLICITLY() { - return __USE_POSIX_IMPLICITLY; - } - private static final int _POSIX_SOURCE = (int)1L; - /** - * {@snippet lang=c : - * #define _POSIX_SOURCE 1 - * } - */ - public static int _POSIX_SOURCE() { - return _POSIX_SOURCE; - } - private static final int __USE_POSIX = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_POSIX 1 - * } - */ - public static int __USE_POSIX() { - return __USE_POSIX; - } - private static final int __USE_POSIX2 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_POSIX2 1 - * } - */ - public static int __USE_POSIX2() { - return __USE_POSIX2; - } - private static final int __USE_POSIX199309 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_POSIX199309 1 - * } - */ - public static int __USE_POSIX199309() { - return __USE_POSIX199309; - } - private static final int __USE_POSIX199506 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_POSIX199506 1 - * } - */ - public static int __USE_POSIX199506() { - return __USE_POSIX199506; - } - private static final int __USE_XOPEN2K = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_XOPEN2K 1 - * } - */ - public static int __USE_XOPEN2K() { - return __USE_XOPEN2K; - } - private static final int __USE_XOPEN2K8 = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_XOPEN2K8 1 - * } - */ - public static int __USE_XOPEN2K8() { - return __USE_XOPEN2K8; - } - private static final int _ATFILE_SOURCE = (int)1L; - /** - * {@snippet lang=c : - * #define _ATFILE_SOURCE 1 - * } - */ - public static int _ATFILE_SOURCE() { - return _ATFILE_SOURCE; - } - private static final int __WORDSIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __WORDSIZE 64 - * } - */ - public static int __WORDSIZE() { - return __WORDSIZE; - } - private static final int __WORDSIZE_TIME64_COMPAT32 = (int)1L; - /** - * {@snippet lang=c : - * #define __WORDSIZE_TIME64_COMPAT32 1 - * } - */ - public static int __WORDSIZE_TIME64_COMPAT32() { - return __WORDSIZE_TIME64_COMPAT32; - } - private static final int __SYSCALL_WORDSIZE = (int)64L; - /** - * {@snippet lang=c : - * #define __SYSCALL_WORDSIZE 64 - * } - */ - public static int __SYSCALL_WORDSIZE() { - return __SYSCALL_WORDSIZE; - } - private static final int __USE_MISC = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_MISC 1 - * } - */ - public static int __USE_MISC() { - return __USE_MISC; - } - private static final int __USE_ATFILE = (int)1L; - /** - * {@snippet lang=c : - * #define __USE_ATFILE 1 - * } - */ - public static int __USE_ATFILE() { - return __USE_ATFILE; - } - private static final int __USE_FORTIFY_LEVEL = (int)0L; - /** - * {@snippet lang=c : - * #define __USE_FORTIFY_LEVEL 0 - * } - */ - public static int __USE_FORTIFY_LEVEL() { - return __USE_FORTIFY_LEVEL; - } - private static final int __GLIBC_USE_DEPRECATED_GETS = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_DEPRECATED_GETS 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_GETS() { - return __GLIBC_USE_DEPRECATED_GETS; - } - private static final int __GLIBC_USE_DEPRECATED_SCANF = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_DEPRECATED_SCANF 0 - * } - */ - public static int __GLIBC_USE_DEPRECATED_SCANF() { - return __GLIBC_USE_DEPRECATED_SCANF; - } - private static final int _STDC_PREDEF_H = (int)1L; - /** - * {@snippet lang=c : - * #define _STDC_PREDEF_H 1 - * } - */ - public static int _STDC_PREDEF_H() { - return _STDC_PREDEF_H; - } - private static final int __STDC_IEC_559__ = (int)1L; - /** - * {@snippet lang=c : - * #define __STDC_IEC_559__ 1 - * } - */ - public static int __STDC_IEC_559__() { - return __STDC_IEC_559__; - } - private static final int __STDC_IEC_559_COMPLEX__ = (int)1L; - /** - * {@snippet lang=c : - * #define __STDC_IEC_559_COMPLEX__ 1 - * } - */ - public static int __STDC_IEC_559_COMPLEX__() { - return __STDC_IEC_559_COMPLEX__; - } - private static final int __GNU_LIBRARY__ = (int)6L; - /** - * {@snippet lang=c : - * #define __GNU_LIBRARY__ 6 - * } - */ - public static int __GNU_LIBRARY__() { - return __GNU_LIBRARY__; - } - private static final int __GLIBC__ = (int)2L; - /** - * {@snippet lang=c : - * #define __GLIBC__ 2 - * } - */ - public static int __GLIBC__() { - return __GLIBC__; - } - private static final int __GLIBC_MINOR__ = (int)35L; - /** - * {@snippet lang=c : - * #define __GLIBC_MINOR__ 35 - * } - */ - public static int __GLIBC_MINOR__() { - return __GLIBC_MINOR__; - } - private static final int _SYS_CDEFS_H = (int)1L; - /** - * {@snippet lang=c : - * #define _SYS_CDEFS_H 1 - * } - */ - public static int _SYS_CDEFS_H() { - return _SYS_CDEFS_H; - } - private static final int __glibc_c99_flexarr_available = (int)1L; - /** - * {@snippet lang=c : - * #define __glibc_c99_flexarr_available 1 - * } - */ - public static int __glibc_c99_flexarr_available() { - return __glibc_c99_flexarr_available; - } - private static final int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = (int)0L; - /** - * {@snippet lang=c : - * #define __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 0 - * } - */ - public static int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI() { - return __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI; - } - private static final int __HAVE_GENERIC_SELECTION = (int)1L; - /** - * {@snippet lang=c : - * #define __HAVE_GENERIC_SELECTION 1 - * } - */ - public static int __HAVE_GENERIC_SELECTION() { - return __HAVE_GENERIC_SELECTION; - } - private static final int __GLIBC_USE_LIB_EXT2 = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_LIB_EXT2 0 - * } - */ - public static int __GLIBC_USE_LIB_EXT2() { - return __GLIBC_USE_LIB_EXT2; - } - private static final int __GLIBC_USE_IEC_60559_BFP_EXT = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_BFP_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT() { - return __GLIBC_USE_IEC_60559_BFP_EXT; - } - private static final int __GLIBC_USE_IEC_60559_BFP_EXT_C2X = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_BFP_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_BFP_EXT_C2X() { - return __GLIBC_USE_IEC_60559_BFP_EXT_C2X; - } - private static final int __GLIBC_USE_IEC_60559_EXT = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_EXT() { - return __GLIBC_USE_IEC_60559_EXT; - } - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT; - } - private static final int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X() { - return __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X; - } - private static final int __GLIBC_USE_IEC_60559_TYPES_EXT = (int)0L; - /** - * {@snippet lang=c : - * #define __GLIBC_USE_IEC_60559_TYPES_EXT 0 - * } - */ - public static int __GLIBC_USE_IEC_60559_TYPES_EXT() { - return __GLIBC_USE_IEC_60559_TYPES_EXT; - } - private static final int MB_LEN_MAX = (int)16L; - /** - * {@snippet lang=c : - * #define MB_LEN_MAX 16 - * } - */ - public static int MB_LEN_MAX() { - return MB_LEN_MAX; - } - private static final int _BITS_POSIX1_LIM_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_POSIX1_LIM_H 1 - * } - */ - public static int _BITS_POSIX1_LIM_H() { - return _BITS_POSIX1_LIM_H; - } - private static final int _POSIX_AIO_LISTIO_MAX = (int)2L; - /** - * {@snippet lang=c : - * #define _POSIX_AIO_LISTIO_MAX 2 - * } - */ - public static int _POSIX_AIO_LISTIO_MAX() { - return _POSIX_AIO_LISTIO_MAX; - } - private static final int _POSIX_AIO_MAX = (int)1L; - /** - * {@snippet lang=c : - * #define _POSIX_AIO_MAX 1 - * } - */ - public static int _POSIX_AIO_MAX() { - return _POSIX_AIO_MAX; - } - private static final int _POSIX_ARG_MAX = (int)4096L; - /** - * {@snippet lang=c : - * #define _POSIX_ARG_MAX 4096 - * } - */ - public static int _POSIX_ARG_MAX() { - return _POSIX_ARG_MAX; - } - private static final int _POSIX_CHILD_MAX = (int)25L; - /** - * {@snippet lang=c : - * #define _POSIX_CHILD_MAX 25 - * } - */ - public static int _POSIX_CHILD_MAX() { - return _POSIX_CHILD_MAX; - } - private static final int _POSIX_DELAYTIMER_MAX = (int)32L; - /** - * {@snippet lang=c : - * #define _POSIX_DELAYTIMER_MAX 32 - * } - */ - public static int _POSIX_DELAYTIMER_MAX() { - return _POSIX_DELAYTIMER_MAX; - } - private static final int _POSIX_HOST_NAME_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define _POSIX_HOST_NAME_MAX 255 - * } - */ - public static int _POSIX_HOST_NAME_MAX() { - return _POSIX_HOST_NAME_MAX; - } - private static final int _POSIX_LINK_MAX = (int)8L; - /** - * {@snippet lang=c : - * #define _POSIX_LINK_MAX 8 - * } - */ - public static int _POSIX_LINK_MAX() { - return _POSIX_LINK_MAX; - } - private static final int _POSIX_LOGIN_NAME_MAX = (int)9L; - /** - * {@snippet lang=c : - * #define _POSIX_LOGIN_NAME_MAX 9 - * } - */ - public static int _POSIX_LOGIN_NAME_MAX() { - return _POSIX_LOGIN_NAME_MAX; - } - private static final int _POSIX_MAX_CANON = (int)255L; - /** - * {@snippet lang=c : - * #define _POSIX_MAX_CANON 255 - * } - */ - public static int _POSIX_MAX_CANON() { - return _POSIX_MAX_CANON; - } - private static final int _POSIX_MAX_INPUT = (int)255L; - /** - * {@snippet lang=c : - * #define _POSIX_MAX_INPUT 255 - * } - */ - public static int _POSIX_MAX_INPUT() { - return _POSIX_MAX_INPUT; - } - private static final int _POSIX_MQ_OPEN_MAX = (int)8L; - /** - * {@snippet lang=c : - * #define _POSIX_MQ_OPEN_MAX 8 - * } - */ - public static int _POSIX_MQ_OPEN_MAX() { - return _POSIX_MQ_OPEN_MAX; - } - private static final int _POSIX_MQ_PRIO_MAX = (int)32L; - /** - * {@snippet lang=c : - * #define _POSIX_MQ_PRIO_MAX 32 - * } - */ - public static int _POSIX_MQ_PRIO_MAX() { - return _POSIX_MQ_PRIO_MAX; - } - private static final int _POSIX_NAME_MAX = (int)14L; - /** - * {@snippet lang=c : - * #define _POSIX_NAME_MAX 14 - * } - */ - public static int _POSIX_NAME_MAX() { - return _POSIX_NAME_MAX; - } - private static final int _POSIX_NGROUPS_MAX = (int)8L; - /** - * {@snippet lang=c : - * #define _POSIX_NGROUPS_MAX 8 - * } - */ - public static int _POSIX_NGROUPS_MAX() { - return _POSIX_NGROUPS_MAX; - } - private static final int _POSIX_OPEN_MAX = (int)20L; - /** - * {@snippet lang=c : - * #define _POSIX_OPEN_MAX 20 - * } - */ - public static int _POSIX_OPEN_MAX() { - return _POSIX_OPEN_MAX; - } - private static final int _POSIX_PATH_MAX = (int)256L; - /** - * {@snippet lang=c : - * #define _POSIX_PATH_MAX 256 - * } - */ - public static int _POSIX_PATH_MAX() { - return _POSIX_PATH_MAX; - } - private static final int _POSIX_PIPE_BUF = (int)512L; - /** - * {@snippet lang=c : - * #define _POSIX_PIPE_BUF 512 - * } - */ - public static int _POSIX_PIPE_BUF() { - return _POSIX_PIPE_BUF; - } - private static final int _POSIX_RE_DUP_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define _POSIX_RE_DUP_MAX 255 - * } - */ - public static int _POSIX_RE_DUP_MAX() { - return _POSIX_RE_DUP_MAX; - } - private static final int _POSIX_RTSIG_MAX = (int)8L; - /** - * {@snippet lang=c : - * #define _POSIX_RTSIG_MAX 8 - * } - */ - public static int _POSIX_RTSIG_MAX() { - return _POSIX_RTSIG_MAX; - } - private static final int _POSIX_SEM_NSEMS_MAX = (int)256L; - /** - * {@snippet lang=c : - * #define _POSIX_SEM_NSEMS_MAX 256 - * } - */ - public static int _POSIX_SEM_NSEMS_MAX() { - return _POSIX_SEM_NSEMS_MAX; - } - private static final int _POSIX_SEM_VALUE_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define _POSIX_SEM_VALUE_MAX 32767 - * } - */ - public static int _POSIX_SEM_VALUE_MAX() { - return _POSIX_SEM_VALUE_MAX; - } - private static final int _POSIX_SIGQUEUE_MAX = (int)32L; - /** - * {@snippet lang=c : - * #define _POSIX_SIGQUEUE_MAX 32 - * } - */ - public static int _POSIX_SIGQUEUE_MAX() { - return _POSIX_SIGQUEUE_MAX; - } - private static final int _POSIX_SSIZE_MAX = (int)32767L; - /** - * {@snippet lang=c : - * #define _POSIX_SSIZE_MAX 32767 - * } - */ - public static int _POSIX_SSIZE_MAX() { - return _POSIX_SSIZE_MAX; - } - private static final int _POSIX_STREAM_MAX = (int)8L; - /** - * {@snippet lang=c : - * #define _POSIX_STREAM_MAX 8 - * } - */ - public static int _POSIX_STREAM_MAX() { - return _POSIX_STREAM_MAX; - } - private static final int _POSIX_SYMLINK_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define _POSIX_SYMLINK_MAX 255 - * } - */ - public static int _POSIX_SYMLINK_MAX() { - return _POSIX_SYMLINK_MAX; - } - private static final int _POSIX_SYMLOOP_MAX = (int)8L; - /** - * {@snippet lang=c : - * #define _POSIX_SYMLOOP_MAX 8 - * } - */ - public static int _POSIX_SYMLOOP_MAX() { - return _POSIX_SYMLOOP_MAX; - } - private static final int _POSIX_TIMER_MAX = (int)32L; - /** - * {@snippet lang=c : - * #define _POSIX_TIMER_MAX 32 - * } - */ - public static int _POSIX_TIMER_MAX() { - return _POSIX_TIMER_MAX; - } - private static final int _POSIX_TTY_NAME_MAX = (int)9L; - /** - * {@snippet lang=c : - * #define _POSIX_TTY_NAME_MAX 9 - * } - */ - public static int _POSIX_TTY_NAME_MAX() { - return _POSIX_TTY_NAME_MAX; - } - private static final int _POSIX_TZNAME_MAX = (int)6L; - /** - * {@snippet lang=c : - * #define _POSIX_TZNAME_MAX 6 - * } - */ - public static int _POSIX_TZNAME_MAX() { - return _POSIX_TZNAME_MAX; - } - private static final int _POSIX_CLOCKRES_MIN = (int)20000000L; - /** - * {@snippet lang=c : - * #define _POSIX_CLOCKRES_MIN 20000000 - * } - */ - public static int _POSIX_CLOCKRES_MIN() { - return _POSIX_CLOCKRES_MIN; - } - private static final int NR_OPEN = (int)1024L; - /** - * {@snippet lang=c : - * #define NR_OPEN 1024 - * } - */ - public static int NR_OPEN() { - return NR_OPEN; - } - private static final int NGROUPS_MAX = (int)65536L; - /** - * {@snippet lang=c : - * #define NGROUPS_MAX 65536 - * } - */ - public static int NGROUPS_MAX() { - return NGROUPS_MAX; - } - private static final int ARG_MAX = (int)131072L; - /** - * {@snippet lang=c : - * #define ARG_MAX 131072 - * } - */ - public static int ARG_MAX() { - return ARG_MAX; - } - private static final int LINK_MAX = (int)127L; - /** - * {@snippet lang=c : - * #define LINK_MAX 127 - * } - */ - public static int LINK_MAX() { - return LINK_MAX; - } - private static final int MAX_CANON = (int)255L; - /** - * {@snippet lang=c : - * #define MAX_CANON 255 - * } - */ - public static int MAX_CANON() { - return MAX_CANON; - } - private static final int MAX_INPUT = (int)255L; - /** - * {@snippet lang=c : - * #define MAX_INPUT 255 - * } - */ - public static int MAX_INPUT() { - return MAX_INPUT; - } - private static final int NAME_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define NAME_MAX 255 - * } - */ - public static int NAME_MAX() { - return NAME_MAX; - } - private static final int PATH_MAX = (int)4096L; - /** - * {@snippet lang=c : - * #define PATH_MAX 4096 - * } - */ - public static int PATH_MAX() { - return PATH_MAX; - } - private static final int PIPE_BUF = (int)4096L; - /** - * {@snippet lang=c : - * #define PIPE_BUF 4096 - * } - */ - public static int PIPE_BUF() { - return PIPE_BUF; - } - private static final int XATTR_NAME_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define XATTR_NAME_MAX 255 - * } - */ - public static int XATTR_NAME_MAX() { - return XATTR_NAME_MAX; - } - private static final int XATTR_SIZE_MAX = (int)65536L; - /** - * {@snippet lang=c : - * #define XATTR_SIZE_MAX 65536 - * } - */ - public static int XATTR_SIZE_MAX() { - return XATTR_SIZE_MAX; - } - private static final int XATTR_LIST_MAX = (int)65536L; - /** - * {@snippet lang=c : - * #define XATTR_LIST_MAX 65536 - * } - */ - public static int XATTR_LIST_MAX() { - return XATTR_LIST_MAX; - } - private static final int RTSIG_MAX = (int)32L; - /** - * {@snippet lang=c : - * #define RTSIG_MAX 32 - * } - */ - public static int RTSIG_MAX() { - return RTSIG_MAX; - } - private static final int _POSIX_THREAD_KEYS_MAX = (int)128L; - /** - * {@snippet lang=c : - * #define _POSIX_THREAD_KEYS_MAX 128 - * } - */ - public static int _POSIX_THREAD_KEYS_MAX() { - return _POSIX_THREAD_KEYS_MAX; - } - private static final int PTHREAD_KEYS_MAX = (int)1024L; - /** - * {@snippet lang=c : - * #define PTHREAD_KEYS_MAX 1024 - * } - */ - public static int PTHREAD_KEYS_MAX() { - return PTHREAD_KEYS_MAX; - } - private static final int _POSIX_THREAD_DESTRUCTOR_ITERATIONS = (int)4L; - /** - * {@snippet lang=c : - * #define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4 - * } - */ - public static int _POSIX_THREAD_DESTRUCTOR_ITERATIONS() { - return _POSIX_THREAD_DESTRUCTOR_ITERATIONS; - } - private static final int _POSIX_THREAD_THREADS_MAX = (int)64L; - /** - * {@snippet lang=c : - * #define _POSIX_THREAD_THREADS_MAX 64 - * } - */ - public static int _POSIX_THREAD_THREADS_MAX() { - return _POSIX_THREAD_THREADS_MAX; - } - private static final int AIO_PRIO_DELTA_MAX = (int)20L; - /** - * {@snippet lang=c : - * #define AIO_PRIO_DELTA_MAX 20 - * } - */ - public static int AIO_PRIO_DELTA_MAX() { - return AIO_PRIO_DELTA_MAX; - } - private static final int PTHREAD_STACK_MIN = (int)16384L; - /** - * {@snippet lang=c : - * #define PTHREAD_STACK_MIN 16384 - * } - */ - public static int PTHREAD_STACK_MIN() { - return PTHREAD_STACK_MIN; - } - private static final int DELAYTIMER_MAX = (int)2147483647L; - /** - * {@snippet lang=c : - * #define DELAYTIMER_MAX 2147483647 - * } - */ - public static int DELAYTIMER_MAX() { - return DELAYTIMER_MAX; - } - private static final int TTY_NAME_MAX = (int)32L; - /** - * {@snippet lang=c : - * #define TTY_NAME_MAX 32 - * } - */ - public static int TTY_NAME_MAX() { - return TTY_NAME_MAX; - } - private static final int LOGIN_NAME_MAX = (int)256L; - /** - * {@snippet lang=c : - * #define LOGIN_NAME_MAX 256 - * } - */ - public static int LOGIN_NAME_MAX() { - return LOGIN_NAME_MAX; - } - private static final int HOST_NAME_MAX = (int)64L; - /** - * {@snippet lang=c : - * #define HOST_NAME_MAX 64 - * } - */ - public static int HOST_NAME_MAX() { - return HOST_NAME_MAX; - } - private static final int MQ_PRIO_MAX = (int)32768L; - /** - * {@snippet lang=c : - * #define MQ_PRIO_MAX 32768 - * } - */ - public static int MQ_PRIO_MAX() { - return MQ_PRIO_MAX; - } - private static final int _BITS_POSIX2_LIM_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_POSIX2_LIM_H 1 - * } - */ - public static int _BITS_POSIX2_LIM_H() { - return _BITS_POSIX2_LIM_H; - } - private static final int _POSIX2_BC_BASE_MAX = (int)99L; - /** - * {@snippet lang=c : - * #define _POSIX2_BC_BASE_MAX 99 - * } - */ - public static int _POSIX2_BC_BASE_MAX() { - return _POSIX2_BC_BASE_MAX; - } - private static final int _POSIX2_BC_DIM_MAX = (int)2048L; - /** - * {@snippet lang=c : - * #define _POSIX2_BC_DIM_MAX 2048 - * } - */ - public static int _POSIX2_BC_DIM_MAX() { - return _POSIX2_BC_DIM_MAX; - } - private static final int _POSIX2_BC_SCALE_MAX = (int)99L; - /** - * {@snippet lang=c : - * #define _POSIX2_BC_SCALE_MAX 99 - * } - */ - public static int _POSIX2_BC_SCALE_MAX() { - return _POSIX2_BC_SCALE_MAX; - } - private static final int _POSIX2_BC_STRING_MAX = (int)1000L; - /** - * {@snippet lang=c : - * #define _POSIX2_BC_STRING_MAX 1000 - * } - */ - public static int _POSIX2_BC_STRING_MAX() { - return _POSIX2_BC_STRING_MAX; - } - private static final int _POSIX2_COLL_WEIGHTS_MAX = (int)2L; - /** - * {@snippet lang=c : - * #define _POSIX2_COLL_WEIGHTS_MAX 2 - * } - */ - public static int _POSIX2_COLL_WEIGHTS_MAX() { - return _POSIX2_COLL_WEIGHTS_MAX; - } - private static final int _POSIX2_EXPR_NEST_MAX = (int)32L; - /** - * {@snippet lang=c : - * #define _POSIX2_EXPR_NEST_MAX 32 - * } - */ - public static int _POSIX2_EXPR_NEST_MAX() { - return _POSIX2_EXPR_NEST_MAX; - } - private static final int _POSIX2_LINE_MAX = (int)2048L; - /** - * {@snippet lang=c : - * #define _POSIX2_LINE_MAX 2048 - * } - */ - public static int _POSIX2_LINE_MAX() { - return _POSIX2_LINE_MAX; - } - private static final int _POSIX2_RE_DUP_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define _POSIX2_RE_DUP_MAX 255 - * } - */ - public static int _POSIX2_RE_DUP_MAX() { - return _POSIX2_RE_DUP_MAX; - } - private static final int _POSIX2_CHARCLASS_NAME_MAX = (int)14L; - /** - * {@snippet lang=c : - * #define _POSIX2_CHARCLASS_NAME_MAX 14 - * } - */ - public static int _POSIX2_CHARCLASS_NAME_MAX() { - return _POSIX2_CHARCLASS_NAME_MAX; - } - private static final int COLL_WEIGHTS_MAX = (int)255L; - /** - * {@snippet lang=c : - * #define COLL_WEIGHTS_MAX 255 - * } - */ - public static int COLL_WEIGHTS_MAX() { - return COLL_WEIGHTS_MAX; - } - private static final int CHARCLASS_NAME_MAX = (int)2048L; - /** - * {@snippet lang=c : - * #define CHARCLASS_NAME_MAX 2048 - * } - */ - public static int CHARCLASS_NAME_MAX() { - return CHARCLASS_NAME_MAX; - } - private static final int cudaHostAllocDefault = (int)0L; - /** - * {@snippet lang=c : - * #define cudaHostAllocDefault 0 - * } - */ - public static int cudaHostAllocDefault() { - return cudaHostAllocDefault; - } - private static final int cudaHostAllocPortable = (int)1L; - /** - * {@snippet lang=c : - * #define cudaHostAllocPortable 1 - * } - */ - public static int cudaHostAllocPortable() { - return cudaHostAllocPortable; - } - private static final int cudaHostAllocMapped = (int)2L; - /** - * {@snippet lang=c : - * #define cudaHostAllocMapped 2 - * } - */ - public static int cudaHostAllocMapped() { - return cudaHostAllocMapped; - } - private static final int cudaHostAllocWriteCombined = (int)4L; - /** - * {@snippet lang=c : - * #define cudaHostAllocWriteCombined 4 - * } - */ - public static int cudaHostAllocWriteCombined() { - return cudaHostAllocWriteCombined; - } - private static final int cudaHostRegisterDefault = (int)0L; - /** - * {@snippet lang=c : - * #define cudaHostRegisterDefault 0 - * } - */ - public static int cudaHostRegisterDefault() { - return cudaHostRegisterDefault; - } - private static final int cudaHostRegisterPortable = (int)1L; - /** - * {@snippet lang=c : - * #define cudaHostRegisterPortable 1 - * } - */ - public static int cudaHostRegisterPortable() { - return cudaHostRegisterPortable; - } - private static final int cudaHostRegisterMapped = (int)2L; - /** - * {@snippet lang=c : - * #define cudaHostRegisterMapped 2 - * } - */ - public static int cudaHostRegisterMapped() { - return cudaHostRegisterMapped; - } - private static final int cudaHostRegisterIoMemory = (int)4L; - /** - * {@snippet lang=c : - * #define cudaHostRegisterIoMemory 4 - * } - */ - public static int cudaHostRegisterIoMemory() { - return cudaHostRegisterIoMemory; - } - private static final int cudaHostRegisterReadOnly = (int)8L; - /** - * {@snippet lang=c : - * #define cudaHostRegisterReadOnly 8 - * } - */ - public static int cudaHostRegisterReadOnly() { - return cudaHostRegisterReadOnly; - } - private static final int cudaPeerAccessDefault = (int)0L; - /** - * {@snippet lang=c : - * #define cudaPeerAccessDefault 0 - * } - */ - public static int cudaPeerAccessDefault() { - return cudaPeerAccessDefault; - } - private static final int cudaStreamDefault = (int)0L; - /** - * {@snippet lang=c : - * #define cudaStreamDefault 0 - * } - */ - public static int cudaStreamDefault() { - return cudaStreamDefault; - } - private static final int cudaStreamNonBlocking = (int)1L; - /** - * {@snippet lang=c : - * #define cudaStreamNonBlocking 1 - * } - */ - public static int cudaStreamNonBlocking() { - return cudaStreamNonBlocking; - } - private static final int cudaEventDefault = (int)0L; - /** - * {@snippet lang=c : - * #define cudaEventDefault 0 - * } - */ - public static int cudaEventDefault() { - return cudaEventDefault; - } - private static final int cudaEventBlockingSync = (int)1L; - /** - * {@snippet lang=c : - * #define cudaEventBlockingSync 1 - * } - */ - public static int cudaEventBlockingSync() { - return cudaEventBlockingSync; - } - private static final int cudaEventDisableTiming = (int)2L; - /** - * {@snippet lang=c : - * #define cudaEventDisableTiming 2 - * } - */ - public static int cudaEventDisableTiming() { - return cudaEventDisableTiming; - } - private static final int cudaEventInterprocess = (int)4L; - /** - * {@snippet lang=c : - * #define cudaEventInterprocess 4 - * } - */ - public static int cudaEventInterprocess() { - return cudaEventInterprocess; - } - private static final int cudaEventRecordDefault = (int)0L; - /** - * {@snippet lang=c : - * #define cudaEventRecordDefault 0 - * } - */ - public static int cudaEventRecordDefault() { - return cudaEventRecordDefault; - } - private static final int cudaEventRecordExternal = (int)1L; - /** - * {@snippet lang=c : - * #define cudaEventRecordExternal 1 - * } - */ - public static int cudaEventRecordExternal() { - return cudaEventRecordExternal; - } - private static final int cudaEventWaitDefault = (int)0L; - /** - * {@snippet lang=c : - * #define cudaEventWaitDefault 0 - * } - */ - public static int cudaEventWaitDefault() { - return cudaEventWaitDefault; - } - private static final int cudaEventWaitExternal = (int)1L; - /** - * {@snippet lang=c : - * #define cudaEventWaitExternal 1 - * } - */ - public static int cudaEventWaitExternal() { - return cudaEventWaitExternal; - } - private static final int cudaDeviceScheduleAuto = (int)0L; - /** - * {@snippet lang=c : - * #define cudaDeviceScheduleAuto 0 - * } - */ - public static int cudaDeviceScheduleAuto() { - return cudaDeviceScheduleAuto; - } - private static final int cudaDeviceScheduleSpin = (int)1L; - /** - * {@snippet lang=c : - * #define cudaDeviceScheduleSpin 1 - * } - */ - public static int cudaDeviceScheduleSpin() { - return cudaDeviceScheduleSpin; - } - private static final int cudaDeviceScheduleYield = (int)2L; - /** - * {@snippet lang=c : - * #define cudaDeviceScheduleYield 2 - * } - */ - public static int cudaDeviceScheduleYield() { - return cudaDeviceScheduleYield; - } - private static final int cudaDeviceScheduleBlockingSync = (int)4L; - /** - * {@snippet lang=c : - * #define cudaDeviceScheduleBlockingSync 4 - * } - */ - public static int cudaDeviceScheduleBlockingSync() { - return cudaDeviceScheduleBlockingSync; - } - private static final int cudaDeviceBlockingSync = (int)4L; - /** - * {@snippet lang=c : - * #define cudaDeviceBlockingSync 4 - * } - */ - public static int cudaDeviceBlockingSync() { - return cudaDeviceBlockingSync; - } - private static final int cudaDeviceScheduleMask = (int)7L; - /** - * {@snippet lang=c : - * #define cudaDeviceScheduleMask 7 - * } - */ - public static int cudaDeviceScheduleMask() { - return cudaDeviceScheduleMask; - } - private static final int cudaDeviceMapHost = (int)8L; - /** - * {@snippet lang=c : - * #define cudaDeviceMapHost 8 - * } - */ - public static int cudaDeviceMapHost() { - return cudaDeviceMapHost; - } - private static final int cudaDeviceLmemResizeToMax = (int)16L; - /** - * {@snippet lang=c : - * #define cudaDeviceLmemResizeToMax 16 - * } - */ - public static int cudaDeviceLmemResizeToMax() { - return cudaDeviceLmemResizeToMax; - } - private static final int cudaDeviceSyncMemops = (int)128L; - /** - * {@snippet lang=c : - * #define cudaDeviceSyncMemops 128 - * } - */ - public static int cudaDeviceSyncMemops() { - return cudaDeviceSyncMemops; - } - private static final int cudaDeviceMask = (int)255L; - /** - * {@snippet lang=c : - * #define cudaDeviceMask 255 - * } - */ - public static int cudaDeviceMask() { - return cudaDeviceMask; - } - private static final int cudaArrayDefault = (int)0L; - /** - * {@snippet lang=c : - * #define cudaArrayDefault 0 - * } - */ - public static int cudaArrayDefault() { - return cudaArrayDefault; - } - private static final int cudaArrayLayered = (int)1L; - /** - * {@snippet lang=c : - * #define cudaArrayLayered 1 - * } - */ - public static int cudaArrayLayered() { - return cudaArrayLayered; - } - private static final int cudaArraySurfaceLoadStore = (int)2L; - /** - * {@snippet lang=c : - * #define cudaArraySurfaceLoadStore 2 - * } - */ - public static int cudaArraySurfaceLoadStore() { - return cudaArraySurfaceLoadStore; - } - private static final int cudaArrayCubemap = (int)4L; - /** - * {@snippet lang=c : - * #define cudaArrayCubemap 4 - * } - */ - public static int cudaArrayCubemap() { - return cudaArrayCubemap; - } - private static final int cudaArrayTextureGather = (int)8L; - /** - * {@snippet lang=c : - * #define cudaArrayTextureGather 8 - * } - */ - public static int cudaArrayTextureGather() { - return cudaArrayTextureGather; - } - private static final int cudaArrayColorAttachment = (int)32L; - /** - * {@snippet lang=c : - * #define cudaArrayColorAttachment 32 - * } - */ - public static int cudaArrayColorAttachment() { - return cudaArrayColorAttachment; - } - private static final int cudaArraySparse = (int)64L; - /** - * {@snippet lang=c : - * #define cudaArraySparse 64 - * } - */ - public static int cudaArraySparse() { - return cudaArraySparse; - } - private static final int cudaArrayDeferredMapping = (int)128L; - /** - * {@snippet lang=c : - * #define cudaArrayDeferredMapping 128 - * } - */ - public static int cudaArrayDeferredMapping() { - return cudaArrayDeferredMapping; - } - private static final int cudaIpcMemLazyEnablePeerAccess = (int)1L; - /** - * {@snippet lang=c : - * #define cudaIpcMemLazyEnablePeerAccess 1 - * } - */ - public static int cudaIpcMemLazyEnablePeerAccess() { - return cudaIpcMemLazyEnablePeerAccess; - } - private static final int cudaMemAttachGlobal = (int)1L; - /** - * {@snippet lang=c : - * #define cudaMemAttachGlobal 1 - * } - */ - public static int cudaMemAttachGlobal() { - return cudaMemAttachGlobal; - } - private static final int cudaMemAttachHost = (int)2L; - /** - * {@snippet lang=c : - * #define cudaMemAttachHost 2 - * } - */ - public static int cudaMemAttachHost() { - return cudaMemAttachHost; - } - private static final int cudaMemAttachSingle = (int)4L; - /** - * {@snippet lang=c : - * #define cudaMemAttachSingle 4 - * } - */ - public static int cudaMemAttachSingle() { - return cudaMemAttachSingle; - } - private static final int cudaOccupancyDefault = (int)0L; - /** - * {@snippet lang=c : - * #define cudaOccupancyDefault 0 - * } - */ - public static int cudaOccupancyDefault() { - return cudaOccupancyDefault; - } - private static final int cudaOccupancyDisableCachingOverride = (int)1L; - /** - * {@snippet lang=c : - * #define cudaOccupancyDisableCachingOverride 1 - * } - */ - public static int cudaOccupancyDisableCachingOverride() { - return cudaOccupancyDisableCachingOverride; - } - private static final int cudaInitDeviceFlagsAreValid = (int)1L; - /** - * {@snippet lang=c : - * #define cudaInitDeviceFlagsAreValid 1 - * } - */ - public static int cudaInitDeviceFlagsAreValid() { - return cudaInitDeviceFlagsAreValid; - } - private static final int cudaCooperativeLaunchMultiDeviceNoPreSync = (int)1L; - /** - * {@snippet lang=c : - * #define cudaCooperativeLaunchMultiDeviceNoPreSync 1 - * } - */ - public static int cudaCooperativeLaunchMultiDeviceNoPreSync() { - return cudaCooperativeLaunchMultiDeviceNoPreSync; - } - private static final int cudaCooperativeLaunchMultiDeviceNoPostSync = (int)2L; - /** - * {@snippet lang=c : - * #define cudaCooperativeLaunchMultiDeviceNoPostSync 2 - * } - */ - public static int cudaCooperativeLaunchMultiDeviceNoPostSync() { - return cudaCooperativeLaunchMultiDeviceNoPostSync; - } - private static final int cudaArraySparsePropertiesSingleMipTail = (int)1L; - /** - * {@snippet lang=c : - * #define cudaArraySparsePropertiesSingleMipTail 1 - * } - */ - public static int cudaArraySparsePropertiesSingleMipTail() { - return cudaArraySparsePropertiesSingleMipTail; - } - private static final int CUDA_IPC_HANDLE_SIZE = (int)64L; - /** - * {@snippet lang=c : - * #define CUDA_IPC_HANDLE_SIZE 64 - * } - */ - public static int CUDA_IPC_HANDLE_SIZE() { - return CUDA_IPC_HANDLE_SIZE; - } - private static final int cudaExternalMemoryDedicated = (int)1L; - /** - * {@snippet lang=c : - * #define cudaExternalMemoryDedicated 1 - * } - */ - public static int cudaExternalMemoryDedicated() { - return cudaExternalMemoryDedicated; - } - private static final int cudaExternalSemaphoreSignalSkipNvSciBufMemSync = (int)1L; - /** - * {@snippet lang=c : - * #define cudaExternalSemaphoreSignalSkipNvSciBufMemSync 1 - * } - */ - public static int cudaExternalSemaphoreSignalSkipNvSciBufMemSync() { - return cudaExternalSemaphoreSignalSkipNvSciBufMemSync; - } - private static final int cudaExternalSemaphoreWaitSkipNvSciBufMemSync = (int)2L; - /** - * {@snippet lang=c : - * #define cudaExternalSemaphoreWaitSkipNvSciBufMemSync 2 - * } - */ - public static int cudaExternalSemaphoreWaitSkipNvSciBufMemSync() { - return cudaExternalSemaphoreWaitSkipNvSciBufMemSync; - } - private static final int cudaNvSciSyncAttrSignal = (int)1L; - /** - * {@snippet lang=c : - * #define cudaNvSciSyncAttrSignal 1 - * } - */ - public static int cudaNvSciSyncAttrSignal() { - return cudaNvSciSyncAttrSignal; - } - private static final int cudaNvSciSyncAttrWait = (int)2L; - /** - * {@snippet lang=c : - * #define cudaNvSciSyncAttrWait 2 - * } - */ - public static int cudaNvSciSyncAttrWait() { - return cudaNvSciSyncAttrWait; - } - private static final int cudaGraphKernelNodePortDefault = (int)0L; - /** - * {@snippet lang=c : - * #define cudaGraphKernelNodePortDefault 0 - * } - */ - public static int cudaGraphKernelNodePortDefault() { - return cudaGraphKernelNodePortDefault; - } - private static final int cudaGraphKernelNodePortProgrammatic = (int)1L; - /** - * {@snippet lang=c : - * #define cudaGraphKernelNodePortProgrammatic 1 - * } - */ - public static int cudaGraphKernelNodePortProgrammatic() { - return cudaGraphKernelNodePortProgrammatic; - } - private static final int cudaGraphKernelNodePortLaunchCompletion = (int)2L; - /** - * {@snippet lang=c : - * #define cudaGraphKernelNodePortLaunchCompletion 2 - * } - */ - public static int cudaGraphKernelNodePortLaunchCompletion() { - return cudaGraphKernelNodePortLaunchCompletion; - } - private static final int cudaSurfaceType1D = (int)1L; - /** - * {@snippet lang=c : - * #define cudaSurfaceType1D 1 - * } - */ - public static int cudaSurfaceType1D() { - return cudaSurfaceType1D; - } - private static final int cudaSurfaceType2D = (int)2L; - /** - * {@snippet lang=c : - * #define cudaSurfaceType2D 2 - * } - */ - public static int cudaSurfaceType2D() { - return cudaSurfaceType2D; - } - private static final int cudaSurfaceType3D = (int)3L; - /** - * {@snippet lang=c : - * #define cudaSurfaceType3D 3 - * } - */ - public static int cudaSurfaceType3D() { - return cudaSurfaceType3D; - } - private static final int cudaSurfaceTypeCubemap = (int)12L; - /** - * {@snippet lang=c : - * #define cudaSurfaceTypeCubemap 12 - * } - */ - public static int cudaSurfaceTypeCubemap() { - return cudaSurfaceTypeCubemap; - } - private static final int cudaSurfaceType1DLayered = (int)241L; - /** - * {@snippet lang=c : - * #define cudaSurfaceType1DLayered 241 - * } - */ - public static int cudaSurfaceType1DLayered() { - return cudaSurfaceType1DLayered; - } - private static final int cudaSurfaceType2DLayered = (int)242L; - /** - * {@snippet lang=c : - * #define cudaSurfaceType2DLayered 242 - * } - */ - public static int cudaSurfaceType2DLayered() { - return cudaSurfaceType2DLayered; - } - private static final int cudaSurfaceTypeCubemapLayered = (int)252L; - /** - * {@snippet lang=c : - * #define cudaSurfaceTypeCubemapLayered 252 - * } - */ - public static int cudaSurfaceTypeCubemapLayered() { - return cudaSurfaceTypeCubemapLayered; - } - private static final int cudaTextureType1D = (int)1L; - /** - * {@snippet lang=c : - * #define cudaTextureType1D 1 - * } - */ - public static int cudaTextureType1D() { - return cudaTextureType1D; - } - private static final int cudaTextureType2D = (int)2L; - /** - * {@snippet lang=c : - * #define cudaTextureType2D 2 - * } - */ - public static int cudaTextureType2D() { - return cudaTextureType2D; - } - private static final int cudaTextureType3D = (int)3L; - /** - * {@snippet lang=c : - * #define cudaTextureType3D 3 - * } - */ - public static int cudaTextureType3D() { - return cudaTextureType3D; - } - private static final int cudaTextureTypeCubemap = (int)12L; - /** - * {@snippet lang=c : - * #define cudaTextureTypeCubemap 12 - * } - */ - public static int cudaTextureTypeCubemap() { - return cudaTextureTypeCubemap; - } - private static final int cudaTextureType1DLayered = (int)241L; - /** - * {@snippet lang=c : - * #define cudaTextureType1DLayered 241 - * } - */ - public static int cudaTextureType1DLayered() { - return cudaTextureType1DLayered; - } - private static final int cudaTextureType2DLayered = (int)242L; - /** - * {@snippet lang=c : - * #define cudaTextureType2DLayered 242 - * } - */ - public static int cudaTextureType2DLayered() { - return cudaTextureType2DLayered; - } - private static final int cudaTextureTypeCubemapLayered = (int)252L; - /** - * {@snippet lang=c : - * #define cudaTextureTypeCubemapLayered 252 - * } - */ - public static int cudaTextureTypeCubemapLayered() { - return cudaTextureTypeCubemapLayered; - } - private static final int CUDART_VERSION = (int)12060L; - /** - * {@snippet lang=c : - * #define CUDART_VERSION 12060 - * } - */ - public static int CUDART_VERSION() { - return CUDART_VERSION; - } - private static final int true_ = (int)1L; - /** - * {@snippet lang=c : - * #define true 1 - * } - */ - public static int true_() { - return true_; - } - private static final int false_ = (int)0L; - /** - * {@snippet lang=c : - * #define false 0 - * } - */ - public static int false_() { - return false_; - } - private static final int __bool_true_false_are_defined = (int)1L; - /** - * {@snippet lang=c : - * #define __bool_true_false_are_defined 1 - * } - */ - public static int __bool_true_false_are_defined() { - return __bool_true_false_are_defined; - } - private static final int _STDINT_H = (int)1L; - /** - * {@snippet lang=c : - * #define _STDINT_H 1 - * } - */ - public static int _STDINT_H() { - return _STDINT_H; - } - private static final int _BITS_TYPES_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_TYPES_H 1 - * } - */ - public static int _BITS_TYPES_H() { - return _BITS_TYPES_H; - } - private static final int _BITS_TYPESIZES_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_TYPESIZES_H 1 - * } - */ - public static int _BITS_TYPESIZES_H() { - return _BITS_TYPESIZES_H; - } - private static final int __OFF_T_MATCHES_OFF64_T = (int)1L; - /** - * {@snippet lang=c : - * #define __OFF_T_MATCHES_OFF64_T 1 - * } - */ - public static int __OFF_T_MATCHES_OFF64_T() { - return __OFF_T_MATCHES_OFF64_T; - } - private static final int __INO_T_MATCHES_INO64_T = (int)1L; - /** - * {@snippet lang=c : - * #define __INO_T_MATCHES_INO64_T 1 - * } - */ - public static int __INO_T_MATCHES_INO64_T() { - return __INO_T_MATCHES_INO64_T; - } - private static final int __RLIM_T_MATCHES_RLIM64_T = (int)1L; - /** - * {@snippet lang=c : - * #define __RLIM_T_MATCHES_RLIM64_T 1 - * } - */ - public static int __RLIM_T_MATCHES_RLIM64_T() { - return __RLIM_T_MATCHES_RLIM64_T; - } - private static final int __STATFS_MATCHES_STATFS64 = (int)1L; - /** - * {@snippet lang=c : - * #define __STATFS_MATCHES_STATFS64 1 - * } - */ - public static int __STATFS_MATCHES_STATFS64() { - return __STATFS_MATCHES_STATFS64; - } - private static final int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = (int)1L; - /** - * {@snippet lang=c : - * #define __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 1 - * } - */ - public static int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64() { - return __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64; - } - private static final int __FD_SETSIZE = (int)1024L; - /** - * {@snippet lang=c : - * #define __FD_SETSIZE 1024 - * } - */ - public static int __FD_SETSIZE() { - return __FD_SETSIZE; - } - private static final int _BITS_TIME64_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_TIME64_H 1 - * } - */ - public static int _BITS_TIME64_H() { - return _BITS_TIME64_H; - } - private static final int _BITS_WCHAR_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_WCHAR_H 1 - * } - */ - public static int _BITS_WCHAR_H() { - return _BITS_WCHAR_H; - } - private static final int _BITS_STDINT_INTN_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_STDINT_INTN_H 1 - * } - */ - public static int _BITS_STDINT_INTN_H() { - return _BITS_STDINT_INTN_H; - } - private static final int _BITS_STDINT_UINTN_H = (int)1L; - /** - * {@snippet lang=c : - * #define _BITS_STDINT_UINTN_H 1 - * } - */ - public static int _BITS_STDINT_UINTN_H() { - return _BITS_STDINT_UINTN_H; - } - private static final int DLPACK_VERSION = (int)80L; - /** - * {@snippet lang=c : - * #define DLPACK_VERSION 80 - * } - */ - public static int DLPACK_VERSION() { - return DLPACK_VERSION; - } - private static final int DLPACK_ABI_VERSION = (int)1L; - /** - * {@snippet lang=c : - * #define DLPACK_ABI_VERSION 1 - * } - */ - public static int DLPACK_ABI_VERSION() { - return DLPACK_ABI_VERSION; - } - private static final int cudaRoundNearest = (int)0L; - /** - * {@snippet lang=c : - * enum cudaRoundMode.cudaRoundNearest = 0 - * } - */ - public static int cudaRoundNearest() { - return cudaRoundNearest; - } - private static final int cudaRoundZero = (int)1L; - /** - * {@snippet lang=c : - * enum cudaRoundMode.cudaRoundZero = 1 - * } - */ - public static int cudaRoundZero() { - return cudaRoundZero; - } - private static final int cudaRoundPosInf = (int)2L; - /** - * {@snippet lang=c : - * enum cudaRoundMode.cudaRoundPosInf = 2 - * } - */ - public static int cudaRoundPosInf() { - return cudaRoundPosInf; - } - private static final int cudaRoundMinInf = (int)3L; - /** - * {@snippet lang=c : - * enum cudaRoundMode.cudaRoundMinInf = 3 - * } - */ - public static int cudaRoundMinInf() { - return cudaRoundMinInf; - } - /** - * {@snippet lang=c : - * typedef long ptrdiff_t - * } - */ - public static final OfLong ptrdiff_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef unsigned long size_t - * } - */ - public static final OfLong size_t = PanamaFFMAPI.C_LONG; - /** - * {@snippet lang=c : - * typedef int wchar_t - * } - */ - public static final OfInt wchar_t = PanamaFFMAPI.C_INT; - private static final int cudaSuccess = (int)0L; - /** - * {@snippet lang=c : - * enum cudaError.cudaSuccess = 0 - * } - */ - public static int cudaSuccess() { - return cudaSuccess; - } - private static final int cudaErrorInvalidValue = (int)1L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidValue = 1 - * } - */ - public static int cudaErrorInvalidValue() { - return cudaErrorInvalidValue; - } - private static final int cudaErrorMemoryAllocation = (int)2L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMemoryAllocation = 2 - * } - */ - public static int cudaErrorMemoryAllocation() { - return cudaErrorMemoryAllocation; - } - private static final int cudaErrorInitializationError = (int)3L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInitializationError = 3 - * } - */ - public static int cudaErrorInitializationError() { - return cudaErrorInitializationError; - } - private static final int cudaErrorCudartUnloading = (int)4L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorCudartUnloading = 4 - * } - */ - public static int cudaErrorCudartUnloading() { - return cudaErrorCudartUnloading; - } - private static final int cudaErrorProfilerDisabled = (int)5L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorProfilerDisabled = 5 - * } - */ - public static int cudaErrorProfilerDisabled() { - return cudaErrorProfilerDisabled; - } - private static final int cudaErrorProfilerNotInitialized = (int)6L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorProfilerNotInitialized = 6 - * } - */ - public static int cudaErrorProfilerNotInitialized() { - return cudaErrorProfilerNotInitialized; - } - private static final int cudaErrorProfilerAlreadyStarted = (int)7L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorProfilerAlreadyStarted = 7 - * } - */ - public static int cudaErrorProfilerAlreadyStarted() { - return cudaErrorProfilerAlreadyStarted; - } - private static final int cudaErrorProfilerAlreadyStopped = (int)8L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorProfilerAlreadyStopped = 8 - * } - */ - public static int cudaErrorProfilerAlreadyStopped() { - return cudaErrorProfilerAlreadyStopped; - } - private static final int cudaErrorInvalidConfiguration = (int)9L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidConfiguration = 9 - * } - */ - public static int cudaErrorInvalidConfiguration() { - return cudaErrorInvalidConfiguration; - } - private static final int cudaErrorInvalidPitchValue = (int)12L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidPitchValue = 12 - * } - */ - public static int cudaErrorInvalidPitchValue() { - return cudaErrorInvalidPitchValue; - } - private static final int cudaErrorInvalidSymbol = (int)13L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidSymbol = 13 - * } - */ - public static int cudaErrorInvalidSymbol() { - return cudaErrorInvalidSymbol; - } - private static final int cudaErrorInvalidHostPointer = (int)16L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidHostPointer = 16 - * } - */ - public static int cudaErrorInvalidHostPointer() { - return cudaErrorInvalidHostPointer; - } - private static final int cudaErrorInvalidDevicePointer = (int)17L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidDevicePointer = 17 - * } - */ - public static int cudaErrorInvalidDevicePointer() { - return cudaErrorInvalidDevicePointer; - } - private static final int cudaErrorInvalidTexture = (int)18L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidTexture = 18 - * } - */ - public static int cudaErrorInvalidTexture() { - return cudaErrorInvalidTexture; - } - private static final int cudaErrorInvalidTextureBinding = (int)19L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidTextureBinding = 19 - * } - */ - public static int cudaErrorInvalidTextureBinding() { - return cudaErrorInvalidTextureBinding; - } - private static final int cudaErrorInvalidChannelDescriptor = (int)20L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidChannelDescriptor = 20 - * } - */ - public static int cudaErrorInvalidChannelDescriptor() { - return cudaErrorInvalidChannelDescriptor; - } - private static final int cudaErrorInvalidMemcpyDirection = (int)21L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidMemcpyDirection = 21 - * } - */ - public static int cudaErrorInvalidMemcpyDirection() { - return cudaErrorInvalidMemcpyDirection; - } - private static final int cudaErrorAddressOfConstant = (int)22L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorAddressOfConstant = 22 - * } - */ - public static int cudaErrorAddressOfConstant() { - return cudaErrorAddressOfConstant; - } - private static final int cudaErrorTextureFetchFailed = (int)23L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorTextureFetchFailed = 23 - * } - */ - public static int cudaErrorTextureFetchFailed() { - return cudaErrorTextureFetchFailed; - } - private static final int cudaErrorTextureNotBound = (int)24L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorTextureNotBound = 24 - * } - */ - public static int cudaErrorTextureNotBound() { - return cudaErrorTextureNotBound; - } - private static final int cudaErrorSynchronizationError = (int)25L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorSynchronizationError = 25 - * } - */ - public static int cudaErrorSynchronizationError() { - return cudaErrorSynchronizationError; - } - private static final int cudaErrorInvalidFilterSetting = (int)26L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidFilterSetting = 26 - * } - */ - public static int cudaErrorInvalidFilterSetting() { - return cudaErrorInvalidFilterSetting; - } - private static final int cudaErrorInvalidNormSetting = (int)27L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidNormSetting = 27 - * } - */ - public static int cudaErrorInvalidNormSetting() { - return cudaErrorInvalidNormSetting; - } - private static final int cudaErrorMixedDeviceExecution = (int)28L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMixedDeviceExecution = 28 - * } - */ - public static int cudaErrorMixedDeviceExecution() { - return cudaErrorMixedDeviceExecution; - } - private static final int cudaErrorNotYetImplemented = (int)31L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorNotYetImplemented = 31 - * } - */ - public static int cudaErrorNotYetImplemented() { - return cudaErrorNotYetImplemented; - } - private static final int cudaErrorMemoryValueTooLarge = (int)32L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMemoryValueTooLarge = 32 - * } - */ - public static int cudaErrorMemoryValueTooLarge() { - return cudaErrorMemoryValueTooLarge; - } - private static final int cudaErrorStubLibrary = (int)34L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorStubLibrary = 34 - * } - */ - public static int cudaErrorStubLibrary() { - return cudaErrorStubLibrary; - } - private static final int cudaErrorInsufficientDriver = (int)35L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInsufficientDriver = 35 - * } - */ - public static int cudaErrorInsufficientDriver() { - return cudaErrorInsufficientDriver; - } - private static final int cudaErrorCallRequiresNewerDriver = (int)36L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorCallRequiresNewerDriver = 36 - * } - */ - public static int cudaErrorCallRequiresNewerDriver() { - return cudaErrorCallRequiresNewerDriver; - } - private static final int cudaErrorInvalidSurface = (int)37L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidSurface = 37 - * } - */ - public static int cudaErrorInvalidSurface() { - return cudaErrorInvalidSurface; - } - private static final int cudaErrorDuplicateVariableName = (int)43L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorDuplicateVariableName = 43 - * } - */ - public static int cudaErrorDuplicateVariableName() { - return cudaErrorDuplicateVariableName; - } - private static final int cudaErrorDuplicateTextureName = (int)44L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorDuplicateTextureName = 44 - * } - */ - public static int cudaErrorDuplicateTextureName() { - return cudaErrorDuplicateTextureName; - } - private static final int cudaErrorDuplicateSurfaceName = (int)45L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorDuplicateSurfaceName = 45 - * } - */ - public static int cudaErrorDuplicateSurfaceName() { - return cudaErrorDuplicateSurfaceName; - } - private static final int cudaErrorDevicesUnavailable = (int)46L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorDevicesUnavailable = 46 - * } - */ - public static int cudaErrorDevicesUnavailable() { - return cudaErrorDevicesUnavailable; - } - private static final int cudaErrorIncompatibleDriverContext = (int)49L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorIncompatibleDriverContext = 49 - * } - */ - public static int cudaErrorIncompatibleDriverContext() { - return cudaErrorIncompatibleDriverContext; - } - private static final int cudaErrorMissingConfiguration = (int)52L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMissingConfiguration = 52 - * } - */ - public static int cudaErrorMissingConfiguration() { - return cudaErrorMissingConfiguration; - } - private static final int cudaErrorPriorLaunchFailure = (int)53L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorPriorLaunchFailure = 53 - * } - */ - public static int cudaErrorPriorLaunchFailure() { - return cudaErrorPriorLaunchFailure; - } - private static final int cudaErrorLaunchMaxDepthExceeded = (int)65L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorLaunchMaxDepthExceeded = 65 - * } - */ - public static int cudaErrorLaunchMaxDepthExceeded() { - return cudaErrorLaunchMaxDepthExceeded; - } - private static final int cudaErrorLaunchFileScopedTex = (int)66L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorLaunchFileScopedTex = 66 - * } - */ - public static int cudaErrorLaunchFileScopedTex() { - return cudaErrorLaunchFileScopedTex; - } - private static final int cudaErrorLaunchFileScopedSurf = (int)67L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorLaunchFileScopedSurf = 67 - * } - */ - public static int cudaErrorLaunchFileScopedSurf() { - return cudaErrorLaunchFileScopedSurf; - } - private static final int cudaErrorSyncDepthExceeded = (int)68L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorSyncDepthExceeded = 68 - * } - */ - public static int cudaErrorSyncDepthExceeded() { - return cudaErrorSyncDepthExceeded; - } - private static final int cudaErrorLaunchPendingCountExceeded = (int)69L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorLaunchPendingCountExceeded = 69 - * } - */ - public static int cudaErrorLaunchPendingCountExceeded() { - return cudaErrorLaunchPendingCountExceeded; - } - private static final int cudaErrorInvalidDeviceFunction = (int)98L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidDeviceFunction = 98 - * } - */ - public static int cudaErrorInvalidDeviceFunction() { - return cudaErrorInvalidDeviceFunction; - } - private static final int cudaErrorNoDevice = (int)100L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorNoDevice = 100 - * } - */ - public static int cudaErrorNoDevice() { - return cudaErrorNoDevice; - } - private static final int cudaErrorInvalidDevice = (int)101L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidDevice = 101 - * } - */ - public static int cudaErrorInvalidDevice() { - return cudaErrorInvalidDevice; - } - private static final int cudaErrorDeviceNotLicensed = (int)102L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorDeviceNotLicensed = 102 - * } - */ - public static int cudaErrorDeviceNotLicensed() { - return cudaErrorDeviceNotLicensed; - } - private static final int cudaErrorSoftwareValidityNotEstablished = (int)103L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorSoftwareValidityNotEstablished = 103 - * } - */ - public static int cudaErrorSoftwareValidityNotEstablished() { - return cudaErrorSoftwareValidityNotEstablished; - } - private static final int cudaErrorStartupFailure = (int)127L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorStartupFailure = 127 - * } - */ - public static int cudaErrorStartupFailure() { - return cudaErrorStartupFailure; - } - private static final int cudaErrorInvalidKernelImage = (int)200L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidKernelImage = 200 - * } - */ - public static int cudaErrorInvalidKernelImage() { - return cudaErrorInvalidKernelImage; - } - private static final int cudaErrorDeviceUninitialized = (int)201L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorDeviceUninitialized = 201 - * } - */ - public static int cudaErrorDeviceUninitialized() { - return cudaErrorDeviceUninitialized; - } - private static final int cudaErrorMapBufferObjectFailed = (int)205L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMapBufferObjectFailed = 205 - * } - */ - public static int cudaErrorMapBufferObjectFailed() { - return cudaErrorMapBufferObjectFailed; - } - private static final int cudaErrorUnmapBufferObjectFailed = (int)206L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorUnmapBufferObjectFailed = 206 - * } - */ - public static int cudaErrorUnmapBufferObjectFailed() { - return cudaErrorUnmapBufferObjectFailed; - } - private static final int cudaErrorArrayIsMapped = (int)207L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorArrayIsMapped = 207 - * } - */ - public static int cudaErrorArrayIsMapped() { - return cudaErrorArrayIsMapped; - } - private static final int cudaErrorAlreadyMapped = (int)208L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorAlreadyMapped = 208 - * } - */ - public static int cudaErrorAlreadyMapped() { - return cudaErrorAlreadyMapped; - } - private static final int cudaErrorNoKernelImageForDevice = (int)209L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorNoKernelImageForDevice = 209 - * } - */ - public static int cudaErrorNoKernelImageForDevice() { - return cudaErrorNoKernelImageForDevice; - } - private static final int cudaErrorAlreadyAcquired = (int)210L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorAlreadyAcquired = 210 - * } - */ - public static int cudaErrorAlreadyAcquired() { - return cudaErrorAlreadyAcquired; - } - private static final int cudaErrorNotMapped = (int)211L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorNotMapped = 211 - * } - */ - public static int cudaErrorNotMapped() { - return cudaErrorNotMapped; - } - private static final int cudaErrorNotMappedAsArray = (int)212L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorNotMappedAsArray = 212 - * } - */ - public static int cudaErrorNotMappedAsArray() { - return cudaErrorNotMappedAsArray; - } - private static final int cudaErrorNotMappedAsPointer = (int)213L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorNotMappedAsPointer = 213 - * } - */ - public static int cudaErrorNotMappedAsPointer() { - return cudaErrorNotMappedAsPointer; - } - private static final int cudaErrorECCUncorrectable = (int)214L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorECCUncorrectable = 214 - * } - */ - public static int cudaErrorECCUncorrectable() { - return cudaErrorECCUncorrectable; - } - private static final int cudaErrorUnsupportedLimit = (int)215L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorUnsupportedLimit = 215 - * } - */ - public static int cudaErrorUnsupportedLimit() { - return cudaErrorUnsupportedLimit; - } - private static final int cudaErrorDeviceAlreadyInUse = (int)216L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorDeviceAlreadyInUse = 216 - * } - */ - public static int cudaErrorDeviceAlreadyInUse() { - return cudaErrorDeviceAlreadyInUse; - } - private static final int cudaErrorPeerAccessUnsupported = (int)217L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorPeerAccessUnsupported = 217 - * } - */ - public static int cudaErrorPeerAccessUnsupported() { - return cudaErrorPeerAccessUnsupported; - } - private static final int cudaErrorInvalidPtx = (int)218L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidPtx = 218 - * } - */ - public static int cudaErrorInvalidPtx() { - return cudaErrorInvalidPtx; - } - private static final int cudaErrorInvalidGraphicsContext = (int)219L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidGraphicsContext = 219 - * } - */ - public static int cudaErrorInvalidGraphicsContext() { - return cudaErrorInvalidGraphicsContext; - } - private static final int cudaErrorNvlinkUncorrectable = (int)220L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorNvlinkUncorrectable = 220 - * } - */ - public static int cudaErrorNvlinkUncorrectable() { - return cudaErrorNvlinkUncorrectable; - } - private static final int cudaErrorJitCompilerNotFound = (int)221L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorJitCompilerNotFound = 221 - * } - */ - public static int cudaErrorJitCompilerNotFound() { - return cudaErrorJitCompilerNotFound; - } - private static final int cudaErrorUnsupportedPtxVersion = (int)222L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorUnsupportedPtxVersion = 222 - * } - */ - public static int cudaErrorUnsupportedPtxVersion() { - return cudaErrorUnsupportedPtxVersion; - } - private static final int cudaErrorJitCompilationDisabled = (int)223L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorJitCompilationDisabled = 223 - * } - */ - public static int cudaErrorJitCompilationDisabled() { - return cudaErrorJitCompilationDisabled; - } - private static final int cudaErrorUnsupportedExecAffinity = (int)224L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorUnsupportedExecAffinity = 224 - * } - */ - public static int cudaErrorUnsupportedExecAffinity() { - return cudaErrorUnsupportedExecAffinity; - } - private static final int cudaErrorUnsupportedDevSideSync = (int)225L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorUnsupportedDevSideSync = 225 - * } - */ - public static int cudaErrorUnsupportedDevSideSync() { - return cudaErrorUnsupportedDevSideSync; - } - private static final int cudaErrorInvalidSource = (int)300L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidSource = 300 - * } - */ - public static int cudaErrorInvalidSource() { - return cudaErrorInvalidSource; - } - private static final int cudaErrorFileNotFound = (int)301L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorFileNotFound = 301 - * } - */ - public static int cudaErrorFileNotFound() { - return cudaErrorFileNotFound; - } - private static final int cudaErrorSharedObjectSymbolNotFound = (int)302L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorSharedObjectSymbolNotFound = 302 - * } - */ - public static int cudaErrorSharedObjectSymbolNotFound() { - return cudaErrorSharedObjectSymbolNotFound; - } - private static final int cudaErrorSharedObjectInitFailed = (int)303L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorSharedObjectInitFailed = 303 - * } - */ - public static int cudaErrorSharedObjectInitFailed() { - return cudaErrorSharedObjectInitFailed; - } - private static final int cudaErrorOperatingSystem = (int)304L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorOperatingSystem = 304 - * } - */ - public static int cudaErrorOperatingSystem() { - return cudaErrorOperatingSystem; - } - private static final int cudaErrorInvalidResourceHandle = (int)400L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidResourceHandle = 400 - * } - */ - public static int cudaErrorInvalidResourceHandle() { - return cudaErrorInvalidResourceHandle; - } - private static final int cudaErrorIllegalState = (int)401L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorIllegalState = 401 - * } - */ - public static int cudaErrorIllegalState() { - return cudaErrorIllegalState; - } - private static final int cudaErrorLossyQuery = (int)402L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorLossyQuery = 402 - * } - */ - public static int cudaErrorLossyQuery() { - return cudaErrorLossyQuery; - } - private static final int cudaErrorSymbolNotFound = (int)500L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorSymbolNotFound = 500 - * } - */ - public static int cudaErrorSymbolNotFound() { - return cudaErrorSymbolNotFound; - } - private static final int cudaErrorNotReady = (int)600L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorNotReady = 600 - * } - */ - public static int cudaErrorNotReady() { - return cudaErrorNotReady; - } - private static final int cudaErrorIllegalAddress = (int)700L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorIllegalAddress = 700 - * } - */ - public static int cudaErrorIllegalAddress() { - return cudaErrorIllegalAddress; - } - private static final int cudaErrorLaunchOutOfResources = (int)701L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorLaunchOutOfResources = 701 - * } - */ - public static int cudaErrorLaunchOutOfResources() { - return cudaErrorLaunchOutOfResources; - } - private static final int cudaErrorLaunchTimeout = (int)702L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorLaunchTimeout = 702 - * } - */ - public static int cudaErrorLaunchTimeout() { - return cudaErrorLaunchTimeout; - } - private static final int cudaErrorLaunchIncompatibleTexturing = (int)703L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorLaunchIncompatibleTexturing = 703 - * } - */ - public static int cudaErrorLaunchIncompatibleTexturing() { - return cudaErrorLaunchIncompatibleTexturing; - } - private static final int cudaErrorPeerAccessAlreadyEnabled = (int)704L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorPeerAccessAlreadyEnabled = 704 - * } - */ - public static int cudaErrorPeerAccessAlreadyEnabled() { - return cudaErrorPeerAccessAlreadyEnabled; - } - private static final int cudaErrorPeerAccessNotEnabled = (int)705L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorPeerAccessNotEnabled = 705 - * } - */ - public static int cudaErrorPeerAccessNotEnabled() { - return cudaErrorPeerAccessNotEnabled; - } - private static final int cudaErrorSetOnActiveProcess = (int)708L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorSetOnActiveProcess = 708 - * } - */ - public static int cudaErrorSetOnActiveProcess() { - return cudaErrorSetOnActiveProcess; - } - private static final int cudaErrorContextIsDestroyed = (int)709L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorContextIsDestroyed = 709 - * } - */ - public static int cudaErrorContextIsDestroyed() { - return cudaErrorContextIsDestroyed; - } - private static final int cudaErrorAssert = (int)710L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorAssert = 710 - * } - */ - public static int cudaErrorAssert() { - return cudaErrorAssert; - } - private static final int cudaErrorTooManyPeers = (int)711L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorTooManyPeers = 711 - * } - */ - public static int cudaErrorTooManyPeers() { - return cudaErrorTooManyPeers; - } - private static final int cudaErrorHostMemoryAlreadyRegistered = (int)712L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorHostMemoryAlreadyRegistered = 712 - * } - */ - public static int cudaErrorHostMemoryAlreadyRegistered() { - return cudaErrorHostMemoryAlreadyRegistered; - } - private static final int cudaErrorHostMemoryNotRegistered = (int)713L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorHostMemoryNotRegistered = 713 - * } - */ - public static int cudaErrorHostMemoryNotRegistered() { - return cudaErrorHostMemoryNotRegistered; - } - private static final int cudaErrorHardwareStackError = (int)714L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorHardwareStackError = 714 - * } - */ - public static int cudaErrorHardwareStackError() { - return cudaErrorHardwareStackError; - } - private static final int cudaErrorIllegalInstruction = (int)715L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorIllegalInstruction = 715 - * } - */ - public static int cudaErrorIllegalInstruction() { - return cudaErrorIllegalInstruction; - } - private static final int cudaErrorMisalignedAddress = (int)716L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMisalignedAddress = 716 - * } - */ - public static int cudaErrorMisalignedAddress() { - return cudaErrorMisalignedAddress; - } - private static final int cudaErrorInvalidAddressSpace = (int)717L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidAddressSpace = 717 - * } - */ - public static int cudaErrorInvalidAddressSpace() { - return cudaErrorInvalidAddressSpace; - } - private static final int cudaErrorInvalidPc = (int)718L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidPc = 718 - * } - */ - public static int cudaErrorInvalidPc() { - return cudaErrorInvalidPc; - } - private static final int cudaErrorLaunchFailure = (int)719L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorLaunchFailure = 719 - * } - */ - public static int cudaErrorLaunchFailure() { - return cudaErrorLaunchFailure; - } - private static final int cudaErrorCooperativeLaunchTooLarge = (int)720L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorCooperativeLaunchTooLarge = 720 - * } - */ - public static int cudaErrorCooperativeLaunchTooLarge() { - return cudaErrorCooperativeLaunchTooLarge; - } - private static final int cudaErrorNotPermitted = (int)800L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorNotPermitted = 800 - * } - */ - public static int cudaErrorNotPermitted() { - return cudaErrorNotPermitted; - } - private static final int cudaErrorNotSupported = (int)801L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorNotSupported = 801 - * } - */ - public static int cudaErrorNotSupported() { - return cudaErrorNotSupported; - } - private static final int cudaErrorSystemNotReady = (int)802L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorSystemNotReady = 802 - * } - */ - public static int cudaErrorSystemNotReady() { - return cudaErrorSystemNotReady; - } - private static final int cudaErrorSystemDriverMismatch = (int)803L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorSystemDriverMismatch = 803 - * } - */ - public static int cudaErrorSystemDriverMismatch() { - return cudaErrorSystemDriverMismatch; - } - private static final int cudaErrorCompatNotSupportedOnDevice = (int)804L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorCompatNotSupportedOnDevice = 804 - * } - */ - public static int cudaErrorCompatNotSupportedOnDevice() { - return cudaErrorCompatNotSupportedOnDevice; - } - private static final int cudaErrorMpsConnectionFailed = (int)805L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMpsConnectionFailed = 805 - * } - */ - public static int cudaErrorMpsConnectionFailed() { - return cudaErrorMpsConnectionFailed; - } - private static final int cudaErrorMpsRpcFailure = (int)806L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMpsRpcFailure = 806 - * } - */ - public static int cudaErrorMpsRpcFailure() { - return cudaErrorMpsRpcFailure; - } - private static final int cudaErrorMpsServerNotReady = (int)807L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMpsServerNotReady = 807 - * } - */ - public static int cudaErrorMpsServerNotReady() { - return cudaErrorMpsServerNotReady; - } - private static final int cudaErrorMpsMaxClientsReached = (int)808L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMpsMaxClientsReached = 808 - * } - */ - public static int cudaErrorMpsMaxClientsReached() { - return cudaErrorMpsMaxClientsReached; - } - private static final int cudaErrorMpsMaxConnectionsReached = (int)809L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMpsMaxConnectionsReached = 809 - * } - */ - public static int cudaErrorMpsMaxConnectionsReached() { - return cudaErrorMpsMaxConnectionsReached; - } - private static final int cudaErrorMpsClientTerminated = (int)810L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorMpsClientTerminated = 810 - * } - */ - public static int cudaErrorMpsClientTerminated() { - return cudaErrorMpsClientTerminated; - } - private static final int cudaErrorCdpNotSupported = (int)811L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorCdpNotSupported = 811 - * } - */ - public static int cudaErrorCdpNotSupported() { - return cudaErrorCdpNotSupported; - } - private static final int cudaErrorCdpVersionMismatch = (int)812L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorCdpVersionMismatch = 812 - * } - */ - public static int cudaErrorCdpVersionMismatch() { - return cudaErrorCdpVersionMismatch; - } - private static final int cudaErrorStreamCaptureUnsupported = (int)900L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorStreamCaptureUnsupported = 900 - * } - */ - public static int cudaErrorStreamCaptureUnsupported() { - return cudaErrorStreamCaptureUnsupported; - } - private static final int cudaErrorStreamCaptureInvalidated = (int)901L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorStreamCaptureInvalidated = 901 - * } - */ - public static int cudaErrorStreamCaptureInvalidated() { - return cudaErrorStreamCaptureInvalidated; - } - private static final int cudaErrorStreamCaptureMerge = (int)902L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorStreamCaptureMerge = 902 - * } - */ - public static int cudaErrorStreamCaptureMerge() { - return cudaErrorStreamCaptureMerge; - } - private static final int cudaErrorStreamCaptureUnmatched = (int)903L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorStreamCaptureUnmatched = 903 - * } - */ - public static int cudaErrorStreamCaptureUnmatched() { - return cudaErrorStreamCaptureUnmatched; - } - private static final int cudaErrorStreamCaptureUnjoined = (int)904L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorStreamCaptureUnjoined = 904 - * } - */ - public static int cudaErrorStreamCaptureUnjoined() { - return cudaErrorStreamCaptureUnjoined; - } - private static final int cudaErrorStreamCaptureIsolation = (int)905L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorStreamCaptureIsolation = 905 - * } - */ - public static int cudaErrorStreamCaptureIsolation() { - return cudaErrorStreamCaptureIsolation; - } - private static final int cudaErrorStreamCaptureImplicit = (int)906L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorStreamCaptureImplicit = 906 - * } - */ - public static int cudaErrorStreamCaptureImplicit() { - return cudaErrorStreamCaptureImplicit; - } - private static final int cudaErrorCapturedEvent = (int)907L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorCapturedEvent = 907 - * } - */ - public static int cudaErrorCapturedEvent() { - return cudaErrorCapturedEvent; - } - private static final int cudaErrorStreamCaptureWrongThread = (int)908L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorStreamCaptureWrongThread = 908 - * } - */ - public static int cudaErrorStreamCaptureWrongThread() { - return cudaErrorStreamCaptureWrongThread; - } - private static final int cudaErrorTimeout = (int)909L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorTimeout = 909 - * } - */ - public static int cudaErrorTimeout() { - return cudaErrorTimeout; - } - private static final int cudaErrorGraphExecUpdateFailure = (int)910L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorGraphExecUpdateFailure = 910 - * } - */ - public static int cudaErrorGraphExecUpdateFailure() { - return cudaErrorGraphExecUpdateFailure; - } - private static final int cudaErrorExternalDevice = (int)911L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorExternalDevice = 911 - * } - */ - public static int cudaErrorExternalDevice() { - return cudaErrorExternalDevice; - } - private static final int cudaErrorInvalidClusterSize = (int)912L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidClusterSize = 912 - * } - */ - public static int cudaErrorInvalidClusterSize() { - return cudaErrorInvalidClusterSize; - } - private static final int cudaErrorFunctionNotLoaded = (int)913L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorFunctionNotLoaded = 913 - * } - */ - public static int cudaErrorFunctionNotLoaded() { - return cudaErrorFunctionNotLoaded; - } - private static final int cudaErrorInvalidResourceType = (int)914L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidResourceType = 914 - * } - */ - public static int cudaErrorInvalidResourceType() { - return cudaErrorInvalidResourceType; - } - private static final int cudaErrorInvalidResourceConfiguration = (int)915L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorInvalidResourceConfiguration = 915 - * } - */ - public static int cudaErrorInvalidResourceConfiguration() { - return cudaErrorInvalidResourceConfiguration; - } - private static final int cudaErrorUnknown = (int)999L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorUnknown = 999 - * } - */ - public static int cudaErrorUnknown() { - return cudaErrorUnknown; - } - private static final int cudaErrorApiFailureBase = (int)10000L; - /** - * {@snippet lang=c : - * enum cudaError.cudaErrorApiFailureBase = 10000 - * } - */ - public static int cudaErrorApiFailureBase() { - return cudaErrorApiFailureBase; - } - private static final int cudaChannelFormatKindSigned = (int)0L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindSigned = 0 - * } - */ - public static int cudaChannelFormatKindSigned() { - return cudaChannelFormatKindSigned; - } - private static final int cudaChannelFormatKindUnsigned = (int)1L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsigned = 1 - * } - */ - public static int cudaChannelFormatKindUnsigned() { - return cudaChannelFormatKindUnsigned; - } - private static final int cudaChannelFormatKindFloat = (int)2L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindFloat = 2 - * } - */ - public static int cudaChannelFormatKindFloat() { - return cudaChannelFormatKindFloat; - } - private static final int cudaChannelFormatKindNone = (int)3L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindNone = 3 - * } - */ - public static int cudaChannelFormatKindNone() { - return cudaChannelFormatKindNone; - } - private static final int cudaChannelFormatKindNV12 = (int)4L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindNV12 = 4 - * } - */ - public static int cudaChannelFormatKindNV12() { - return cudaChannelFormatKindNV12; - } - private static final int cudaChannelFormatKindUnsignedNormalized8X1 = (int)5L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X1 = 5 - * } - */ - public static int cudaChannelFormatKindUnsignedNormalized8X1() { - return cudaChannelFormatKindUnsignedNormalized8X1; - } - private static final int cudaChannelFormatKindUnsignedNormalized8X2 = (int)6L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X2 = 6 - * } - */ - public static int cudaChannelFormatKindUnsignedNormalized8X2() { - return cudaChannelFormatKindUnsignedNormalized8X2; - } - private static final int cudaChannelFormatKindUnsignedNormalized8X4 = (int)7L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized8X4 = 7 - * } - */ - public static int cudaChannelFormatKindUnsignedNormalized8X4() { - return cudaChannelFormatKindUnsignedNormalized8X4; - } - private static final int cudaChannelFormatKindUnsignedNormalized16X1 = (int)8L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X1 = 8 - * } - */ - public static int cudaChannelFormatKindUnsignedNormalized16X1() { - return cudaChannelFormatKindUnsignedNormalized16X1; - } - private static final int cudaChannelFormatKindUnsignedNormalized16X2 = (int)9L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X2 = 9 - * } - */ - public static int cudaChannelFormatKindUnsignedNormalized16X2() { - return cudaChannelFormatKindUnsignedNormalized16X2; - } - private static final int cudaChannelFormatKindUnsignedNormalized16X4 = (int)10L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedNormalized16X4 = 10 - * } - */ - public static int cudaChannelFormatKindUnsignedNormalized16X4() { - return cudaChannelFormatKindUnsignedNormalized16X4; - } - private static final int cudaChannelFormatKindSignedNormalized8X1 = (int)11L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X1 = 11 - * } - */ - public static int cudaChannelFormatKindSignedNormalized8X1() { - return cudaChannelFormatKindSignedNormalized8X1; - } - private static final int cudaChannelFormatKindSignedNormalized8X2 = (int)12L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X2 = 12 - * } - */ - public static int cudaChannelFormatKindSignedNormalized8X2() { - return cudaChannelFormatKindSignedNormalized8X2; - } - private static final int cudaChannelFormatKindSignedNormalized8X4 = (int)13L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized8X4 = 13 - * } - */ - public static int cudaChannelFormatKindSignedNormalized8X4() { - return cudaChannelFormatKindSignedNormalized8X4; - } - private static final int cudaChannelFormatKindSignedNormalized16X1 = (int)14L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X1 = 14 - * } - */ - public static int cudaChannelFormatKindSignedNormalized16X1() { - return cudaChannelFormatKindSignedNormalized16X1; - } - private static final int cudaChannelFormatKindSignedNormalized16X2 = (int)15L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X2 = 15 - * } - */ - public static int cudaChannelFormatKindSignedNormalized16X2() { - return cudaChannelFormatKindSignedNormalized16X2; - } - private static final int cudaChannelFormatKindSignedNormalized16X4 = (int)16L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindSignedNormalized16X4 = 16 - * } - */ - public static int cudaChannelFormatKindSignedNormalized16X4() { - return cudaChannelFormatKindSignedNormalized16X4; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed1 = (int)17L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1 = 17 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed1() { - return cudaChannelFormatKindUnsignedBlockCompressed1; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed1SRGB = (int)18L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed1SRGB = 18 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed1SRGB() { - return cudaChannelFormatKindUnsignedBlockCompressed1SRGB; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed2 = (int)19L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2 = 19 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed2() { - return cudaChannelFormatKindUnsignedBlockCompressed2; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed2SRGB = (int)20L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed2SRGB = 20 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed2SRGB() { - return cudaChannelFormatKindUnsignedBlockCompressed2SRGB; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed3 = (int)21L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3 = 21 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed3() { - return cudaChannelFormatKindUnsignedBlockCompressed3; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed3SRGB = (int)22L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed3SRGB = 22 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed3SRGB() { - return cudaChannelFormatKindUnsignedBlockCompressed3SRGB; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed4 = (int)23L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed4 = 23 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed4() { - return cudaChannelFormatKindUnsignedBlockCompressed4; - } - private static final int cudaChannelFormatKindSignedBlockCompressed4 = (int)24L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed4 = 24 - * } - */ - public static int cudaChannelFormatKindSignedBlockCompressed4() { - return cudaChannelFormatKindSignedBlockCompressed4; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed5 = (int)25L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed5 = 25 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed5() { - return cudaChannelFormatKindUnsignedBlockCompressed5; - } - private static final int cudaChannelFormatKindSignedBlockCompressed5 = (int)26L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed5 = 26 - * } - */ - public static int cudaChannelFormatKindSignedBlockCompressed5() { - return cudaChannelFormatKindSignedBlockCompressed5; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed6H = (int)27L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed6H = 27 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed6H() { - return cudaChannelFormatKindUnsignedBlockCompressed6H; - } - private static final int cudaChannelFormatKindSignedBlockCompressed6H = (int)28L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindSignedBlockCompressed6H = 28 - * } - */ - public static int cudaChannelFormatKindSignedBlockCompressed6H() { - return cudaChannelFormatKindSignedBlockCompressed6H; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed7 = (int)29L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7 = 29 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed7() { - return cudaChannelFormatKindUnsignedBlockCompressed7; - } - private static final int cudaChannelFormatKindUnsignedBlockCompressed7SRGB = (int)30L; - /** - * {@snippet lang=c : - * enum cudaChannelFormatKind.cudaChannelFormatKindUnsignedBlockCompressed7SRGB = 30 - * } - */ - public static int cudaChannelFormatKindUnsignedBlockCompressed7SRGB() { - return cudaChannelFormatKindUnsignedBlockCompressed7SRGB; - } - /** - * {@snippet lang=c : - * typedef struct cudaArray *cudaArray_t - * } - */ - public static final AddressLayout cudaArray_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef const struct cudaArray *cudaArray_const_t - * } - */ - public static final AddressLayout cudaArray_const_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct cudaMipmappedArray *cudaMipmappedArray_t - * } - */ - public static final AddressLayout cudaMipmappedArray_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef const struct cudaMipmappedArray *cudaMipmappedArray_const_t - * } - */ - public static final AddressLayout cudaMipmappedArray_const_t = PanamaFFMAPI.C_POINTER; - private static final int cudaMemoryTypeUnregistered = (int)0L; - /** - * {@snippet lang=c : - * enum cudaMemoryType.cudaMemoryTypeUnregistered = 0 - * } - */ - public static int cudaMemoryTypeUnregistered() { - return cudaMemoryTypeUnregistered; - } - private static final int cudaMemoryTypeHost = (int)1L; - /** - * {@snippet lang=c : - * enum cudaMemoryType.cudaMemoryTypeHost = 1 - * } - */ - public static int cudaMemoryTypeHost() { - return cudaMemoryTypeHost; - } - private static final int cudaMemoryTypeDevice = (int)2L; - /** - * {@snippet lang=c : - * enum cudaMemoryType.cudaMemoryTypeDevice = 2 - * } - */ - public static int cudaMemoryTypeDevice() { - return cudaMemoryTypeDevice; - } - private static final int cudaMemoryTypeManaged = (int)3L; - /** - * {@snippet lang=c : - * enum cudaMemoryType.cudaMemoryTypeManaged = 3 - * } - */ - public static int cudaMemoryTypeManaged() { - return cudaMemoryTypeManaged; - } - private static final int cudaMemcpyHostToHost = (int)0L; - /** - * {@snippet lang=c : - * enum cudaMemcpyKind.cudaMemcpyHostToHost = 0 - * } - */ - public static int cudaMemcpyHostToHost() { - return cudaMemcpyHostToHost; - } - private static final int cudaMemcpyHostToDevice = (int)1L; - /** - * {@snippet lang=c : - * enum cudaMemcpyKind.cudaMemcpyHostToDevice = 1 - * } - */ - public static int cudaMemcpyHostToDevice() { - return cudaMemcpyHostToDevice; - } - private static final int cudaMemcpyDeviceToHost = (int)2L; - /** - * {@snippet lang=c : - * enum cudaMemcpyKind.cudaMemcpyDeviceToHost = 2 - * } - */ - public static int cudaMemcpyDeviceToHost() { - return cudaMemcpyDeviceToHost; - } - private static final int cudaMemcpyDeviceToDevice = (int)3L; - /** - * {@snippet lang=c : - * enum cudaMemcpyKind.cudaMemcpyDeviceToDevice = 3 - * } - */ - public static int cudaMemcpyDeviceToDevice() { - return cudaMemcpyDeviceToDevice; - } - private static final int cudaMemcpyDefault = (int)4L; - /** - * {@snippet lang=c : - * enum cudaMemcpyKind.cudaMemcpyDefault = 4 - * } - */ - public static int cudaMemcpyDefault() { - return cudaMemcpyDefault; - } - private static final int cudaAccessPropertyNormal = (int)0L; - /** - * {@snippet lang=c : - * enum cudaAccessProperty.cudaAccessPropertyNormal = 0 - * } - */ - public static int cudaAccessPropertyNormal() { - return cudaAccessPropertyNormal; - } - private static final int cudaAccessPropertyStreaming = (int)1L; - /** - * {@snippet lang=c : - * enum cudaAccessProperty.cudaAccessPropertyStreaming = 1 - * } - */ - public static int cudaAccessPropertyStreaming() { - return cudaAccessPropertyStreaming; - } - private static final int cudaAccessPropertyPersisting = (int)2L; - /** - * {@snippet lang=c : - * enum cudaAccessProperty.cudaAccessPropertyPersisting = 2 - * } - */ - public static int cudaAccessPropertyPersisting() { - return cudaAccessPropertyPersisting; - } - private static final int cudaStreamCaptureStatusNone = (int)0L; - /** - * {@snippet lang=c : - * enum cudaStreamCaptureStatus.cudaStreamCaptureStatusNone = 0 - * } - */ - public static int cudaStreamCaptureStatusNone() { - return cudaStreamCaptureStatusNone; - } - private static final int cudaStreamCaptureStatusActive = (int)1L; - /** - * {@snippet lang=c : - * enum cudaStreamCaptureStatus.cudaStreamCaptureStatusActive = 1 - * } - */ - public static int cudaStreamCaptureStatusActive() { - return cudaStreamCaptureStatusActive; - } - private static final int cudaStreamCaptureStatusInvalidated = (int)2L; - /** - * {@snippet lang=c : - * enum cudaStreamCaptureStatus.cudaStreamCaptureStatusInvalidated = 2 - * } - */ - public static int cudaStreamCaptureStatusInvalidated() { - return cudaStreamCaptureStatusInvalidated; - } - private static final int cudaStreamCaptureModeGlobal = (int)0L; - /** - * {@snippet lang=c : - * enum cudaStreamCaptureMode.cudaStreamCaptureModeGlobal = 0 - * } - */ - public static int cudaStreamCaptureModeGlobal() { - return cudaStreamCaptureModeGlobal; - } - private static final int cudaStreamCaptureModeThreadLocal = (int)1L; - /** - * {@snippet lang=c : - * enum cudaStreamCaptureMode.cudaStreamCaptureModeThreadLocal = 1 - * } - */ - public static int cudaStreamCaptureModeThreadLocal() { - return cudaStreamCaptureModeThreadLocal; - } - private static final int cudaStreamCaptureModeRelaxed = (int)2L; - /** - * {@snippet lang=c : - * enum cudaStreamCaptureMode.cudaStreamCaptureModeRelaxed = 2 - * } - */ - public static int cudaStreamCaptureModeRelaxed() { - return cudaStreamCaptureModeRelaxed; - } - private static final int cudaSyncPolicyAuto = (int)1L; - /** - * {@snippet lang=c : - * enum cudaSynchronizationPolicy.cudaSyncPolicyAuto = 1 - * } - */ - public static int cudaSyncPolicyAuto() { - return cudaSyncPolicyAuto; - } - private static final int cudaSyncPolicySpin = (int)2L; - /** - * {@snippet lang=c : - * enum cudaSynchronizationPolicy.cudaSyncPolicySpin = 2 - * } - */ - public static int cudaSyncPolicySpin() { - return cudaSyncPolicySpin; - } - private static final int cudaSyncPolicyYield = (int)3L; - /** - * {@snippet lang=c : - * enum cudaSynchronizationPolicy.cudaSyncPolicyYield = 3 - * } - */ - public static int cudaSyncPolicyYield() { - return cudaSyncPolicyYield; - } - private static final int cudaSyncPolicyBlockingSync = (int)4L; - /** - * {@snippet lang=c : - * enum cudaSynchronizationPolicy.cudaSyncPolicyBlockingSync = 4 - * } - */ - public static int cudaSyncPolicyBlockingSync() { - return cudaSyncPolicyBlockingSync; - } - private static final int cudaClusterSchedulingPolicyDefault = (int)0L; - /** - * {@snippet lang=c : - * enum cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyDefault = 0 - * } - */ - public static int cudaClusterSchedulingPolicyDefault() { - return cudaClusterSchedulingPolicyDefault; - } - private static final int cudaClusterSchedulingPolicySpread = (int)1L; - /** - * {@snippet lang=c : - * enum cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicySpread = 1 - * } - */ - public static int cudaClusterSchedulingPolicySpread() { - return cudaClusterSchedulingPolicySpread; - } - private static final int cudaClusterSchedulingPolicyLoadBalancing = (int)2L; - /** - * {@snippet lang=c : - * enum cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyLoadBalancing = 2 - * } - */ - public static int cudaClusterSchedulingPolicyLoadBalancing() { - return cudaClusterSchedulingPolicyLoadBalancing; - } - private static final int cudaStreamAddCaptureDependencies = (int)0L; - /** - * {@snippet lang=c : - * enum cudaStreamUpdateCaptureDependenciesFlags.cudaStreamAddCaptureDependencies = 0 - * } - */ - public static int cudaStreamAddCaptureDependencies() { - return cudaStreamAddCaptureDependencies; - } - private static final int cudaStreamSetCaptureDependencies = (int)1L; - /** - * {@snippet lang=c : - * enum cudaStreamUpdateCaptureDependenciesFlags.cudaStreamSetCaptureDependencies = 1 - * } - */ - public static int cudaStreamSetCaptureDependencies() { - return cudaStreamSetCaptureDependencies; - } - private static final int cudaUserObjectNoDestructorSync = (int)1L; - /** - * {@snippet lang=c : - * enum cudaUserObjectFlags.cudaUserObjectNoDestructorSync = 1 - * } - */ - public static int cudaUserObjectNoDestructorSync() { - return cudaUserObjectNoDestructorSync; - } - private static final int cudaGraphUserObjectMove = (int)1L; - /** - * {@snippet lang=c : - * enum cudaUserObjectRetainFlags.cudaGraphUserObjectMove = 1 - * } - */ - public static int cudaGraphUserObjectMove() { - return cudaGraphUserObjectMove; - } - private static final int cudaGraphicsRegisterFlagsNone = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsNone = 0 - * } - */ - public static int cudaGraphicsRegisterFlagsNone() { - return cudaGraphicsRegisterFlagsNone; - } - private static final int cudaGraphicsRegisterFlagsReadOnly = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsReadOnly = 1 - * } - */ - public static int cudaGraphicsRegisterFlagsReadOnly() { - return cudaGraphicsRegisterFlagsReadOnly; - } - private static final int cudaGraphicsRegisterFlagsWriteDiscard = (int)2L; - /** - * {@snippet lang=c : - * enum cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsWriteDiscard = 2 - * } - */ - public static int cudaGraphicsRegisterFlagsWriteDiscard() { - return cudaGraphicsRegisterFlagsWriteDiscard; - } - private static final int cudaGraphicsRegisterFlagsSurfaceLoadStore = (int)4L; - /** - * {@snippet lang=c : - * enum cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsSurfaceLoadStore = 4 - * } - */ - public static int cudaGraphicsRegisterFlagsSurfaceLoadStore() { - return cudaGraphicsRegisterFlagsSurfaceLoadStore; - } - private static final int cudaGraphicsRegisterFlagsTextureGather = (int)8L; - /** - * {@snippet lang=c : - * enum cudaGraphicsRegisterFlags.cudaGraphicsRegisterFlagsTextureGather = 8 - * } - */ - public static int cudaGraphicsRegisterFlagsTextureGather() { - return cudaGraphicsRegisterFlagsTextureGather; - } - private static final int cudaGraphicsMapFlagsNone = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGraphicsMapFlags.cudaGraphicsMapFlagsNone = 0 - * } - */ - public static int cudaGraphicsMapFlagsNone() { - return cudaGraphicsMapFlagsNone; - } - private static final int cudaGraphicsMapFlagsReadOnly = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphicsMapFlags.cudaGraphicsMapFlagsReadOnly = 1 - * } - */ - public static int cudaGraphicsMapFlagsReadOnly() { - return cudaGraphicsMapFlagsReadOnly; - } - private static final int cudaGraphicsMapFlagsWriteDiscard = (int)2L; - /** - * {@snippet lang=c : - * enum cudaGraphicsMapFlags.cudaGraphicsMapFlagsWriteDiscard = 2 - * } - */ - public static int cudaGraphicsMapFlagsWriteDiscard() { - return cudaGraphicsMapFlagsWriteDiscard; - } - private static final int cudaGraphicsCubeFacePositiveX = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveX = 0 - * } - */ - public static int cudaGraphicsCubeFacePositiveX() { - return cudaGraphicsCubeFacePositiveX; - } - private static final int cudaGraphicsCubeFaceNegativeX = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeX = 1 - * } - */ - public static int cudaGraphicsCubeFaceNegativeX() { - return cudaGraphicsCubeFaceNegativeX; - } - private static final int cudaGraphicsCubeFacePositiveY = (int)2L; - /** - * {@snippet lang=c : - * enum cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveY = 2 - * } - */ - public static int cudaGraphicsCubeFacePositiveY() { - return cudaGraphicsCubeFacePositiveY; - } - private static final int cudaGraphicsCubeFaceNegativeY = (int)3L; - /** - * {@snippet lang=c : - * enum cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeY = 3 - * } - */ - public static int cudaGraphicsCubeFaceNegativeY() { - return cudaGraphicsCubeFaceNegativeY; - } - private static final int cudaGraphicsCubeFacePositiveZ = (int)4L; - /** - * {@snippet lang=c : - * enum cudaGraphicsCubeFace.cudaGraphicsCubeFacePositiveZ = 4 - * } - */ - public static int cudaGraphicsCubeFacePositiveZ() { - return cudaGraphicsCubeFacePositiveZ; - } - private static final int cudaGraphicsCubeFaceNegativeZ = (int)5L; - /** - * {@snippet lang=c : - * enum cudaGraphicsCubeFace.cudaGraphicsCubeFaceNegativeZ = 5 - * } - */ - public static int cudaGraphicsCubeFaceNegativeZ() { - return cudaGraphicsCubeFaceNegativeZ; - } - private static final int cudaResourceTypeArray = (int)0L; - /** - * {@snippet lang=c : - * enum cudaResourceType.cudaResourceTypeArray = 0 - * } - */ - public static int cudaResourceTypeArray() { - return cudaResourceTypeArray; - } - private static final int cudaResourceTypeMipmappedArray = (int)1L; - /** - * {@snippet lang=c : - * enum cudaResourceType.cudaResourceTypeMipmappedArray = 1 - * } - */ - public static int cudaResourceTypeMipmappedArray() { - return cudaResourceTypeMipmappedArray; - } - private static final int cudaResourceTypeLinear = (int)2L; - /** - * {@snippet lang=c : - * enum cudaResourceType.cudaResourceTypeLinear = 2 - * } - */ - public static int cudaResourceTypeLinear() { - return cudaResourceTypeLinear; - } - private static final int cudaResourceTypePitch2D = (int)3L; - /** - * {@snippet lang=c : - * enum cudaResourceType.cudaResourceTypePitch2D = 3 - * } - */ - public static int cudaResourceTypePitch2D() { - return cudaResourceTypePitch2D; - } - private static final int cudaResViewFormatNone = (int)0L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatNone = 0 - * } - */ - public static int cudaResViewFormatNone() { - return cudaResViewFormatNone; - } - private static final int cudaResViewFormatUnsignedChar1 = (int)1L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedChar1 = 1 - * } - */ - public static int cudaResViewFormatUnsignedChar1() { - return cudaResViewFormatUnsignedChar1; - } - private static final int cudaResViewFormatUnsignedChar2 = (int)2L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedChar2 = 2 - * } - */ - public static int cudaResViewFormatUnsignedChar2() { - return cudaResViewFormatUnsignedChar2; - } - private static final int cudaResViewFormatUnsignedChar4 = (int)3L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedChar4 = 3 - * } - */ - public static int cudaResViewFormatUnsignedChar4() { - return cudaResViewFormatUnsignedChar4; - } - private static final int cudaResViewFormatSignedChar1 = (int)4L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedChar1 = 4 - * } - */ - public static int cudaResViewFormatSignedChar1() { - return cudaResViewFormatSignedChar1; - } - private static final int cudaResViewFormatSignedChar2 = (int)5L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedChar2 = 5 - * } - */ - public static int cudaResViewFormatSignedChar2() { - return cudaResViewFormatSignedChar2; - } - private static final int cudaResViewFormatSignedChar4 = (int)6L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedChar4 = 6 - * } - */ - public static int cudaResViewFormatSignedChar4() { - return cudaResViewFormatSignedChar4; - } - private static final int cudaResViewFormatUnsignedShort1 = (int)7L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedShort1 = 7 - * } - */ - public static int cudaResViewFormatUnsignedShort1() { - return cudaResViewFormatUnsignedShort1; - } - private static final int cudaResViewFormatUnsignedShort2 = (int)8L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedShort2 = 8 - * } - */ - public static int cudaResViewFormatUnsignedShort2() { - return cudaResViewFormatUnsignedShort2; - } - private static final int cudaResViewFormatUnsignedShort4 = (int)9L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedShort4 = 9 - * } - */ - public static int cudaResViewFormatUnsignedShort4() { - return cudaResViewFormatUnsignedShort4; - } - private static final int cudaResViewFormatSignedShort1 = (int)10L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedShort1 = 10 - * } - */ - public static int cudaResViewFormatSignedShort1() { - return cudaResViewFormatSignedShort1; - } - private static final int cudaResViewFormatSignedShort2 = (int)11L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedShort2 = 11 - * } - */ - public static int cudaResViewFormatSignedShort2() { - return cudaResViewFormatSignedShort2; - } - private static final int cudaResViewFormatSignedShort4 = (int)12L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedShort4 = 12 - * } - */ - public static int cudaResViewFormatSignedShort4() { - return cudaResViewFormatSignedShort4; - } - private static final int cudaResViewFormatUnsignedInt1 = (int)13L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedInt1 = 13 - * } - */ - public static int cudaResViewFormatUnsignedInt1() { - return cudaResViewFormatUnsignedInt1; - } - private static final int cudaResViewFormatUnsignedInt2 = (int)14L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedInt2 = 14 - * } - */ - public static int cudaResViewFormatUnsignedInt2() { - return cudaResViewFormatUnsignedInt2; - } - private static final int cudaResViewFormatUnsignedInt4 = (int)15L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedInt4 = 15 - * } - */ - public static int cudaResViewFormatUnsignedInt4() { - return cudaResViewFormatUnsignedInt4; - } - private static final int cudaResViewFormatSignedInt1 = (int)16L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedInt1 = 16 - * } - */ - public static int cudaResViewFormatSignedInt1() { - return cudaResViewFormatSignedInt1; - } - private static final int cudaResViewFormatSignedInt2 = (int)17L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedInt2 = 17 - * } - */ - public static int cudaResViewFormatSignedInt2() { - return cudaResViewFormatSignedInt2; - } - private static final int cudaResViewFormatSignedInt4 = (int)18L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedInt4 = 18 - * } - */ - public static int cudaResViewFormatSignedInt4() { - return cudaResViewFormatSignedInt4; - } - private static final int cudaResViewFormatHalf1 = (int)19L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatHalf1 = 19 - * } - */ - public static int cudaResViewFormatHalf1() { - return cudaResViewFormatHalf1; - } - private static final int cudaResViewFormatHalf2 = (int)20L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatHalf2 = 20 - * } - */ - public static int cudaResViewFormatHalf2() { - return cudaResViewFormatHalf2; - } - private static final int cudaResViewFormatHalf4 = (int)21L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatHalf4 = 21 - * } - */ - public static int cudaResViewFormatHalf4() { - return cudaResViewFormatHalf4; - } - private static final int cudaResViewFormatFloat1 = (int)22L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatFloat1 = 22 - * } - */ - public static int cudaResViewFormatFloat1() { - return cudaResViewFormatFloat1; - } - private static final int cudaResViewFormatFloat2 = (int)23L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatFloat2 = 23 - * } - */ - public static int cudaResViewFormatFloat2() { - return cudaResViewFormatFloat2; - } - private static final int cudaResViewFormatFloat4 = (int)24L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatFloat4 = 24 - * } - */ - public static int cudaResViewFormatFloat4() { - return cudaResViewFormatFloat4; - } - private static final int cudaResViewFormatUnsignedBlockCompressed1 = (int)25L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed1 = 25 - * } - */ - public static int cudaResViewFormatUnsignedBlockCompressed1() { - return cudaResViewFormatUnsignedBlockCompressed1; - } - private static final int cudaResViewFormatUnsignedBlockCompressed2 = (int)26L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed2 = 26 - * } - */ - public static int cudaResViewFormatUnsignedBlockCompressed2() { - return cudaResViewFormatUnsignedBlockCompressed2; - } - private static final int cudaResViewFormatUnsignedBlockCompressed3 = (int)27L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed3 = 27 - * } - */ - public static int cudaResViewFormatUnsignedBlockCompressed3() { - return cudaResViewFormatUnsignedBlockCompressed3; - } - private static final int cudaResViewFormatUnsignedBlockCompressed4 = (int)28L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed4 = 28 - * } - */ - public static int cudaResViewFormatUnsignedBlockCompressed4() { - return cudaResViewFormatUnsignedBlockCompressed4; - } - private static final int cudaResViewFormatSignedBlockCompressed4 = (int)29L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed4 = 29 - * } - */ - public static int cudaResViewFormatSignedBlockCompressed4() { - return cudaResViewFormatSignedBlockCompressed4; - } - private static final int cudaResViewFormatUnsignedBlockCompressed5 = (int)30L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed5 = 30 - * } - */ - public static int cudaResViewFormatUnsignedBlockCompressed5() { - return cudaResViewFormatUnsignedBlockCompressed5; - } - private static final int cudaResViewFormatSignedBlockCompressed5 = (int)31L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed5 = 31 - * } - */ - public static int cudaResViewFormatSignedBlockCompressed5() { - return cudaResViewFormatSignedBlockCompressed5; - } - private static final int cudaResViewFormatUnsignedBlockCompressed6H = (int)32L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed6H = 32 - * } - */ - public static int cudaResViewFormatUnsignedBlockCompressed6H() { - return cudaResViewFormatUnsignedBlockCompressed6H; - } - private static final int cudaResViewFormatSignedBlockCompressed6H = (int)33L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatSignedBlockCompressed6H = 33 - * } - */ - public static int cudaResViewFormatSignedBlockCompressed6H() { - return cudaResViewFormatSignedBlockCompressed6H; - } - private static final int cudaResViewFormatUnsignedBlockCompressed7 = (int)34L; - /** - * {@snippet lang=c : - * enum cudaResourceViewFormat.cudaResViewFormatUnsignedBlockCompressed7 = 34 - * } - */ - public static int cudaResViewFormatUnsignedBlockCompressed7() { - return cudaResViewFormatUnsignedBlockCompressed7; - } - private static final int cudaFuncAttributeMaxDynamicSharedMemorySize = (int)8L; - /** - * {@snippet lang=c : - * enum cudaFuncAttribute.cudaFuncAttributeMaxDynamicSharedMemorySize = 8 - * } - */ - public static int cudaFuncAttributeMaxDynamicSharedMemorySize() { - return cudaFuncAttributeMaxDynamicSharedMemorySize; - } - private static final int cudaFuncAttributePreferredSharedMemoryCarveout = (int)9L; - /** - * {@snippet lang=c : - * enum cudaFuncAttribute.cudaFuncAttributePreferredSharedMemoryCarveout = 9 - * } - */ - public static int cudaFuncAttributePreferredSharedMemoryCarveout() { - return cudaFuncAttributePreferredSharedMemoryCarveout; - } - private static final int cudaFuncAttributeClusterDimMustBeSet = (int)10L; - /** - * {@snippet lang=c : - * enum cudaFuncAttribute.cudaFuncAttributeClusterDimMustBeSet = 10 - * } - */ - public static int cudaFuncAttributeClusterDimMustBeSet() { - return cudaFuncAttributeClusterDimMustBeSet; - } - private static final int cudaFuncAttributeRequiredClusterWidth = (int)11L; - /** - * {@snippet lang=c : - * enum cudaFuncAttribute.cudaFuncAttributeRequiredClusterWidth = 11 - * } - */ - public static int cudaFuncAttributeRequiredClusterWidth() { - return cudaFuncAttributeRequiredClusterWidth; - } - private static final int cudaFuncAttributeRequiredClusterHeight = (int)12L; - /** - * {@snippet lang=c : - * enum cudaFuncAttribute.cudaFuncAttributeRequiredClusterHeight = 12 - * } - */ - public static int cudaFuncAttributeRequiredClusterHeight() { - return cudaFuncAttributeRequiredClusterHeight; - } - private static final int cudaFuncAttributeRequiredClusterDepth = (int)13L; - /** - * {@snippet lang=c : - * enum cudaFuncAttribute.cudaFuncAttributeRequiredClusterDepth = 13 - * } - */ - public static int cudaFuncAttributeRequiredClusterDepth() { - return cudaFuncAttributeRequiredClusterDepth; - } - private static final int cudaFuncAttributeNonPortableClusterSizeAllowed = (int)14L; - /** - * {@snippet lang=c : - * enum cudaFuncAttribute.cudaFuncAttributeNonPortableClusterSizeAllowed = 14 - * } - */ - public static int cudaFuncAttributeNonPortableClusterSizeAllowed() { - return cudaFuncAttributeNonPortableClusterSizeAllowed; - } - private static final int cudaFuncAttributeClusterSchedulingPolicyPreference = (int)15L; - /** - * {@snippet lang=c : - * enum cudaFuncAttribute.cudaFuncAttributeClusterSchedulingPolicyPreference = 15 - * } - */ - public static int cudaFuncAttributeClusterSchedulingPolicyPreference() { - return cudaFuncAttributeClusterSchedulingPolicyPreference; - } - private static final int cudaFuncAttributeMax = (int)16L; - /** - * {@snippet lang=c : - * enum cudaFuncAttribute.cudaFuncAttributeMax = 16 - * } - */ - public static int cudaFuncAttributeMax() { - return cudaFuncAttributeMax; - } - private static final int cudaFuncCachePreferNone = (int)0L; - /** - * {@snippet lang=c : - * enum cudaFuncCache.cudaFuncCachePreferNone = 0 - * } - */ - public static int cudaFuncCachePreferNone() { - return cudaFuncCachePreferNone; - } - private static final int cudaFuncCachePreferShared = (int)1L; - /** - * {@snippet lang=c : - * enum cudaFuncCache.cudaFuncCachePreferShared = 1 - * } - */ - public static int cudaFuncCachePreferShared() { - return cudaFuncCachePreferShared; - } - private static final int cudaFuncCachePreferL1 = (int)2L; - /** - * {@snippet lang=c : - * enum cudaFuncCache.cudaFuncCachePreferL1 = 2 - * } - */ - public static int cudaFuncCachePreferL1() { - return cudaFuncCachePreferL1; - } - private static final int cudaFuncCachePreferEqual = (int)3L; - /** - * {@snippet lang=c : - * enum cudaFuncCache.cudaFuncCachePreferEqual = 3 - * } - */ - public static int cudaFuncCachePreferEqual() { - return cudaFuncCachePreferEqual; - } - private static final int cudaSharedMemBankSizeDefault = (int)0L; - /** - * {@snippet lang=c : - * enum cudaSharedMemConfig.cudaSharedMemBankSizeDefault = 0 - * } - */ - public static int cudaSharedMemBankSizeDefault() { - return cudaSharedMemBankSizeDefault; - } - private static final int cudaSharedMemBankSizeFourByte = (int)1L; - /** - * {@snippet lang=c : - * enum cudaSharedMemConfig.cudaSharedMemBankSizeFourByte = 1 - * } - */ - public static int cudaSharedMemBankSizeFourByte() { - return cudaSharedMemBankSizeFourByte; - } - private static final int cudaSharedMemBankSizeEightByte = (int)2L; - /** - * {@snippet lang=c : - * enum cudaSharedMemConfig.cudaSharedMemBankSizeEightByte = 2 - * } - */ - public static int cudaSharedMemBankSizeEightByte() { - return cudaSharedMemBankSizeEightByte; - } - private static final int cudaSharedmemCarveoutDefault = (int)-1L; - /** - * {@snippet lang=c : - * enum cudaSharedCarveout.cudaSharedmemCarveoutDefault = -1 - * } - */ - public static int cudaSharedmemCarveoutDefault() { - return cudaSharedmemCarveoutDefault; - } - private static final int cudaSharedmemCarveoutMaxShared = (int)100L; - /** - * {@snippet lang=c : - * enum cudaSharedCarveout.cudaSharedmemCarveoutMaxShared = 100 - * } - */ - public static int cudaSharedmemCarveoutMaxShared() { - return cudaSharedmemCarveoutMaxShared; - } - private static final int cudaSharedmemCarveoutMaxL1 = (int)0L; - /** - * {@snippet lang=c : - * enum cudaSharedCarveout.cudaSharedmemCarveoutMaxL1 = 0 - * } - */ - public static int cudaSharedmemCarveoutMaxL1() { - return cudaSharedmemCarveoutMaxL1; - } - private static final int cudaComputeModeDefault = (int)0L; - /** - * {@snippet lang=c : - * enum cudaComputeMode.cudaComputeModeDefault = 0 - * } - */ - public static int cudaComputeModeDefault() { - return cudaComputeModeDefault; - } - private static final int cudaComputeModeExclusive = (int)1L; - /** - * {@snippet lang=c : - * enum cudaComputeMode.cudaComputeModeExclusive = 1 - * } - */ - public static int cudaComputeModeExclusive() { - return cudaComputeModeExclusive; - } - private static final int cudaComputeModeProhibited = (int)2L; - /** - * {@snippet lang=c : - * enum cudaComputeMode.cudaComputeModeProhibited = 2 - * } - */ - public static int cudaComputeModeProhibited() { - return cudaComputeModeProhibited; - } - private static final int cudaComputeModeExclusiveProcess = (int)3L; - /** - * {@snippet lang=c : - * enum cudaComputeMode.cudaComputeModeExclusiveProcess = 3 - * } - */ - public static int cudaComputeModeExclusiveProcess() { - return cudaComputeModeExclusiveProcess; - } - private static final int cudaLimitStackSize = (int)0L; - /** - * {@snippet lang=c : - * enum cudaLimit.cudaLimitStackSize = 0 - * } - */ - public static int cudaLimitStackSize() { - return cudaLimitStackSize; - } - private static final int cudaLimitPrintfFifoSize = (int)1L; - /** - * {@snippet lang=c : - * enum cudaLimit.cudaLimitPrintfFifoSize = 1 - * } - */ - public static int cudaLimitPrintfFifoSize() { - return cudaLimitPrintfFifoSize; - } - private static final int cudaLimitMallocHeapSize = (int)2L; - /** - * {@snippet lang=c : - * enum cudaLimit.cudaLimitMallocHeapSize = 2 - * } - */ - public static int cudaLimitMallocHeapSize() { - return cudaLimitMallocHeapSize; - } - private static final int cudaLimitDevRuntimeSyncDepth = (int)3L; - /** - * {@snippet lang=c : - * enum cudaLimit.cudaLimitDevRuntimeSyncDepth = 3 - * } - */ - public static int cudaLimitDevRuntimeSyncDepth() { - return cudaLimitDevRuntimeSyncDepth; - } - private static final int cudaLimitDevRuntimePendingLaunchCount = (int)4L; - /** - * {@snippet lang=c : - * enum cudaLimit.cudaLimitDevRuntimePendingLaunchCount = 4 - * } - */ - public static int cudaLimitDevRuntimePendingLaunchCount() { - return cudaLimitDevRuntimePendingLaunchCount; - } - private static final int cudaLimitMaxL2FetchGranularity = (int)5L; - /** - * {@snippet lang=c : - * enum cudaLimit.cudaLimitMaxL2FetchGranularity = 5 - * } - */ - public static int cudaLimitMaxL2FetchGranularity() { - return cudaLimitMaxL2FetchGranularity; - } - private static final int cudaLimitPersistingL2CacheSize = (int)6L; - /** - * {@snippet lang=c : - * enum cudaLimit.cudaLimitPersistingL2CacheSize = 6 - * } - */ - public static int cudaLimitPersistingL2CacheSize() { - return cudaLimitPersistingL2CacheSize; - } - private static final int cudaMemAdviseSetReadMostly = (int)1L; - /** - * {@snippet lang=c : - * enum cudaMemoryAdvise.cudaMemAdviseSetReadMostly = 1 - * } - */ - public static int cudaMemAdviseSetReadMostly() { - return cudaMemAdviseSetReadMostly; - } - private static final int cudaMemAdviseUnsetReadMostly = (int)2L; - /** - * {@snippet lang=c : - * enum cudaMemoryAdvise.cudaMemAdviseUnsetReadMostly = 2 - * } - */ - public static int cudaMemAdviseUnsetReadMostly() { - return cudaMemAdviseUnsetReadMostly; - } - private static final int cudaMemAdviseSetPreferredLocation = (int)3L; - /** - * {@snippet lang=c : - * enum cudaMemoryAdvise.cudaMemAdviseSetPreferredLocation = 3 - * } - */ - public static int cudaMemAdviseSetPreferredLocation() { - return cudaMemAdviseSetPreferredLocation; - } - private static final int cudaMemAdviseUnsetPreferredLocation = (int)4L; - /** - * {@snippet lang=c : - * enum cudaMemoryAdvise.cudaMemAdviseUnsetPreferredLocation = 4 - * } - */ - public static int cudaMemAdviseUnsetPreferredLocation() { - return cudaMemAdviseUnsetPreferredLocation; - } - private static final int cudaMemAdviseSetAccessedBy = (int)5L; - /** - * {@snippet lang=c : - * enum cudaMemoryAdvise.cudaMemAdviseSetAccessedBy = 5 - * } - */ - public static int cudaMemAdviseSetAccessedBy() { - return cudaMemAdviseSetAccessedBy; - } - private static final int cudaMemAdviseUnsetAccessedBy = (int)6L; - /** - * {@snippet lang=c : - * enum cudaMemoryAdvise.cudaMemAdviseUnsetAccessedBy = 6 - * } - */ - public static int cudaMemAdviseUnsetAccessedBy() { - return cudaMemAdviseUnsetAccessedBy; - } - private static final int cudaMemRangeAttributeReadMostly = (int)1L; - /** - * {@snippet lang=c : - * enum cudaMemRangeAttribute.cudaMemRangeAttributeReadMostly = 1 - * } - */ - public static int cudaMemRangeAttributeReadMostly() { - return cudaMemRangeAttributeReadMostly; - } - private static final int cudaMemRangeAttributePreferredLocation = (int)2L; - /** - * {@snippet lang=c : - * enum cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocation = 2 - * } - */ - public static int cudaMemRangeAttributePreferredLocation() { - return cudaMemRangeAttributePreferredLocation; - } - private static final int cudaMemRangeAttributeAccessedBy = (int)3L; - /** - * {@snippet lang=c : - * enum cudaMemRangeAttribute.cudaMemRangeAttributeAccessedBy = 3 - * } - */ - public static int cudaMemRangeAttributeAccessedBy() { - return cudaMemRangeAttributeAccessedBy; - } - private static final int cudaMemRangeAttributeLastPrefetchLocation = (int)4L; - /** - * {@snippet lang=c : - * enum cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocation = 4 - * } - */ - public static int cudaMemRangeAttributeLastPrefetchLocation() { - return cudaMemRangeAttributeLastPrefetchLocation; - } - private static final int cudaMemRangeAttributePreferredLocationType = (int)5L; - /** - * {@snippet lang=c : - * enum cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationType = 5 - * } - */ - public static int cudaMemRangeAttributePreferredLocationType() { - return cudaMemRangeAttributePreferredLocationType; - } - private static final int cudaMemRangeAttributePreferredLocationId = (int)6L; - /** - * {@snippet lang=c : - * enum cudaMemRangeAttribute.cudaMemRangeAttributePreferredLocationId = 6 - * } - */ - public static int cudaMemRangeAttributePreferredLocationId() { - return cudaMemRangeAttributePreferredLocationId; - } - private static final int cudaMemRangeAttributeLastPrefetchLocationType = (int)7L; - /** - * {@snippet lang=c : - * enum cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationType = 7 - * } - */ - public static int cudaMemRangeAttributeLastPrefetchLocationType() { - return cudaMemRangeAttributeLastPrefetchLocationType; - } - private static final int cudaMemRangeAttributeLastPrefetchLocationId = (int)8L; - /** - * {@snippet lang=c : - * enum cudaMemRangeAttribute.cudaMemRangeAttributeLastPrefetchLocationId = 8 - * } - */ - public static int cudaMemRangeAttributeLastPrefetchLocationId() { - return cudaMemRangeAttributeLastPrefetchLocationId; - } - private static final int cudaFlushGPUDirectRDMAWritesOptionHost = (int)1L; - /** - * {@snippet lang=c : - * enum cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionHost = 1 - * } - */ - public static int cudaFlushGPUDirectRDMAWritesOptionHost() { - return cudaFlushGPUDirectRDMAWritesOptionHost; - } - private static final int cudaFlushGPUDirectRDMAWritesOptionMemOps = (int)2L; - /** - * {@snippet lang=c : - * enum cudaFlushGPUDirectRDMAWritesOptions.cudaFlushGPUDirectRDMAWritesOptionMemOps = 2 - * } - */ - public static int cudaFlushGPUDirectRDMAWritesOptionMemOps() { - return cudaFlushGPUDirectRDMAWritesOptionMemOps; - } - private static final int cudaGPUDirectRDMAWritesOrderingNone = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingNone = 0 - * } - */ - public static int cudaGPUDirectRDMAWritesOrderingNone() { - return cudaGPUDirectRDMAWritesOrderingNone; - } - private static final int cudaGPUDirectRDMAWritesOrderingOwner = (int)100L; - /** - * {@snippet lang=c : - * enum cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingOwner = 100 - * } - */ - public static int cudaGPUDirectRDMAWritesOrderingOwner() { - return cudaGPUDirectRDMAWritesOrderingOwner; - } - private static final int cudaGPUDirectRDMAWritesOrderingAllDevices = (int)200L; - /** - * {@snippet lang=c : - * enum cudaGPUDirectRDMAWritesOrdering.cudaGPUDirectRDMAWritesOrderingAllDevices = 200 - * } - */ - public static int cudaGPUDirectRDMAWritesOrderingAllDevices() { - return cudaGPUDirectRDMAWritesOrderingAllDevices; - } - private static final int cudaFlushGPUDirectRDMAWritesToOwner = (int)100L; - /** - * {@snippet lang=c : - * enum cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToOwner = 100 - * } - */ - public static int cudaFlushGPUDirectRDMAWritesToOwner() { - return cudaFlushGPUDirectRDMAWritesToOwner; - } - private static final int cudaFlushGPUDirectRDMAWritesToAllDevices = (int)200L; - /** - * {@snippet lang=c : - * enum cudaFlushGPUDirectRDMAWritesScope.cudaFlushGPUDirectRDMAWritesToAllDevices = 200 - * } - */ - public static int cudaFlushGPUDirectRDMAWritesToAllDevices() { - return cudaFlushGPUDirectRDMAWritesToAllDevices; - } - private static final int cudaFlushGPUDirectRDMAWritesTargetCurrentDevice = (int)0L; - /** - * {@snippet lang=c : - * enum cudaFlushGPUDirectRDMAWritesTarget.cudaFlushGPUDirectRDMAWritesTargetCurrentDevice = 0 - * } - */ - public static int cudaFlushGPUDirectRDMAWritesTargetCurrentDevice() { - return cudaFlushGPUDirectRDMAWritesTargetCurrentDevice; - } - private static final int cudaDevAttrMaxThreadsPerBlock = (int)1L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxThreadsPerBlock = 1 - * } - */ - public static int cudaDevAttrMaxThreadsPerBlock() { - return cudaDevAttrMaxThreadsPerBlock; - } - private static final int cudaDevAttrMaxBlockDimX = (int)2L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxBlockDimX = 2 - * } - */ - public static int cudaDevAttrMaxBlockDimX() { - return cudaDevAttrMaxBlockDimX; - } - private static final int cudaDevAttrMaxBlockDimY = (int)3L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxBlockDimY = 3 - * } - */ - public static int cudaDevAttrMaxBlockDimY() { - return cudaDevAttrMaxBlockDimY; - } - private static final int cudaDevAttrMaxBlockDimZ = (int)4L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxBlockDimZ = 4 - * } - */ - public static int cudaDevAttrMaxBlockDimZ() { - return cudaDevAttrMaxBlockDimZ; - } - private static final int cudaDevAttrMaxGridDimX = (int)5L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxGridDimX = 5 - * } - */ - public static int cudaDevAttrMaxGridDimX() { - return cudaDevAttrMaxGridDimX; - } - private static final int cudaDevAttrMaxGridDimY = (int)6L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxGridDimY = 6 - * } - */ - public static int cudaDevAttrMaxGridDimY() { - return cudaDevAttrMaxGridDimY; - } - private static final int cudaDevAttrMaxGridDimZ = (int)7L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxGridDimZ = 7 - * } - */ - public static int cudaDevAttrMaxGridDimZ() { - return cudaDevAttrMaxGridDimZ; - } - private static final int cudaDevAttrMaxSharedMemoryPerBlock = (int)8L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlock = 8 - * } - */ - public static int cudaDevAttrMaxSharedMemoryPerBlock() { - return cudaDevAttrMaxSharedMemoryPerBlock; - } - private static final int cudaDevAttrTotalConstantMemory = (int)9L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrTotalConstantMemory = 9 - * } - */ - public static int cudaDevAttrTotalConstantMemory() { - return cudaDevAttrTotalConstantMemory; - } - private static final int cudaDevAttrWarpSize = (int)10L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrWarpSize = 10 - * } - */ - public static int cudaDevAttrWarpSize() { - return cudaDevAttrWarpSize; - } - private static final int cudaDevAttrMaxPitch = (int)11L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxPitch = 11 - * } - */ - public static int cudaDevAttrMaxPitch() { - return cudaDevAttrMaxPitch; - } - private static final int cudaDevAttrMaxRegistersPerBlock = (int)12L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxRegistersPerBlock = 12 - * } - */ - public static int cudaDevAttrMaxRegistersPerBlock() { - return cudaDevAttrMaxRegistersPerBlock; - } - private static final int cudaDevAttrClockRate = (int)13L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrClockRate = 13 - * } - */ - public static int cudaDevAttrClockRate() { - return cudaDevAttrClockRate; - } - private static final int cudaDevAttrTextureAlignment = (int)14L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrTextureAlignment = 14 - * } - */ - public static int cudaDevAttrTextureAlignment() { - return cudaDevAttrTextureAlignment; - } - private static final int cudaDevAttrGpuOverlap = (int)15L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrGpuOverlap = 15 - * } - */ - public static int cudaDevAttrGpuOverlap() { - return cudaDevAttrGpuOverlap; - } - private static final int cudaDevAttrMultiProcessorCount = (int)16L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMultiProcessorCount = 16 - * } - */ - public static int cudaDevAttrMultiProcessorCount() { - return cudaDevAttrMultiProcessorCount; - } - private static final int cudaDevAttrKernelExecTimeout = (int)17L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrKernelExecTimeout = 17 - * } - */ - public static int cudaDevAttrKernelExecTimeout() { - return cudaDevAttrKernelExecTimeout; - } - private static final int cudaDevAttrIntegrated = (int)18L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrIntegrated = 18 - * } - */ - public static int cudaDevAttrIntegrated() { - return cudaDevAttrIntegrated; - } - private static final int cudaDevAttrCanMapHostMemory = (int)19L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrCanMapHostMemory = 19 - * } - */ - public static int cudaDevAttrCanMapHostMemory() { - return cudaDevAttrCanMapHostMemory; - } - private static final int cudaDevAttrComputeMode = (int)20L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrComputeMode = 20 - * } - */ - public static int cudaDevAttrComputeMode() { - return cudaDevAttrComputeMode; - } - private static final int cudaDevAttrMaxTexture1DWidth = (int)21L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture1DWidth = 21 - * } - */ - public static int cudaDevAttrMaxTexture1DWidth() { - return cudaDevAttrMaxTexture1DWidth; - } - private static final int cudaDevAttrMaxTexture2DWidth = (int)22L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DWidth = 22 - * } - */ - public static int cudaDevAttrMaxTexture2DWidth() { - return cudaDevAttrMaxTexture2DWidth; - } - private static final int cudaDevAttrMaxTexture2DHeight = (int)23L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DHeight = 23 - * } - */ - public static int cudaDevAttrMaxTexture2DHeight() { - return cudaDevAttrMaxTexture2DHeight; - } - private static final int cudaDevAttrMaxTexture3DWidth = (int)24L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DWidth = 24 - * } - */ - public static int cudaDevAttrMaxTexture3DWidth() { - return cudaDevAttrMaxTexture3DWidth; - } - private static final int cudaDevAttrMaxTexture3DHeight = (int)25L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DHeight = 25 - * } - */ - public static int cudaDevAttrMaxTexture3DHeight() { - return cudaDevAttrMaxTexture3DHeight; - } - private static final int cudaDevAttrMaxTexture3DDepth = (int)26L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DDepth = 26 - * } - */ - public static int cudaDevAttrMaxTexture3DDepth() { - return cudaDevAttrMaxTexture3DDepth; - } - private static final int cudaDevAttrMaxTexture2DLayeredWidth = (int)27L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredWidth = 27 - * } - */ - public static int cudaDevAttrMaxTexture2DLayeredWidth() { - return cudaDevAttrMaxTexture2DLayeredWidth; - } - private static final int cudaDevAttrMaxTexture2DLayeredHeight = (int)28L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredHeight = 28 - * } - */ - public static int cudaDevAttrMaxTexture2DLayeredHeight() { - return cudaDevAttrMaxTexture2DLayeredHeight; - } - private static final int cudaDevAttrMaxTexture2DLayeredLayers = (int)29L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLayeredLayers = 29 - * } - */ - public static int cudaDevAttrMaxTexture2DLayeredLayers() { - return cudaDevAttrMaxTexture2DLayeredLayers; - } - private static final int cudaDevAttrSurfaceAlignment = (int)30L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrSurfaceAlignment = 30 - * } - */ - public static int cudaDevAttrSurfaceAlignment() { - return cudaDevAttrSurfaceAlignment; - } - private static final int cudaDevAttrConcurrentKernels = (int)31L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrConcurrentKernels = 31 - * } - */ - public static int cudaDevAttrConcurrentKernels() { - return cudaDevAttrConcurrentKernels; - } - private static final int cudaDevAttrEccEnabled = (int)32L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrEccEnabled = 32 - * } - */ - public static int cudaDevAttrEccEnabled() { - return cudaDevAttrEccEnabled; - } - private static final int cudaDevAttrPciBusId = (int)33L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrPciBusId = 33 - * } - */ - public static int cudaDevAttrPciBusId() { - return cudaDevAttrPciBusId; - } - private static final int cudaDevAttrPciDeviceId = (int)34L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrPciDeviceId = 34 - * } - */ - public static int cudaDevAttrPciDeviceId() { - return cudaDevAttrPciDeviceId; - } - private static final int cudaDevAttrTccDriver = (int)35L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrTccDriver = 35 - * } - */ - public static int cudaDevAttrTccDriver() { - return cudaDevAttrTccDriver; - } - private static final int cudaDevAttrMemoryClockRate = (int)36L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMemoryClockRate = 36 - * } - */ - public static int cudaDevAttrMemoryClockRate() { - return cudaDevAttrMemoryClockRate; - } - private static final int cudaDevAttrGlobalMemoryBusWidth = (int)37L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrGlobalMemoryBusWidth = 37 - * } - */ - public static int cudaDevAttrGlobalMemoryBusWidth() { - return cudaDevAttrGlobalMemoryBusWidth; - } - private static final int cudaDevAttrL2CacheSize = (int)38L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrL2CacheSize = 38 - * } - */ - public static int cudaDevAttrL2CacheSize() { - return cudaDevAttrL2CacheSize; - } - private static final int cudaDevAttrMaxThreadsPerMultiProcessor = (int)39L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxThreadsPerMultiProcessor = 39 - * } - */ - public static int cudaDevAttrMaxThreadsPerMultiProcessor() { - return cudaDevAttrMaxThreadsPerMultiProcessor; - } - private static final int cudaDevAttrAsyncEngineCount = (int)40L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrAsyncEngineCount = 40 - * } - */ - public static int cudaDevAttrAsyncEngineCount() { - return cudaDevAttrAsyncEngineCount; - } - private static final int cudaDevAttrUnifiedAddressing = (int)41L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrUnifiedAddressing = 41 - * } - */ - public static int cudaDevAttrUnifiedAddressing() { - return cudaDevAttrUnifiedAddressing; - } - private static final int cudaDevAttrMaxTexture1DLayeredWidth = (int)42L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredWidth = 42 - * } - */ - public static int cudaDevAttrMaxTexture1DLayeredWidth() { - return cudaDevAttrMaxTexture1DLayeredWidth; - } - private static final int cudaDevAttrMaxTexture1DLayeredLayers = (int)43L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture1DLayeredLayers = 43 - * } - */ - public static int cudaDevAttrMaxTexture1DLayeredLayers() { - return cudaDevAttrMaxTexture1DLayeredLayers; - } - private static final int cudaDevAttrMaxTexture2DGatherWidth = (int)45L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherWidth = 45 - * } - */ - public static int cudaDevAttrMaxTexture2DGatherWidth() { - return cudaDevAttrMaxTexture2DGatherWidth; - } - private static final int cudaDevAttrMaxTexture2DGatherHeight = (int)46L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DGatherHeight = 46 - * } - */ - public static int cudaDevAttrMaxTexture2DGatherHeight() { - return cudaDevAttrMaxTexture2DGatherHeight; - } - private static final int cudaDevAttrMaxTexture3DWidthAlt = (int)47L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DWidthAlt = 47 - * } - */ - public static int cudaDevAttrMaxTexture3DWidthAlt() { - return cudaDevAttrMaxTexture3DWidthAlt; - } - private static final int cudaDevAttrMaxTexture3DHeightAlt = (int)48L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DHeightAlt = 48 - * } - */ - public static int cudaDevAttrMaxTexture3DHeightAlt() { - return cudaDevAttrMaxTexture3DHeightAlt; - } - private static final int cudaDevAttrMaxTexture3DDepthAlt = (int)49L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture3DDepthAlt = 49 - * } - */ - public static int cudaDevAttrMaxTexture3DDepthAlt() { - return cudaDevAttrMaxTexture3DDepthAlt; - } - private static final int cudaDevAttrPciDomainId = (int)50L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrPciDomainId = 50 - * } - */ - public static int cudaDevAttrPciDomainId() { - return cudaDevAttrPciDomainId; - } - private static final int cudaDevAttrTexturePitchAlignment = (int)51L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrTexturePitchAlignment = 51 - * } - */ - public static int cudaDevAttrTexturePitchAlignment() { - return cudaDevAttrTexturePitchAlignment; - } - private static final int cudaDevAttrMaxTextureCubemapWidth = (int)52L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTextureCubemapWidth = 52 - * } - */ - public static int cudaDevAttrMaxTextureCubemapWidth() { - return cudaDevAttrMaxTextureCubemapWidth; - } - private static final int cudaDevAttrMaxTextureCubemapLayeredWidth = (int)53L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredWidth = 53 - * } - */ - public static int cudaDevAttrMaxTextureCubemapLayeredWidth() { - return cudaDevAttrMaxTextureCubemapLayeredWidth; - } - private static final int cudaDevAttrMaxTextureCubemapLayeredLayers = (int)54L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTextureCubemapLayeredLayers = 54 - * } - */ - public static int cudaDevAttrMaxTextureCubemapLayeredLayers() { - return cudaDevAttrMaxTextureCubemapLayeredLayers; - } - private static final int cudaDevAttrMaxSurface1DWidth = (int)55L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface1DWidth = 55 - * } - */ - public static int cudaDevAttrMaxSurface1DWidth() { - return cudaDevAttrMaxSurface1DWidth; - } - private static final int cudaDevAttrMaxSurface2DWidth = (int)56L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface2DWidth = 56 - * } - */ - public static int cudaDevAttrMaxSurface2DWidth() { - return cudaDevAttrMaxSurface2DWidth; - } - private static final int cudaDevAttrMaxSurface2DHeight = (int)57L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface2DHeight = 57 - * } - */ - public static int cudaDevAttrMaxSurface2DHeight() { - return cudaDevAttrMaxSurface2DHeight; - } - private static final int cudaDevAttrMaxSurface3DWidth = (int)58L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface3DWidth = 58 - * } - */ - public static int cudaDevAttrMaxSurface3DWidth() { - return cudaDevAttrMaxSurface3DWidth; - } - private static final int cudaDevAttrMaxSurface3DHeight = (int)59L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface3DHeight = 59 - * } - */ - public static int cudaDevAttrMaxSurface3DHeight() { - return cudaDevAttrMaxSurface3DHeight; - } - private static final int cudaDevAttrMaxSurface3DDepth = (int)60L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface3DDepth = 60 - * } - */ - public static int cudaDevAttrMaxSurface3DDepth() { - return cudaDevAttrMaxSurface3DDepth; - } - private static final int cudaDevAttrMaxSurface1DLayeredWidth = (int)61L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredWidth = 61 - * } - */ - public static int cudaDevAttrMaxSurface1DLayeredWidth() { - return cudaDevAttrMaxSurface1DLayeredWidth; - } - private static final int cudaDevAttrMaxSurface1DLayeredLayers = (int)62L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface1DLayeredLayers = 62 - * } - */ - public static int cudaDevAttrMaxSurface1DLayeredLayers() { - return cudaDevAttrMaxSurface1DLayeredLayers; - } - private static final int cudaDevAttrMaxSurface2DLayeredWidth = (int)63L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredWidth = 63 - * } - */ - public static int cudaDevAttrMaxSurface2DLayeredWidth() { - return cudaDevAttrMaxSurface2DLayeredWidth; - } - private static final int cudaDevAttrMaxSurface2DLayeredHeight = (int)64L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredHeight = 64 - * } - */ - public static int cudaDevAttrMaxSurface2DLayeredHeight() { - return cudaDevAttrMaxSurface2DLayeredHeight; - } - private static final int cudaDevAttrMaxSurface2DLayeredLayers = (int)65L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurface2DLayeredLayers = 65 - * } - */ - public static int cudaDevAttrMaxSurface2DLayeredLayers() { - return cudaDevAttrMaxSurface2DLayeredLayers; - } - private static final int cudaDevAttrMaxSurfaceCubemapWidth = (int)66L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapWidth = 66 - * } - */ - public static int cudaDevAttrMaxSurfaceCubemapWidth() { - return cudaDevAttrMaxSurfaceCubemapWidth; - } - private static final int cudaDevAttrMaxSurfaceCubemapLayeredWidth = (int)67L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredWidth = 67 - * } - */ - public static int cudaDevAttrMaxSurfaceCubemapLayeredWidth() { - return cudaDevAttrMaxSurfaceCubemapLayeredWidth; - } - private static final int cudaDevAttrMaxSurfaceCubemapLayeredLayers = (int)68L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSurfaceCubemapLayeredLayers = 68 - * } - */ - public static int cudaDevAttrMaxSurfaceCubemapLayeredLayers() { - return cudaDevAttrMaxSurfaceCubemapLayeredLayers; - } - private static final int cudaDevAttrMaxTexture1DLinearWidth = (int)69L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture1DLinearWidth = 69 - * } - */ - public static int cudaDevAttrMaxTexture1DLinearWidth() { - return cudaDevAttrMaxTexture1DLinearWidth; - } - private static final int cudaDevAttrMaxTexture2DLinearWidth = (int)70L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearWidth = 70 - * } - */ - public static int cudaDevAttrMaxTexture2DLinearWidth() { - return cudaDevAttrMaxTexture2DLinearWidth; - } - private static final int cudaDevAttrMaxTexture2DLinearHeight = (int)71L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearHeight = 71 - * } - */ - public static int cudaDevAttrMaxTexture2DLinearHeight() { - return cudaDevAttrMaxTexture2DLinearHeight; - } - private static final int cudaDevAttrMaxTexture2DLinearPitch = (int)72L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DLinearPitch = 72 - * } - */ - public static int cudaDevAttrMaxTexture2DLinearPitch() { - return cudaDevAttrMaxTexture2DLinearPitch; - } - private static final int cudaDevAttrMaxTexture2DMipmappedWidth = (int)73L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedWidth = 73 - * } - */ - public static int cudaDevAttrMaxTexture2DMipmappedWidth() { - return cudaDevAttrMaxTexture2DMipmappedWidth; - } - private static final int cudaDevAttrMaxTexture2DMipmappedHeight = (int)74L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture2DMipmappedHeight = 74 - * } - */ - public static int cudaDevAttrMaxTexture2DMipmappedHeight() { - return cudaDevAttrMaxTexture2DMipmappedHeight; - } - private static final int cudaDevAttrComputeCapabilityMajor = (int)75L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrComputeCapabilityMajor = 75 - * } - */ - public static int cudaDevAttrComputeCapabilityMajor() { - return cudaDevAttrComputeCapabilityMajor; - } - private static final int cudaDevAttrComputeCapabilityMinor = (int)76L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrComputeCapabilityMinor = 76 - * } - */ - public static int cudaDevAttrComputeCapabilityMinor() { - return cudaDevAttrComputeCapabilityMinor; - } - private static final int cudaDevAttrMaxTexture1DMipmappedWidth = (int)77L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTexture1DMipmappedWidth = 77 - * } - */ - public static int cudaDevAttrMaxTexture1DMipmappedWidth() { - return cudaDevAttrMaxTexture1DMipmappedWidth; - } - private static final int cudaDevAttrStreamPrioritiesSupported = (int)78L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrStreamPrioritiesSupported = 78 - * } - */ - public static int cudaDevAttrStreamPrioritiesSupported() { - return cudaDevAttrStreamPrioritiesSupported; - } - private static final int cudaDevAttrGlobalL1CacheSupported = (int)79L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrGlobalL1CacheSupported = 79 - * } - */ - public static int cudaDevAttrGlobalL1CacheSupported() { - return cudaDevAttrGlobalL1CacheSupported; - } - private static final int cudaDevAttrLocalL1CacheSupported = (int)80L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrLocalL1CacheSupported = 80 - * } - */ - public static int cudaDevAttrLocalL1CacheSupported() { - return cudaDevAttrLocalL1CacheSupported; - } - private static final int cudaDevAttrMaxSharedMemoryPerMultiprocessor = (int)81L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerMultiprocessor = 81 - * } - */ - public static int cudaDevAttrMaxSharedMemoryPerMultiprocessor() { - return cudaDevAttrMaxSharedMemoryPerMultiprocessor; - } - private static final int cudaDevAttrMaxRegistersPerMultiprocessor = (int)82L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxRegistersPerMultiprocessor = 82 - * } - */ - public static int cudaDevAttrMaxRegistersPerMultiprocessor() { - return cudaDevAttrMaxRegistersPerMultiprocessor; - } - private static final int cudaDevAttrManagedMemory = (int)83L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrManagedMemory = 83 - * } - */ - public static int cudaDevAttrManagedMemory() { - return cudaDevAttrManagedMemory; - } - private static final int cudaDevAttrIsMultiGpuBoard = (int)84L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrIsMultiGpuBoard = 84 - * } - */ - public static int cudaDevAttrIsMultiGpuBoard() { - return cudaDevAttrIsMultiGpuBoard; - } - private static final int cudaDevAttrMultiGpuBoardGroupID = (int)85L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMultiGpuBoardGroupID = 85 - * } - */ - public static int cudaDevAttrMultiGpuBoardGroupID() { - return cudaDevAttrMultiGpuBoardGroupID; - } - private static final int cudaDevAttrHostNativeAtomicSupported = (int)86L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrHostNativeAtomicSupported = 86 - * } - */ - public static int cudaDevAttrHostNativeAtomicSupported() { - return cudaDevAttrHostNativeAtomicSupported; - } - private static final int cudaDevAttrSingleToDoublePrecisionPerfRatio = (int)87L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrSingleToDoublePrecisionPerfRatio = 87 - * } - */ - public static int cudaDevAttrSingleToDoublePrecisionPerfRatio() { - return cudaDevAttrSingleToDoublePrecisionPerfRatio; - } - private static final int cudaDevAttrPageableMemoryAccess = (int)88L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrPageableMemoryAccess = 88 - * } - */ - public static int cudaDevAttrPageableMemoryAccess() { - return cudaDevAttrPageableMemoryAccess; - } - private static final int cudaDevAttrConcurrentManagedAccess = (int)89L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrConcurrentManagedAccess = 89 - * } - */ - public static int cudaDevAttrConcurrentManagedAccess() { - return cudaDevAttrConcurrentManagedAccess; - } - private static final int cudaDevAttrComputePreemptionSupported = (int)90L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrComputePreemptionSupported = 90 - * } - */ - public static int cudaDevAttrComputePreemptionSupported() { - return cudaDevAttrComputePreemptionSupported; - } - private static final int cudaDevAttrCanUseHostPointerForRegisteredMem = (int)91L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrCanUseHostPointerForRegisteredMem = 91 - * } - */ - public static int cudaDevAttrCanUseHostPointerForRegisteredMem() { - return cudaDevAttrCanUseHostPointerForRegisteredMem; - } - private static final int cudaDevAttrReserved92 = (int)92L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReserved92 = 92 - * } - */ - public static int cudaDevAttrReserved92() { - return cudaDevAttrReserved92; - } - private static final int cudaDevAttrReserved93 = (int)93L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReserved93 = 93 - * } - */ - public static int cudaDevAttrReserved93() { - return cudaDevAttrReserved93; - } - private static final int cudaDevAttrReserved94 = (int)94L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReserved94 = 94 - * } - */ - public static int cudaDevAttrReserved94() { - return cudaDevAttrReserved94; - } - private static final int cudaDevAttrCooperativeLaunch = (int)95L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrCooperativeLaunch = 95 - * } - */ - public static int cudaDevAttrCooperativeLaunch() { - return cudaDevAttrCooperativeLaunch; - } - private static final int cudaDevAttrCooperativeMultiDeviceLaunch = (int)96L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrCooperativeMultiDeviceLaunch = 96 - * } - */ - public static int cudaDevAttrCooperativeMultiDeviceLaunch() { - return cudaDevAttrCooperativeMultiDeviceLaunch; - } - private static final int cudaDevAttrMaxSharedMemoryPerBlockOptin = (int)97L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxSharedMemoryPerBlockOptin = 97 - * } - */ - public static int cudaDevAttrMaxSharedMemoryPerBlockOptin() { - return cudaDevAttrMaxSharedMemoryPerBlockOptin; - } - private static final int cudaDevAttrCanFlushRemoteWrites = (int)98L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrCanFlushRemoteWrites = 98 - * } - */ - public static int cudaDevAttrCanFlushRemoteWrites() { - return cudaDevAttrCanFlushRemoteWrites; - } - private static final int cudaDevAttrHostRegisterSupported = (int)99L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrHostRegisterSupported = 99 - * } - */ - public static int cudaDevAttrHostRegisterSupported() { - return cudaDevAttrHostRegisterSupported; - } - private static final int cudaDevAttrPageableMemoryAccessUsesHostPageTables = (int)100L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrPageableMemoryAccessUsesHostPageTables = 100 - * } - */ - public static int cudaDevAttrPageableMemoryAccessUsesHostPageTables() { - return cudaDevAttrPageableMemoryAccessUsesHostPageTables; - } - private static final int cudaDevAttrDirectManagedMemAccessFromHost = (int)101L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrDirectManagedMemAccessFromHost = 101 - * } - */ - public static int cudaDevAttrDirectManagedMemAccessFromHost() { - return cudaDevAttrDirectManagedMemAccessFromHost; - } - private static final int cudaDevAttrMaxBlocksPerMultiprocessor = (int)106L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxBlocksPerMultiprocessor = 106 - * } - */ - public static int cudaDevAttrMaxBlocksPerMultiprocessor() { - return cudaDevAttrMaxBlocksPerMultiprocessor; - } - private static final int cudaDevAttrMaxPersistingL2CacheSize = (int)108L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxPersistingL2CacheSize = 108 - * } - */ - public static int cudaDevAttrMaxPersistingL2CacheSize() { - return cudaDevAttrMaxPersistingL2CacheSize; - } - private static final int cudaDevAttrMaxAccessPolicyWindowSize = (int)109L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxAccessPolicyWindowSize = 109 - * } - */ - public static int cudaDevAttrMaxAccessPolicyWindowSize() { - return cudaDevAttrMaxAccessPolicyWindowSize; - } - private static final int cudaDevAttrReservedSharedMemoryPerBlock = (int)111L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReservedSharedMemoryPerBlock = 111 - * } - */ - public static int cudaDevAttrReservedSharedMemoryPerBlock() { - return cudaDevAttrReservedSharedMemoryPerBlock; - } - private static final int cudaDevAttrSparseCudaArraySupported = (int)112L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrSparseCudaArraySupported = 112 - * } - */ - public static int cudaDevAttrSparseCudaArraySupported() { - return cudaDevAttrSparseCudaArraySupported; - } - private static final int cudaDevAttrHostRegisterReadOnlySupported = (int)113L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrHostRegisterReadOnlySupported = 113 - * } - */ - public static int cudaDevAttrHostRegisterReadOnlySupported() { - return cudaDevAttrHostRegisterReadOnlySupported; - } - private static final int cudaDevAttrTimelineSemaphoreInteropSupported = (int)114L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrTimelineSemaphoreInteropSupported = 114 - * } - */ - public static int cudaDevAttrTimelineSemaphoreInteropSupported() { - return cudaDevAttrTimelineSemaphoreInteropSupported; - } - private static final int cudaDevAttrMaxTimelineSemaphoreInteropSupported = (int)114L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMaxTimelineSemaphoreInteropSupported = 114 - * } - */ - public static int cudaDevAttrMaxTimelineSemaphoreInteropSupported() { - return cudaDevAttrMaxTimelineSemaphoreInteropSupported; - } - private static final int cudaDevAttrMemoryPoolsSupported = (int)115L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMemoryPoolsSupported = 115 - * } - */ - public static int cudaDevAttrMemoryPoolsSupported() { - return cudaDevAttrMemoryPoolsSupported; - } - private static final int cudaDevAttrGPUDirectRDMASupported = (int)116L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrGPUDirectRDMASupported = 116 - * } - */ - public static int cudaDevAttrGPUDirectRDMASupported() { - return cudaDevAttrGPUDirectRDMASupported; - } - private static final int cudaDevAttrGPUDirectRDMAFlushWritesOptions = (int)117L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrGPUDirectRDMAFlushWritesOptions = 117 - * } - */ - public static int cudaDevAttrGPUDirectRDMAFlushWritesOptions() { - return cudaDevAttrGPUDirectRDMAFlushWritesOptions; - } - private static final int cudaDevAttrGPUDirectRDMAWritesOrdering = (int)118L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrGPUDirectRDMAWritesOrdering = 118 - * } - */ - public static int cudaDevAttrGPUDirectRDMAWritesOrdering() { - return cudaDevAttrGPUDirectRDMAWritesOrdering; - } - private static final int cudaDevAttrMemoryPoolSupportedHandleTypes = (int)119L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMemoryPoolSupportedHandleTypes = 119 - * } - */ - public static int cudaDevAttrMemoryPoolSupportedHandleTypes() { - return cudaDevAttrMemoryPoolSupportedHandleTypes; - } - private static final int cudaDevAttrClusterLaunch = (int)120L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrClusterLaunch = 120 - * } - */ - public static int cudaDevAttrClusterLaunch() { - return cudaDevAttrClusterLaunch; - } - private static final int cudaDevAttrDeferredMappingCudaArraySupported = (int)121L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrDeferredMappingCudaArraySupported = 121 - * } - */ - public static int cudaDevAttrDeferredMappingCudaArraySupported() { - return cudaDevAttrDeferredMappingCudaArraySupported; - } - private static final int cudaDevAttrReserved122 = (int)122L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReserved122 = 122 - * } - */ - public static int cudaDevAttrReserved122() { - return cudaDevAttrReserved122; - } - private static final int cudaDevAttrReserved123 = (int)123L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReserved123 = 123 - * } - */ - public static int cudaDevAttrReserved123() { - return cudaDevAttrReserved123; - } - private static final int cudaDevAttrReserved124 = (int)124L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReserved124 = 124 - * } - */ - public static int cudaDevAttrReserved124() { - return cudaDevAttrReserved124; - } - private static final int cudaDevAttrIpcEventSupport = (int)125L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrIpcEventSupport = 125 - * } - */ - public static int cudaDevAttrIpcEventSupport() { - return cudaDevAttrIpcEventSupport; - } - private static final int cudaDevAttrMemSyncDomainCount = (int)126L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMemSyncDomainCount = 126 - * } - */ - public static int cudaDevAttrMemSyncDomainCount() { - return cudaDevAttrMemSyncDomainCount; - } - private static final int cudaDevAttrReserved127 = (int)127L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReserved127 = 127 - * } - */ - public static int cudaDevAttrReserved127() { - return cudaDevAttrReserved127; - } - private static final int cudaDevAttrReserved128 = (int)128L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReserved128 = 128 - * } - */ - public static int cudaDevAttrReserved128() { - return cudaDevAttrReserved128; - } - private static final int cudaDevAttrReserved129 = (int)129L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReserved129 = 129 - * } - */ - public static int cudaDevAttrReserved129() { - return cudaDevAttrReserved129; - } - private static final int cudaDevAttrNumaConfig = (int)130L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrNumaConfig = 130 - * } - */ - public static int cudaDevAttrNumaConfig() { - return cudaDevAttrNumaConfig; - } - private static final int cudaDevAttrNumaId = (int)131L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrNumaId = 131 - * } - */ - public static int cudaDevAttrNumaId() { - return cudaDevAttrNumaId; - } - private static final int cudaDevAttrReserved132 = (int)132L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrReserved132 = 132 - * } - */ - public static int cudaDevAttrReserved132() { - return cudaDevAttrReserved132; - } - private static final int cudaDevAttrMpsEnabled = (int)133L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMpsEnabled = 133 - * } - */ - public static int cudaDevAttrMpsEnabled() { - return cudaDevAttrMpsEnabled; - } - private static final int cudaDevAttrHostNumaId = (int)134L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrHostNumaId = 134 - * } - */ - public static int cudaDevAttrHostNumaId() { - return cudaDevAttrHostNumaId; - } - private static final int cudaDevAttrD3D12CigSupported = (int)135L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrD3D12CigSupported = 135 - * } - */ - public static int cudaDevAttrD3D12CigSupported() { - return cudaDevAttrD3D12CigSupported; - } - private static final int cudaDevAttrMax = (int)136L; - /** - * {@snippet lang=c : - * enum cudaDeviceAttr.cudaDevAttrMax = 136 - * } - */ - public static int cudaDevAttrMax() { - return cudaDevAttrMax; - } - private static final int cudaMemPoolReuseFollowEventDependencies = (int)1L; - /** - * {@snippet lang=c : - * enum cudaMemPoolAttr.cudaMemPoolReuseFollowEventDependencies = 1 - * } - */ - public static int cudaMemPoolReuseFollowEventDependencies() { - return cudaMemPoolReuseFollowEventDependencies; - } - private static final int cudaMemPoolReuseAllowOpportunistic = (int)2L; - /** - * {@snippet lang=c : - * enum cudaMemPoolAttr.cudaMemPoolReuseAllowOpportunistic = 2 - * } - */ - public static int cudaMemPoolReuseAllowOpportunistic() { - return cudaMemPoolReuseAllowOpportunistic; - } - private static final int cudaMemPoolReuseAllowInternalDependencies = (int)3L; - /** - * {@snippet lang=c : - * enum cudaMemPoolAttr.cudaMemPoolReuseAllowInternalDependencies = 3 - * } - */ - public static int cudaMemPoolReuseAllowInternalDependencies() { - return cudaMemPoolReuseAllowInternalDependencies; - } - private static final int cudaMemPoolAttrReleaseThreshold = (int)4L; - /** - * {@snippet lang=c : - * enum cudaMemPoolAttr.cudaMemPoolAttrReleaseThreshold = 4 - * } - */ - public static int cudaMemPoolAttrReleaseThreshold() { - return cudaMemPoolAttrReleaseThreshold; - } - private static final int cudaMemPoolAttrReservedMemCurrent = (int)5L; - /** - * {@snippet lang=c : - * enum cudaMemPoolAttr.cudaMemPoolAttrReservedMemCurrent = 5 - * } - */ - public static int cudaMemPoolAttrReservedMemCurrent() { - return cudaMemPoolAttrReservedMemCurrent; - } - private static final int cudaMemPoolAttrReservedMemHigh = (int)6L; - /** - * {@snippet lang=c : - * enum cudaMemPoolAttr.cudaMemPoolAttrReservedMemHigh = 6 - * } - */ - public static int cudaMemPoolAttrReservedMemHigh() { - return cudaMemPoolAttrReservedMemHigh; - } - private static final int cudaMemPoolAttrUsedMemCurrent = (int)7L; - /** - * {@snippet lang=c : - * enum cudaMemPoolAttr.cudaMemPoolAttrUsedMemCurrent = 7 - * } - */ - public static int cudaMemPoolAttrUsedMemCurrent() { - return cudaMemPoolAttrUsedMemCurrent; - } - private static final int cudaMemPoolAttrUsedMemHigh = (int)8L; - /** - * {@snippet lang=c : - * enum cudaMemPoolAttr.cudaMemPoolAttrUsedMemHigh = 8 - * } - */ - public static int cudaMemPoolAttrUsedMemHigh() { - return cudaMemPoolAttrUsedMemHigh; - } - private static final int cudaMemLocationTypeInvalid = (int)0L; - /** - * {@snippet lang=c : - * enum cudaMemLocationType.cudaMemLocationTypeInvalid = 0 - * } - */ - public static int cudaMemLocationTypeInvalid() { - return cudaMemLocationTypeInvalid; - } - private static final int cudaMemLocationTypeDevice = (int)1L; - /** - * {@snippet lang=c : - * enum cudaMemLocationType.cudaMemLocationTypeDevice = 1 - * } - */ - public static int cudaMemLocationTypeDevice() { - return cudaMemLocationTypeDevice; - } - private static final int cudaMemLocationTypeHost = (int)2L; - /** - * {@snippet lang=c : - * enum cudaMemLocationType.cudaMemLocationTypeHost = 2 - * } - */ - public static int cudaMemLocationTypeHost() { - return cudaMemLocationTypeHost; - } - private static final int cudaMemLocationTypeHostNuma = (int)3L; - /** - * {@snippet lang=c : - * enum cudaMemLocationType.cudaMemLocationTypeHostNuma = 3 - * } - */ - public static int cudaMemLocationTypeHostNuma() { - return cudaMemLocationTypeHostNuma; - } - private static final int cudaMemLocationTypeHostNumaCurrent = (int)4L; - /** - * {@snippet lang=c : - * enum cudaMemLocationType.cudaMemLocationTypeHostNumaCurrent = 4 - * } - */ - public static int cudaMemLocationTypeHostNumaCurrent() { - return cudaMemLocationTypeHostNumaCurrent; - } - private static final int cudaMemAccessFlagsProtNone = (int)0L; - /** - * {@snippet lang=c : - * enum cudaMemAccessFlags.cudaMemAccessFlagsProtNone = 0 - * } - */ - public static int cudaMemAccessFlagsProtNone() { - return cudaMemAccessFlagsProtNone; - } - private static final int cudaMemAccessFlagsProtRead = (int)1L; - /** - * {@snippet lang=c : - * enum cudaMemAccessFlags.cudaMemAccessFlagsProtRead = 1 - * } - */ - public static int cudaMemAccessFlagsProtRead() { - return cudaMemAccessFlagsProtRead; - } - private static final int cudaMemAccessFlagsProtReadWrite = (int)3L; - /** - * {@snippet lang=c : - * enum cudaMemAccessFlags.cudaMemAccessFlagsProtReadWrite = 3 - * } - */ - public static int cudaMemAccessFlagsProtReadWrite() { - return cudaMemAccessFlagsProtReadWrite; - } - private static final int cudaMemAllocationTypeInvalid = (int)0L; - /** - * {@snippet lang=c : - * enum cudaMemAllocationType.cudaMemAllocationTypeInvalid = 0 - * } - */ - public static int cudaMemAllocationTypeInvalid() { - return cudaMemAllocationTypeInvalid; - } - private static final int cudaMemAllocationTypePinned = (int)1L; - /** - * {@snippet lang=c : - * enum cudaMemAllocationType.cudaMemAllocationTypePinned = 1 - * } - */ - public static int cudaMemAllocationTypePinned() { - return cudaMemAllocationTypePinned; - } - private static final int cudaMemAllocationTypeMax = (int)2147483647L; - /** - * {@snippet lang=c : - * enum cudaMemAllocationType.cudaMemAllocationTypeMax = 2147483647 - * } - */ - public static int cudaMemAllocationTypeMax() { - return cudaMemAllocationTypeMax; - } - private static final int cudaMemHandleTypeNone = (int)0L; - /** - * {@snippet lang=c : - * enum cudaMemAllocationHandleType.cudaMemHandleTypeNone = 0 - * } - */ - public static int cudaMemHandleTypeNone() { - return cudaMemHandleTypeNone; - } - private static final int cudaMemHandleTypePosixFileDescriptor = (int)1L; - /** - * {@snippet lang=c : - * enum cudaMemAllocationHandleType.cudaMemHandleTypePosixFileDescriptor = 1 - * } - */ - public static int cudaMemHandleTypePosixFileDescriptor() { - return cudaMemHandleTypePosixFileDescriptor; - } - private static final int cudaMemHandleTypeWin32 = (int)2L; - /** - * {@snippet lang=c : - * enum cudaMemAllocationHandleType.cudaMemHandleTypeWin32 = 2 - * } - */ - public static int cudaMemHandleTypeWin32() { - return cudaMemHandleTypeWin32; - } - private static final int cudaMemHandleTypeWin32Kmt = (int)4L; - /** - * {@snippet lang=c : - * enum cudaMemAllocationHandleType.cudaMemHandleTypeWin32Kmt = 4 - * } - */ - public static int cudaMemHandleTypeWin32Kmt() { - return cudaMemHandleTypeWin32Kmt; - } - private static final int cudaMemHandleTypeFabric = (int)8L; - /** - * {@snippet lang=c : - * enum cudaMemAllocationHandleType.cudaMemHandleTypeFabric = 8 - * } - */ - public static int cudaMemHandleTypeFabric() { - return cudaMemHandleTypeFabric; - } - private static final int cudaGraphMemAttrUsedMemCurrent = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemCurrent = 0 - * } - */ - public static int cudaGraphMemAttrUsedMemCurrent() { - return cudaGraphMemAttrUsedMemCurrent; - } - private static final int cudaGraphMemAttrUsedMemHigh = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphMemAttributeType.cudaGraphMemAttrUsedMemHigh = 1 - * } - */ - public static int cudaGraphMemAttrUsedMemHigh() { - return cudaGraphMemAttrUsedMemHigh; - } - private static final int cudaGraphMemAttrReservedMemCurrent = (int)2L; - /** - * {@snippet lang=c : - * enum cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemCurrent = 2 - * } - */ - public static int cudaGraphMemAttrReservedMemCurrent() { - return cudaGraphMemAttrReservedMemCurrent; - } - private static final int cudaGraphMemAttrReservedMemHigh = (int)3L; - /** - * {@snippet lang=c : - * enum cudaGraphMemAttributeType.cudaGraphMemAttrReservedMemHigh = 3 - * } - */ - public static int cudaGraphMemAttrReservedMemHigh() { - return cudaGraphMemAttrReservedMemHigh; - } - private static final int cudaDevP2PAttrPerformanceRank = (int)1L; - /** - * {@snippet lang=c : - * enum cudaDeviceP2PAttr.cudaDevP2PAttrPerformanceRank = 1 - * } - */ - public static int cudaDevP2PAttrPerformanceRank() { - return cudaDevP2PAttrPerformanceRank; - } - private static final int cudaDevP2PAttrAccessSupported = (int)2L; - /** - * {@snippet lang=c : - * enum cudaDeviceP2PAttr.cudaDevP2PAttrAccessSupported = 2 - * } - */ - public static int cudaDevP2PAttrAccessSupported() { - return cudaDevP2PAttrAccessSupported; - } - private static final int cudaDevP2PAttrNativeAtomicSupported = (int)3L; - /** - * {@snippet lang=c : - * enum cudaDeviceP2PAttr.cudaDevP2PAttrNativeAtomicSupported = 3 - * } - */ - public static int cudaDevP2PAttrNativeAtomicSupported() { - return cudaDevP2PAttrNativeAtomicSupported; - } - private static final int cudaDevP2PAttrCudaArrayAccessSupported = (int)4L; - /** - * {@snippet lang=c : - * enum cudaDeviceP2PAttr.cudaDevP2PAttrCudaArrayAccessSupported = 4 - * } - */ - public static int cudaDevP2PAttrCudaArrayAccessSupported() { - return cudaDevP2PAttrCudaArrayAccessSupported; - } - private static final int cudaExternalMemoryHandleTypeOpaqueFd = (int)1L; - /** - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueFd = 1 - * } - */ - public static int cudaExternalMemoryHandleTypeOpaqueFd() { - return cudaExternalMemoryHandleTypeOpaqueFd; - } - private static final int cudaExternalMemoryHandleTypeOpaqueWin32 = (int)2L; - /** - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32 = 2 - * } - */ - public static int cudaExternalMemoryHandleTypeOpaqueWin32() { - return cudaExternalMemoryHandleTypeOpaqueWin32; - } - private static final int cudaExternalMemoryHandleTypeOpaqueWin32Kmt = (int)3L; - /** - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeOpaqueWin32Kmt = 3 - * } - */ - public static int cudaExternalMemoryHandleTypeOpaqueWin32Kmt() { - return cudaExternalMemoryHandleTypeOpaqueWin32Kmt; - } - private static final int cudaExternalMemoryHandleTypeD3D12Heap = (int)4L; - /** - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Heap = 4 - * } - */ - public static int cudaExternalMemoryHandleTypeD3D12Heap() { - return cudaExternalMemoryHandleTypeD3D12Heap; - } - private static final int cudaExternalMemoryHandleTypeD3D12Resource = (int)5L; - /** - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D12Resource = 5 - * } - */ - public static int cudaExternalMemoryHandleTypeD3D12Resource() { - return cudaExternalMemoryHandleTypeD3D12Resource; - } - private static final int cudaExternalMemoryHandleTypeD3D11Resource = (int)6L; - /** - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11Resource = 6 - * } - */ - public static int cudaExternalMemoryHandleTypeD3D11Resource() { - return cudaExternalMemoryHandleTypeD3D11Resource; - } - private static final int cudaExternalMemoryHandleTypeD3D11ResourceKmt = (int)7L; - /** - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeD3D11ResourceKmt = 7 - * } - */ - public static int cudaExternalMemoryHandleTypeD3D11ResourceKmt() { - return cudaExternalMemoryHandleTypeD3D11ResourceKmt; - } - private static final int cudaExternalMemoryHandleTypeNvSciBuf = (int)8L; - /** - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType.cudaExternalMemoryHandleTypeNvSciBuf = 8 - * } - */ - public static int cudaExternalMemoryHandleTypeNvSciBuf() { - return cudaExternalMemoryHandleTypeNvSciBuf; - } - private static final int cudaExternalSemaphoreHandleTypeOpaqueFd = (int)1L; - /** - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueFd = 1 - * } - */ - public static int cudaExternalSemaphoreHandleTypeOpaqueFd() { - return cudaExternalSemaphoreHandleTypeOpaqueFd; - } - private static final int cudaExternalSemaphoreHandleTypeOpaqueWin32 = (int)2L; - /** - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32 = 2 - * } - */ - public static int cudaExternalSemaphoreHandleTypeOpaqueWin32() { - return cudaExternalSemaphoreHandleTypeOpaqueWin32; - } - private static final int cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt = (int)3L; - /** - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt = 3 - * } - */ - public static int cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt() { - return cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt; - } - private static final int cudaExternalSemaphoreHandleTypeD3D12Fence = (int)4L; - /** - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D12Fence = 4 - * } - */ - public static int cudaExternalSemaphoreHandleTypeD3D12Fence() { - return cudaExternalSemaphoreHandleTypeD3D12Fence; - } - private static final int cudaExternalSemaphoreHandleTypeD3D11Fence = (int)5L; - /** - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeD3D11Fence = 5 - * } - */ - public static int cudaExternalSemaphoreHandleTypeD3D11Fence() { - return cudaExternalSemaphoreHandleTypeD3D11Fence; - } - private static final int cudaExternalSemaphoreHandleTypeNvSciSync = (int)6L; - /** - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeNvSciSync = 6 - * } - */ - public static int cudaExternalSemaphoreHandleTypeNvSciSync() { - return cudaExternalSemaphoreHandleTypeNvSciSync; - } - private static final int cudaExternalSemaphoreHandleTypeKeyedMutex = (int)7L; - /** - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutex = 7 - * } - */ - public static int cudaExternalSemaphoreHandleTypeKeyedMutex() { - return cudaExternalSemaphoreHandleTypeKeyedMutex; - } - private static final int cudaExternalSemaphoreHandleTypeKeyedMutexKmt = (int)8L; - /** - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeKeyedMutexKmt = 8 - * } - */ - public static int cudaExternalSemaphoreHandleTypeKeyedMutexKmt() { - return cudaExternalSemaphoreHandleTypeKeyedMutexKmt; - } - private static final int cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = (int)9L; - /** - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd = 9 - * } - */ - public static int cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd() { - return cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd; - } - private static final int cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = (int)10L; - /** - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType.cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = 10 - * } - */ - public static int cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32() { - return cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32; - } - /** - * {@snippet lang=c : - * typedef struct CUstream_st *cudaStream_t - * } - */ - public static final AddressLayout cudaStream_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct CUevent_st *cudaEvent_t - * } - */ - public static final AddressLayout cudaEvent_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct cudaGraphicsResource *cudaGraphicsResource_t - * } - */ - public static final AddressLayout cudaGraphicsResource_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct CUexternalMemory_st *cudaExternalMemory_t - * } - */ - public static final AddressLayout cudaExternalMemory_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct CUexternalSemaphore_st *cudaExternalSemaphore_t - * } - */ - public static final AddressLayout cudaExternalSemaphore_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct CUgraph_st *cudaGraph_t - * } - */ - public static final AddressLayout cudaGraph_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct CUgraphNode_st *cudaGraphNode_t - * } - */ - public static final AddressLayout cudaGraphNode_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct CUuserObject_st *cudaUserObject_t - * } - */ - public static final AddressLayout cudaUserObject_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef unsigned long long cudaGraphConditionalHandle - * } - */ - public static final OfLong cudaGraphConditionalHandle = PanamaFFMAPI.C_LONG_LONG; - /** - * {@snippet lang=c : - * typedef struct CUfunc_st *cudaFunction_t - * } - */ - public static final AddressLayout cudaFunction_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct CUkern_st *cudaKernel_t - * } - */ - public static final AddressLayout cudaKernel_t = PanamaFFMAPI.C_POINTER; - /** - * {@snippet lang=c : - * typedef struct CUmemPoolHandle_st *cudaMemPool_t - * } - */ - public static final AddressLayout cudaMemPool_t = PanamaFFMAPI.C_POINTER; - private static final int cudaCGScopeInvalid = (int)0L; - /** - * {@snippet lang=c : - * enum cudaCGScope.cudaCGScopeInvalid = 0 - * } - */ - public static int cudaCGScopeInvalid() { - return cudaCGScopeInvalid; - } - private static final int cudaCGScopeGrid = (int)1L; - /** - * {@snippet lang=c : - * enum cudaCGScope.cudaCGScopeGrid = 1 - * } - */ - public static int cudaCGScopeGrid() { - return cudaCGScopeGrid; - } - private static final int cudaCGScopeMultiGrid = (int)2L; - /** - * {@snippet lang=c : - * enum cudaCGScope.cudaCGScopeMultiGrid = 2 - * } - */ - public static int cudaCGScopeMultiGrid() { - return cudaCGScopeMultiGrid; - } - private static final int cudaGraphCondAssignDefault = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphConditionalHandleFlags.cudaGraphCondAssignDefault = 1 - * } - */ - public static int cudaGraphCondAssignDefault() { - return cudaGraphCondAssignDefault; - } - private static final int cudaGraphCondTypeIf = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGraphConditionalNodeType.cudaGraphCondTypeIf = 0 - * } - */ - public static int cudaGraphCondTypeIf() { - return cudaGraphCondTypeIf; - } - private static final int cudaGraphCondTypeWhile = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphConditionalNodeType.cudaGraphCondTypeWhile = 1 - * } - */ - public static int cudaGraphCondTypeWhile() { - return cudaGraphCondTypeWhile; - } - private static final int cudaGraphNodeTypeKernel = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeKernel = 0 - * } - */ - public static int cudaGraphNodeTypeKernel() { - return cudaGraphNodeTypeKernel; - } - private static final int cudaGraphNodeTypeMemcpy = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeMemcpy = 1 - * } - */ - public static int cudaGraphNodeTypeMemcpy() { - return cudaGraphNodeTypeMemcpy; - } - private static final int cudaGraphNodeTypeMemset = (int)2L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeMemset = 2 - * } - */ - public static int cudaGraphNodeTypeMemset() { - return cudaGraphNodeTypeMemset; - } - private static final int cudaGraphNodeTypeHost = (int)3L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeHost = 3 - * } - */ - public static int cudaGraphNodeTypeHost() { - return cudaGraphNodeTypeHost; - } - private static final int cudaGraphNodeTypeGraph = (int)4L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeGraph = 4 - * } - */ - public static int cudaGraphNodeTypeGraph() { - return cudaGraphNodeTypeGraph; - } - private static final int cudaGraphNodeTypeEmpty = (int)5L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeEmpty = 5 - * } - */ - public static int cudaGraphNodeTypeEmpty() { - return cudaGraphNodeTypeEmpty; - } - private static final int cudaGraphNodeTypeWaitEvent = (int)6L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeWaitEvent = 6 - * } - */ - public static int cudaGraphNodeTypeWaitEvent() { - return cudaGraphNodeTypeWaitEvent; - } - private static final int cudaGraphNodeTypeEventRecord = (int)7L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeEventRecord = 7 - * } - */ - public static int cudaGraphNodeTypeEventRecord() { - return cudaGraphNodeTypeEventRecord; - } - private static final int cudaGraphNodeTypeExtSemaphoreSignal = (int)8L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreSignal = 8 - * } - */ - public static int cudaGraphNodeTypeExtSemaphoreSignal() { - return cudaGraphNodeTypeExtSemaphoreSignal; - } - private static final int cudaGraphNodeTypeExtSemaphoreWait = (int)9L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeExtSemaphoreWait = 9 - * } - */ - public static int cudaGraphNodeTypeExtSemaphoreWait() { - return cudaGraphNodeTypeExtSemaphoreWait; - } - private static final int cudaGraphNodeTypeMemAlloc = (int)10L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeMemAlloc = 10 - * } - */ - public static int cudaGraphNodeTypeMemAlloc() { - return cudaGraphNodeTypeMemAlloc; - } - private static final int cudaGraphNodeTypeMemFree = (int)11L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeMemFree = 11 - * } - */ - public static int cudaGraphNodeTypeMemFree() { - return cudaGraphNodeTypeMemFree; - } - private static final int cudaGraphNodeTypeConditional = (int)13L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeConditional = 13 - * } - */ - public static int cudaGraphNodeTypeConditional() { - return cudaGraphNodeTypeConditional; - } - private static final int cudaGraphNodeTypeCount = (int)14L; - /** - * {@snippet lang=c : - * enum cudaGraphNodeType.cudaGraphNodeTypeCount = 14 - * } - */ - public static int cudaGraphNodeTypeCount() { - return cudaGraphNodeTypeCount; - } - private static final int cudaGraphDependencyTypeDefault = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGraphDependencyType_enum.cudaGraphDependencyTypeDefault = 0 - * } - */ - public static int cudaGraphDependencyTypeDefault() { - return cudaGraphDependencyTypeDefault; - } - private static final int cudaGraphDependencyTypeProgrammatic = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphDependencyType_enum.cudaGraphDependencyTypeProgrammatic = 1 - * } - */ - public static int cudaGraphDependencyTypeProgrammatic() { - return cudaGraphDependencyTypeProgrammatic; - } - /** - * {@snippet lang=c : - * typedef struct CUgraphExec_st *cudaGraphExec_t - * } - */ - public static final AddressLayout cudaGraphExec_t = PanamaFFMAPI.C_POINTER; - private static final int cudaGraphExecUpdateSuccess = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateSuccess = 0 - * } - */ - public static int cudaGraphExecUpdateSuccess() { - return cudaGraphExecUpdateSuccess; - } - private static final int cudaGraphExecUpdateError = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateError = 1 - * } - */ - public static int cudaGraphExecUpdateError() { - return cudaGraphExecUpdateError; - } - private static final int cudaGraphExecUpdateErrorTopologyChanged = (int)2L; - /** - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorTopologyChanged = 2 - * } - */ - public static int cudaGraphExecUpdateErrorTopologyChanged() { - return cudaGraphExecUpdateErrorTopologyChanged; - } - private static final int cudaGraphExecUpdateErrorNodeTypeChanged = (int)3L; - /** - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNodeTypeChanged = 3 - * } - */ - public static int cudaGraphExecUpdateErrorNodeTypeChanged() { - return cudaGraphExecUpdateErrorNodeTypeChanged; - } - private static final int cudaGraphExecUpdateErrorFunctionChanged = (int)4L; - /** - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorFunctionChanged = 4 - * } - */ - public static int cudaGraphExecUpdateErrorFunctionChanged() { - return cudaGraphExecUpdateErrorFunctionChanged; - } - private static final int cudaGraphExecUpdateErrorParametersChanged = (int)5L; - /** - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorParametersChanged = 5 - * } - */ - public static int cudaGraphExecUpdateErrorParametersChanged() { - return cudaGraphExecUpdateErrorParametersChanged; - } - private static final int cudaGraphExecUpdateErrorNotSupported = (int)6L; - /** - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorNotSupported = 6 - * } - */ - public static int cudaGraphExecUpdateErrorNotSupported() { - return cudaGraphExecUpdateErrorNotSupported; - } - private static final int cudaGraphExecUpdateErrorUnsupportedFunctionChange = (int)7L; - /** - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorUnsupportedFunctionChange = 7 - * } - */ - public static int cudaGraphExecUpdateErrorUnsupportedFunctionChange() { - return cudaGraphExecUpdateErrorUnsupportedFunctionChange; - } - private static final int cudaGraphExecUpdateErrorAttributesChanged = (int)8L; - /** - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult.cudaGraphExecUpdateErrorAttributesChanged = 8 - * } - */ - public static int cudaGraphExecUpdateErrorAttributesChanged() { - return cudaGraphExecUpdateErrorAttributesChanged; - } - private static final int cudaGraphInstantiateSuccess = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGraphInstantiateResult.cudaGraphInstantiateSuccess = 0 - * } - */ - public static int cudaGraphInstantiateSuccess() { - return cudaGraphInstantiateSuccess; - } - private static final int cudaGraphInstantiateError = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphInstantiateResult.cudaGraphInstantiateError = 1 - * } - */ - public static int cudaGraphInstantiateError() { - return cudaGraphInstantiateError; - } - private static final int cudaGraphInstantiateInvalidStructure = (int)2L; - /** - * {@snippet lang=c : - * enum cudaGraphInstantiateResult.cudaGraphInstantiateInvalidStructure = 2 - * } - */ - public static int cudaGraphInstantiateInvalidStructure() { - return cudaGraphInstantiateInvalidStructure; - } - private static final int cudaGraphInstantiateNodeOperationNotSupported = (int)3L; - /** - * {@snippet lang=c : - * enum cudaGraphInstantiateResult.cudaGraphInstantiateNodeOperationNotSupported = 3 - * } - */ - public static int cudaGraphInstantiateNodeOperationNotSupported() { - return cudaGraphInstantiateNodeOperationNotSupported; - } - private static final int cudaGraphInstantiateMultipleDevicesNotSupported = (int)4L; - /** - * {@snippet lang=c : - * enum cudaGraphInstantiateResult.cudaGraphInstantiateMultipleDevicesNotSupported = 4 - * } - */ - public static int cudaGraphInstantiateMultipleDevicesNotSupported() { - return cudaGraphInstantiateMultipleDevicesNotSupported; - } - /** - * {@snippet lang=c : - * typedef struct CUgraphDeviceUpdatableNode_st *cudaGraphDeviceNode_t - * } - */ - public static final AddressLayout cudaGraphDeviceNode_t = PanamaFFMAPI.C_POINTER; - private static final int cudaGraphKernelNodeFieldInvalid = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGraphKernelNodeField.cudaGraphKernelNodeFieldInvalid = 0 - * } - */ - public static int cudaGraphKernelNodeFieldInvalid() { - return cudaGraphKernelNodeFieldInvalid; - } - private static final int cudaGraphKernelNodeFieldGridDim = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphKernelNodeField.cudaGraphKernelNodeFieldGridDim = 1 - * } - */ - public static int cudaGraphKernelNodeFieldGridDim() { - return cudaGraphKernelNodeFieldGridDim; - } - private static final int cudaGraphKernelNodeFieldParam = (int)2L; - /** - * {@snippet lang=c : - * enum cudaGraphKernelNodeField.cudaGraphKernelNodeFieldParam = 2 - * } - */ - public static int cudaGraphKernelNodeFieldParam() { - return cudaGraphKernelNodeFieldParam; - } - private static final int cudaGraphKernelNodeFieldEnabled = (int)3L; - /** - * {@snippet lang=c : - * enum cudaGraphKernelNodeField.cudaGraphKernelNodeFieldEnabled = 3 - * } - */ - public static int cudaGraphKernelNodeFieldEnabled() { - return cudaGraphKernelNodeFieldEnabled; - } - private static final int cudaEnableDefault = (int)0L; - /** - * {@snippet lang=c : - * enum cudaGetDriverEntryPointFlags.cudaEnableDefault = 0 - * } - */ - public static int cudaEnableDefault() { - return cudaEnableDefault; - } - private static final int cudaEnableLegacyStream = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGetDriverEntryPointFlags.cudaEnableLegacyStream = 1 - * } - */ - public static int cudaEnableLegacyStream() { - return cudaEnableLegacyStream; - } - private static final int cudaEnablePerThreadDefaultStream = (int)2L; - /** - * {@snippet lang=c : - * enum cudaGetDriverEntryPointFlags.cudaEnablePerThreadDefaultStream = 2 - * } - */ - public static int cudaEnablePerThreadDefaultStream() { - return cudaEnablePerThreadDefaultStream; - } - private static final int cudaDriverEntryPointSuccess = (int)0L; - /** - * {@snippet lang=c : - * enum cudaDriverEntryPointQueryResult.cudaDriverEntryPointSuccess = 0 - * } - */ - public static int cudaDriverEntryPointSuccess() { - return cudaDriverEntryPointSuccess; - } - private static final int cudaDriverEntryPointSymbolNotFound = (int)1L; - /** - * {@snippet lang=c : - * enum cudaDriverEntryPointQueryResult.cudaDriverEntryPointSymbolNotFound = 1 - * } - */ - public static int cudaDriverEntryPointSymbolNotFound() { - return cudaDriverEntryPointSymbolNotFound; - } - private static final int cudaDriverEntryPointVersionNotSufficent = (int)2L; - /** - * {@snippet lang=c : - * enum cudaDriverEntryPointQueryResult.cudaDriverEntryPointVersionNotSufficent = 2 - * } - */ - public static int cudaDriverEntryPointVersionNotSufficent() { - return cudaDriverEntryPointVersionNotSufficent; - } - private static final int cudaGraphDebugDotFlagsVerbose = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsVerbose = 1 - * } - */ - public static int cudaGraphDebugDotFlagsVerbose() { - return cudaGraphDebugDotFlagsVerbose; - } - private static final int cudaGraphDebugDotFlagsKernelNodeParams = (int)4L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeParams = 4 - * } - */ - public static int cudaGraphDebugDotFlagsKernelNodeParams() { - return cudaGraphDebugDotFlagsKernelNodeParams; - } - private static final int cudaGraphDebugDotFlagsMemcpyNodeParams = (int)8L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemcpyNodeParams = 8 - * } - */ - public static int cudaGraphDebugDotFlagsMemcpyNodeParams() { - return cudaGraphDebugDotFlagsMemcpyNodeParams; - } - private static final int cudaGraphDebugDotFlagsMemsetNodeParams = (int)16L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemsetNodeParams = 16 - * } - */ - public static int cudaGraphDebugDotFlagsMemsetNodeParams() { - return cudaGraphDebugDotFlagsMemsetNodeParams; - } - private static final int cudaGraphDebugDotFlagsHostNodeParams = (int)32L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHostNodeParams = 32 - * } - */ - public static int cudaGraphDebugDotFlagsHostNodeParams() { - return cudaGraphDebugDotFlagsHostNodeParams; - } - private static final int cudaGraphDebugDotFlagsEventNodeParams = (int)64L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsEventNodeParams = 64 - * } - */ - public static int cudaGraphDebugDotFlagsEventNodeParams() { - return cudaGraphDebugDotFlagsEventNodeParams; - } - private static final int cudaGraphDebugDotFlagsExtSemasSignalNodeParams = (int)128L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasSignalNodeParams = 128 - * } - */ - public static int cudaGraphDebugDotFlagsExtSemasSignalNodeParams() { - return cudaGraphDebugDotFlagsExtSemasSignalNodeParams; - } - private static final int cudaGraphDebugDotFlagsExtSemasWaitNodeParams = (int)256L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsExtSemasWaitNodeParams = 256 - * } - */ - public static int cudaGraphDebugDotFlagsExtSemasWaitNodeParams() { - return cudaGraphDebugDotFlagsExtSemasWaitNodeParams; - } - private static final int cudaGraphDebugDotFlagsKernelNodeAttributes = (int)512L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsKernelNodeAttributes = 512 - * } - */ - public static int cudaGraphDebugDotFlagsKernelNodeAttributes() { - return cudaGraphDebugDotFlagsKernelNodeAttributes; - } - private static final int cudaGraphDebugDotFlagsHandles = (int)1024L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsHandles = 1024 - * } - */ - public static int cudaGraphDebugDotFlagsHandles() { - return cudaGraphDebugDotFlagsHandles; - } - private static final int cudaGraphDebugDotFlagsConditionalNodeParams = (int)32768L; - /** - * {@snippet lang=c : - * enum cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsConditionalNodeParams = 32768 - * } - */ - public static int cudaGraphDebugDotFlagsConditionalNodeParams() { - return cudaGraphDebugDotFlagsConditionalNodeParams; - } - private static final int cudaGraphInstantiateFlagAutoFreeOnLaunch = (int)1L; - /** - * {@snippet lang=c : - * enum cudaGraphInstantiateFlags.cudaGraphInstantiateFlagAutoFreeOnLaunch = 1 - * } - */ - public static int cudaGraphInstantiateFlagAutoFreeOnLaunch() { - return cudaGraphInstantiateFlagAutoFreeOnLaunch; - } - private static final int cudaGraphInstantiateFlagUpload = (int)2L; - /** - * {@snippet lang=c : - * enum cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUpload = 2 - * } - */ - public static int cudaGraphInstantiateFlagUpload() { - return cudaGraphInstantiateFlagUpload; - } - private static final int cudaGraphInstantiateFlagDeviceLaunch = (int)4L; - /** - * {@snippet lang=c : - * enum cudaGraphInstantiateFlags.cudaGraphInstantiateFlagDeviceLaunch = 4 - * } - */ - public static int cudaGraphInstantiateFlagDeviceLaunch() { - return cudaGraphInstantiateFlagDeviceLaunch; - } - private static final int cudaGraphInstantiateFlagUseNodePriority = (int)8L; - /** - * {@snippet lang=c : - * enum cudaGraphInstantiateFlags.cudaGraphInstantiateFlagUseNodePriority = 8 - * } - */ - public static int cudaGraphInstantiateFlagUseNodePriority() { - return cudaGraphInstantiateFlagUseNodePriority; - } - private static final int cudaLaunchMemSyncDomainDefault = (int)0L; - /** - * {@snippet lang=c : - * enum cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainDefault = 0 - * } - */ - public static int cudaLaunchMemSyncDomainDefault() { - return cudaLaunchMemSyncDomainDefault; - } - private static final int cudaLaunchMemSyncDomainRemote = (int)1L; - /** - * {@snippet lang=c : - * enum cudaLaunchMemSyncDomain.cudaLaunchMemSyncDomainRemote = 1 - * } - */ - public static int cudaLaunchMemSyncDomainRemote() { - return cudaLaunchMemSyncDomainRemote; - } - private static final int cudaLaunchAttributeIgnore = (int)0L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeIgnore = 0 - * } - */ - public static int cudaLaunchAttributeIgnore() { - return cudaLaunchAttributeIgnore; - } - private static final int cudaLaunchAttributeAccessPolicyWindow = (int)1L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeAccessPolicyWindow = 1 - * } - */ - public static int cudaLaunchAttributeAccessPolicyWindow() { - return cudaLaunchAttributeAccessPolicyWindow; - } - private static final int cudaLaunchAttributeCooperative = (int)2L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeCooperative = 2 - * } - */ - public static int cudaLaunchAttributeCooperative() { - return cudaLaunchAttributeCooperative; - } - private static final int cudaLaunchAttributeSynchronizationPolicy = (int)3L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeSynchronizationPolicy = 3 - * } - */ - public static int cudaLaunchAttributeSynchronizationPolicy() { - return cudaLaunchAttributeSynchronizationPolicy; - } - private static final int cudaLaunchAttributeClusterDimension = (int)4L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeClusterDimension = 4 - * } - */ - public static int cudaLaunchAttributeClusterDimension() { - return cudaLaunchAttributeClusterDimension; - } - private static final int cudaLaunchAttributeClusterSchedulingPolicyPreference = (int)5L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeClusterSchedulingPolicyPreference = 5 - * } - */ - public static int cudaLaunchAttributeClusterSchedulingPolicyPreference() { - return cudaLaunchAttributeClusterSchedulingPolicyPreference; - } - private static final int cudaLaunchAttributeProgrammaticStreamSerialization = (int)6L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticStreamSerialization = 6 - * } - */ - public static int cudaLaunchAttributeProgrammaticStreamSerialization() { - return cudaLaunchAttributeProgrammaticStreamSerialization; - } - private static final int cudaLaunchAttributeProgrammaticEvent = (int)7L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeProgrammaticEvent = 7 - * } - */ - public static int cudaLaunchAttributeProgrammaticEvent() { - return cudaLaunchAttributeProgrammaticEvent; - } - private static final int cudaLaunchAttributePriority = (int)8L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributePriority = 8 - * } - */ - public static int cudaLaunchAttributePriority() { - return cudaLaunchAttributePriority; - } - private static final int cudaLaunchAttributeMemSyncDomainMap = (int)9L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomainMap = 9 - * } - */ - public static int cudaLaunchAttributeMemSyncDomainMap() { - return cudaLaunchAttributeMemSyncDomainMap; - } - private static final int cudaLaunchAttributeMemSyncDomain = (int)10L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeMemSyncDomain = 10 - * } - */ - public static int cudaLaunchAttributeMemSyncDomain() { - return cudaLaunchAttributeMemSyncDomain; - } - private static final int cudaLaunchAttributeLaunchCompletionEvent = (int)12L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeLaunchCompletionEvent = 12 - * } - */ - public static int cudaLaunchAttributeLaunchCompletionEvent() { - return cudaLaunchAttributeLaunchCompletionEvent; - } - private static final int cudaLaunchAttributeDeviceUpdatableKernelNode = (int)13L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributeDeviceUpdatableKernelNode = 13 - * } - */ - public static int cudaLaunchAttributeDeviceUpdatableKernelNode() { - return cudaLaunchAttributeDeviceUpdatableKernelNode; - } - private static final int cudaLaunchAttributePreferredSharedMemoryCarveout = (int)14L; - /** - * {@snippet lang=c : - * enum cudaLaunchAttributeID.cudaLaunchAttributePreferredSharedMemoryCarveout = 14 - * } - */ - public static int cudaLaunchAttributePreferredSharedMemoryCarveout() { - return cudaLaunchAttributePreferredSharedMemoryCarveout; - } - private static final int cudaDeviceNumaConfigNone = (int)0L; - /** - * {@snippet lang=c : - * enum cudaDeviceNumaConfig.cudaDeviceNumaConfigNone = 0 - * } - */ - public static int cudaDeviceNumaConfigNone() { - return cudaDeviceNumaConfigNone; - } - private static final int cudaDeviceNumaConfigNumaNode = (int)1L; - /** - * {@snippet lang=c : - * enum cudaDeviceNumaConfig.cudaDeviceNumaConfigNumaNode = 1 - * } - */ - public static int cudaDeviceNumaConfigNumaNode() { - return cudaDeviceNumaConfigNumaNode; - } - /** - * {@snippet lang=c : - * typedef struct cudaAsyncCallbackEntry *cudaAsyncCallbackHandle_t - * } - */ - public static final AddressLayout cudaAsyncCallbackHandle_t = PanamaFFMAPI.C_POINTER; - private static final int cudaAsyncNotificationTypeOverBudget = (int)1L; - /** - * {@snippet lang=c : - * enum cudaAsyncNotificationType_enum.cudaAsyncNotificationTypeOverBudget = 1 - * } - */ - public static int cudaAsyncNotificationTypeOverBudget() { - return cudaAsyncNotificationTypeOverBudget; - } - private static final int cudaBoundaryModeZero = (int)0L; - /** - * {@snippet lang=c : - * enum cudaSurfaceBoundaryMode.cudaBoundaryModeZero = 0 - * } - */ - public static int cudaBoundaryModeZero() { - return cudaBoundaryModeZero; - } - private static final int cudaBoundaryModeClamp = (int)1L; - /** - * {@snippet lang=c : - * enum cudaSurfaceBoundaryMode.cudaBoundaryModeClamp = 1 - * } - */ - public static int cudaBoundaryModeClamp() { - return cudaBoundaryModeClamp; - } - private static final int cudaBoundaryModeTrap = (int)2L; - /** - * {@snippet lang=c : - * enum cudaSurfaceBoundaryMode.cudaBoundaryModeTrap = 2 - * } - */ - public static int cudaBoundaryModeTrap() { - return cudaBoundaryModeTrap; - } - private static final int cudaFormatModeForced = (int)0L; - /** - * {@snippet lang=c : - * enum cudaSurfaceFormatMode.cudaFormatModeForced = 0 - * } - */ - public static int cudaFormatModeForced() { - return cudaFormatModeForced; - } - private static final int cudaFormatModeAuto = (int)1L; - /** - * {@snippet lang=c : - * enum cudaSurfaceFormatMode.cudaFormatModeAuto = 1 - * } - */ - public static int cudaFormatModeAuto() { - return cudaFormatModeAuto; - } - /** - * {@snippet lang=c : - * typedef unsigned long long cudaSurfaceObject_t - * } - */ - public static final OfLong cudaSurfaceObject_t = PanamaFFMAPI.C_LONG_LONG; - private static final int cudaAddressModeWrap = (int)0L; - /** - * {@snippet lang=c : - * enum cudaTextureAddressMode.cudaAddressModeWrap = 0 - * } - */ - public static int cudaAddressModeWrap() { - return cudaAddressModeWrap; - } - private static final int cudaAddressModeClamp = (int)1L; - /** - * {@snippet lang=c : - * enum cudaTextureAddressMode.cudaAddressModeClamp = 1 - * } - */ - public static int cudaAddressModeClamp() { - return cudaAddressModeClamp; - } - private static final int cudaAddressModeMirror = (int)2L; - /** - * {@snippet lang=c : - * enum cudaTextureAddressMode.cudaAddressModeMirror = 2 - * } - */ - public static int cudaAddressModeMirror() { - return cudaAddressModeMirror; - } - private static final int cudaAddressModeBorder = (int)3L; - /** - * {@snippet lang=c : - * enum cudaTextureAddressMode.cudaAddressModeBorder = 3 - * } - */ - public static int cudaAddressModeBorder() { - return cudaAddressModeBorder; - } - private static final int cudaFilterModePoint = (int)0L; - /** - * {@snippet lang=c : - * enum cudaTextureFilterMode.cudaFilterModePoint = 0 - * } - */ - public static int cudaFilterModePoint() { - return cudaFilterModePoint; - } - private static final int cudaFilterModeLinear = (int)1L; - /** - * {@snippet lang=c : - * enum cudaTextureFilterMode.cudaFilterModeLinear = 1 - * } - */ - public static int cudaFilterModeLinear() { - return cudaFilterModeLinear; - } - private static final int cudaReadModeElementType = (int)0L; - /** - * {@snippet lang=c : - * enum cudaTextureReadMode.cudaReadModeElementType = 0 - * } - */ - public static int cudaReadModeElementType() { - return cudaReadModeElementType; - } - private static final int cudaReadModeNormalizedFloat = (int)1L; - /** - * {@snippet lang=c : - * enum cudaTextureReadMode.cudaReadModeNormalizedFloat = 1 - * } - */ - public static int cudaReadModeNormalizedFloat() { - return cudaReadModeNormalizedFloat; - } - /** - * {@snippet lang=c : - * typedef unsigned long long cudaTextureObject_t - * } - */ - public static final OfLong cudaTextureObject_t = PanamaFFMAPI.C_LONG_LONG; - private static final int CUDA_R_16F = (int)2L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_16F = 2 - * } - */ - public static int CUDA_R_16F() { - return CUDA_R_16F; - } - private static final int CUDA_C_16F = (int)6L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_16F = 6 - * } - */ - public static int CUDA_C_16F() { - return CUDA_C_16F; - } - private static final int CUDA_R_16BF = (int)14L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_16BF = 14 - * } - */ - public static int CUDA_R_16BF() { - return CUDA_R_16BF; - } - private static final int CUDA_C_16BF = (int)15L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_16BF = 15 - * } - */ - public static int CUDA_C_16BF() { - return CUDA_C_16BF; - } - private static final int CUDA_R_32F = (int)0L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_32F = 0 - * } - */ - public static int CUDA_R_32F() { - return CUDA_R_32F; - } - private static final int CUDA_C_32F = (int)4L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_32F = 4 - * } - */ - public static int CUDA_C_32F() { - return CUDA_C_32F; - } - private static final int CUDA_R_64F = (int)1L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_64F = 1 - * } - */ - public static int CUDA_R_64F() { - return CUDA_R_64F; - } - private static final int CUDA_C_64F = (int)5L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_64F = 5 - * } - */ - public static int CUDA_C_64F() { - return CUDA_C_64F; - } - private static final int CUDA_R_4I = (int)16L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_4I = 16 - * } - */ - public static int CUDA_R_4I() { - return CUDA_R_4I; - } - private static final int CUDA_C_4I = (int)17L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_4I = 17 - * } - */ - public static int CUDA_C_4I() { - return CUDA_C_4I; - } - private static final int CUDA_R_4U = (int)18L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_4U = 18 - * } - */ - public static int CUDA_R_4U() { - return CUDA_R_4U; - } - private static final int CUDA_C_4U = (int)19L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_4U = 19 - * } - */ - public static int CUDA_C_4U() { - return CUDA_C_4U; - } - private static final int CUDA_R_8I = (int)3L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_8I = 3 - * } - */ - public static int CUDA_R_8I() { - return CUDA_R_8I; - } - private static final int CUDA_C_8I = (int)7L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_8I = 7 - * } - */ - public static int CUDA_C_8I() { - return CUDA_C_8I; - } - private static final int CUDA_R_8U = (int)8L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_8U = 8 - * } - */ - public static int CUDA_R_8U() { - return CUDA_R_8U; - } - private static final int CUDA_C_8U = (int)9L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_8U = 9 - * } - */ - public static int CUDA_C_8U() { - return CUDA_C_8U; - } - private static final int CUDA_R_16I = (int)20L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_16I = 20 - * } - */ - public static int CUDA_R_16I() { - return CUDA_R_16I; - } - private static final int CUDA_C_16I = (int)21L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_16I = 21 - * } - */ - public static int CUDA_C_16I() { - return CUDA_C_16I; - } - private static final int CUDA_R_16U = (int)22L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_16U = 22 - * } - */ - public static int CUDA_R_16U() { - return CUDA_R_16U; - } - private static final int CUDA_C_16U = (int)23L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_16U = 23 - * } - */ - public static int CUDA_C_16U() { - return CUDA_C_16U; - } - private static final int CUDA_R_32I = (int)10L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_32I = 10 - * } - */ - public static int CUDA_R_32I() { - return CUDA_R_32I; - } - private static final int CUDA_C_32I = (int)11L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_32I = 11 - * } - */ - public static int CUDA_C_32I() { - return CUDA_C_32I; - } - private static final int CUDA_R_32U = (int)12L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_32U = 12 - * } - */ - public static int CUDA_R_32U() { - return CUDA_R_32U; - } - private static final int CUDA_C_32U = (int)13L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_32U = 13 - * } - */ - public static int CUDA_C_32U() { - return CUDA_C_32U; - } - private static final int CUDA_R_64I = (int)24L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_64I = 24 - * } - */ - public static int CUDA_R_64I() { - return CUDA_R_64I; - } - private static final int CUDA_C_64I = (int)25L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_64I = 25 - * } - */ - public static int CUDA_C_64I() { - return CUDA_C_64I; - } - private static final int CUDA_R_64U = (int)26L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_64U = 26 - * } - */ - public static int CUDA_R_64U() { - return CUDA_R_64U; - } - private static final int CUDA_C_64U = (int)27L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_C_64U = 27 - * } - */ - public static int CUDA_C_64U() { - return CUDA_C_64U; - } - private static final int CUDA_R_8F_E4M3 = (int)28L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_8F_E4M3 = 28 - * } - */ - public static int CUDA_R_8F_E4M3() { - return CUDA_R_8F_E4M3; - } - private static final int CUDA_R_8F_E5M2 = (int)29L; - /** - * {@snippet lang=c : - * enum cudaDataType_t.CUDA_R_8F_E5M2 = 29 - * } - */ - public static int CUDA_R_8F_E5M2() { - return CUDA_R_8F_E5M2; - } - private static final int MAJOR_VERSION = (int)0L; - /** - * {@snippet lang=c : - * enum libraryPropertyType_t.MAJOR_VERSION = 0 - * } - */ - public static int MAJOR_VERSION() { - return MAJOR_VERSION; - } - private static final int MINOR_VERSION = (int)1L; - /** - * {@snippet lang=c : - * enum libraryPropertyType_t.MINOR_VERSION = 1 - * } - */ - public static int MINOR_VERSION() { - return MINOR_VERSION; - } - private static final int PATCH_LEVEL = (int)2L; - /** - * {@snippet lang=c : - * enum libraryPropertyType_t.PATCH_LEVEL = 2 - * } - */ - public static int PATCH_LEVEL() { - return PATCH_LEVEL; - } - - private static class cudaDeviceReset { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceReset"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceReset() - * } - */ - public static FunctionDescriptor cudaDeviceReset$descriptor() { - return cudaDeviceReset.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceReset() - * } - */ - public static MethodHandle cudaDeviceReset$handle() { - return cudaDeviceReset.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceReset() - * } - */ - public static MemorySegment cudaDeviceReset$address() { - return cudaDeviceReset.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceReset() - * } - */ - public static int cudaDeviceReset() { - var mh$ = cudaDeviceReset.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceReset"); - } - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceSynchronize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSynchronize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSynchronize() - * } - */ - public static FunctionDescriptor cudaDeviceSynchronize$descriptor() { - return cudaDeviceSynchronize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSynchronize() - * } - */ - public static MethodHandle cudaDeviceSynchronize$handle() { - return cudaDeviceSynchronize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSynchronize() - * } - */ - public static MemorySegment cudaDeviceSynchronize$address() { - return cudaDeviceSynchronize.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSynchronize() - * } - */ - public static int cudaDeviceSynchronize() { - var mh$ = cudaDeviceSynchronize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceSynchronize"); - } - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceSetLimit { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSetLimit"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetLimit(enum cudaLimit limit, size_t value) - * } - */ - public static FunctionDescriptor cudaDeviceSetLimit$descriptor() { - return cudaDeviceSetLimit.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetLimit(enum cudaLimit limit, size_t value) - * } - */ - public static MethodHandle cudaDeviceSetLimit$handle() { - return cudaDeviceSetLimit.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetLimit(enum cudaLimit limit, size_t value) - * } - */ - public static MemorySegment cudaDeviceSetLimit$address() { - return cudaDeviceSetLimit.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetLimit(enum cudaLimit limit, size_t value) - * } - */ - public static int cudaDeviceSetLimit(int limit, long value) { - var mh$ = cudaDeviceSetLimit.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceSetLimit", limit, value); - } - return (int)mh$.invokeExact(limit, value); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetLimit { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetLimit"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetLimit(size_t *pValue, enum cudaLimit limit) - * } - */ - public static FunctionDescriptor cudaDeviceGetLimit$descriptor() { - return cudaDeviceGetLimit.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetLimit(size_t *pValue, enum cudaLimit limit) - * } - */ - public static MethodHandle cudaDeviceGetLimit$handle() { - return cudaDeviceGetLimit.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetLimit(size_t *pValue, enum cudaLimit limit) - * } - */ - public static MemorySegment cudaDeviceGetLimit$address() { - return cudaDeviceGetLimit.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetLimit(size_t *pValue, enum cudaLimit limit) - * } - */ - public static int cudaDeviceGetLimit(MemorySegment pValue, int limit) { - var mh$ = cudaDeviceGetLimit.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetLimit", pValue, limit); - } - return (int)mh$.invokeExact(pValue, limit); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetTexture1DLinearMaxWidth { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetTexture1DLinearMaxWidth"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t *maxWidthInElements, const struct cudaChannelFormatDesc *fmtDesc, int device) - * } - */ - public static FunctionDescriptor cudaDeviceGetTexture1DLinearMaxWidth$descriptor() { - return cudaDeviceGetTexture1DLinearMaxWidth.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t *maxWidthInElements, const struct cudaChannelFormatDesc *fmtDesc, int device) - * } - */ - public static MethodHandle cudaDeviceGetTexture1DLinearMaxWidth$handle() { - return cudaDeviceGetTexture1DLinearMaxWidth.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t *maxWidthInElements, const struct cudaChannelFormatDesc *fmtDesc, int device) - * } - */ - public static MemorySegment cudaDeviceGetTexture1DLinearMaxWidth$address() { - return cudaDeviceGetTexture1DLinearMaxWidth.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetTexture1DLinearMaxWidth(size_t *maxWidthInElements, const struct cudaChannelFormatDesc *fmtDesc, int device) - * } - */ - public static int cudaDeviceGetTexture1DLinearMaxWidth(MemorySegment maxWidthInElements, MemorySegment fmtDesc, int device) { - var mh$ = cudaDeviceGetTexture1DLinearMaxWidth.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetTexture1DLinearMaxWidth", maxWidthInElements, fmtDesc, device); - } - return (int)mh$.invokeExact(maxWidthInElements, fmtDesc, device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetCacheConfig { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetCacheConfig"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetCacheConfig(enum cudaFuncCache *pCacheConfig) - * } - */ - public static FunctionDescriptor cudaDeviceGetCacheConfig$descriptor() { - return cudaDeviceGetCacheConfig.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetCacheConfig(enum cudaFuncCache *pCacheConfig) - * } - */ - public static MethodHandle cudaDeviceGetCacheConfig$handle() { - return cudaDeviceGetCacheConfig.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetCacheConfig(enum cudaFuncCache *pCacheConfig) - * } - */ - public static MemorySegment cudaDeviceGetCacheConfig$address() { - return cudaDeviceGetCacheConfig.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetCacheConfig(enum cudaFuncCache *pCacheConfig) - * } - */ - public static int cudaDeviceGetCacheConfig(MemorySegment pCacheConfig) { - var mh$ = cudaDeviceGetCacheConfig.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetCacheConfig", pCacheConfig); - } - return (int)mh$.invokeExact(pCacheConfig); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetStreamPriorityRange { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetStreamPriorityRange"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority) - * } - */ - public static FunctionDescriptor cudaDeviceGetStreamPriorityRange$descriptor() { - return cudaDeviceGetStreamPriorityRange.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority) - * } - */ - public static MethodHandle cudaDeviceGetStreamPriorityRange$handle() { - return cudaDeviceGetStreamPriorityRange.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority) - * } - */ - public static MemorySegment cudaDeviceGetStreamPriorityRange$address() { - return cudaDeviceGetStreamPriorityRange.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetStreamPriorityRange(int *leastPriority, int *greatestPriority) - * } - */ - public static int cudaDeviceGetStreamPriorityRange(MemorySegment leastPriority, MemorySegment greatestPriority) { - var mh$ = cudaDeviceGetStreamPriorityRange.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetStreamPriorityRange", leastPriority, greatestPriority); - } - return (int)mh$.invokeExact(leastPriority, greatestPriority); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceSetCacheConfig { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSetCacheConfig"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetCacheConfig(enum cudaFuncCache cacheConfig) - * } - */ - public static FunctionDescriptor cudaDeviceSetCacheConfig$descriptor() { - return cudaDeviceSetCacheConfig.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetCacheConfig(enum cudaFuncCache cacheConfig) - * } - */ - public static MethodHandle cudaDeviceSetCacheConfig$handle() { - return cudaDeviceSetCacheConfig.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetCacheConfig(enum cudaFuncCache cacheConfig) - * } - */ - public static MemorySegment cudaDeviceSetCacheConfig$address() { - return cudaDeviceSetCacheConfig.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetCacheConfig(enum cudaFuncCache cacheConfig) - * } - */ - public static int cudaDeviceSetCacheConfig(int cacheConfig) { - var mh$ = cudaDeviceSetCacheConfig.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceSetCacheConfig", cacheConfig); - } - return (int)mh$.invokeExact(cacheConfig); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetByPCIBusId { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetByPCIBusId"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetByPCIBusId(int *device, const char *pciBusId) - * } - */ - public static FunctionDescriptor cudaDeviceGetByPCIBusId$descriptor() { - return cudaDeviceGetByPCIBusId.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetByPCIBusId(int *device, const char *pciBusId) - * } - */ - public static MethodHandle cudaDeviceGetByPCIBusId$handle() { - return cudaDeviceGetByPCIBusId.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetByPCIBusId(int *device, const char *pciBusId) - * } - */ - public static MemorySegment cudaDeviceGetByPCIBusId$address() { - return cudaDeviceGetByPCIBusId.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetByPCIBusId(int *device, const char *pciBusId) - * } - */ - public static int cudaDeviceGetByPCIBusId(MemorySegment device, MemorySegment pciBusId) { - var mh$ = cudaDeviceGetByPCIBusId.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetByPCIBusId", device, pciBusId); - } - return (int)mh$.invokeExact(device, pciBusId); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetPCIBusId { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetPCIBusId"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetPCIBusId(char *pciBusId, int len, int device) - * } - */ - public static FunctionDescriptor cudaDeviceGetPCIBusId$descriptor() { - return cudaDeviceGetPCIBusId.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetPCIBusId(char *pciBusId, int len, int device) - * } - */ - public static MethodHandle cudaDeviceGetPCIBusId$handle() { - return cudaDeviceGetPCIBusId.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetPCIBusId(char *pciBusId, int len, int device) - * } - */ - public static MemorySegment cudaDeviceGetPCIBusId$address() { - return cudaDeviceGetPCIBusId.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetPCIBusId(char *pciBusId, int len, int device) - * } - */ - public static int cudaDeviceGetPCIBusId(MemorySegment pciBusId, int len, int device) { - var mh$ = cudaDeviceGetPCIBusId.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetPCIBusId", pciBusId, len, device); - } - return (int)mh$.invokeExact(pciBusId, len, device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaIpcGetEventHandle { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaIpcGetEventHandle"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t *handle, cudaEvent_t event) - * } - */ - public static FunctionDescriptor cudaIpcGetEventHandle$descriptor() { - return cudaIpcGetEventHandle.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t *handle, cudaEvent_t event) - * } - */ - public static MethodHandle cudaIpcGetEventHandle$handle() { - return cudaIpcGetEventHandle.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t *handle, cudaEvent_t event) - * } - */ - public static MemorySegment cudaIpcGetEventHandle$address() { - return cudaIpcGetEventHandle.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaIpcGetEventHandle(cudaIpcEventHandle_t *handle, cudaEvent_t event) - * } - */ - public static int cudaIpcGetEventHandle(MemorySegment handle, MemorySegment event) { - var mh$ = cudaIpcGetEventHandle.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaIpcGetEventHandle", handle, event); - } - return (int)mh$.invokeExact(handle, event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaIpcOpenEventHandle { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - cudaIpcEventHandle_st.layout() - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaIpcOpenEventHandle"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcOpenEventHandle(cudaEvent_t *event, cudaIpcEventHandle_t handle) - * } - */ - public static FunctionDescriptor cudaIpcOpenEventHandle$descriptor() { - return cudaIpcOpenEventHandle.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcOpenEventHandle(cudaEvent_t *event, cudaIpcEventHandle_t handle) - * } - */ - public static MethodHandle cudaIpcOpenEventHandle$handle() { - return cudaIpcOpenEventHandle.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcOpenEventHandle(cudaEvent_t *event, cudaIpcEventHandle_t handle) - * } - */ - public static MemorySegment cudaIpcOpenEventHandle$address() { - return cudaIpcOpenEventHandle.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaIpcOpenEventHandle(cudaEvent_t *event, cudaIpcEventHandle_t handle) - * } - */ - public static int cudaIpcOpenEventHandle(MemorySegment event, MemorySegment handle) { - var mh$ = cudaIpcOpenEventHandle.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaIpcOpenEventHandle", event, handle); - } - return (int)mh$.invokeExact(event, handle); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaIpcGetMemHandle { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaIpcGetMemHandle"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t *handle, void *devPtr) - * } - */ - public static FunctionDescriptor cudaIpcGetMemHandle$descriptor() { - return cudaIpcGetMemHandle.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t *handle, void *devPtr) - * } - */ - public static MethodHandle cudaIpcGetMemHandle$handle() { - return cudaIpcGetMemHandle.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t *handle, void *devPtr) - * } - */ - public static MemorySegment cudaIpcGetMemHandle$address() { - return cudaIpcGetMemHandle.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaIpcGetMemHandle(cudaIpcMemHandle_t *handle, void *devPtr) - * } - */ - public static int cudaIpcGetMemHandle(MemorySegment handle, MemorySegment devPtr) { - var mh$ = cudaIpcGetMemHandle.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaIpcGetMemHandle", handle, devPtr); - } - return (int)mh$.invokeExact(handle, devPtr); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaIpcOpenMemHandle { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - cudaIpcMemHandle_st.layout(), - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaIpcOpenMemHandle"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcOpenMemHandle(void **devPtr, cudaIpcMemHandle_t handle, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaIpcOpenMemHandle$descriptor() { - return cudaIpcOpenMemHandle.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcOpenMemHandle(void **devPtr, cudaIpcMemHandle_t handle, unsigned int flags) - * } - */ - public static MethodHandle cudaIpcOpenMemHandle$handle() { - return cudaIpcOpenMemHandle.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcOpenMemHandle(void **devPtr, cudaIpcMemHandle_t handle, unsigned int flags) - * } - */ - public static MemorySegment cudaIpcOpenMemHandle$address() { - return cudaIpcOpenMemHandle.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaIpcOpenMemHandle(void **devPtr, cudaIpcMemHandle_t handle, unsigned int flags) - * } - */ - public static int cudaIpcOpenMemHandle(MemorySegment devPtr, MemorySegment handle, int flags) { - var mh$ = cudaIpcOpenMemHandle.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaIpcOpenMemHandle", devPtr, handle, flags); - } - return (int)mh$.invokeExact(devPtr, handle, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaIpcCloseMemHandle { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaIpcCloseMemHandle"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcCloseMemHandle(void *devPtr) - * } - */ - public static FunctionDescriptor cudaIpcCloseMemHandle$descriptor() { - return cudaIpcCloseMemHandle.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcCloseMemHandle(void *devPtr) - * } - */ - public static MethodHandle cudaIpcCloseMemHandle$handle() { - return cudaIpcCloseMemHandle.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaIpcCloseMemHandle(void *devPtr) - * } - */ - public static MemorySegment cudaIpcCloseMemHandle$address() { - return cudaIpcCloseMemHandle.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaIpcCloseMemHandle(void *devPtr) - * } - */ - public static int cudaIpcCloseMemHandle(MemorySegment devPtr) { - var mh$ = cudaIpcCloseMemHandle.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaIpcCloseMemHandle", devPtr); - } - return (int)mh$.invokeExact(devPtr); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceFlushGPUDirectRDMAWrites { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceFlushGPUDirectRDMAWrites"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(enum cudaFlushGPUDirectRDMAWritesTarget target, enum cudaFlushGPUDirectRDMAWritesScope scope) - * } - */ - public static FunctionDescriptor cudaDeviceFlushGPUDirectRDMAWrites$descriptor() { - return cudaDeviceFlushGPUDirectRDMAWrites.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(enum cudaFlushGPUDirectRDMAWritesTarget target, enum cudaFlushGPUDirectRDMAWritesScope scope) - * } - */ - public static MethodHandle cudaDeviceFlushGPUDirectRDMAWrites$handle() { - return cudaDeviceFlushGPUDirectRDMAWrites.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(enum cudaFlushGPUDirectRDMAWritesTarget target, enum cudaFlushGPUDirectRDMAWritesScope scope) - * } - */ - public static MemorySegment cudaDeviceFlushGPUDirectRDMAWrites$address() { - return cudaDeviceFlushGPUDirectRDMAWrites.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceFlushGPUDirectRDMAWrites(enum cudaFlushGPUDirectRDMAWritesTarget target, enum cudaFlushGPUDirectRDMAWritesScope scope) - * } - */ - public static int cudaDeviceFlushGPUDirectRDMAWrites(int target, int scope) { - var mh$ = cudaDeviceFlushGPUDirectRDMAWrites.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceFlushGPUDirectRDMAWrites", target, scope); - } - return (int)mh$.invokeExact(target, scope); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceRegisterAsyncNotification { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceRegisterAsyncNotification"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void *userData, cudaAsyncCallbackHandle_t *callback) - * } - */ - public static FunctionDescriptor cudaDeviceRegisterAsyncNotification$descriptor() { - return cudaDeviceRegisterAsyncNotification.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void *userData, cudaAsyncCallbackHandle_t *callback) - * } - */ - public static MethodHandle cudaDeviceRegisterAsyncNotification$handle() { - return cudaDeviceRegisterAsyncNotification.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void *userData, cudaAsyncCallbackHandle_t *callback) - * } - */ - public static MemorySegment cudaDeviceRegisterAsyncNotification$address() { - return cudaDeviceRegisterAsyncNotification.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceRegisterAsyncNotification(int device, cudaAsyncCallback callbackFunc, void *userData, cudaAsyncCallbackHandle_t *callback) - * } - */ - public static int cudaDeviceRegisterAsyncNotification(int device, MemorySegment callbackFunc, MemorySegment userData, MemorySegment callback) { - var mh$ = cudaDeviceRegisterAsyncNotification.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceRegisterAsyncNotification", device, callbackFunc, userData, callback); - } - return (int)mh$.invokeExact(device, callbackFunc, userData, callback); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceUnregisterAsyncNotification { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceUnregisterAsyncNotification"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) - * } - */ - public static FunctionDescriptor cudaDeviceUnregisterAsyncNotification$descriptor() { - return cudaDeviceUnregisterAsyncNotification.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) - * } - */ - public static MethodHandle cudaDeviceUnregisterAsyncNotification$handle() { - return cudaDeviceUnregisterAsyncNotification.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) - * } - */ - public static MemorySegment cudaDeviceUnregisterAsyncNotification$address() { - return cudaDeviceUnregisterAsyncNotification.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceUnregisterAsyncNotification(int device, cudaAsyncCallbackHandle_t callback) - * } - */ - public static int cudaDeviceUnregisterAsyncNotification(int device, MemorySegment callback) { - var mh$ = cudaDeviceUnregisterAsyncNotification.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceUnregisterAsyncNotification", device, callback); - } - return (int)mh$.invokeExact(device, callback); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetSharedMemConfig { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetSharedMemConfig"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetSharedMemConfig(enum cudaSharedMemConfig *pConfig) - * } - */ - public static FunctionDescriptor cudaDeviceGetSharedMemConfig$descriptor() { - return cudaDeviceGetSharedMemConfig.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetSharedMemConfig(enum cudaSharedMemConfig *pConfig) - * } - */ - public static MethodHandle cudaDeviceGetSharedMemConfig$handle() { - return cudaDeviceGetSharedMemConfig.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetSharedMemConfig(enum cudaSharedMemConfig *pConfig) - * } - */ - public static MemorySegment cudaDeviceGetSharedMemConfig$address() { - return cudaDeviceGetSharedMemConfig.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetSharedMemConfig(enum cudaSharedMemConfig *pConfig) - * } - */ - public static int cudaDeviceGetSharedMemConfig(MemorySegment pConfig) { - var mh$ = cudaDeviceGetSharedMemConfig.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetSharedMemConfig", pConfig); - } - return (int)mh$.invokeExact(pConfig); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceSetSharedMemConfig { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSetSharedMemConfig"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetSharedMemConfig(enum cudaSharedMemConfig config) - * } - */ - public static FunctionDescriptor cudaDeviceSetSharedMemConfig$descriptor() { - return cudaDeviceSetSharedMemConfig.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetSharedMemConfig(enum cudaSharedMemConfig config) - * } - */ - public static MethodHandle cudaDeviceSetSharedMemConfig$handle() { - return cudaDeviceSetSharedMemConfig.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetSharedMemConfig(enum cudaSharedMemConfig config) - * } - */ - public static MemorySegment cudaDeviceSetSharedMemConfig$address() { - return cudaDeviceSetSharedMemConfig.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetSharedMemConfig(enum cudaSharedMemConfig config) - * } - */ - public static int cudaDeviceSetSharedMemConfig(int config) { - var mh$ = cudaDeviceSetSharedMemConfig.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceSetSharedMemConfig", config); - } - return (int)mh$.invokeExact(config); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaThreadExit { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadExit"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadExit() - * } - */ - public static FunctionDescriptor cudaThreadExit$descriptor() { - return cudaThreadExit.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadExit() - * } - */ - public static MethodHandle cudaThreadExit$handle() { - return cudaThreadExit.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadExit() - * } - */ - public static MemorySegment cudaThreadExit$address() { - return cudaThreadExit.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaThreadExit() - * } - */ - public static int cudaThreadExit() { - var mh$ = cudaThreadExit.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaThreadExit"); - } - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaThreadSynchronize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadSynchronize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadSynchronize() - * } - */ - public static FunctionDescriptor cudaThreadSynchronize$descriptor() { - return cudaThreadSynchronize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadSynchronize() - * } - */ - public static MethodHandle cudaThreadSynchronize$handle() { - return cudaThreadSynchronize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadSynchronize() - * } - */ - public static MemorySegment cudaThreadSynchronize$address() { - return cudaThreadSynchronize.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaThreadSynchronize() - * } - */ - public static int cudaThreadSynchronize() { - var mh$ = cudaThreadSynchronize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaThreadSynchronize"); - } - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaThreadSetLimit { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadSetLimit"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadSetLimit(enum cudaLimit limit, size_t value) - * } - */ - public static FunctionDescriptor cudaThreadSetLimit$descriptor() { - return cudaThreadSetLimit.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadSetLimit(enum cudaLimit limit, size_t value) - * } - */ - public static MethodHandle cudaThreadSetLimit$handle() { - return cudaThreadSetLimit.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadSetLimit(enum cudaLimit limit, size_t value) - * } - */ - public static MemorySegment cudaThreadSetLimit$address() { - return cudaThreadSetLimit.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaThreadSetLimit(enum cudaLimit limit, size_t value) - * } - */ - public static int cudaThreadSetLimit(int limit, long value) { - var mh$ = cudaThreadSetLimit.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaThreadSetLimit", limit, value); - } - return (int)mh$.invokeExact(limit, value); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaThreadGetLimit { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadGetLimit"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadGetLimit(size_t *pValue, enum cudaLimit limit) - * } - */ - public static FunctionDescriptor cudaThreadGetLimit$descriptor() { - return cudaThreadGetLimit.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadGetLimit(size_t *pValue, enum cudaLimit limit) - * } - */ - public static MethodHandle cudaThreadGetLimit$handle() { - return cudaThreadGetLimit.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadGetLimit(size_t *pValue, enum cudaLimit limit) - * } - */ - public static MemorySegment cudaThreadGetLimit$address() { - return cudaThreadGetLimit.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaThreadGetLimit(size_t *pValue, enum cudaLimit limit) - * } - */ - public static int cudaThreadGetLimit(MemorySegment pValue, int limit) { - var mh$ = cudaThreadGetLimit.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaThreadGetLimit", pValue, limit); - } - return (int)mh$.invokeExact(pValue, limit); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaThreadGetCacheConfig { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadGetCacheConfig"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadGetCacheConfig(enum cudaFuncCache *pCacheConfig) - * } - */ - public static FunctionDescriptor cudaThreadGetCacheConfig$descriptor() { - return cudaThreadGetCacheConfig.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadGetCacheConfig(enum cudaFuncCache *pCacheConfig) - * } - */ - public static MethodHandle cudaThreadGetCacheConfig$handle() { - return cudaThreadGetCacheConfig.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadGetCacheConfig(enum cudaFuncCache *pCacheConfig) - * } - */ - public static MemorySegment cudaThreadGetCacheConfig$address() { - return cudaThreadGetCacheConfig.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaThreadGetCacheConfig(enum cudaFuncCache *pCacheConfig) - * } - */ - public static int cudaThreadGetCacheConfig(MemorySegment pCacheConfig) { - var mh$ = cudaThreadGetCacheConfig.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaThreadGetCacheConfig", pCacheConfig); - } - return (int)mh$.invokeExact(pCacheConfig); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaThreadSetCacheConfig { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadSetCacheConfig"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadSetCacheConfig(enum cudaFuncCache cacheConfig) - * } - */ - public static FunctionDescriptor cudaThreadSetCacheConfig$descriptor() { - return cudaThreadSetCacheConfig.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadSetCacheConfig(enum cudaFuncCache cacheConfig) - * } - */ - public static MethodHandle cudaThreadSetCacheConfig$handle() { - return cudaThreadSetCacheConfig.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadSetCacheConfig(enum cudaFuncCache cacheConfig) - * } - */ - public static MemorySegment cudaThreadSetCacheConfig$address() { - return cudaThreadSetCacheConfig.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaThreadSetCacheConfig(enum cudaFuncCache cacheConfig) - * } - */ - public static int cudaThreadSetCacheConfig(int cacheConfig) { - var mh$ = cudaThreadSetCacheConfig.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaThreadSetCacheConfig", cacheConfig); - } - return (int)mh$.invokeExact(cacheConfig); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetLastError { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetLastError"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetLastError() - * } - */ - public static FunctionDescriptor cudaGetLastError$descriptor() { - return cudaGetLastError.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetLastError() - * } - */ - public static MethodHandle cudaGetLastError$handle() { - return cudaGetLastError.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetLastError() - * } - */ - public static MemorySegment cudaGetLastError$address() { - return cudaGetLastError.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetLastError() - * } - */ - public static int cudaGetLastError() { - var mh$ = cudaGetLastError.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetLastError"); - } - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaPeekAtLastError { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaPeekAtLastError"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaPeekAtLastError() - * } - */ - public static FunctionDescriptor cudaPeekAtLastError$descriptor() { - return cudaPeekAtLastError.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaPeekAtLastError() - * } - */ - public static MethodHandle cudaPeekAtLastError$handle() { - return cudaPeekAtLastError.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaPeekAtLastError() - * } - */ - public static MemorySegment cudaPeekAtLastError$address() { - return cudaPeekAtLastError.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaPeekAtLastError() - * } - */ - public static int cudaPeekAtLastError() { - var mh$ = cudaPeekAtLastError.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaPeekAtLastError"); - } - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetErrorName { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetErrorName"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern const char *cudaGetErrorName(cudaError_t error) - * } - */ - public static FunctionDescriptor cudaGetErrorName$descriptor() { - return cudaGetErrorName.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern const char *cudaGetErrorName(cudaError_t error) - * } - */ - public static MethodHandle cudaGetErrorName$handle() { - return cudaGetErrorName.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern const char *cudaGetErrorName(cudaError_t error) - * } - */ - public static MemorySegment cudaGetErrorName$address() { - return cudaGetErrorName.ADDR; - } - - /** - * {@snippet lang=c : - * extern const char *cudaGetErrorName(cudaError_t error) - * } - */ - public static MemorySegment cudaGetErrorName(int error) { - var mh$ = cudaGetErrorName.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetErrorName", error); - } - return (MemorySegment)mh$.invokeExact(error); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetErrorString { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetErrorString"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern const char *cudaGetErrorString(cudaError_t error) - * } - */ - public static FunctionDescriptor cudaGetErrorString$descriptor() { - return cudaGetErrorString.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern const char *cudaGetErrorString(cudaError_t error) - * } - */ - public static MethodHandle cudaGetErrorString$handle() { - return cudaGetErrorString.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern const char *cudaGetErrorString(cudaError_t error) - * } - */ - public static MemorySegment cudaGetErrorString$address() { - return cudaGetErrorString.ADDR; - } - - /** - * {@snippet lang=c : - * extern const char *cudaGetErrorString(cudaError_t error) - * } - */ - public static MemorySegment cudaGetErrorString(int error) { - var mh$ = cudaGetErrorString.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetErrorString", error); - } - return (MemorySegment)mh$.invokeExact(error); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetDeviceCount { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDeviceCount"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceCount(int *count) - * } - */ - public static FunctionDescriptor cudaGetDeviceCount$descriptor() { - return cudaGetDeviceCount.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceCount(int *count) - * } - */ - public static MethodHandle cudaGetDeviceCount$handle() { - return cudaGetDeviceCount.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceCount(int *count) - * } - */ - public static MemorySegment cudaGetDeviceCount$address() { - return cudaGetDeviceCount.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceCount(int *count) - * } - */ - public static int cudaGetDeviceCount(MemorySegment count) { - var mh$ = cudaGetDeviceCount.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetDeviceCount", count); - } - return (int)mh$.invokeExact(count); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetDeviceProperties_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDeviceProperties_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceProperties_v2(struct cudaDeviceProp *prop, int device) - * } - */ - public static FunctionDescriptor cudaGetDeviceProperties_v2$descriptor() { - return cudaGetDeviceProperties_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceProperties_v2(struct cudaDeviceProp *prop, int device) - * } - */ - public static MethodHandle cudaGetDeviceProperties_v2$handle() { - return cudaGetDeviceProperties_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceProperties_v2(struct cudaDeviceProp *prop, int device) - * } - */ - public static MemorySegment cudaGetDeviceProperties_v2$address() { - return cudaGetDeviceProperties_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceProperties_v2(struct cudaDeviceProp *prop, int device) - * } - */ - public static int cudaGetDeviceProperties_v2(MemorySegment prop, int device) { - var mh$ = cudaGetDeviceProperties_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetDeviceProperties_v2", prop, device); - } - return (int)mh$.invokeExact(prop, device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device) - * } - */ - public static FunctionDescriptor cudaDeviceGetAttribute$descriptor() { - return cudaDeviceGetAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device) - * } - */ - public static MethodHandle cudaDeviceGetAttribute$handle() { - return cudaDeviceGetAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device) - * } - */ - public static MemorySegment cudaDeviceGetAttribute$address() { - return cudaDeviceGetAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetAttribute(int *value, enum cudaDeviceAttr attr, int device) - * } - */ - public static int cudaDeviceGetAttribute(MemorySegment value, int attr, int device) { - var mh$ = cudaDeviceGetAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetAttribute", value, attr, device); - } - return (int)mh$.invokeExact(value, attr, device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetDefaultMemPool { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetDefaultMemPool"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t *memPool, int device) - * } - */ - public static FunctionDescriptor cudaDeviceGetDefaultMemPool$descriptor() { - return cudaDeviceGetDefaultMemPool.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t *memPool, int device) - * } - */ - public static MethodHandle cudaDeviceGetDefaultMemPool$handle() { - return cudaDeviceGetDefaultMemPool.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t *memPool, int device) - * } - */ - public static MemorySegment cudaDeviceGetDefaultMemPool$address() { - return cudaDeviceGetDefaultMemPool.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetDefaultMemPool(cudaMemPool_t *memPool, int device) - * } - */ - public static int cudaDeviceGetDefaultMemPool(MemorySegment memPool, int device) { - var mh$ = cudaDeviceGetDefaultMemPool.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetDefaultMemPool", memPool, device); - } - return (int)mh$.invokeExact(memPool, device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceSetMemPool { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceSetMemPool"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) - * } - */ - public static FunctionDescriptor cudaDeviceSetMemPool$descriptor() { - return cudaDeviceSetMemPool.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) - * } - */ - public static MethodHandle cudaDeviceSetMemPool$handle() { - return cudaDeviceSetMemPool.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) - * } - */ - public static MemorySegment cudaDeviceSetMemPool$address() { - return cudaDeviceSetMemPool.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceSetMemPool(int device, cudaMemPool_t memPool) - * } - */ - public static int cudaDeviceSetMemPool(int device, MemorySegment memPool) { - var mh$ = cudaDeviceSetMemPool.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceSetMemPool", device, memPool); - } - return (int)mh$.invokeExact(device, memPool); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetMemPool { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetMemPool"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetMemPool(cudaMemPool_t *memPool, int device) - * } - */ - public static FunctionDescriptor cudaDeviceGetMemPool$descriptor() { - return cudaDeviceGetMemPool.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetMemPool(cudaMemPool_t *memPool, int device) - * } - */ - public static MethodHandle cudaDeviceGetMemPool$handle() { - return cudaDeviceGetMemPool.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetMemPool(cudaMemPool_t *memPool, int device) - * } - */ - public static MemorySegment cudaDeviceGetMemPool$address() { - return cudaDeviceGetMemPool.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetMemPool(cudaMemPool_t *memPool, int device) - * } - */ - public static int cudaDeviceGetMemPool(MemorySegment memPool, int device) { - var mh$ = cudaDeviceGetMemPool.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetMemPool", memPool, device); - } - return (int)mh$.invokeExact(memPool, device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetNvSciSyncAttributes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetNvSciSyncAttributes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetNvSciSyncAttributes(void *nvSciSyncAttrList, int device, int flags) - * } - */ - public static FunctionDescriptor cudaDeviceGetNvSciSyncAttributes$descriptor() { - return cudaDeviceGetNvSciSyncAttributes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetNvSciSyncAttributes(void *nvSciSyncAttrList, int device, int flags) - * } - */ - public static MethodHandle cudaDeviceGetNvSciSyncAttributes$handle() { - return cudaDeviceGetNvSciSyncAttributes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetNvSciSyncAttributes(void *nvSciSyncAttrList, int device, int flags) - * } - */ - public static MemorySegment cudaDeviceGetNvSciSyncAttributes$address() { - return cudaDeviceGetNvSciSyncAttributes.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetNvSciSyncAttributes(void *nvSciSyncAttrList, int device, int flags) - * } - */ - public static int cudaDeviceGetNvSciSyncAttributes(MemorySegment nvSciSyncAttrList, int device, int flags) { - var mh$ = cudaDeviceGetNvSciSyncAttributes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetNvSciSyncAttributes", nvSciSyncAttrList, device, flags); - } - return (int)mh$.invokeExact(nvSciSyncAttrList, device, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDeviceGetP2PAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDeviceGetP2PAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetP2PAttribute(int *value, enum cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) - * } - */ - public static FunctionDescriptor cudaDeviceGetP2PAttribute$descriptor() { - return cudaDeviceGetP2PAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetP2PAttribute(int *value, enum cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) - * } - */ - public static MethodHandle cudaDeviceGetP2PAttribute$handle() { - return cudaDeviceGetP2PAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetP2PAttribute(int *value, enum cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) - * } - */ - public static MemorySegment cudaDeviceGetP2PAttribute$address() { - return cudaDeviceGetP2PAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDeviceGetP2PAttribute(int *value, enum cudaDeviceP2PAttr attr, int srcDevice, int dstDevice) - * } - */ - public static int cudaDeviceGetP2PAttribute(MemorySegment value, int attr, int srcDevice, int dstDevice) { - var mh$ = cudaDeviceGetP2PAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDeviceGetP2PAttribute", value, attr, srcDevice, dstDevice); - } - return (int)mh$.invokeExact(value, attr, srcDevice, dstDevice); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaChooseDevice { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaChooseDevice"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaChooseDevice(int *device, const struct cudaDeviceProp *prop) - * } - */ - public static FunctionDescriptor cudaChooseDevice$descriptor() { - return cudaChooseDevice.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaChooseDevice(int *device, const struct cudaDeviceProp *prop) - * } - */ - public static MethodHandle cudaChooseDevice$handle() { - return cudaChooseDevice.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaChooseDevice(int *device, const struct cudaDeviceProp *prop) - * } - */ - public static MemorySegment cudaChooseDevice$address() { - return cudaChooseDevice.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaChooseDevice(int *device, const struct cudaDeviceProp *prop) - * } - */ - public static int cudaChooseDevice(MemorySegment device, MemorySegment prop) { - var mh$ = cudaChooseDevice.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaChooseDevice", device, prop); - } - return (int)mh$.invokeExact(device, prop); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaInitDevice { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaInitDevice"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaInitDevice$descriptor() { - return cudaInitDevice.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) - * } - */ - public static MethodHandle cudaInitDevice$handle() { - return cudaInitDevice.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) - * } - */ - public static MemorySegment cudaInitDevice$address() { - return cudaInitDevice.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaInitDevice(int device, unsigned int deviceFlags, unsigned int flags) - * } - */ - public static int cudaInitDevice(int device, int deviceFlags, int flags) { - var mh$ = cudaInitDevice.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaInitDevice", device, deviceFlags, flags); - } - return (int)mh$.invokeExact(device, deviceFlags, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaSetDevice { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSetDevice"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDevice(int device) - * } - */ - public static FunctionDescriptor cudaSetDevice$descriptor() { - return cudaSetDevice.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDevice(int device) - * } - */ - public static MethodHandle cudaSetDevice$handle() { - return cudaSetDevice.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDevice(int device) - * } - */ - public static MemorySegment cudaSetDevice$address() { - return cudaSetDevice.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaSetDevice(int device) - * } - */ - public static int cudaSetDevice(int device) { - var mh$ = cudaSetDevice.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaSetDevice", device); - } - return (int)mh$.invokeExact(device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetDevice { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDevice"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDevice(int *device) - * } - */ - public static FunctionDescriptor cudaGetDevice$descriptor() { - return cudaGetDevice.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDevice(int *device) - * } - */ - public static MethodHandle cudaGetDevice$handle() { - return cudaGetDevice.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDevice(int *device) - * } - */ - public static MemorySegment cudaGetDevice$address() { - return cudaGetDevice.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetDevice(int *device) - * } - */ - public static int cudaGetDevice(MemorySegment device) { - var mh$ = cudaGetDevice.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetDevice", device); - } - return (int)mh$.invokeExact(device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaSetValidDevices { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSetValidDevices"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaSetValidDevices(int *device_arr, int len) - * } - */ - public static FunctionDescriptor cudaSetValidDevices$descriptor() { - return cudaSetValidDevices.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaSetValidDevices(int *device_arr, int len) - * } - */ - public static MethodHandle cudaSetValidDevices$handle() { - return cudaSetValidDevices.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaSetValidDevices(int *device_arr, int len) - * } - */ - public static MemorySegment cudaSetValidDevices$address() { - return cudaSetValidDevices.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaSetValidDevices(int *device_arr, int len) - * } - */ - public static int cudaSetValidDevices(MemorySegment device_arr, int len) { - var mh$ = cudaSetValidDevices.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaSetValidDevices", device_arr, len); - } - return (int)mh$.invokeExact(device_arr, len); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaSetDeviceFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSetDeviceFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDeviceFlags(unsigned int flags) - * } - */ - public static FunctionDescriptor cudaSetDeviceFlags$descriptor() { - return cudaSetDeviceFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDeviceFlags(unsigned int flags) - * } - */ - public static MethodHandle cudaSetDeviceFlags$handle() { - return cudaSetDeviceFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDeviceFlags(unsigned int flags) - * } - */ - public static MemorySegment cudaSetDeviceFlags$address() { - return cudaSetDeviceFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaSetDeviceFlags(unsigned int flags) - * } - */ - public static int cudaSetDeviceFlags(int flags) { - var mh$ = cudaSetDeviceFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaSetDeviceFlags", flags); - } - return (int)mh$.invokeExact(flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetDeviceFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetDeviceFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceFlags(unsigned int *flags) - * } - */ - public static FunctionDescriptor cudaGetDeviceFlags$descriptor() { - return cudaGetDeviceFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceFlags(unsigned int *flags) - * } - */ - public static MethodHandle cudaGetDeviceFlags$handle() { - return cudaGetDeviceFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceFlags(unsigned int *flags) - * } - */ - public static MemorySegment cudaGetDeviceFlags$address() { - return cudaGetDeviceFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetDeviceFlags(unsigned int *flags) - * } - */ - public static int cudaGetDeviceFlags(MemorySegment flags) { - var mh$ = cudaGetDeviceFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetDeviceFlags", flags); - } - return (int)mh$.invokeExact(flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreate(cudaStream_t *pStream) - * } - */ - public static FunctionDescriptor cudaStreamCreate$descriptor() { - return cudaStreamCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreate(cudaStream_t *pStream) - * } - */ - public static MethodHandle cudaStreamCreate$handle() { - return cudaStreamCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreate(cudaStream_t *pStream) - * } - */ - public static MemorySegment cudaStreamCreate$address() { - return cudaStreamCreate.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreate(cudaStream_t *pStream) - * } - */ - public static int cudaStreamCreate(MemorySegment pStream) { - var mh$ = cudaStreamCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamCreate", pStream); - } - return (int)mh$.invokeExact(pStream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamCreateWithFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamCreateWithFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t *pStream, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaStreamCreateWithFlags$descriptor() { - return cudaStreamCreateWithFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t *pStream, unsigned int flags) - * } - */ - public static MethodHandle cudaStreamCreateWithFlags$handle() { - return cudaStreamCreateWithFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t *pStream, unsigned int flags) - * } - */ - public static MemorySegment cudaStreamCreateWithFlags$address() { - return cudaStreamCreateWithFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreateWithFlags(cudaStream_t *pStream, unsigned int flags) - * } - */ - public static int cudaStreamCreateWithFlags(MemorySegment pStream, int flags) { - var mh$ = cudaStreamCreateWithFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamCreateWithFlags", pStream, flags); - } - return (int)mh$.invokeExact(pStream, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamCreateWithPriority { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamCreateWithPriority"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreateWithPriority(cudaStream_t *pStream, unsigned int flags, int priority) - * } - */ - public static FunctionDescriptor cudaStreamCreateWithPriority$descriptor() { - return cudaStreamCreateWithPriority.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreateWithPriority(cudaStream_t *pStream, unsigned int flags, int priority) - * } - */ - public static MethodHandle cudaStreamCreateWithPriority$handle() { - return cudaStreamCreateWithPriority.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreateWithPriority(cudaStream_t *pStream, unsigned int flags, int priority) - * } - */ - public static MemorySegment cudaStreamCreateWithPriority$address() { - return cudaStreamCreateWithPriority.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamCreateWithPriority(cudaStream_t *pStream, unsigned int flags, int priority) - * } - */ - public static int cudaStreamCreateWithPriority(MemorySegment pStream, int flags, int priority) { - var mh$ = cudaStreamCreateWithPriority.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamCreateWithPriority", pStream, flags, priority); - } - return (int)mh$.invokeExact(pStream, flags, priority); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamGetPriority { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetPriority"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int *priority) - * } - */ - public static FunctionDescriptor cudaStreamGetPriority$descriptor() { - return cudaStreamGetPriority.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int *priority) - * } - */ - public static MethodHandle cudaStreamGetPriority$handle() { - return cudaStreamGetPriority.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int *priority) - * } - */ - public static MemorySegment cudaStreamGetPriority$address() { - return cudaStreamGetPriority.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetPriority(cudaStream_t hStream, int *priority) - * } - */ - public static int cudaStreamGetPriority(MemorySegment hStream, MemorySegment priority) { - var mh$ = cudaStreamGetPriority.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamGetPriority", hStream, priority); - } - return (int)mh$.invokeExact(hStream, priority); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamGetFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int *flags) - * } - */ - public static FunctionDescriptor cudaStreamGetFlags$descriptor() { - return cudaStreamGetFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int *flags) - * } - */ - public static MethodHandle cudaStreamGetFlags$handle() { - return cudaStreamGetFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int *flags) - * } - */ - public static MemorySegment cudaStreamGetFlags$address() { - return cudaStreamGetFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetFlags(cudaStream_t hStream, unsigned int *flags) - * } - */ - public static int cudaStreamGetFlags(MemorySegment hStream, MemorySegment flags) { - var mh$ = cudaStreamGetFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamGetFlags", hStream, flags); - } - return (int)mh$.invokeExact(hStream, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamGetId { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetId"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long *streamId) - * } - */ - public static FunctionDescriptor cudaStreamGetId$descriptor() { - return cudaStreamGetId.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long *streamId) - * } - */ - public static MethodHandle cudaStreamGetId$handle() { - return cudaStreamGetId.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long *streamId) - * } - */ - public static MemorySegment cudaStreamGetId$address() { - return cudaStreamGetId.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetId(cudaStream_t hStream, unsigned long long *streamId) - * } - */ - public static int cudaStreamGetId(MemorySegment hStream, MemorySegment streamId) { - var mh$ = cudaStreamGetId.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamGetId", hStream, streamId); - } - return (int)mh$.invokeExact(hStream, streamId); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaCtxResetPersistingL2Cache { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaCtxResetPersistingL2Cache"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaCtxResetPersistingL2Cache() - * } - */ - public static FunctionDescriptor cudaCtxResetPersistingL2Cache$descriptor() { - return cudaCtxResetPersistingL2Cache.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaCtxResetPersistingL2Cache() - * } - */ - public static MethodHandle cudaCtxResetPersistingL2Cache$handle() { - return cudaCtxResetPersistingL2Cache.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaCtxResetPersistingL2Cache() - * } - */ - public static MemorySegment cudaCtxResetPersistingL2Cache$address() { - return cudaCtxResetPersistingL2Cache.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaCtxResetPersistingL2Cache() - * } - */ - public static int cudaCtxResetPersistingL2Cache() { - var mh$ = cudaCtxResetPersistingL2Cache.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaCtxResetPersistingL2Cache"); - } - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamCopyAttributes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamCopyAttributes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) - * } - */ - public static FunctionDescriptor cudaStreamCopyAttributes$descriptor() { - return cudaStreamCopyAttributes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) - * } - */ - public static MethodHandle cudaStreamCopyAttributes$handle() { - return cudaStreamCopyAttributes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) - * } - */ - public static MemorySegment cudaStreamCopyAttributes$address() { - return cudaStreamCopyAttributes.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamCopyAttributes(cudaStream_t dst, cudaStream_t src) - * } - */ - public static int cudaStreamCopyAttributes(MemorySegment dst, MemorySegment src) { - var mh$ = cudaStreamCopyAttributes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamCopyAttributes", dst, src); - } - return (int)mh$.invokeExact(dst, src); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamGetAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) - * } - */ - public static FunctionDescriptor cudaStreamGetAttribute$descriptor() { - return cudaStreamGetAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) - * } - */ - public static MethodHandle cudaStreamGetAttribute$handle() { - return cudaStreamGetAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) - * } - */ - public static MemorySegment cudaStreamGetAttribute$address() { - return cudaStreamGetAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, cudaLaunchAttributeValue *value_out) - * } - */ - public static int cudaStreamGetAttribute(MemorySegment hStream, int attr, MemorySegment value_out) { - var mh$ = cudaStreamGetAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamGetAttribute", hStream, attr, value_out); - } - return (int)mh$.invokeExact(hStream, attr, value_out); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamSetAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamSetAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) - * } - */ - public static FunctionDescriptor cudaStreamSetAttribute$descriptor() { - return cudaStreamSetAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) - * } - */ - public static MethodHandle cudaStreamSetAttribute$handle() { - return cudaStreamSetAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) - * } - */ - public static MemorySegment cudaStreamSetAttribute$address() { - return cudaStreamSetAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamSetAttribute(cudaStream_t hStream, cudaLaunchAttributeID attr, const cudaLaunchAttributeValue *value) - * } - */ - public static int cudaStreamSetAttribute(MemorySegment hStream, int attr, MemorySegment value) { - var mh$ = cudaStreamSetAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamSetAttribute", hStream, attr, value); - } - return (int)mh$.invokeExact(hStream, attr, value); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamDestroy(cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaStreamDestroy$descriptor() { - return cudaStreamDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamDestroy(cudaStream_t stream) - * } - */ - public static MethodHandle cudaStreamDestroy$handle() { - return cudaStreamDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamDestroy(cudaStream_t stream) - * } - */ - public static MemorySegment cudaStreamDestroy$address() { - return cudaStreamDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamDestroy(cudaStream_t stream) - * } - */ - public static int cudaStreamDestroy(MemorySegment stream) { - var mh$ = cudaStreamDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamDestroy", stream); - } - return (int)mh$.invokeExact(stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamWaitEvent { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamWaitEvent"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaStreamWaitEvent$descriptor() { - return cudaStreamWaitEvent.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) - * } - */ - public static MethodHandle cudaStreamWaitEvent$handle() { - return cudaStreamWaitEvent.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) - * } - */ - public static MemorySegment cudaStreamWaitEvent$address() { - return cudaStreamWaitEvent.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamWaitEvent(cudaStream_t stream, cudaEvent_t event, unsigned int flags) - * } - */ - public static int cudaStreamWaitEvent(MemorySegment stream, MemorySegment event, int flags) { - var mh$ = cudaStreamWaitEvent.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamWaitEvent", stream, event, flags); - } - return (int)mh$.invokeExact(stream, event, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamAddCallback { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamAddCallback"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void *userData, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaStreamAddCallback$descriptor() { - return cudaStreamAddCallback.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void *userData, unsigned int flags) - * } - */ - public static MethodHandle cudaStreamAddCallback$handle() { - return cudaStreamAddCallback.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void *userData, unsigned int flags) - * } - */ - public static MemorySegment cudaStreamAddCallback$address() { - return cudaStreamAddCallback.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamAddCallback(cudaStream_t stream, cudaStreamCallback_t callback, void *userData, unsigned int flags) - * } - */ - public static int cudaStreamAddCallback(MemorySegment stream, MemorySegment callback, MemorySegment userData, int flags) { - var mh$ = cudaStreamAddCallback.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamAddCallback", stream, callback, userData, flags); - } - return (int)mh$.invokeExact(stream, callback, userData, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamSynchronize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamSynchronize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamSynchronize(cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaStreamSynchronize$descriptor() { - return cudaStreamSynchronize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamSynchronize(cudaStream_t stream) - * } - */ - public static MethodHandle cudaStreamSynchronize$handle() { - return cudaStreamSynchronize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamSynchronize(cudaStream_t stream) - * } - */ - public static MemorySegment cudaStreamSynchronize$address() { - return cudaStreamSynchronize.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamSynchronize(cudaStream_t stream) - * } - */ - public static int cudaStreamSynchronize(MemorySegment stream) { - var mh$ = cudaStreamSynchronize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamSynchronize", stream); - } - return (int)mh$.invokeExact(stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamQuery { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamQuery"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamQuery(cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaStreamQuery$descriptor() { - return cudaStreamQuery.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamQuery(cudaStream_t stream) - * } - */ - public static MethodHandle cudaStreamQuery$handle() { - return cudaStreamQuery.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamQuery(cudaStream_t stream) - * } - */ - public static MemorySegment cudaStreamQuery$address() { - return cudaStreamQuery.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamQuery(cudaStream_t stream) - * } - */ - public static int cudaStreamQuery(MemorySegment stream) { - var mh$ = cudaStreamQuery.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamQuery", stream); - } - return (int)mh$.invokeExact(stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamAttachMemAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamAttachMemAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void *devPtr, size_t length, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaStreamAttachMemAsync$descriptor() { - return cudaStreamAttachMemAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void *devPtr, size_t length, unsigned int flags) - * } - */ - public static MethodHandle cudaStreamAttachMemAsync$handle() { - return cudaStreamAttachMemAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void *devPtr, size_t length, unsigned int flags) - * } - */ - public static MemorySegment cudaStreamAttachMemAsync$address() { - return cudaStreamAttachMemAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamAttachMemAsync(cudaStream_t stream, void *devPtr, size_t length, unsigned int flags) - * } - */ - public static int cudaStreamAttachMemAsync(MemorySegment stream, MemorySegment devPtr, long length, int flags) { - var mh$ = cudaStreamAttachMemAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamAttachMemAsync", stream, devPtr, length, flags); - } - return (int)mh$.invokeExact(stream, devPtr, length, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamBeginCapture { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamBeginCapture"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamBeginCapture(cudaStream_t stream, enum cudaStreamCaptureMode mode) - * } - */ - public static FunctionDescriptor cudaStreamBeginCapture$descriptor() { - return cudaStreamBeginCapture.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamBeginCapture(cudaStream_t stream, enum cudaStreamCaptureMode mode) - * } - */ - public static MethodHandle cudaStreamBeginCapture$handle() { - return cudaStreamBeginCapture.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamBeginCapture(cudaStream_t stream, enum cudaStreamCaptureMode mode) - * } - */ - public static MemorySegment cudaStreamBeginCapture$address() { - return cudaStreamBeginCapture.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamBeginCapture(cudaStream_t stream, enum cudaStreamCaptureMode mode) - * } - */ - public static int cudaStreamBeginCapture(MemorySegment stream, int mode) { - var mh$ = cudaStreamBeginCapture.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamBeginCapture", stream, mode); - } - return (int)mh$.invokeExact(stream, mode); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamBeginCaptureToGraph { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamBeginCaptureToGraph"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, enum cudaStreamCaptureMode mode) - * } - */ - public static FunctionDescriptor cudaStreamBeginCaptureToGraph$descriptor() { - return cudaStreamBeginCaptureToGraph.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, enum cudaStreamCaptureMode mode) - * } - */ - public static MethodHandle cudaStreamBeginCaptureToGraph$handle() { - return cudaStreamBeginCaptureToGraph.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, enum cudaStreamCaptureMode mode) - * } - */ - public static MemorySegment cudaStreamBeginCaptureToGraph$address() { - return cudaStreamBeginCaptureToGraph.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamBeginCaptureToGraph(cudaStream_t stream, cudaGraph_t graph, const cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, enum cudaStreamCaptureMode mode) - * } - */ - public static int cudaStreamBeginCaptureToGraph(MemorySegment stream, MemorySegment graph, MemorySegment dependencies, MemorySegment dependencyData, long numDependencies, int mode) { - var mh$ = cudaStreamBeginCaptureToGraph.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamBeginCaptureToGraph", stream, graph, dependencies, dependencyData, numDependencies, mode); - } - return (int)mh$.invokeExact(stream, graph, dependencies, dependencyData, numDependencies, mode); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaThreadExchangeStreamCaptureMode { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaThreadExchangeStreamCaptureMode"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadExchangeStreamCaptureMode(enum cudaStreamCaptureMode *mode) - * } - */ - public static FunctionDescriptor cudaThreadExchangeStreamCaptureMode$descriptor() { - return cudaThreadExchangeStreamCaptureMode.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadExchangeStreamCaptureMode(enum cudaStreamCaptureMode *mode) - * } - */ - public static MethodHandle cudaThreadExchangeStreamCaptureMode$handle() { - return cudaThreadExchangeStreamCaptureMode.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaThreadExchangeStreamCaptureMode(enum cudaStreamCaptureMode *mode) - * } - */ - public static MemorySegment cudaThreadExchangeStreamCaptureMode$address() { - return cudaThreadExchangeStreamCaptureMode.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaThreadExchangeStreamCaptureMode(enum cudaStreamCaptureMode *mode) - * } - */ - public static int cudaThreadExchangeStreamCaptureMode(MemorySegment mode) { - var mh$ = cudaThreadExchangeStreamCaptureMode.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaThreadExchangeStreamCaptureMode", mode); - } - return (int)mh$.invokeExact(mode); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamEndCapture { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamEndCapture"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t *pGraph) - * } - */ - public static FunctionDescriptor cudaStreamEndCapture$descriptor() { - return cudaStreamEndCapture.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t *pGraph) - * } - */ - public static MethodHandle cudaStreamEndCapture$handle() { - return cudaStreamEndCapture.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t *pGraph) - * } - */ - public static MemorySegment cudaStreamEndCapture$address() { - return cudaStreamEndCapture.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamEndCapture(cudaStream_t stream, cudaGraph_t *pGraph) - * } - */ - public static int cudaStreamEndCapture(MemorySegment stream, MemorySegment pGraph) { - var mh$ = cudaStreamEndCapture.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamEndCapture", stream, pGraph); - } - return (int)mh$.invokeExact(stream, pGraph); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamIsCapturing { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamIsCapturing"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamIsCapturing(cudaStream_t stream, enum cudaStreamCaptureStatus *pCaptureStatus) - * } - */ - public static FunctionDescriptor cudaStreamIsCapturing$descriptor() { - return cudaStreamIsCapturing.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamIsCapturing(cudaStream_t stream, enum cudaStreamCaptureStatus *pCaptureStatus) - * } - */ - public static MethodHandle cudaStreamIsCapturing$handle() { - return cudaStreamIsCapturing.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamIsCapturing(cudaStream_t stream, enum cudaStreamCaptureStatus *pCaptureStatus) - * } - */ - public static MemorySegment cudaStreamIsCapturing$address() { - return cudaStreamIsCapturing.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamIsCapturing(cudaStream_t stream, enum cudaStreamCaptureStatus *pCaptureStatus) - * } - */ - public static int cudaStreamIsCapturing(MemorySegment stream, MemorySegment pCaptureStatus) { - var mh$ = cudaStreamIsCapturing.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamIsCapturing", stream, pCaptureStatus); - } - return (int)mh$.invokeExact(stream, pCaptureStatus); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamGetCaptureInfo_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetCaptureInfo_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetCaptureInfo_v2(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, size_t *numDependencies_out) - * } - */ - public static FunctionDescriptor cudaStreamGetCaptureInfo_v2$descriptor() { - return cudaStreamGetCaptureInfo_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetCaptureInfo_v2(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, size_t *numDependencies_out) - * } - */ - public static MethodHandle cudaStreamGetCaptureInfo_v2$handle() { - return cudaStreamGetCaptureInfo_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetCaptureInfo_v2(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, size_t *numDependencies_out) - * } - */ - public static MemorySegment cudaStreamGetCaptureInfo_v2$address() { - return cudaStreamGetCaptureInfo_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetCaptureInfo_v2(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, size_t *numDependencies_out) - * } - */ - public static int cudaStreamGetCaptureInfo_v2(MemorySegment stream, MemorySegment captureStatus_out, MemorySegment id_out, MemorySegment graph_out, MemorySegment dependencies_out, MemorySegment numDependencies_out) { - var mh$ = cudaStreamGetCaptureInfo_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamGetCaptureInfo_v2", stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out); - } - return (int)mh$.invokeExact(stream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamGetCaptureInfo_v3 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamGetCaptureInfo_v3"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, const cudaGraphEdgeData **edgeData_out, size_t *numDependencies_out) - * } - */ - public static FunctionDescriptor cudaStreamGetCaptureInfo_v3$descriptor() { - return cudaStreamGetCaptureInfo_v3.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, const cudaGraphEdgeData **edgeData_out, size_t *numDependencies_out) - * } - */ - public static MethodHandle cudaStreamGetCaptureInfo_v3$handle() { - return cudaStreamGetCaptureInfo_v3.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, const cudaGraphEdgeData **edgeData_out, size_t *numDependencies_out) - * } - */ - public static MemorySegment cudaStreamGetCaptureInfo_v3$address() { - return cudaStreamGetCaptureInfo_v3.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamGetCaptureInfo_v3(cudaStream_t stream, enum cudaStreamCaptureStatus *captureStatus_out, unsigned long long *id_out, cudaGraph_t *graph_out, const cudaGraphNode_t **dependencies_out, const cudaGraphEdgeData **edgeData_out, size_t *numDependencies_out) - * } - */ - public static int cudaStreamGetCaptureInfo_v3(MemorySegment stream, MemorySegment captureStatus_out, MemorySegment id_out, MemorySegment graph_out, MemorySegment dependencies_out, MemorySegment edgeData_out, MemorySegment numDependencies_out) { - var mh$ = cudaStreamGetCaptureInfo_v3.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamGetCaptureInfo_v3", stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out); - } - return (int)mh$.invokeExact(stream, captureStatus_out, id_out, graph_out, dependencies_out, edgeData_out, numDependencies_out); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamUpdateCaptureDependencies { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamUpdateCaptureDependencies"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t *dependencies, size_t numDependencies, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaStreamUpdateCaptureDependencies$descriptor() { - return cudaStreamUpdateCaptureDependencies.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t *dependencies, size_t numDependencies, unsigned int flags) - * } - */ - public static MethodHandle cudaStreamUpdateCaptureDependencies$handle() { - return cudaStreamUpdateCaptureDependencies.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t *dependencies, size_t numDependencies, unsigned int flags) - * } - */ - public static MemorySegment cudaStreamUpdateCaptureDependencies$address() { - return cudaStreamUpdateCaptureDependencies.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamUpdateCaptureDependencies(cudaStream_t stream, cudaGraphNode_t *dependencies, size_t numDependencies, unsigned int flags) - * } - */ - public static int cudaStreamUpdateCaptureDependencies(MemorySegment stream, MemorySegment dependencies, long numDependencies, int flags) { - var mh$ = cudaStreamUpdateCaptureDependencies.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamUpdateCaptureDependencies", stream, dependencies, numDependencies, flags); - } - return (int)mh$.invokeExact(stream, dependencies, numDependencies, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaStreamUpdateCaptureDependencies_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaStreamUpdateCaptureDependencies_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaStreamUpdateCaptureDependencies_v2$descriptor() { - return cudaStreamUpdateCaptureDependencies_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, unsigned int flags) - * } - */ - public static MethodHandle cudaStreamUpdateCaptureDependencies_v2$handle() { - return cudaStreamUpdateCaptureDependencies_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, unsigned int flags) - * } - */ - public static MemorySegment cudaStreamUpdateCaptureDependencies_v2$address() { - return cudaStreamUpdateCaptureDependencies_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaStreamUpdateCaptureDependencies_v2(cudaStream_t stream, cudaGraphNode_t *dependencies, const cudaGraphEdgeData *dependencyData, size_t numDependencies, unsigned int flags) - * } - */ - public static int cudaStreamUpdateCaptureDependencies_v2(MemorySegment stream, MemorySegment dependencies, MemorySegment dependencyData, long numDependencies, int flags) { - var mh$ = cudaStreamUpdateCaptureDependencies_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaStreamUpdateCaptureDependencies_v2", stream, dependencies, dependencyData, numDependencies, flags); - } - return (int)mh$.invokeExact(stream, dependencies, dependencyData, numDependencies, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaEventCreate { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventCreate"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaEventCreate(cudaEvent_t *event) - * } - */ - public static FunctionDescriptor cudaEventCreate$descriptor() { - return cudaEventCreate.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaEventCreate(cudaEvent_t *event) - * } - */ - public static MethodHandle cudaEventCreate$handle() { - return cudaEventCreate.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaEventCreate(cudaEvent_t *event) - * } - */ - public static MemorySegment cudaEventCreate$address() { - return cudaEventCreate.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaEventCreate(cudaEvent_t *event) - * } - */ - public static int cudaEventCreate(MemorySegment event) { - var mh$ = cudaEventCreate.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaEventCreate", event); - } - return (int)mh$.invokeExact(event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaEventCreateWithFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventCreateWithFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t *event, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaEventCreateWithFlags$descriptor() { - return cudaEventCreateWithFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t *event, unsigned int flags) - * } - */ - public static MethodHandle cudaEventCreateWithFlags$handle() { - return cudaEventCreateWithFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t *event, unsigned int flags) - * } - */ - public static MemorySegment cudaEventCreateWithFlags$address() { - return cudaEventCreateWithFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaEventCreateWithFlags(cudaEvent_t *event, unsigned int flags) - * } - */ - public static int cudaEventCreateWithFlags(MemorySegment event, int flags) { - var mh$ = cudaEventCreateWithFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaEventCreateWithFlags", event, flags); - } - return (int)mh$.invokeExact(event, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaEventRecord { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventRecord"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaEventRecord$descriptor() { - return cudaEventRecord.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) - * } - */ - public static MethodHandle cudaEventRecord$handle() { - return cudaEventRecord.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) - * } - */ - public static MemorySegment cudaEventRecord$address() { - return cudaEventRecord.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaEventRecord(cudaEvent_t event, cudaStream_t stream) - * } - */ - public static int cudaEventRecord(MemorySegment event, MemorySegment stream) { - var mh$ = cudaEventRecord.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaEventRecord", event, stream); - } - return (int)mh$.invokeExact(event, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaEventRecordWithFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventRecordWithFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaEventRecordWithFlags$descriptor() { - return cudaEventRecordWithFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) - * } - */ - public static MethodHandle cudaEventRecordWithFlags$handle() { - return cudaEventRecordWithFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) - * } - */ - public static MemorySegment cudaEventRecordWithFlags$address() { - return cudaEventRecordWithFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaEventRecordWithFlags(cudaEvent_t event, cudaStream_t stream, unsigned int flags) - * } - */ - public static int cudaEventRecordWithFlags(MemorySegment event, MemorySegment stream, int flags) { - var mh$ = cudaEventRecordWithFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaEventRecordWithFlags", event, stream, flags); - } - return (int)mh$.invokeExact(event, stream, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaEventQuery { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventQuery"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaEventQuery(cudaEvent_t event) - * } - */ - public static FunctionDescriptor cudaEventQuery$descriptor() { - return cudaEventQuery.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaEventQuery(cudaEvent_t event) - * } - */ - public static MethodHandle cudaEventQuery$handle() { - return cudaEventQuery.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaEventQuery(cudaEvent_t event) - * } - */ - public static MemorySegment cudaEventQuery$address() { - return cudaEventQuery.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaEventQuery(cudaEvent_t event) - * } - */ - public static int cudaEventQuery(MemorySegment event) { - var mh$ = cudaEventQuery.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaEventQuery", event); - } - return (int)mh$.invokeExact(event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaEventSynchronize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventSynchronize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaEventSynchronize(cudaEvent_t event) - * } - */ - public static FunctionDescriptor cudaEventSynchronize$descriptor() { - return cudaEventSynchronize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaEventSynchronize(cudaEvent_t event) - * } - */ - public static MethodHandle cudaEventSynchronize$handle() { - return cudaEventSynchronize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaEventSynchronize(cudaEvent_t event) - * } - */ - public static MemorySegment cudaEventSynchronize$address() { - return cudaEventSynchronize.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaEventSynchronize(cudaEvent_t event) - * } - */ - public static int cudaEventSynchronize(MemorySegment event) { - var mh$ = cudaEventSynchronize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaEventSynchronize", event); - } - return (int)mh$.invokeExact(event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaEventDestroy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventDestroy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaEventDestroy(cudaEvent_t event) - * } - */ - public static FunctionDescriptor cudaEventDestroy$descriptor() { - return cudaEventDestroy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaEventDestroy(cudaEvent_t event) - * } - */ - public static MethodHandle cudaEventDestroy$handle() { - return cudaEventDestroy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaEventDestroy(cudaEvent_t event) - * } - */ - public static MemorySegment cudaEventDestroy$address() { - return cudaEventDestroy.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaEventDestroy(cudaEvent_t event) - * } - */ - public static int cudaEventDestroy(MemorySegment event) { - var mh$ = cudaEventDestroy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaEventDestroy", event); - } - return (int)mh$.invokeExact(event); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaEventElapsedTime { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaEventElapsedTime"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end) - * } - */ - public static FunctionDescriptor cudaEventElapsedTime$descriptor() { - return cudaEventElapsedTime.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end) - * } - */ - public static MethodHandle cudaEventElapsedTime$handle() { - return cudaEventElapsedTime.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end) - * } - */ - public static MemorySegment cudaEventElapsedTime$address() { - return cudaEventElapsedTime.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end) - * } - */ - public static int cudaEventElapsedTime(MemorySegment ms, MemorySegment start, MemorySegment end) { - var mh$ = cudaEventElapsedTime.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaEventElapsedTime", ms, start, end); - } - return (int)mh$.invokeExact(ms, start, end); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaImportExternalMemory { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaImportExternalMemory"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaImportExternalMemory(cudaExternalMemory_t *extMem_out, const struct cudaExternalMemoryHandleDesc *memHandleDesc) - * } - */ - public static FunctionDescriptor cudaImportExternalMemory$descriptor() { - return cudaImportExternalMemory.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaImportExternalMemory(cudaExternalMemory_t *extMem_out, const struct cudaExternalMemoryHandleDesc *memHandleDesc) - * } - */ - public static MethodHandle cudaImportExternalMemory$handle() { - return cudaImportExternalMemory.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaImportExternalMemory(cudaExternalMemory_t *extMem_out, const struct cudaExternalMemoryHandleDesc *memHandleDesc) - * } - */ - public static MemorySegment cudaImportExternalMemory$address() { - return cudaImportExternalMemory.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaImportExternalMemory(cudaExternalMemory_t *extMem_out, const struct cudaExternalMemoryHandleDesc *memHandleDesc) - * } - */ - public static int cudaImportExternalMemory(MemorySegment extMem_out, MemorySegment memHandleDesc) { - var mh$ = cudaImportExternalMemory.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaImportExternalMemory", extMem_out, memHandleDesc); - } - return (int)mh$.invokeExact(extMem_out, memHandleDesc); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaExternalMemoryGetMappedBuffer { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaExternalMemoryGetMappedBuffer"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaExternalMemoryGetMappedBuffer(void **devPtr, cudaExternalMemory_t extMem, const struct cudaExternalMemoryBufferDesc *bufferDesc) - * } - */ - public static FunctionDescriptor cudaExternalMemoryGetMappedBuffer$descriptor() { - return cudaExternalMemoryGetMappedBuffer.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaExternalMemoryGetMappedBuffer(void **devPtr, cudaExternalMemory_t extMem, const struct cudaExternalMemoryBufferDesc *bufferDesc) - * } - */ - public static MethodHandle cudaExternalMemoryGetMappedBuffer$handle() { - return cudaExternalMemoryGetMappedBuffer.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaExternalMemoryGetMappedBuffer(void **devPtr, cudaExternalMemory_t extMem, const struct cudaExternalMemoryBufferDesc *bufferDesc) - * } - */ - public static MemorySegment cudaExternalMemoryGetMappedBuffer$address() { - return cudaExternalMemoryGetMappedBuffer.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaExternalMemoryGetMappedBuffer(void **devPtr, cudaExternalMemory_t extMem, const struct cudaExternalMemoryBufferDesc *bufferDesc) - * } - */ - public static int cudaExternalMemoryGetMappedBuffer(MemorySegment devPtr, MemorySegment extMem, MemorySegment bufferDesc) { - var mh$ = cudaExternalMemoryGetMappedBuffer.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaExternalMemoryGetMappedBuffer", devPtr, extMem, bufferDesc); - } - return (int)mh$.invokeExact(devPtr, extMem, bufferDesc); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaExternalMemoryGetMappedMipmappedArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaExternalMemoryGetMappedMipmappedArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t *mipmap, cudaExternalMemory_t extMem, const struct cudaExternalMemoryMipmappedArrayDesc *mipmapDesc) - * } - */ - public static FunctionDescriptor cudaExternalMemoryGetMappedMipmappedArray$descriptor() { - return cudaExternalMemoryGetMappedMipmappedArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t *mipmap, cudaExternalMemory_t extMem, const struct cudaExternalMemoryMipmappedArrayDesc *mipmapDesc) - * } - */ - public static MethodHandle cudaExternalMemoryGetMappedMipmappedArray$handle() { - return cudaExternalMemoryGetMappedMipmappedArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t *mipmap, cudaExternalMemory_t extMem, const struct cudaExternalMemoryMipmappedArrayDesc *mipmapDesc) - * } - */ - public static MemorySegment cudaExternalMemoryGetMappedMipmappedArray$address() { - return cudaExternalMemoryGetMappedMipmappedArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaExternalMemoryGetMappedMipmappedArray(cudaMipmappedArray_t *mipmap, cudaExternalMemory_t extMem, const struct cudaExternalMemoryMipmappedArrayDesc *mipmapDesc) - * } - */ - public static int cudaExternalMemoryGetMappedMipmappedArray(MemorySegment mipmap, MemorySegment extMem, MemorySegment mipmapDesc) { - var mh$ = cudaExternalMemoryGetMappedMipmappedArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaExternalMemoryGetMappedMipmappedArray", mipmap, extMem, mipmapDesc); - } - return (int)mh$.invokeExact(mipmap, extMem, mipmapDesc); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDestroyExternalMemory { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDestroyExternalMemory"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) - * } - */ - public static FunctionDescriptor cudaDestroyExternalMemory$descriptor() { - return cudaDestroyExternalMemory.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) - * } - */ - public static MethodHandle cudaDestroyExternalMemory$handle() { - return cudaDestroyExternalMemory.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) - * } - */ - public static MemorySegment cudaDestroyExternalMemory$address() { - return cudaDestroyExternalMemory.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDestroyExternalMemory(cudaExternalMemory_t extMem) - * } - */ - public static int cudaDestroyExternalMemory(MemorySegment extMem) { - var mh$ = cudaDestroyExternalMemory.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDestroyExternalMemory", extMem); - } - return (int)mh$.invokeExact(extMem); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaImportExternalSemaphore { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaImportExternalSemaphore"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t *extSem_out, const struct cudaExternalSemaphoreHandleDesc *semHandleDesc) - * } - */ - public static FunctionDescriptor cudaImportExternalSemaphore$descriptor() { - return cudaImportExternalSemaphore.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t *extSem_out, const struct cudaExternalSemaphoreHandleDesc *semHandleDesc) - * } - */ - public static MethodHandle cudaImportExternalSemaphore$handle() { - return cudaImportExternalSemaphore.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t *extSem_out, const struct cudaExternalSemaphoreHandleDesc *semHandleDesc) - * } - */ - public static MemorySegment cudaImportExternalSemaphore$address() { - return cudaImportExternalSemaphore.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaImportExternalSemaphore(cudaExternalSemaphore_t *extSem_out, const struct cudaExternalSemaphoreHandleDesc *semHandleDesc) - * } - */ - public static int cudaImportExternalSemaphore(MemorySegment extSem_out, MemorySegment semHandleDesc) { - var mh$ = cudaImportExternalSemaphore.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaImportExternalSemaphore", extSem_out, semHandleDesc); - } - return (int)mh$.invokeExact(extSem_out, semHandleDesc); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaSignalExternalSemaphoresAsync_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSignalExternalSemaphoresAsync_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreSignalParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaSignalExternalSemaphoresAsync_v2$descriptor() { - return cudaSignalExternalSemaphoresAsync_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreSignalParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) - * } - */ - public static MethodHandle cudaSignalExternalSemaphoresAsync_v2$handle() { - return cudaSignalExternalSemaphoresAsync_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreSignalParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) - * } - */ - public static MemorySegment cudaSignalExternalSemaphoresAsync_v2$address() { - return cudaSignalExternalSemaphoresAsync_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaSignalExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreSignalParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) - * } - */ - public static int cudaSignalExternalSemaphoresAsync_v2(MemorySegment extSemArray, MemorySegment paramsArray, int numExtSems, MemorySegment stream) { - var mh$ = cudaSignalExternalSemaphoresAsync_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaSignalExternalSemaphoresAsync_v2", extSemArray, paramsArray, numExtSems, stream); - } - return (int)mh$.invokeExact(extSemArray, paramsArray, numExtSems, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaWaitExternalSemaphoresAsync_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaWaitExternalSemaphoresAsync_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreWaitParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaWaitExternalSemaphoresAsync_v2$descriptor() { - return cudaWaitExternalSemaphoresAsync_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreWaitParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) - * } - */ - public static MethodHandle cudaWaitExternalSemaphoresAsync_v2$handle() { - return cudaWaitExternalSemaphoresAsync_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreWaitParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) - * } - */ - public static MemorySegment cudaWaitExternalSemaphoresAsync_v2$address() { - return cudaWaitExternalSemaphoresAsync_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaWaitExternalSemaphoresAsync_v2(const cudaExternalSemaphore_t *extSemArray, const struct cudaExternalSemaphoreWaitParams *paramsArray, unsigned int numExtSems, cudaStream_t stream) - * } - */ - public static int cudaWaitExternalSemaphoresAsync_v2(MemorySegment extSemArray, MemorySegment paramsArray, int numExtSems, MemorySegment stream) { - var mh$ = cudaWaitExternalSemaphoresAsync_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaWaitExternalSemaphoresAsync_v2", extSemArray, paramsArray, numExtSems, stream); - } - return (int)mh$.invokeExact(extSemArray, paramsArray, numExtSems, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaDestroyExternalSemaphore { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaDestroyExternalSemaphore"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) - * } - */ - public static FunctionDescriptor cudaDestroyExternalSemaphore$descriptor() { - return cudaDestroyExternalSemaphore.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) - * } - */ - public static MethodHandle cudaDestroyExternalSemaphore$handle() { - return cudaDestroyExternalSemaphore.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) - * } - */ - public static MemorySegment cudaDestroyExternalSemaphore$address() { - return cudaDestroyExternalSemaphore.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaDestroyExternalSemaphore(cudaExternalSemaphore_t extSem) - * } - */ - public static int cudaDestroyExternalSemaphore(MemorySegment extSem) { - var mh$ = cudaDestroyExternalSemaphore.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaDestroyExternalSemaphore", extSem); - } - return (int)mh$.invokeExact(extSem); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaLaunchKernel { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - dim3.layout(), - dim3.layout(), - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaLaunchKernel"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaLaunchKernel$descriptor() { - return cudaLaunchKernel.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) - * } - */ - public static MethodHandle cudaLaunchKernel$handle() { - return cudaLaunchKernel.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) - * } - */ - public static MemorySegment cudaLaunchKernel$address() { - return cudaLaunchKernel.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaLaunchKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) - * } - */ - public static int cudaLaunchKernel(MemorySegment func, MemorySegment gridDim, MemorySegment blockDim, MemorySegment args, long sharedMem, MemorySegment stream) { - var mh$ = cudaLaunchKernel.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaLaunchKernel", func, gridDim, blockDim, args, sharedMem, stream); - } - return (int)mh$.invokeExact(func, gridDim, blockDim, args, sharedMem, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaLaunchKernelExC { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaLaunchKernelExC"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchKernelExC(const cudaLaunchConfig_t *config, const void *func, void **args) - * } - */ - public static FunctionDescriptor cudaLaunchKernelExC$descriptor() { - return cudaLaunchKernelExC.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchKernelExC(const cudaLaunchConfig_t *config, const void *func, void **args) - * } - */ - public static MethodHandle cudaLaunchKernelExC$handle() { - return cudaLaunchKernelExC.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchKernelExC(const cudaLaunchConfig_t *config, const void *func, void **args) - * } - */ - public static MemorySegment cudaLaunchKernelExC$address() { - return cudaLaunchKernelExC.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaLaunchKernelExC(const cudaLaunchConfig_t *config, const void *func, void **args) - * } - */ - public static int cudaLaunchKernelExC(MemorySegment config, MemorySegment func, MemorySegment args) { - var mh$ = cudaLaunchKernelExC.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaLaunchKernelExC", config, func, args); - } - return (int)mh$.invokeExact(config, func, args); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaLaunchCooperativeKernel { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - dim3.layout(), - dim3.layout(), - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaLaunchCooperativeKernel"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchCooperativeKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaLaunchCooperativeKernel$descriptor() { - return cudaLaunchCooperativeKernel.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchCooperativeKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) - * } - */ - public static MethodHandle cudaLaunchCooperativeKernel$handle() { - return cudaLaunchCooperativeKernel.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchCooperativeKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) - * } - */ - public static MemorySegment cudaLaunchCooperativeKernel$address() { - return cudaLaunchCooperativeKernel.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaLaunchCooperativeKernel(const void *func, dim3 gridDim, dim3 blockDim, void **args, size_t sharedMem, cudaStream_t stream) - * } - */ - public static int cudaLaunchCooperativeKernel(MemorySegment func, MemorySegment gridDim, MemorySegment blockDim, MemorySegment args, long sharedMem, MemorySegment stream) { - var mh$ = cudaLaunchCooperativeKernel.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaLaunchCooperativeKernel", func, gridDim, blockDim, args, sharedMem, stream); - } - return (int)mh$.invokeExact(func, gridDim, blockDim, args, sharedMem, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaLaunchCooperativeKernelMultiDevice { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaLaunchCooperativeKernelMultiDevice"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchCooperativeKernelMultiDevice(struct cudaLaunchParams *launchParamsList, unsigned int numDevices, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaLaunchCooperativeKernelMultiDevice$descriptor() { - return cudaLaunchCooperativeKernelMultiDevice.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchCooperativeKernelMultiDevice(struct cudaLaunchParams *launchParamsList, unsigned int numDevices, unsigned int flags) - * } - */ - public static MethodHandle cudaLaunchCooperativeKernelMultiDevice$handle() { - return cudaLaunchCooperativeKernelMultiDevice.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchCooperativeKernelMultiDevice(struct cudaLaunchParams *launchParamsList, unsigned int numDevices, unsigned int flags) - * } - */ - public static MemorySegment cudaLaunchCooperativeKernelMultiDevice$address() { - return cudaLaunchCooperativeKernelMultiDevice.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaLaunchCooperativeKernelMultiDevice(struct cudaLaunchParams *launchParamsList, unsigned int numDevices, unsigned int flags) - * } - */ - public static int cudaLaunchCooperativeKernelMultiDevice(MemorySegment launchParamsList, int numDevices, int flags) { - var mh$ = cudaLaunchCooperativeKernelMultiDevice.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaLaunchCooperativeKernelMultiDevice", launchParamsList, numDevices, flags); - } - return (int)mh$.invokeExact(launchParamsList, numDevices, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFuncSetCacheConfig { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncSetCacheConfig"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetCacheConfig(const void *func, enum cudaFuncCache cacheConfig) - * } - */ - public static FunctionDescriptor cudaFuncSetCacheConfig$descriptor() { - return cudaFuncSetCacheConfig.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetCacheConfig(const void *func, enum cudaFuncCache cacheConfig) - * } - */ - public static MethodHandle cudaFuncSetCacheConfig$handle() { - return cudaFuncSetCacheConfig.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetCacheConfig(const void *func, enum cudaFuncCache cacheConfig) - * } - */ - public static MemorySegment cudaFuncSetCacheConfig$address() { - return cudaFuncSetCacheConfig.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetCacheConfig(const void *func, enum cudaFuncCache cacheConfig) - * } - */ - public static int cudaFuncSetCacheConfig(MemorySegment func, int cacheConfig) { - var mh$ = cudaFuncSetCacheConfig.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFuncSetCacheConfig", func, cacheConfig); - } - return (int)mh$.invokeExact(func, cacheConfig); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFuncGetAttributes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncGetAttributes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetAttributes(struct cudaFuncAttributes *attr, const void *func) - * } - */ - public static FunctionDescriptor cudaFuncGetAttributes$descriptor() { - return cudaFuncGetAttributes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetAttributes(struct cudaFuncAttributes *attr, const void *func) - * } - */ - public static MethodHandle cudaFuncGetAttributes$handle() { - return cudaFuncGetAttributes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetAttributes(struct cudaFuncAttributes *attr, const void *func) - * } - */ - public static MemorySegment cudaFuncGetAttributes$address() { - return cudaFuncGetAttributes.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetAttributes(struct cudaFuncAttributes *attr, const void *func) - * } - */ - public static int cudaFuncGetAttributes(MemorySegment attr, MemorySegment func) { - var mh$ = cudaFuncGetAttributes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFuncGetAttributes", attr, func); - } - return (int)mh$.invokeExact(attr, func); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFuncSetAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncSetAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetAttribute(const void *func, enum cudaFuncAttribute attr, int value) - * } - */ - public static FunctionDescriptor cudaFuncSetAttribute$descriptor() { - return cudaFuncSetAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetAttribute(const void *func, enum cudaFuncAttribute attr, int value) - * } - */ - public static MethodHandle cudaFuncSetAttribute$handle() { - return cudaFuncSetAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetAttribute(const void *func, enum cudaFuncAttribute attr, int value) - * } - */ - public static MemorySegment cudaFuncSetAttribute$address() { - return cudaFuncSetAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetAttribute(const void *func, enum cudaFuncAttribute attr, int value) - * } - */ - public static int cudaFuncSetAttribute(MemorySegment func, int attr, int value) { - var mh$ = cudaFuncSetAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFuncSetAttribute", func, attr, value); - } - return (int)mh$.invokeExact(func, attr, value); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFuncGetName { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncGetName"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetName(const char **name, const void *func) - * } - */ - public static FunctionDescriptor cudaFuncGetName$descriptor() { - return cudaFuncGetName.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetName(const char **name, const void *func) - * } - */ - public static MethodHandle cudaFuncGetName$handle() { - return cudaFuncGetName.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetName(const char **name, const void *func) - * } - */ - public static MemorySegment cudaFuncGetName$address() { - return cudaFuncGetName.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetName(const char **name, const void *func) - * } - */ - public static int cudaFuncGetName(MemorySegment name, MemorySegment func) { - var mh$ = cudaFuncGetName.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFuncGetName", name, func); - } - return (int)mh$.invokeExact(name, func); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFuncGetParamInfo { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncGetParamInfo"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetParamInfo(const void *func, size_t paramIndex, size_t *paramOffset, size_t *paramSize) - * } - */ - public static FunctionDescriptor cudaFuncGetParamInfo$descriptor() { - return cudaFuncGetParamInfo.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetParamInfo(const void *func, size_t paramIndex, size_t *paramOffset, size_t *paramSize) - * } - */ - public static MethodHandle cudaFuncGetParamInfo$handle() { - return cudaFuncGetParamInfo.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetParamInfo(const void *func, size_t paramIndex, size_t *paramOffset, size_t *paramSize) - * } - */ - public static MemorySegment cudaFuncGetParamInfo$address() { - return cudaFuncGetParamInfo.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFuncGetParamInfo(const void *func, size_t paramIndex, size_t *paramOffset, size_t *paramSize) - * } - */ - public static int cudaFuncGetParamInfo(MemorySegment func, long paramIndex, MemorySegment paramOffset, MemorySegment paramSize) { - var mh$ = cudaFuncGetParamInfo.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFuncGetParamInfo", func, paramIndex, paramOffset, paramSize); - } - return (int)mh$.invokeExact(func, paramIndex, paramOffset, paramSize); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaSetDoubleForDevice { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSetDoubleForDevice"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDoubleForDevice(double *d) - * } - */ - public static FunctionDescriptor cudaSetDoubleForDevice$descriptor() { - return cudaSetDoubleForDevice.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDoubleForDevice(double *d) - * } - */ - public static MethodHandle cudaSetDoubleForDevice$handle() { - return cudaSetDoubleForDevice.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDoubleForDevice(double *d) - * } - */ - public static MemorySegment cudaSetDoubleForDevice$address() { - return cudaSetDoubleForDevice.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaSetDoubleForDevice(double *d) - * } - */ - public static int cudaSetDoubleForDevice(MemorySegment d) { - var mh$ = cudaSetDoubleForDevice.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaSetDoubleForDevice", d); - } - return (int)mh$.invokeExact(d); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaSetDoubleForHost { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaSetDoubleForHost"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDoubleForHost(double *d) - * } - */ - public static FunctionDescriptor cudaSetDoubleForHost$descriptor() { - return cudaSetDoubleForHost.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDoubleForHost(double *d) - * } - */ - public static MethodHandle cudaSetDoubleForHost$handle() { - return cudaSetDoubleForHost.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaSetDoubleForHost(double *d) - * } - */ - public static MemorySegment cudaSetDoubleForHost$address() { - return cudaSetDoubleForHost.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaSetDoubleForHost(double *d) - * } - */ - public static int cudaSetDoubleForHost(MemorySegment d) { - var mh$ = cudaSetDoubleForHost.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaSetDoubleForHost", d); - } - return (int)mh$.invokeExact(d); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaLaunchHostFunc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaLaunchHostFunc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void *userData) - * } - */ - public static FunctionDescriptor cudaLaunchHostFunc$descriptor() { - return cudaLaunchHostFunc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void *userData) - * } - */ - public static MethodHandle cudaLaunchHostFunc$handle() { - return cudaLaunchHostFunc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void *userData) - * } - */ - public static MemorySegment cudaLaunchHostFunc$address() { - return cudaLaunchHostFunc.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaLaunchHostFunc(cudaStream_t stream, cudaHostFn_t fn, void *userData) - * } - */ - public static int cudaLaunchHostFunc(MemorySegment stream, MemorySegment fn, MemorySegment userData) { - var mh$ = cudaLaunchHostFunc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaLaunchHostFunc", stream, fn, userData); - } - return (int)mh$.invokeExact(stream, fn, userData); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFuncSetSharedMemConfig { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFuncSetSharedMemConfig"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetSharedMemConfig(const void *func, enum cudaSharedMemConfig config) - * } - */ - public static FunctionDescriptor cudaFuncSetSharedMemConfig$descriptor() { - return cudaFuncSetSharedMemConfig.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetSharedMemConfig(const void *func, enum cudaSharedMemConfig config) - * } - */ - public static MethodHandle cudaFuncSetSharedMemConfig$handle() { - return cudaFuncSetSharedMemConfig.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetSharedMemConfig(const void *func, enum cudaSharedMemConfig config) - * } - */ - public static MemorySegment cudaFuncSetSharedMemConfig$address() { - return cudaFuncSetSharedMemConfig.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFuncSetSharedMemConfig(const void *func, enum cudaSharedMemConfig config) - * } - */ - public static int cudaFuncSetSharedMemConfig(MemorySegment func, int config) { - var mh$ = cudaFuncSetSharedMemConfig.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFuncSetSharedMemConfig", func, config); - } - return (int)mh$.invokeExact(func, config); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaOccupancyMaxActiveBlocksPerMultiprocessor { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaOccupancyMaxActiveBlocksPerMultiprocessor"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize) - * } - */ - public static FunctionDescriptor cudaOccupancyMaxActiveBlocksPerMultiprocessor$descriptor() { - return cudaOccupancyMaxActiveBlocksPerMultiprocessor.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize) - * } - */ - public static MethodHandle cudaOccupancyMaxActiveBlocksPerMultiprocessor$handle() { - return cudaOccupancyMaxActiveBlocksPerMultiprocessor.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize) - * } - */ - public static MemorySegment cudaOccupancyMaxActiveBlocksPerMultiprocessor$address() { - return cudaOccupancyMaxActiveBlocksPerMultiprocessor.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessor(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize) - * } - */ - public static int cudaOccupancyMaxActiveBlocksPerMultiprocessor(MemorySegment numBlocks, MemorySegment func, int blockSize, long dynamicSMemSize) { - var mh$ = cudaOccupancyMaxActiveBlocksPerMultiprocessor.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaOccupancyMaxActiveBlocksPerMultiprocessor", numBlocks, func, blockSize, dynamicSMemSize); - } - return (int)mh$.invokeExact(numBlocks, func, blockSize, dynamicSMemSize); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaOccupancyAvailableDynamicSMemPerBlock { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaOccupancyAvailableDynamicSMemPerBlock"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t *dynamicSmemSize, const void *func, int numBlocks, int blockSize) - * } - */ - public static FunctionDescriptor cudaOccupancyAvailableDynamicSMemPerBlock$descriptor() { - return cudaOccupancyAvailableDynamicSMemPerBlock.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t *dynamicSmemSize, const void *func, int numBlocks, int blockSize) - * } - */ - public static MethodHandle cudaOccupancyAvailableDynamicSMemPerBlock$handle() { - return cudaOccupancyAvailableDynamicSMemPerBlock.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t *dynamicSmemSize, const void *func, int numBlocks, int blockSize) - * } - */ - public static MemorySegment cudaOccupancyAvailableDynamicSMemPerBlock$address() { - return cudaOccupancyAvailableDynamicSMemPerBlock.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyAvailableDynamicSMemPerBlock(size_t *dynamicSmemSize, const void *func, int numBlocks, int blockSize) - * } - */ - public static int cudaOccupancyAvailableDynamicSMemPerBlock(MemorySegment dynamicSmemSize, MemorySegment func, int numBlocks, int blockSize) { - var mh$ = cudaOccupancyAvailableDynamicSMemPerBlock.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaOccupancyAvailableDynamicSMemPerBlock", dynamicSmemSize, func, numBlocks, blockSize); - } - return (int)mh$.invokeExact(dynamicSmemSize, func, numBlocks, blockSize); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags$descriptor() { - return cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize, unsigned int flags) - * } - */ - public static MethodHandle cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags$handle() { - return cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize, unsigned int flags) - * } - */ - public static MemorySegment cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags$address() { - return cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int *numBlocks, const void *func, int blockSize, size_t dynamicSMemSize, unsigned int flags) - * } - */ - public static int cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(MemorySegment numBlocks, MemorySegment func, int blockSize, long dynamicSMemSize, int flags) { - var mh$ = cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags", numBlocks, func, blockSize, dynamicSMemSize, flags); - } - return (int)mh$.invokeExact(numBlocks, func, blockSize, dynamicSMemSize, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaOccupancyMaxPotentialClusterSize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaOccupancyMaxPotentialClusterSize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxPotentialClusterSize(int *clusterSize, const void *func, const cudaLaunchConfig_t *launchConfig) - * } - */ - public static FunctionDescriptor cudaOccupancyMaxPotentialClusterSize$descriptor() { - return cudaOccupancyMaxPotentialClusterSize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxPotentialClusterSize(int *clusterSize, const void *func, const cudaLaunchConfig_t *launchConfig) - * } - */ - public static MethodHandle cudaOccupancyMaxPotentialClusterSize$handle() { - return cudaOccupancyMaxPotentialClusterSize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxPotentialClusterSize(int *clusterSize, const void *func, const cudaLaunchConfig_t *launchConfig) - * } - */ - public static MemorySegment cudaOccupancyMaxPotentialClusterSize$address() { - return cudaOccupancyMaxPotentialClusterSize.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxPotentialClusterSize(int *clusterSize, const void *func, const cudaLaunchConfig_t *launchConfig) - * } - */ - public static int cudaOccupancyMaxPotentialClusterSize(MemorySegment clusterSize, MemorySegment func, MemorySegment launchConfig) { - var mh$ = cudaOccupancyMaxPotentialClusterSize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaOccupancyMaxPotentialClusterSize", clusterSize, func, launchConfig); - } - return (int)mh$.invokeExact(clusterSize, func, launchConfig); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaOccupancyMaxActiveClusters { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaOccupancyMaxActiveClusters"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveClusters(int *numClusters, const void *func, const cudaLaunchConfig_t *launchConfig) - * } - */ - public static FunctionDescriptor cudaOccupancyMaxActiveClusters$descriptor() { - return cudaOccupancyMaxActiveClusters.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveClusters(int *numClusters, const void *func, const cudaLaunchConfig_t *launchConfig) - * } - */ - public static MethodHandle cudaOccupancyMaxActiveClusters$handle() { - return cudaOccupancyMaxActiveClusters.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveClusters(int *numClusters, const void *func, const cudaLaunchConfig_t *launchConfig) - * } - */ - public static MemorySegment cudaOccupancyMaxActiveClusters$address() { - return cudaOccupancyMaxActiveClusters.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaOccupancyMaxActiveClusters(int *numClusters, const void *func, const cudaLaunchConfig_t *launchConfig) - * } - */ - public static int cudaOccupancyMaxActiveClusters(MemorySegment numClusters, MemorySegment func, MemorySegment launchConfig) { - var mh$ = cudaOccupancyMaxActiveClusters.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaOccupancyMaxActiveClusters", numClusters, func, launchConfig); - } - return (int)mh$.invokeExact(numClusters, func, launchConfig); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMallocManaged { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocManaged"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocManaged(void **devPtr, size_t size, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaMallocManaged$descriptor() { - return cudaMallocManaged.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocManaged(void **devPtr, size_t size, unsigned int flags) - * } - */ - public static MethodHandle cudaMallocManaged$handle() { - return cudaMallocManaged.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocManaged(void **devPtr, size_t size, unsigned int flags) - * } - */ - public static MemorySegment cudaMallocManaged$address() { - return cudaMallocManaged.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMallocManaged(void **devPtr, size_t size, unsigned int flags) - * } - */ - public static int cudaMallocManaged(MemorySegment devPtr, long size, int flags) { - var mh$ = cudaMallocManaged.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMallocManaged", devPtr, size, flags); - } - return (int)mh$.invokeExact(devPtr, size, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMalloc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMalloc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMalloc(void **devPtr, size_t size) - * } - */ - public static FunctionDescriptor cudaMalloc$descriptor() { - return cudaMalloc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMalloc(void **devPtr, size_t size) - * } - */ - public static MethodHandle cudaMalloc$handle() { - return cudaMalloc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMalloc(void **devPtr, size_t size) - * } - */ - public static MemorySegment cudaMalloc$address() { - return cudaMalloc.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMalloc(void **devPtr, size_t size) - * } - */ - public static int cudaMalloc(MemorySegment devPtr, long size) { - var mh$ = cudaMalloc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMalloc", devPtr, size); - } - return (int)mh$.invokeExact(devPtr, size); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMallocHost { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocHost"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocHost(void **ptr, size_t size) - * } - */ - public static FunctionDescriptor cudaMallocHost$descriptor() { - return cudaMallocHost.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocHost(void **ptr, size_t size) - * } - */ - public static MethodHandle cudaMallocHost$handle() { - return cudaMallocHost.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocHost(void **ptr, size_t size) - * } - */ - public static MemorySegment cudaMallocHost$address() { - return cudaMallocHost.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMallocHost(void **ptr, size_t size) - * } - */ - public static int cudaMallocHost(MemorySegment ptr, long size) { - var mh$ = cudaMallocHost.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMallocHost", ptr, size); - } - return (int)mh$.invokeExact(ptr, size); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMallocPitch { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocPitch"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height) - * } - */ - public static FunctionDescriptor cudaMallocPitch$descriptor() { - return cudaMallocPitch.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height) - * } - */ - public static MethodHandle cudaMallocPitch$handle() { - return cudaMallocPitch.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height) - * } - */ - public static MemorySegment cudaMallocPitch$address() { - return cudaMallocPitch.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height) - * } - */ - public static int cudaMallocPitch(MemorySegment devPtr, MemorySegment pitch, long width, long height) { - var mh$ = cudaMallocPitch.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMallocPitch", devPtr, pitch, width, height); - } - return (int)mh$.invokeExact(devPtr, pitch, width, height); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMallocArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, size_t width, size_t height, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaMallocArray$descriptor() { - return cudaMallocArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, size_t width, size_t height, unsigned int flags) - * } - */ - public static MethodHandle cudaMallocArray$handle() { - return cudaMallocArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, size_t width, size_t height, unsigned int flags) - * } - */ - public static MemorySegment cudaMallocArray$address() { - return cudaMallocArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMallocArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, size_t width, size_t height, unsigned int flags) - * } - */ - public static int cudaMallocArray(MemorySegment array, MemorySegment desc, long width, long height, int flags) { - var mh$ = cudaMallocArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMallocArray", array, desc, width, height, flags); - } - return (int)mh$.invokeExact(array, desc, width, height, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFree { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFree"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFree(void *devPtr) - * } - */ - public static FunctionDescriptor cudaFree$descriptor() { - return cudaFree.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFree(void *devPtr) - * } - */ - public static MethodHandle cudaFree$handle() { - return cudaFree.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFree(void *devPtr) - * } - */ - public static MemorySegment cudaFree$address() { - return cudaFree.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFree(void *devPtr) - * } - */ - public static int cudaFree(MemorySegment devPtr) { - var mh$ = cudaFree.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFree", devPtr); - } - return (int)mh$.invokeExact(devPtr); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFreeHost { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFreeHost"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeHost(void *ptr) - * } - */ - public static FunctionDescriptor cudaFreeHost$descriptor() { - return cudaFreeHost.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeHost(void *ptr) - * } - */ - public static MethodHandle cudaFreeHost$handle() { - return cudaFreeHost.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeHost(void *ptr) - * } - */ - public static MemorySegment cudaFreeHost$address() { - return cudaFreeHost.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFreeHost(void *ptr) - * } - */ - public static int cudaFreeHost(MemorySegment ptr) { - var mh$ = cudaFreeHost.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFreeHost", ptr); - } - return (int)mh$.invokeExact(ptr); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFreeArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFreeArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeArray(cudaArray_t array) - * } - */ - public static FunctionDescriptor cudaFreeArray$descriptor() { - return cudaFreeArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeArray(cudaArray_t array) - * } - */ - public static MethodHandle cudaFreeArray$handle() { - return cudaFreeArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeArray(cudaArray_t array) - * } - */ - public static MemorySegment cudaFreeArray$address() { - return cudaFreeArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFreeArray(cudaArray_t array) - * } - */ - public static int cudaFreeArray(MemorySegment array) { - var mh$ = cudaFreeArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFreeArray", array); - } - return (int)mh$.invokeExact(array); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFreeMipmappedArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFreeMipmappedArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) - * } - */ - public static FunctionDescriptor cudaFreeMipmappedArray$descriptor() { - return cudaFreeMipmappedArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) - * } - */ - public static MethodHandle cudaFreeMipmappedArray$handle() { - return cudaFreeMipmappedArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) - * } - */ - public static MemorySegment cudaFreeMipmappedArray$address() { - return cudaFreeMipmappedArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFreeMipmappedArray(cudaMipmappedArray_t mipmappedArray) - * } - */ - public static int cudaFreeMipmappedArray(MemorySegment mipmappedArray) { - var mh$ = cudaFreeMipmappedArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFreeMipmappedArray", mipmappedArray); - } - return (int)mh$.invokeExact(mipmappedArray); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaHostAlloc { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaHostAlloc"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaHostAlloc(void **pHost, size_t size, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaHostAlloc$descriptor() { - return cudaHostAlloc.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaHostAlloc(void **pHost, size_t size, unsigned int flags) - * } - */ - public static MethodHandle cudaHostAlloc$handle() { - return cudaHostAlloc.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaHostAlloc(void **pHost, size_t size, unsigned int flags) - * } - */ - public static MemorySegment cudaHostAlloc$address() { - return cudaHostAlloc.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaHostAlloc(void **pHost, size_t size, unsigned int flags) - * } - */ - public static int cudaHostAlloc(MemorySegment pHost, long size, int flags) { - var mh$ = cudaHostAlloc.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaHostAlloc", pHost, size, flags); - } - return (int)mh$.invokeExact(pHost, size, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaHostRegister { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaHostRegister"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaHostRegister(void *ptr, size_t size, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaHostRegister$descriptor() { - return cudaHostRegister.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaHostRegister(void *ptr, size_t size, unsigned int flags) - * } - */ - public static MethodHandle cudaHostRegister$handle() { - return cudaHostRegister.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaHostRegister(void *ptr, size_t size, unsigned int flags) - * } - */ - public static MemorySegment cudaHostRegister$address() { - return cudaHostRegister.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaHostRegister(void *ptr, size_t size, unsigned int flags) - * } - */ - public static int cudaHostRegister(MemorySegment ptr, long size, int flags) { - var mh$ = cudaHostRegister.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaHostRegister", ptr, size, flags); - } - return (int)mh$.invokeExact(ptr, size, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaHostUnregister { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaHostUnregister"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaHostUnregister(void *ptr) - * } - */ - public static FunctionDescriptor cudaHostUnregister$descriptor() { - return cudaHostUnregister.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaHostUnregister(void *ptr) - * } - */ - public static MethodHandle cudaHostUnregister$handle() { - return cudaHostUnregister.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaHostUnregister(void *ptr) - * } - */ - public static MemorySegment cudaHostUnregister$address() { - return cudaHostUnregister.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaHostUnregister(void *ptr) - * } - */ - public static int cudaHostUnregister(MemorySegment ptr) { - var mh$ = cudaHostUnregister.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaHostUnregister", ptr); - } - return (int)mh$.invokeExact(ptr); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaHostGetDevicePointer { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaHostGetDevicePointer"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaHostGetDevicePointer(void **pDevice, void *pHost, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaHostGetDevicePointer$descriptor() { - return cudaHostGetDevicePointer.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaHostGetDevicePointer(void **pDevice, void *pHost, unsigned int flags) - * } - */ - public static MethodHandle cudaHostGetDevicePointer$handle() { - return cudaHostGetDevicePointer.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaHostGetDevicePointer(void **pDevice, void *pHost, unsigned int flags) - * } - */ - public static MemorySegment cudaHostGetDevicePointer$address() { - return cudaHostGetDevicePointer.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaHostGetDevicePointer(void **pDevice, void *pHost, unsigned int flags) - * } - */ - public static int cudaHostGetDevicePointer(MemorySegment pDevice, MemorySegment pHost, int flags) { - var mh$ = cudaHostGetDevicePointer.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaHostGetDevicePointer", pDevice, pHost, flags); - } - return (int)mh$.invokeExact(pDevice, pHost, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaHostGetFlags { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaHostGetFlags"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaHostGetFlags(unsigned int *pFlags, void *pHost) - * } - */ - public static FunctionDescriptor cudaHostGetFlags$descriptor() { - return cudaHostGetFlags.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaHostGetFlags(unsigned int *pFlags, void *pHost) - * } - */ - public static MethodHandle cudaHostGetFlags$handle() { - return cudaHostGetFlags.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaHostGetFlags(unsigned int *pFlags, void *pHost) - * } - */ - public static MemorySegment cudaHostGetFlags$address() { - return cudaHostGetFlags.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaHostGetFlags(unsigned int *pFlags, void *pHost) - * } - */ - public static int cudaHostGetFlags(MemorySegment pFlags, MemorySegment pHost) { - var mh$ = cudaHostGetFlags.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaHostGetFlags", pFlags, pHost); - } - return (int)mh$.invokeExact(pFlags, pHost); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMalloc3D { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - cudaExtent.layout() - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMalloc3D"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMalloc3D(struct cudaPitchedPtr *pitchedDevPtr, struct cudaExtent extent) - * } - */ - public static FunctionDescriptor cudaMalloc3D$descriptor() { - return cudaMalloc3D.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMalloc3D(struct cudaPitchedPtr *pitchedDevPtr, struct cudaExtent extent) - * } - */ - public static MethodHandle cudaMalloc3D$handle() { - return cudaMalloc3D.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMalloc3D(struct cudaPitchedPtr *pitchedDevPtr, struct cudaExtent extent) - * } - */ - public static MemorySegment cudaMalloc3D$address() { - return cudaMalloc3D.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMalloc3D(struct cudaPitchedPtr *pitchedDevPtr, struct cudaExtent extent) - * } - */ - public static int cudaMalloc3D(MemorySegment pitchedDevPtr, MemorySegment extent) { - var mh$ = cudaMalloc3D.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMalloc3D", pitchedDevPtr, extent); - } - return (int)mh$.invokeExact(pitchedDevPtr, extent); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMalloc3DArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - cudaExtent.layout(), - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMalloc3DArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMalloc3DArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaMalloc3DArray$descriptor() { - return cudaMalloc3DArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMalloc3DArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int flags) - * } - */ - public static MethodHandle cudaMalloc3DArray$handle() { - return cudaMalloc3DArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMalloc3DArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int flags) - * } - */ - public static MemorySegment cudaMalloc3DArray$address() { - return cudaMalloc3DArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMalloc3DArray(cudaArray_t *array, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int flags) - * } - */ - public static int cudaMalloc3DArray(MemorySegment array, MemorySegment desc, MemorySegment extent, int flags) { - var mh$ = cudaMalloc3DArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMalloc3DArray", array, desc, extent, flags); - } - return (int)mh$.invokeExact(array, desc, extent, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMallocMipmappedArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - cudaExtent.layout(), - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocMipmappedArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int numLevels, unsigned int flags) - * } - */ - public static FunctionDescriptor cudaMallocMipmappedArray$descriptor() { - return cudaMallocMipmappedArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int numLevels, unsigned int flags) - * } - */ - public static MethodHandle cudaMallocMipmappedArray$handle() { - return cudaMallocMipmappedArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int numLevels, unsigned int flags) - * } - */ - public static MemorySegment cudaMallocMipmappedArray$address() { - return cudaMallocMipmappedArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMallocMipmappedArray(cudaMipmappedArray_t *mipmappedArray, const struct cudaChannelFormatDesc *desc, struct cudaExtent extent, unsigned int numLevels, unsigned int flags) - * } - */ - public static int cudaMallocMipmappedArray(MemorySegment mipmappedArray, MemorySegment desc, MemorySegment extent, int numLevels, int flags) { - var mh$ = cudaMallocMipmappedArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMallocMipmappedArray", mipmappedArray, desc, extent, numLevels, flags); - } - return (int)mh$.invokeExact(mipmappedArray, desc, extent, numLevels, flags); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetMipmappedArrayLevel { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetMipmappedArrayLevel"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t *levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) - * } - */ - public static FunctionDescriptor cudaGetMipmappedArrayLevel$descriptor() { - return cudaGetMipmappedArrayLevel.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t *levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) - * } - */ - public static MethodHandle cudaGetMipmappedArrayLevel$handle() { - return cudaGetMipmappedArrayLevel.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t *levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) - * } - */ - public static MemorySegment cudaGetMipmappedArrayLevel$address() { - return cudaGetMipmappedArrayLevel.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetMipmappedArrayLevel(cudaArray_t *levelArray, cudaMipmappedArray_const_t mipmappedArray, unsigned int level) - * } - */ - public static int cudaGetMipmappedArrayLevel(MemorySegment levelArray, MemorySegment mipmappedArray, int level) { - var mh$ = cudaGetMipmappedArrayLevel.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetMipmappedArrayLevel", levelArray, mipmappedArray, level); - } - return (int)mh$.invokeExact(levelArray, mipmappedArray, level); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy3D { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy3D"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3D(const struct cudaMemcpy3DParms *p) - * } - */ - public static FunctionDescriptor cudaMemcpy3D$descriptor() { - return cudaMemcpy3D.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3D(const struct cudaMemcpy3DParms *p) - * } - */ - public static MethodHandle cudaMemcpy3D$handle() { - return cudaMemcpy3D.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3D(const struct cudaMemcpy3DParms *p) - * } - */ - public static MemorySegment cudaMemcpy3D$address() { - return cudaMemcpy3D.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3D(const struct cudaMemcpy3DParms *p) - * } - */ - public static int cudaMemcpy3D(MemorySegment p) { - var mh$ = cudaMemcpy3D.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy3D", p); - } - return (int)mh$.invokeExact(p); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy3DPeer { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy3DPeer"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DPeer(const struct cudaMemcpy3DPeerParms *p) - * } - */ - public static FunctionDescriptor cudaMemcpy3DPeer$descriptor() { - return cudaMemcpy3DPeer.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DPeer(const struct cudaMemcpy3DPeerParms *p) - * } - */ - public static MethodHandle cudaMemcpy3DPeer$handle() { - return cudaMemcpy3DPeer.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DPeer(const struct cudaMemcpy3DPeerParms *p) - * } - */ - public static MemorySegment cudaMemcpy3DPeer$address() { - return cudaMemcpy3DPeer.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DPeer(const struct cudaMemcpy3DPeerParms *p) - * } - */ - public static int cudaMemcpy3DPeer(MemorySegment p) { - var mh$ = cudaMemcpy3DPeer.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy3DPeer", p); - } - return (int)mh$.invokeExact(p); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy3DAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy3DAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DAsync(const struct cudaMemcpy3DParms *p, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpy3DAsync$descriptor() { - return cudaMemcpy3DAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DAsync(const struct cudaMemcpy3DParms *p, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpy3DAsync$handle() { - return cudaMemcpy3DAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DAsync(const struct cudaMemcpy3DParms *p, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpy3DAsync$address() { - return cudaMemcpy3DAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DAsync(const struct cudaMemcpy3DParms *p, cudaStream_t stream) - * } - */ - public static int cudaMemcpy3DAsync(MemorySegment p, MemorySegment stream) { - var mh$ = cudaMemcpy3DAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy3DAsync", p, stream); - } - return (int)mh$.invokeExact(p, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy3DPeerAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy3DPeerAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DPeerAsync(const struct cudaMemcpy3DPeerParms *p, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpy3DPeerAsync$descriptor() { - return cudaMemcpy3DPeerAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DPeerAsync(const struct cudaMemcpy3DPeerParms *p, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpy3DPeerAsync$handle() { - return cudaMemcpy3DPeerAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DPeerAsync(const struct cudaMemcpy3DPeerParms *p, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpy3DPeerAsync$address() { - return cudaMemcpy3DPeerAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy3DPeerAsync(const struct cudaMemcpy3DPeerParms *p, cudaStream_t stream) - * } - */ - public static int cudaMemcpy3DPeerAsync(MemorySegment p, MemorySegment stream) { - var mh$ = cudaMemcpy3DPeerAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy3DPeerAsync", p, stream); - } - return (int)mh$.invokeExact(p, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemGetInfo { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemGetInfo"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemGetInfo(size_t *free, size_t *total) - * } - */ - public static FunctionDescriptor cudaMemGetInfo$descriptor() { - return cudaMemGetInfo.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemGetInfo(size_t *free, size_t *total) - * } - */ - public static MethodHandle cudaMemGetInfo$handle() { - return cudaMemGetInfo.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemGetInfo(size_t *free, size_t *total) - * } - */ - public static MemorySegment cudaMemGetInfo$address() { - return cudaMemGetInfo.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemGetInfo(size_t *free, size_t *total) - * } - */ - public static int cudaMemGetInfo(MemorySegment free, MemorySegment total) { - var mh$ = cudaMemGetInfo.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemGetInfo", free, total); - } - return (int)mh$.invokeExact(free, total); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaArrayGetInfo { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaArrayGetInfo"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetInfo(struct cudaChannelFormatDesc *desc, struct cudaExtent *extent, unsigned int *flags, cudaArray_t array) - * } - */ - public static FunctionDescriptor cudaArrayGetInfo$descriptor() { - return cudaArrayGetInfo.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetInfo(struct cudaChannelFormatDesc *desc, struct cudaExtent *extent, unsigned int *flags, cudaArray_t array) - * } - */ - public static MethodHandle cudaArrayGetInfo$handle() { - return cudaArrayGetInfo.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetInfo(struct cudaChannelFormatDesc *desc, struct cudaExtent *extent, unsigned int *flags, cudaArray_t array) - * } - */ - public static MemorySegment cudaArrayGetInfo$address() { - return cudaArrayGetInfo.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetInfo(struct cudaChannelFormatDesc *desc, struct cudaExtent *extent, unsigned int *flags, cudaArray_t array) - * } - */ - public static int cudaArrayGetInfo(MemorySegment desc, MemorySegment extent, MemorySegment flags, MemorySegment array) { - var mh$ = cudaArrayGetInfo.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaArrayGetInfo", desc, extent, flags, array); - } - return (int)mh$.invokeExact(desc, extent, flags, array); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaArrayGetPlane { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaArrayGetPlane"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetPlane(cudaArray_t *pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) - * } - */ - public static FunctionDescriptor cudaArrayGetPlane$descriptor() { - return cudaArrayGetPlane.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetPlane(cudaArray_t *pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) - * } - */ - public static MethodHandle cudaArrayGetPlane$handle() { - return cudaArrayGetPlane.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetPlane(cudaArray_t *pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) - * } - */ - public static MemorySegment cudaArrayGetPlane$address() { - return cudaArrayGetPlane.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetPlane(cudaArray_t *pPlaneArray, cudaArray_t hArray, unsigned int planeIdx) - * } - */ - public static int cudaArrayGetPlane(MemorySegment pPlaneArray, MemorySegment hArray, int planeIdx) { - var mh$ = cudaArrayGetPlane.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaArrayGetPlane", pPlaneArray, hArray, planeIdx); - } - return (int)mh$.invokeExact(pPlaneArray, hArray, planeIdx); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaArrayGetMemoryRequirements { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaArrayGetMemoryRequirements"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaArray_t array, int device) - * } - */ - public static FunctionDescriptor cudaArrayGetMemoryRequirements$descriptor() { - return cudaArrayGetMemoryRequirements.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaArray_t array, int device) - * } - */ - public static MethodHandle cudaArrayGetMemoryRequirements$handle() { - return cudaArrayGetMemoryRequirements.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaArray_t array, int device) - * } - */ - public static MemorySegment cudaArrayGetMemoryRequirements$address() { - return cudaArrayGetMemoryRequirements.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaArray_t array, int device) - * } - */ - public static int cudaArrayGetMemoryRequirements(MemorySegment memoryRequirements, MemorySegment array, int device) { - var mh$ = cudaArrayGetMemoryRequirements.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaArrayGetMemoryRequirements", memoryRequirements, array, device); - } - return (int)mh$.invokeExact(memoryRequirements, array, device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMipmappedArrayGetMemoryRequirements { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMipmappedArrayGetMemoryRequirements"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMipmappedArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaMipmappedArray_t mipmap, int device) - * } - */ - public static FunctionDescriptor cudaMipmappedArrayGetMemoryRequirements$descriptor() { - return cudaMipmappedArrayGetMemoryRequirements.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMipmappedArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaMipmappedArray_t mipmap, int device) - * } - */ - public static MethodHandle cudaMipmappedArrayGetMemoryRequirements$handle() { - return cudaMipmappedArrayGetMemoryRequirements.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMipmappedArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaMipmappedArray_t mipmap, int device) - * } - */ - public static MemorySegment cudaMipmappedArrayGetMemoryRequirements$address() { - return cudaMipmappedArrayGetMemoryRequirements.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMipmappedArrayGetMemoryRequirements(struct cudaArrayMemoryRequirements *memoryRequirements, cudaMipmappedArray_t mipmap, int device) - * } - */ - public static int cudaMipmappedArrayGetMemoryRequirements(MemorySegment memoryRequirements, MemorySegment mipmap, int device) { - var mh$ = cudaMipmappedArrayGetMemoryRequirements.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMipmappedArrayGetMemoryRequirements", memoryRequirements, mipmap, device); - } - return (int)mh$.invokeExact(memoryRequirements, mipmap, device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaArrayGetSparseProperties { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaArrayGetSparseProperties"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaArray_t array) - * } - */ - public static FunctionDescriptor cudaArrayGetSparseProperties$descriptor() { - return cudaArrayGetSparseProperties.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaArray_t array) - * } - */ - public static MethodHandle cudaArrayGetSparseProperties$handle() { - return cudaArrayGetSparseProperties.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaArray_t array) - * } - */ - public static MemorySegment cudaArrayGetSparseProperties$address() { - return cudaArrayGetSparseProperties.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaArray_t array) - * } - */ - public static int cudaArrayGetSparseProperties(MemorySegment sparseProperties, MemorySegment array) { - var mh$ = cudaArrayGetSparseProperties.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaArrayGetSparseProperties", sparseProperties, array); - } - return (int)mh$.invokeExact(sparseProperties, array); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMipmappedArrayGetSparseProperties { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMipmappedArrayGetSparseProperties"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMipmappedArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaMipmappedArray_t mipmap) - * } - */ - public static FunctionDescriptor cudaMipmappedArrayGetSparseProperties$descriptor() { - return cudaMipmappedArrayGetSparseProperties.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMipmappedArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaMipmappedArray_t mipmap) - * } - */ - public static MethodHandle cudaMipmappedArrayGetSparseProperties$handle() { - return cudaMipmappedArrayGetSparseProperties.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMipmappedArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaMipmappedArray_t mipmap) - * } - */ - public static MemorySegment cudaMipmappedArrayGetSparseProperties$address() { - return cudaMipmappedArrayGetSparseProperties.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMipmappedArrayGetSparseProperties(struct cudaArraySparseProperties *sparseProperties, cudaMipmappedArray_t mipmap) - * } - */ - public static int cudaMipmappedArrayGetSparseProperties(MemorySegment sparseProperties, MemorySegment mipmap) { - var mh$ = cudaMipmappedArrayGetSparseProperties.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMipmappedArrayGetSparseProperties", sparseProperties, mipmap); - } - return (int)mh$.invokeExact(sparseProperties, mipmap); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaMemcpy$descriptor() { - return cudaMemcpy.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaMemcpy$handle() { - return cudaMemcpy.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaMemcpy$address() { - return cudaMemcpy.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static int cudaMemcpy(MemorySegment dst, MemorySegment src, long count, int kind) { - var mh$ = cudaMemcpy.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy", dst, src, count, kind); - } - return (int)mh$.invokeExact(dst, src, count, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyPeer { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyPeer"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyPeer(void *dst, int dstDevice, const void *src, int srcDevice, size_t count) - * } - */ - public static FunctionDescriptor cudaMemcpyPeer$descriptor() { - return cudaMemcpyPeer.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyPeer(void *dst, int dstDevice, const void *src, int srcDevice, size_t count) - * } - */ - public static MethodHandle cudaMemcpyPeer$handle() { - return cudaMemcpyPeer.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyPeer(void *dst, int dstDevice, const void *src, int srcDevice, size_t count) - * } - */ - public static MemorySegment cudaMemcpyPeer$address() { - return cudaMemcpyPeer.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyPeer(void *dst, int dstDevice, const void *src, int srcDevice, size_t count) - * } - */ - public static int cudaMemcpyPeer(MemorySegment dst, int dstDevice, MemorySegment src, int srcDevice, long count) { - var mh$ = cudaMemcpyPeer.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyPeer", dst, dstDevice, src, srcDevice, count); - } - return (int)mh$.invokeExact(dst, dstDevice, src, srcDevice, count); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy2D { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2D"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaMemcpy2D$descriptor() { - return cudaMemcpy2D.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaMemcpy2D$handle() { - return cudaMemcpy2D.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaMemcpy2D$address() { - return cudaMemcpy2D.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static int cudaMemcpy2D(MemorySegment dst, long dpitch, MemorySegment src, long spitch, long width, long height, int kind) { - var mh$ = cudaMemcpy2D.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy2D", dst, dpitch, src, spitch, width, height, kind); - } - return (int)mh$.invokeExact(dst, dpitch, src, spitch, width, height, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy2DToArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DToArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaMemcpy2DToArray$descriptor() { - return cudaMemcpy2DToArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaMemcpy2DToArray$handle() { - return cudaMemcpy2DToArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaMemcpy2DToArray$address() { - return cudaMemcpy2DToArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static int cudaMemcpy2DToArray(MemorySegment dst, long wOffset, long hOffset, MemorySegment src, long spitch, long width, long height, int kind) { - var mh$ = cudaMemcpy2DToArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy2DToArray", dst, wOffset, hOffset, src, spitch, width, height, kind); - } - return (int)mh$.invokeExact(dst, wOffset, hOffset, src, spitch, width, height, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy2DFromArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DFromArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DFromArray(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaMemcpy2DFromArray$descriptor() { - return cudaMemcpy2DFromArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DFromArray(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaMemcpy2DFromArray$handle() { - return cudaMemcpy2DFromArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DFromArray(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaMemcpy2DFromArray$address() { - return cudaMemcpy2DFromArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DFromArray(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static int cudaMemcpy2DFromArray(MemorySegment dst, long dpitch, MemorySegment src, long wOffset, long hOffset, long width, long height, int kind) { - var mh$ = cudaMemcpy2DFromArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy2DFromArray", dst, dpitch, src, wOffset, hOffset, width, height, kind); - } - return (int)mh$.invokeExact(dst, dpitch, src, wOffset, hOffset, width, height, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy2DArrayToArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DArrayToArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaMemcpy2DArrayToArray$descriptor() { - return cudaMemcpy2DArrayToArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaMemcpy2DArrayToArray$handle() { - return cudaMemcpy2DArrayToArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaMemcpy2DArrayToArray$address() { - return cudaMemcpy2DArrayToArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, enum cudaMemcpyKind kind) - * } - */ - public static int cudaMemcpy2DArrayToArray(MemorySegment dst, long wOffsetDst, long hOffsetDst, MemorySegment src, long wOffsetSrc, long hOffsetSrc, long width, long height, int kind) { - var mh$ = cudaMemcpy2DArrayToArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy2DArrayToArray", dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind); - } - return (int)mh$.invokeExact(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, width, height, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyToSymbol { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyToSymbol"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToSymbol(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaMemcpyToSymbol$descriptor() { - return cudaMemcpyToSymbol.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToSymbol(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaMemcpyToSymbol$handle() { - return cudaMemcpyToSymbol.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToSymbol(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaMemcpyToSymbol$address() { - return cudaMemcpyToSymbol.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToSymbol(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static int cudaMemcpyToSymbol(MemorySegment symbol, MemorySegment src, long count, long offset, int kind) { - var mh$ = cudaMemcpyToSymbol.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyToSymbol", symbol, src, count, offset, kind); - } - return (int)mh$.invokeExact(symbol, src, count, offset, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyFromSymbol { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyFromSymbol"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromSymbol(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaMemcpyFromSymbol$descriptor() { - return cudaMemcpyFromSymbol.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromSymbol(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaMemcpyFromSymbol$handle() { - return cudaMemcpyFromSymbol.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromSymbol(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaMemcpyFromSymbol$address() { - return cudaMemcpyFromSymbol.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromSymbol(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind) - * } - */ - public static int cudaMemcpyFromSymbol(MemorySegment dst, MemorySegment symbol, long count, long offset, int kind) { - var mh$ = cudaMemcpyFromSymbol.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyFromSymbol", dst, symbol, count, offset, kind); - } - return (int)mh$.invokeExact(dst, symbol, count, offset, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyAsync(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpyAsync$descriptor() { - return cudaMemcpyAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyAsync(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpyAsync$handle() { - return cudaMemcpyAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyAsync(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpyAsync$address() { - return cudaMemcpyAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyAsync(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static int cudaMemcpyAsync(MemorySegment dst, MemorySegment src, long count, int kind, MemorySegment stream) { - var mh$ = cudaMemcpyAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyAsync", dst, src, count, kind, stream); - } - return (int)mh$.invokeExact(dst, src, count, kind, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyPeerAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyPeerAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyPeerAsync(void *dst, int dstDevice, const void *src, int srcDevice, size_t count, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpyPeerAsync$descriptor() { - return cudaMemcpyPeerAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyPeerAsync(void *dst, int dstDevice, const void *src, int srcDevice, size_t count, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpyPeerAsync$handle() { - return cudaMemcpyPeerAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyPeerAsync(void *dst, int dstDevice, const void *src, int srcDevice, size_t count, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpyPeerAsync$address() { - return cudaMemcpyPeerAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyPeerAsync(void *dst, int dstDevice, const void *src, int srcDevice, size_t count, cudaStream_t stream) - * } - */ - public static int cudaMemcpyPeerAsync(MemorySegment dst, int dstDevice, MemorySegment src, int srcDevice, long count, MemorySegment stream) { - var mh$ = cudaMemcpyPeerAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyPeerAsync", dst, dstDevice, src, srcDevice, count, stream); - } - return (int)mh$.invokeExact(dst, dstDevice, src, srcDevice, count, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy2DAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpy2DAsync$descriptor() { - return cudaMemcpy2DAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpy2DAsync$handle() { - return cudaMemcpy2DAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpy2DAsync$address() { - return cudaMemcpy2DAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static int cudaMemcpy2DAsync(MemorySegment dst, long dpitch, MemorySegment src, long spitch, long width, long height, int kind, MemorySegment stream) { - var mh$ = cudaMemcpy2DAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy2DAsync", dst, dpitch, src, spitch, width, height, kind, stream); - } - return (int)mh$.invokeExact(dst, dpitch, src, spitch, width, height, kind, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy2DToArrayAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DToArrayAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpy2DToArrayAsync$descriptor() { - return cudaMemcpy2DToArrayAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpy2DToArrayAsync$handle() { - return cudaMemcpy2DToArrayAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpy2DToArrayAsync$address() { - return cudaMemcpy2DToArrayAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static int cudaMemcpy2DToArrayAsync(MemorySegment dst, long wOffset, long hOffset, MemorySegment src, long spitch, long width, long height, int kind, MemorySegment stream) { - var mh$ = cudaMemcpy2DToArrayAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy2DToArrayAsync", dst, wOffset, hOffset, src, spitch, width, height, kind, stream); - } - return (int)mh$.invokeExact(dst, wOffset, hOffset, src, spitch, width, height, kind, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpy2DFromArrayAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpy2DFromArrayAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DFromArrayAsync(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpy2DFromArrayAsync$descriptor() { - return cudaMemcpy2DFromArrayAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DFromArrayAsync(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpy2DFromArrayAsync$handle() { - return cudaMemcpy2DFromArrayAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DFromArrayAsync(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpy2DFromArrayAsync$address() { - return cudaMemcpy2DFromArrayAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpy2DFromArrayAsync(void *dst, size_t dpitch, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static int cudaMemcpy2DFromArrayAsync(MemorySegment dst, long dpitch, MemorySegment src, long wOffset, long hOffset, long width, long height, int kind, MemorySegment stream) { - var mh$ = cudaMemcpy2DFromArrayAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpy2DFromArrayAsync", dst, dpitch, src, wOffset, hOffset, width, height, kind, stream); - } - return (int)mh$.invokeExact(dst, dpitch, src, wOffset, hOffset, width, height, kind, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyToSymbolAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyToSymbolAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToSymbolAsync(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpyToSymbolAsync$descriptor() { - return cudaMemcpyToSymbolAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToSymbolAsync(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpyToSymbolAsync$handle() { - return cudaMemcpyToSymbolAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToSymbolAsync(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpyToSymbolAsync$address() { - return cudaMemcpyToSymbolAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToSymbolAsync(const void *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static int cudaMemcpyToSymbolAsync(MemorySegment symbol, MemorySegment src, long count, long offset, int kind, MemorySegment stream) { - var mh$ = cudaMemcpyToSymbolAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyToSymbolAsync", symbol, src, count, offset, kind, stream); - } - return (int)mh$.invokeExact(symbol, src, count, offset, kind, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyFromSymbolAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyFromSymbolAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromSymbolAsync(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpyFromSymbolAsync$descriptor() { - return cudaMemcpyFromSymbolAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromSymbolAsync(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpyFromSymbolAsync$handle() { - return cudaMemcpyFromSymbolAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromSymbolAsync(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpyFromSymbolAsync$address() { - return cudaMemcpyFromSymbolAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromSymbolAsync(void *dst, const void *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static int cudaMemcpyFromSymbolAsync(MemorySegment dst, MemorySegment symbol, long count, long offset, int kind, MemorySegment stream) { - var mh$ = cudaMemcpyFromSymbolAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyFromSymbolAsync", dst, symbol, count, offset, kind, stream); - } - return (int)mh$.invokeExact(dst, symbol, count, offset, kind, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemset { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemset"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset(void *devPtr, int value, size_t count) - * } - */ - public static FunctionDescriptor cudaMemset$descriptor() { - return cudaMemset.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset(void *devPtr, int value, size_t count) - * } - */ - public static MethodHandle cudaMemset$handle() { - return cudaMemset.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset(void *devPtr, int value, size_t count) - * } - */ - public static MemorySegment cudaMemset$address() { - return cudaMemset.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemset(void *devPtr, int value, size_t count) - * } - */ - public static int cudaMemset(MemorySegment devPtr, int value, long count) { - var mh$ = cudaMemset.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemset", devPtr, value, count); - } - return (int)mh$.invokeExact(devPtr, value, count); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemset2D { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemset2D"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset2D(void *devPtr, size_t pitch, int value, size_t width, size_t height) - * } - */ - public static FunctionDescriptor cudaMemset2D$descriptor() { - return cudaMemset2D.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset2D(void *devPtr, size_t pitch, int value, size_t width, size_t height) - * } - */ - public static MethodHandle cudaMemset2D$handle() { - return cudaMemset2D.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset2D(void *devPtr, size_t pitch, int value, size_t width, size_t height) - * } - */ - public static MemorySegment cudaMemset2D$address() { - return cudaMemset2D.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemset2D(void *devPtr, size_t pitch, int value, size_t width, size_t height) - * } - */ - public static int cudaMemset2D(MemorySegment devPtr, long pitch, int value, long width, long height) { - var mh$ = cudaMemset2D.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemset2D", devPtr, pitch, value, width, height); - } - return (int)mh$.invokeExact(devPtr, pitch, value, width, height); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemset3D { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - cudaPitchedPtr.layout(), - PanamaFFMAPI.C_INT, - cudaExtent.layout() - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemset3D"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset3D(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent) - * } - */ - public static FunctionDescriptor cudaMemset3D$descriptor() { - return cudaMemset3D.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset3D(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent) - * } - */ - public static MethodHandle cudaMemset3D$handle() { - return cudaMemset3D.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset3D(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent) - * } - */ - public static MemorySegment cudaMemset3D$address() { - return cudaMemset3D.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemset3D(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent) - * } - */ - public static int cudaMemset3D(MemorySegment pitchedDevPtr, int value, MemorySegment extent) { - var mh$ = cudaMemset3D.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemset3D", pitchedDevPtr, value, extent); - } - return (int)mh$.invokeExact(pitchedDevPtr, value, extent); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemsetAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemsetAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemsetAsync(void *devPtr, int value, size_t count, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemsetAsync$descriptor() { - return cudaMemsetAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemsetAsync(void *devPtr, int value, size_t count, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemsetAsync$handle() { - return cudaMemsetAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemsetAsync(void *devPtr, int value, size_t count, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemsetAsync$address() { - return cudaMemsetAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemsetAsync(void *devPtr, int value, size_t count, cudaStream_t stream) - * } - */ - public static int cudaMemsetAsync(MemorySegment devPtr, int value, long count, MemorySegment stream) { - var mh$ = cudaMemsetAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemsetAsync", devPtr, value, count, stream); - } - return (int)mh$.invokeExact(devPtr, value, count, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemset2DAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemset2DAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset2DAsync(void *devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemset2DAsync$descriptor() { - return cudaMemset2DAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset2DAsync(void *devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemset2DAsync$handle() { - return cudaMemset2DAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset2DAsync(void *devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemset2DAsync$address() { - return cudaMemset2DAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemset2DAsync(void *devPtr, size_t pitch, int value, size_t width, size_t height, cudaStream_t stream) - * } - */ - public static int cudaMemset2DAsync(MemorySegment devPtr, long pitch, int value, long width, long height, MemorySegment stream) { - var mh$ = cudaMemset2DAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemset2DAsync", devPtr, pitch, value, width, height, stream); - } - return (int)mh$.invokeExact(devPtr, pitch, value, width, height, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemset3DAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - cudaPitchedPtr.layout(), - PanamaFFMAPI.C_INT, - cudaExtent.layout(), - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemset3DAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset3DAsync(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemset3DAsync$descriptor() { - return cudaMemset3DAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset3DAsync(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemset3DAsync$handle() { - return cudaMemset3DAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemset3DAsync(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemset3DAsync$address() { - return cudaMemset3DAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemset3DAsync(struct cudaPitchedPtr pitchedDevPtr, int value, struct cudaExtent extent, cudaStream_t stream) - * } - */ - public static int cudaMemset3DAsync(MemorySegment pitchedDevPtr, int value, MemorySegment extent, MemorySegment stream) { - var mh$ = cudaMemset3DAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemset3DAsync", pitchedDevPtr, value, extent, stream); - } - return (int)mh$.invokeExact(pitchedDevPtr, value, extent, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetSymbolAddress { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetSymbolAddress"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetSymbolAddress(void **devPtr, const void *symbol) - * } - */ - public static FunctionDescriptor cudaGetSymbolAddress$descriptor() { - return cudaGetSymbolAddress.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetSymbolAddress(void **devPtr, const void *symbol) - * } - */ - public static MethodHandle cudaGetSymbolAddress$handle() { - return cudaGetSymbolAddress.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetSymbolAddress(void **devPtr, const void *symbol) - * } - */ - public static MemorySegment cudaGetSymbolAddress$address() { - return cudaGetSymbolAddress.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetSymbolAddress(void **devPtr, const void *symbol) - * } - */ - public static int cudaGetSymbolAddress(MemorySegment devPtr, MemorySegment symbol) { - var mh$ = cudaGetSymbolAddress.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetSymbolAddress", devPtr, symbol); - } - return (int)mh$.invokeExact(devPtr, symbol); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaGetSymbolSize { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaGetSymbolSize"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaGetSymbolSize(size_t *size, const void *symbol) - * } - */ - public static FunctionDescriptor cudaGetSymbolSize$descriptor() { - return cudaGetSymbolSize.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaGetSymbolSize(size_t *size, const void *symbol) - * } - */ - public static MethodHandle cudaGetSymbolSize$handle() { - return cudaGetSymbolSize.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaGetSymbolSize(size_t *size, const void *symbol) - * } - */ - public static MemorySegment cudaGetSymbolSize$address() { - return cudaGetSymbolSize.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaGetSymbolSize(size_t *size, const void *symbol) - * } - */ - public static int cudaGetSymbolSize(MemorySegment size, MemorySegment symbol) { - var mh$ = cudaGetSymbolSize.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaGetSymbolSize", size, symbol); - } - return (int)mh$.invokeExact(size, symbol); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPrefetchAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPrefetchAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPrefetchAsync(const void *devPtr, size_t count, int dstDevice, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemPrefetchAsync$descriptor() { - return cudaMemPrefetchAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPrefetchAsync(const void *devPtr, size_t count, int dstDevice, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemPrefetchAsync$handle() { - return cudaMemPrefetchAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPrefetchAsync(const void *devPtr, size_t count, int dstDevice, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemPrefetchAsync$address() { - return cudaMemPrefetchAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPrefetchAsync(const void *devPtr, size_t count, int dstDevice, cudaStream_t stream) - * } - */ - public static int cudaMemPrefetchAsync(MemorySegment devPtr, long count, int dstDevice, MemorySegment stream) { - var mh$ = cudaMemPrefetchAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPrefetchAsync", devPtr, count, dstDevice, stream); - } - return (int)mh$.invokeExact(devPtr, count, dstDevice, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPrefetchAsync_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - cudaMemLocation.layout(), - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPrefetchAsync_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPrefetchAsync_v2(const void *devPtr, size_t count, struct cudaMemLocation location, unsigned int flags, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemPrefetchAsync_v2$descriptor() { - return cudaMemPrefetchAsync_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPrefetchAsync_v2(const void *devPtr, size_t count, struct cudaMemLocation location, unsigned int flags, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemPrefetchAsync_v2$handle() { - return cudaMemPrefetchAsync_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPrefetchAsync_v2(const void *devPtr, size_t count, struct cudaMemLocation location, unsigned int flags, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemPrefetchAsync_v2$address() { - return cudaMemPrefetchAsync_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPrefetchAsync_v2(const void *devPtr, size_t count, struct cudaMemLocation location, unsigned int flags, cudaStream_t stream) - * } - */ - public static int cudaMemPrefetchAsync_v2(MemorySegment devPtr, long count, MemorySegment location, int flags, MemorySegment stream) { - var mh$ = cudaMemPrefetchAsync_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPrefetchAsync_v2", devPtr, count, location, flags, stream); - } - return (int)mh$.invokeExact(devPtr, count, location, flags, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemAdvise { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemAdvise"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemAdvise(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, int device) - * } - */ - public static FunctionDescriptor cudaMemAdvise$descriptor() { - return cudaMemAdvise.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemAdvise(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, int device) - * } - */ - public static MethodHandle cudaMemAdvise$handle() { - return cudaMemAdvise.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemAdvise(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, int device) - * } - */ - public static MemorySegment cudaMemAdvise$address() { - return cudaMemAdvise.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemAdvise(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, int device) - * } - */ - public static int cudaMemAdvise(MemorySegment devPtr, long count, int advice, int device) { - var mh$ = cudaMemAdvise.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemAdvise", devPtr, count, advice, device); - } - return (int)mh$.invokeExact(devPtr, count, advice, device); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemAdvise_v2 { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - cudaMemLocation.layout() - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemAdvise_v2"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemAdvise_v2(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, struct cudaMemLocation location) - * } - */ - public static FunctionDescriptor cudaMemAdvise_v2$descriptor() { - return cudaMemAdvise_v2.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemAdvise_v2(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, struct cudaMemLocation location) - * } - */ - public static MethodHandle cudaMemAdvise_v2$handle() { - return cudaMemAdvise_v2.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemAdvise_v2(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, struct cudaMemLocation location) - * } - */ - public static MemorySegment cudaMemAdvise_v2$address() { - return cudaMemAdvise_v2.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemAdvise_v2(const void *devPtr, size_t count, enum cudaMemoryAdvise advice, struct cudaMemLocation location) - * } - */ - public static int cudaMemAdvise_v2(MemorySegment devPtr, long count, int advice, MemorySegment location) { - var mh$ = cudaMemAdvise_v2.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemAdvise_v2", devPtr, count, advice, location); - } - return (int)mh$.invokeExact(devPtr, count, advice, location); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemRangeGetAttribute { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemRangeGetAttribute"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemRangeGetAttribute(void *data, size_t dataSize, enum cudaMemRangeAttribute attribute, const void *devPtr, size_t count) - * } - */ - public static FunctionDescriptor cudaMemRangeGetAttribute$descriptor() { - return cudaMemRangeGetAttribute.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemRangeGetAttribute(void *data, size_t dataSize, enum cudaMemRangeAttribute attribute, const void *devPtr, size_t count) - * } - */ - public static MethodHandle cudaMemRangeGetAttribute$handle() { - return cudaMemRangeGetAttribute.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemRangeGetAttribute(void *data, size_t dataSize, enum cudaMemRangeAttribute attribute, const void *devPtr, size_t count) - * } - */ - public static MemorySegment cudaMemRangeGetAttribute$address() { - return cudaMemRangeGetAttribute.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemRangeGetAttribute(void *data, size_t dataSize, enum cudaMemRangeAttribute attribute, const void *devPtr, size_t count) - * } - */ - public static int cudaMemRangeGetAttribute(MemorySegment data, long dataSize, int attribute, MemorySegment devPtr, long count) { - var mh$ = cudaMemRangeGetAttribute.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemRangeGetAttribute", data, dataSize, attribute, devPtr, count); - } - return (int)mh$.invokeExact(data, dataSize, attribute, devPtr, count); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemRangeGetAttributes { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemRangeGetAttributes"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemRangeGetAttributes(void **data, size_t *dataSizes, enum cudaMemRangeAttribute *attributes, size_t numAttributes, const void *devPtr, size_t count) - * } - */ - public static FunctionDescriptor cudaMemRangeGetAttributes$descriptor() { - return cudaMemRangeGetAttributes.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemRangeGetAttributes(void **data, size_t *dataSizes, enum cudaMemRangeAttribute *attributes, size_t numAttributes, const void *devPtr, size_t count) - * } - */ - public static MethodHandle cudaMemRangeGetAttributes$handle() { - return cudaMemRangeGetAttributes.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemRangeGetAttributes(void **data, size_t *dataSizes, enum cudaMemRangeAttribute *attributes, size_t numAttributes, const void *devPtr, size_t count) - * } - */ - public static MemorySegment cudaMemRangeGetAttributes$address() { - return cudaMemRangeGetAttributes.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemRangeGetAttributes(void **data, size_t *dataSizes, enum cudaMemRangeAttribute *attributes, size_t numAttributes, const void *devPtr, size_t count) - * } - */ - public static int cudaMemRangeGetAttributes(MemorySegment data, MemorySegment dataSizes, MemorySegment attributes, long numAttributes, MemorySegment devPtr, long count) { - var mh$ = cudaMemRangeGetAttributes.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemRangeGetAttributes", data, dataSizes, attributes, numAttributes, devPtr, count); - } - return (int)mh$.invokeExact(data, dataSizes, attributes, numAttributes, devPtr, count); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyToArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyToArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaMemcpyToArray$descriptor() { - return cudaMemcpyToArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaMemcpyToArray$handle() { - return cudaMemcpyToArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaMemcpyToArray$address() { - return cudaMemcpyToArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToArray(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static int cudaMemcpyToArray(MemorySegment dst, long wOffset, long hOffset, MemorySegment src, long count, int kind) { - var mh$ = cudaMemcpyToArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyToArray", dst, wOffset, hOffset, src, count, kind); - } - return (int)mh$.invokeExact(dst, wOffset, hOffset, src, count, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyFromArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyFromArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromArray(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaMemcpyFromArray$descriptor() { - return cudaMemcpyFromArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromArray(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaMemcpyFromArray$handle() { - return cudaMemcpyFromArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromArray(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaMemcpyFromArray$address() { - return cudaMemcpyFromArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromArray(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static int cudaMemcpyFromArray(MemorySegment dst, MemorySegment src, long wOffset, long hOffset, long count, int kind) { - var mh$ = cudaMemcpyFromArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyFromArray", dst, src, wOffset, hOffset, count, kind); - } - return (int)mh$.invokeExact(dst, src, wOffset, hOffset, count, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyArrayToArray { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyArrayToArray"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static FunctionDescriptor cudaMemcpyArrayToArray$descriptor() { - return cudaMemcpyArrayToArray.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MethodHandle cudaMemcpyArrayToArray$handle() { - return cudaMemcpyArrayToArray.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static MemorySegment cudaMemcpyArrayToArray$address() { - return cudaMemcpyArrayToArray.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyArrayToArray(cudaArray_t dst, size_t wOffsetDst, size_t hOffsetDst, cudaArray_const_t src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, enum cudaMemcpyKind kind) - * } - */ - public static int cudaMemcpyArrayToArray(MemorySegment dst, long wOffsetDst, long hOffsetDst, MemorySegment src, long wOffsetSrc, long hOffsetSrc, long count, int kind) { - var mh$ = cudaMemcpyArrayToArray.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyArrayToArray", dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind); - } - return (int)mh$.invokeExact(dst, wOffsetDst, hOffsetDst, src, wOffsetSrc, hOffsetSrc, count, kind); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyToArrayAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyToArrayAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpyToArrayAsync$descriptor() { - return cudaMemcpyToArrayAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpyToArrayAsync$handle() { - return cudaMemcpyToArrayAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpyToArrayAsync$address() { - return cudaMemcpyToArrayAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyToArrayAsync(cudaArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static int cudaMemcpyToArrayAsync(MemorySegment dst, long wOffset, long hOffset, MemorySegment src, long count, int kind, MemorySegment stream) { - var mh$ = cudaMemcpyToArrayAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyToArrayAsync", dst, wOffset, hOffset, src, count, kind, stream); - } - return (int)mh$.invokeExact(dst, wOffset, hOffset, src, count, kind, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemcpyFromArrayAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemcpyFromArrayAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromArrayAsync(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static FunctionDescriptor cudaMemcpyFromArrayAsync$descriptor() { - return cudaMemcpyFromArrayAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromArrayAsync(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MethodHandle cudaMemcpyFromArrayAsync$handle() { - return cudaMemcpyFromArrayAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromArrayAsync(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static MemorySegment cudaMemcpyFromArrayAsync$address() { - return cudaMemcpyFromArrayAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemcpyFromArrayAsync(void *dst, cudaArray_const_t src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream) - * } - */ - public static int cudaMemcpyFromArrayAsync(MemorySegment dst, MemorySegment src, long wOffset, long hOffset, long count, int kind, MemorySegment stream) { - var mh$ = cudaMemcpyFromArrayAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemcpyFromArrayAsync", dst, src, wOffset, hOffset, count, kind, stream); - } - return (int)mh$.invokeExact(dst, src, wOffset, hOffset, count, kind, stream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMallocAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMallocAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocAsync(void **devPtr, size_t size, cudaStream_t hStream) - * } - */ - public static FunctionDescriptor cudaMallocAsync$descriptor() { - return cudaMallocAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocAsync(void **devPtr, size_t size, cudaStream_t hStream) - * } - */ - public static MethodHandle cudaMallocAsync$handle() { - return cudaMallocAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMallocAsync(void **devPtr, size_t size, cudaStream_t hStream) - * } - */ - public static MemorySegment cudaMallocAsync$address() { - return cudaMallocAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMallocAsync(void **devPtr, size_t size, cudaStream_t hStream) - * } - */ - public static int cudaMallocAsync(MemorySegment devPtr, long size, MemorySegment hStream) { - var mh$ = cudaMallocAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMallocAsync", devPtr, size, hStream); - } - return (int)mh$.invokeExact(devPtr, size, hStream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaFreeAsync { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaFreeAsync"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeAsync(void *devPtr, cudaStream_t hStream) - * } - */ - public static FunctionDescriptor cudaFreeAsync$descriptor() { - return cudaFreeAsync.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeAsync(void *devPtr, cudaStream_t hStream) - * } - */ - public static MethodHandle cudaFreeAsync$handle() { - return cudaFreeAsync.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaFreeAsync(void *devPtr, cudaStream_t hStream) - * } - */ - public static MemorySegment cudaFreeAsync$address() { - return cudaFreeAsync.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaFreeAsync(void *devPtr, cudaStream_t hStream) - * } - */ - public static int cudaFreeAsync(MemorySegment devPtr, MemorySegment hStream) { - var mh$ = cudaFreeAsync.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaFreeAsync", devPtr, hStream); - } - return (int)mh$.invokeExact(devPtr, hStream); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - - private static class cudaMemPoolTrimTo { - public static final FunctionDescriptor DESC = FunctionDescriptor.of( - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_LONG - ); - - public static final MemorySegment ADDR = PanamaFFMAPI.findOrThrow("cudaMemPoolTrimTo"); - - public static final MethodHandle HANDLE = Linker.nativeLinker().downcallHandle(ADDR, DESC); - } - - /** - * Function descriptor for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) - * } - */ - public static FunctionDescriptor cudaMemPoolTrimTo$descriptor() { - return cudaMemPoolTrimTo.DESC; - } - - /** - * Downcall method handle for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) - * } - */ - public static MethodHandle cudaMemPoolTrimTo$handle() { - return cudaMemPoolTrimTo.HANDLE; - } - - /** - * Address for: - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) - * } - */ - public static MemorySegment cudaMemPoolTrimTo$address() { - return cudaMemPoolTrimTo.ADDR; - } - - /** - * {@snippet lang=c : - * extern cudaError_t cudaMemPoolTrimTo(cudaMemPool_t memPool, size_t minBytesToKeep) - * } - */ - public static int cudaMemPoolTrimTo(MemorySegment memPool, long minBytesToKeep) { - var mh$ = cudaMemPoolTrimTo.HANDLE; - try { - if (TRACE_DOWNCALLS) { - traceDowncall("cudaMemPoolTrimTo", memPool, minBytesToKeep); - } - return (int)mh$.invokeExact(memPool, minBytesToKeep); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/__fsid_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/__fsid_t.java deleted file mode 100644 index c435ed24e1..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/__fsid_t.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct { - * int __val[2]; - * } - * } - */ -public class __fsid_t { - - __fsid_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("__val") - ).withName("$anon$155:12"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout __val$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("__val")); - - /** - * Layout for field: - * {@snippet lang=c : - * int __val[2] - * } - */ - public static final SequenceLayout __val$layout() { - return __val$LAYOUT; - } - - private static final long __val$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int __val[2] - * } - */ - public static final long __val$offset() { - return __val$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int __val[2] - * } - */ - public static MemorySegment __val(MemorySegment struct) { - return struct.asSlice(__val$OFFSET, __val$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int __val[2] - * } - */ - public static void __val(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, __val$OFFSET, __val$LAYOUT.byteSize()); - } - - private static long[] __val$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int __val[2] - * } - */ - public static long[] __val$dimensions() { - return __val$DIMS; - } - private static final VarHandle __val$ELEM_HANDLE = __val$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int __val[2] - * } - */ - public static int __val(MemorySegment struct, long index0) { - return (int)__val$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int __val[2] - * } - */ - public static void __val(MemorySegment struct, long index0, int fieldValue) { - __val$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char1.java deleted file mode 100644 index f1ea3f8848..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct char1 { - * signed char x; - * } - * } - */ -public class char1 { - - char1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("x") - ).withName("char1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static final OfByte x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static byte x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static void x(MemorySegment struct, byte fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char2.java deleted file mode 100644 index 2874a9e9c9..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct char2 { - * signed char x; - * signed char y; - * } - * } - */ -public class char2 { - - char2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("x"), - PanamaFFMAPI.C_CHAR.withName("y") - ).withName("char2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static final OfByte x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static byte x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static void x(MemorySegment struct, byte fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static final OfByte y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 1; - - /** - * Offset for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static byte y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static void y(MemorySegment struct, byte fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char3.java deleted file mode 100644 index dea37ee6a5..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct char3 { - * signed char x; - * signed char y; - * signed char z; - * } - * } - */ -public class char3 { - - char3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("x"), - PanamaFFMAPI.C_CHAR.withName("y"), - PanamaFFMAPI.C_CHAR.withName("z") - ).withName("char3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static final OfByte x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static byte x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static void x(MemorySegment struct, byte fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static final OfByte y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 1; - - /** - * Offset for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static byte y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static void y(MemorySegment struct, byte fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfByte z$LAYOUT = (OfByte)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * signed char z - * } - */ - public static final OfByte z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * signed char z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * signed char z - * } - */ - public static byte z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * signed char z - * } - */ - public static void z(MemorySegment struct, byte fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char4.java deleted file mode 100644 index e32312dd9c..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/char4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct char4 { - * signed char x; - * signed char y; - * signed char z; - * signed char w; - * } - * } - */ -public class char4 { - - char4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("x"), - PanamaFFMAPI.C_CHAR.withName("y"), - PanamaFFMAPI.C_CHAR.withName("z"), - PanamaFFMAPI.C_CHAR.withName("w") - ).withName("char4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static final OfByte x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static byte x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * signed char x - * } - */ - public static void x(MemorySegment struct, byte fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static final OfByte y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 1; - - /** - * Offset for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static byte y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * signed char y - * } - */ - public static void y(MemorySegment struct, byte fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfByte z$LAYOUT = (OfByte)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * signed char z - * } - */ - public static final OfByte z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * signed char z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * signed char z - * } - */ - public static byte z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * signed char z - * } - */ - public static void z(MemorySegment struct, byte fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfByte w$LAYOUT = (OfByte)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * signed char w - * } - */ - public static final OfByte w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 3; - - /** - * Offset for field: - * {@snippet lang=c : - * signed char w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * signed char w - * } - */ - public static byte w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * signed char w - * } - */ - public static void w(MemorySegment struct, byte fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAccessPolicyWindow.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAccessPolicyWindow.java deleted file mode 100644 index 6a83ffe5c4..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAccessPolicyWindow.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaAccessPolicyWindow { - * void *base_ptr; - * size_t num_bytes; - * float hitRatio; - * enum cudaAccessProperty hitProp; - * enum cudaAccessProperty missProp; - * } - * } - */ -public class cudaAccessPolicyWindow { - - cudaAccessPolicyWindow() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("base_ptr"), - PanamaFFMAPI.C_LONG.withName("num_bytes"), - PanamaFFMAPI.C_FLOAT.withName("hitRatio"), - PanamaFFMAPI.C_INT.withName("hitProp"), - PanamaFFMAPI.C_INT.withName("missProp"), - MemoryLayout.paddingLayout(4) - ).withName("cudaAccessPolicyWindow"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout base_ptr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("base_ptr")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *base_ptr - * } - */ - public static final AddressLayout base_ptr$layout() { - return base_ptr$LAYOUT; - } - - private static final long base_ptr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *base_ptr - * } - */ - public static final long base_ptr$offset() { - return base_ptr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *base_ptr - * } - */ - public static MemorySegment base_ptr(MemorySegment struct) { - return struct.get(base_ptr$LAYOUT, base_ptr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *base_ptr - * } - */ - public static void base_ptr(MemorySegment struct, MemorySegment fieldValue) { - struct.set(base_ptr$LAYOUT, base_ptr$OFFSET, fieldValue); - } - - private static final OfLong num_bytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("num_bytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t num_bytes - * } - */ - public static final OfLong num_bytes$layout() { - return num_bytes$LAYOUT; - } - - private static final long num_bytes$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t num_bytes - * } - */ - public static final long num_bytes$offset() { - return num_bytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t num_bytes - * } - */ - public static long num_bytes(MemorySegment struct) { - return struct.get(num_bytes$LAYOUT, num_bytes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t num_bytes - * } - */ - public static void num_bytes(MemorySegment struct, long fieldValue) { - struct.set(num_bytes$LAYOUT, num_bytes$OFFSET, fieldValue); - } - - private static final OfFloat hitRatio$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("hitRatio")); - - /** - * Layout for field: - * {@snippet lang=c : - * float hitRatio - * } - */ - public static final OfFloat hitRatio$layout() { - return hitRatio$LAYOUT; - } - - private static final long hitRatio$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * float hitRatio - * } - */ - public static final long hitRatio$offset() { - return hitRatio$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float hitRatio - * } - */ - public static float hitRatio(MemorySegment struct) { - return struct.get(hitRatio$LAYOUT, hitRatio$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float hitRatio - * } - */ - public static void hitRatio(MemorySegment struct, float fieldValue) { - struct.set(hitRatio$LAYOUT, hitRatio$OFFSET, fieldValue); - } - - private static final OfInt hitProp$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hitProp")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaAccessProperty hitProp - * } - */ - public static final OfInt hitProp$layout() { - return hitProp$LAYOUT; - } - - private static final long hitProp$OFFSET = 20; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaAccessProperty hitProp - * } - */ - public static final long hitProp$offset() { - return hitProp$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaAccessProperty hitProp - * } - */ - public static int hitProp(MemorySegment struct) { - return struct.get(hitProp$LAYOUT, hitProp$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaAccessProperty hitProp - * } - */ - public static void hitProp(MemorySegment struct, int fieldValue) { - struct.set(hitProp$LAYOUT, hitProp$OFFSET, fieldValue); - } - - private static final OfInt missProp$LAYOUT = (OfInt)$LAYOUT.select(groupElement("missProp")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaAccessProperty missProp - * } - */ - public static final OfInt missProp$layout() { - return missProp$LAYOUT; - } - - private static final long missProp$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaAccessProperty missProp - * } - */ - public static final long missProp$offset() { - return missProp$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaAccessProperty missProp - * } - */ - public static int missProp(MemorySegment struct) { - return struct.get(missProp$LAYOUT, missProp$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaAccessProperty missProp - * } - */ - public static void missProp(MemorySegment struct, int fieldValue) { - struct.set(missProp$LAYOUT, missProp$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArrayMemoryRequirements.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArrayMemoryRequirements.java deleted file mode 100644 index b69a98e5f7..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArrayMemoryRequirements.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaArrayMemoryRequirements { - * size_t size; - * size_t alignment; - * unsigned int reserved[4]; - * } - * } - */ -public class cudaArrayMemoryRequirements { - - cudaArrayMemoryRequirements() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("size"), - PanamaFFMAPI.C_LONG.withName("alignment"), - MemoryLayout.sequenceLayout(4, PanamaFFMAPI.C_INT).withName("reserved") - ).withName("cudaArrayMemoryRequirements"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("size")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t size - * } - */ - public static final OfLong size$layout() { - return size$LAYOUT; - } - - private static final long size$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t size - * } - */ - public static final long size$offset() { - return size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t size - * } - */ - public static long size(MemorySegment struct) { - return struct.get(size$LAYOUT, size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t size - * } - */ - public static void size(MemorySegment struct, long fieldValue) { - struct.set(size$LAYOUT, size$OFFSET, fieldValue); - } - - private static final OfLong alignment$LAYOUT = (OfLong)$LAYOUT.select(groupElement("alignment")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t alignment - * } - */ - public static final OfLong alignment$layout() { - return alignment$LAYOUT; - } - - private static final long alignment$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t alignment - * } - */ - public static final long alignment$offset() { - return alignment$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t alignment - * } - */ - public static long alignment(MemorySegment struct) { - return struct.get(alignment$LAYOUT, alignment$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t alignment - * } - */ - public static void alignment(MemorySegment struct, long fieldValue) { - struct.set(alignment$LAYOUT, alignment$OFFSET, fieldValue); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 4 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static int reserved(MemorySegment struct, long index0) { - return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static void reserved(MemorySegment struct, long index0, int fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArraySparseProperties.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArraySparseProperties.java deleted file mode 100644 index 0a917cf49a..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaArraySparseProperties.java +++ /dev/null @@ -1,586 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaArraySparseProperties { - * struct { - * unsigned int width; - * unsigned int height; - * unsigned int depth; - * } tileExtent; - * unsigned int miptailFirstLevel; - * unsigned long long miptailSize; - * unsigned int flags; - * unsigned int reserved[4]; - * } - * } - */ -public class cudaArraySparseProperties { - - cudaArraySparseProperties() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaArraySparseProperties.tileExtent.layout().withName("tileExtent"), - PanamaFFMAPI.C_INT.withName("miptailFirstLevel"), - PanamaFFMAPI.C_LONG_LONG.withName("miptailSize"), - PanamaFFMAPI.C_INT.withName("flags"), - MemoryLayout.sequenceLayout(4, PanamaFFMAPI.C_INT).withName("reserved"), - MemoryLayout.paddingLayout(4) - ).withName("cudaArraySparseProperties"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * unsigned int width; - * unsigned int height; - * unsigned int depth; - * } - * } - */ - public static class tileExtent { - - tileExtent() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("width"), - PanamaFFMAPI.C_INT.withName("height"), - PanamaFFMAPI.C_INT.withName("depth") - ).withName("$anon$1203:5"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt width$LAYOUT = (OfInt)$LAYOUT.select(groupElement("width")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int width - * } - */ - public static final OfInt width$layout() { - return width$LAYOUT; - } - - private static final long width$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int width - * } - */ - public static final long width$offset() { - return width$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int width - * } - */ - public static int width(MemorySegment struct) { - return struct.get(width$LAYOUT, width$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int width - * } - */ - public static void width(MemorySegment struct, int fieldValue) { - struct.set(width$LAYOUT, width$OFFSET, fieldValue); - } - - private static final OfInt height$LAYOUT = (OfInt)$LAYOUT.select(groupElement("height")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int height - * } - */ - public static final OfInt height$layout() { - return height$LAYOUT; - } - - private static final long height$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int height - * } - */ - public static final long height$offset() { - return height$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int height - * } - */ - public static int height(MemorySegment struct) { - return struct.get(height$LAYOUT, height$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int height - * } - */ - public static void height(MemorySegment struct, int fieldValue) { - struct.set(height$LAYOUT, height$OFFSET, fieldValue); - } - - private static final OfInt depth$LAYOUT = (OfInt)$LAYOUT.select(groupElement("depth")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int depth - * } - */ - public static final OfInt depth$layout() { - return depth$LAYOUT; - } - - private static final long depth$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int depth - * } - */ - public static final long depth$offset() { - return depth$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int depth - * } - */ - public static int depth(MemorySegment struct) { - return struct.get(depth$LAYOUT, depth$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int depth - * } - */ - public static void depth(MemorySegment struct, int fieldValue) { - struct.set(depth$LAYOUT, depth$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout tileExtent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("tileExtent")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned int width; - * unsigned int height; - * unsigned int depth; - * } tileExtent - * } - */ - public static final GroupLayout tileExtent$layout() { - return tileExtent$LAYOUT; - } - - private static final long tileExtent$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned int width; - * unsigned int height; - * unsigned int depth; - * } tileExtent - * } - */ - public static final long tileExtent$offset() { - return tileExtent$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned int width; - * unsigned int height; - * unsigned int depth; - * } tileExtent - * } - */ - public static MemorySegment tileExtent(MemorySegment struct) { - return struct.asSlice(tileExtent$OFFSET, tileExtent$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned int width; - * unsigned int height; - * unsigned int depth; - * } tileExtent - * } - */ - public static void tileExtent(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, tileExtent$OFFSET, tileExtent$LAYOUT.byteSize()); - } - - private static final OfInt miptailFirstLevel$LAYOUT = (OfInt)$LAYOUT.select(groupElement("miptailFirstLevel")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int miptailFirstLevel - * } - */ - public static final OfInt miptailFirstLevel$layout() { - return miptailFirstLevel$LAYOUT; - } - - private static final long miptailFirstLevel$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int miptailFirstLevel - * } - */ - public static final long miptailFirstLevel$offset() { - return miptailFirstLevel$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int miptailFirstLevel - * } - */ - public static int miptailFirstLevel(MemorySegment struct) { - return struct.get(miptailFirstLevel$LAYOUT, miptailFirstLevel$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int miptailFirstLevel - * } - */ - public static void miptailFirstLevel(MemorySegment struct, int fieldValue) { - struct.set(miptailFirstLevel$LAYOUT, miptailFirstLevel$OFFSET, fieldValue); - } - - private static final OfLong miptailSize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("miptailSize")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long miptailSize - * } - */ - public static final OfLong miptailSize$layout() { - return miptailSize$LAYOUT; - } - - private static final long miptailSize$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long miptailSize - * } - */ - public static final long miptailSize$offset() { - return miptailSize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long miptailSize - * } - */ - public static long miptailSize(MemorySegment struct) { - return struct.get(miptailSize$LAYOUT, miptailSize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long miptailSize - * } - */ - public static void miptailSize(MemorySegment struct, long fieldValue) { - struct.set(miptailSize$LAYOUT, miptailSize$OFFSET, fieldValue); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 28; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 4 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static int reserved(MemorySegment struct, long index0) { - return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned int reserved[4] - * } - */ - public static void reserved(MemorySegment struct, long index0, int fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncCallback.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncCallback.java deleted file mode 100644 index 83972463e5..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncCallback.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef void (*cudaAsyncCallback)(cudaAsyncNotificationInfo_t *, void *, cudaAsyncCallbackHandle_t) - * } - */ -public class cudaAsyncCallback { - - cudaAsyncCallback() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - void apply(MemorySegment _x0, MemorySegment _x1, MemorySegment _x2); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_POINTER - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = PanamaFFMAPI.upcallHandle(cudaAsyncCallback.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(cudaAsyncCallback.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, MemorySegment _x2) { - try { - DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo.java deleted file mode 100644 index f2e84182bf..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo.java +++ /dev/null @@ -1,446 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaAsyncNotificationInfo { - * cudaAsyncNotificationType type; - * union { - * struct { - * unsigned long long bytesOverBudget; - * } overBudget; - * } info; - * } - * } - */ -public class cudaAsyncNotificationInfo { - - cudaAsyncNotificationInfo() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("type"), - MemoryLayout.paddingLayout(4), - cudaAsyncNotificationInfo.info.layout().withName("info") - ).withName("cudaAsyncNotificationInfo"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaAsyncNotificationType type - * } - */ - public static final OfInt type$layout() { - return type$LAYOUT; - } - - private static final long type$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaAsyncNotificationType type - * } - */ - public static final long type$offset() { - return type$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaAsyncNotificationType type - * } - */ - public static int type(MemorySegment struct) { - return struct.get(type$LAYOUT, type$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaAsyncNotificationType type - * } - */ - public static void type(MemorySegment struct, int fieldValue) { - struct.set(type$LAYOUT, type$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * union { - * struct { - * unsigned long long bytesOverBudget; - * } overBudget; - * } - * } - */ - public static class info { - - info() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - cudaAsyncNotificationInfo.info.overBudget.layout().withName("overBudget") - ).withName("$anon$3670:5"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * unsigned long long bytesOverBudget; - * } - * } - */ - public static class overBudget { - - overBudget() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("bytesOverBudget") - ).withName("$anon$3671:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong bytesOverBudget$LAYOUT = (OfLong)$LAYOUT.select(groupElement("bytesOverBudget")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long bytesOverBudget - * } - */ - public static final OfLong bytesOverBudget$layout() { - return bytesOverBudget$LAYOUT; - } - - private static final long bytesOverBudget$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long bytesOverBudget - * } - */ - public static final long bytesOverBudget$offset() { - return bytesOverBudget$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long bytesOverBudget - * } - */ - public static long bytesOverBudget(MemorySegment struct) { - return struct.get(bytesOverBudget$LAYOUT, bytesOverBudget$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long bytesOverBudget - * } - */ - public static void bytesOverBudget(MemorySegment struct, long fieldValue) { - struct.set(bytesOverBudget$LAYOUT, bytesOverBudget$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout overBudget$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("overBudget")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned long long bytesOverBudget; - * } overBudget - * } - */ - public static final GroupLayout overBudget$layout() { - return overBudget$LAYOUT; - } - - private static final long overBudget$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned long long bytesOverBudget; - * } overBudget - * } - */ - public static final long overBudget$offset() { - return overBudget$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned long long bytesOverBudget; - * } overBudget - * } - */ - public static MemorySegment overBudget(MemorySegment union) { - return union.asSlice(overBudget$OFFSET, overBudget$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned long long bytesOverBudget; - * } overBudget - * } - */ - public static void overBudget(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, overBudget$OFFSET, overBudget$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout info$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("info")); - - /** - * Layout for field: - * {@snippet lang=c : - * union { - * struct { - * unsigned long long bytesOverBudget; - * } overBudget; - * } info - * } - */ - public static final GroupLayout info$layout() { - return info$LAYOUT; - } - - private static final long info$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * union { - * struct { - * unsigned long long bytesOverBudget; - * } overBudget; - * } info - * } - */ - public static final long info$offset() { - return info$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * union { - * struct { - * unsigned long long bytesOverBudget; - * } overBudget; - * } info - * } - */ - public static MemorySegment info(MemorySegment struct) { - return struct.asSlice(info$OFFSET, info$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * union { - * struct { - * unsigned long long bytesOverBudget; - * } overBudget; - * } info - * } - */ - public static void info(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, info$OFFSET, info$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo_t.java deleted file mode 100644 index 5d503e7a0e..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaAsyncNotificationInfo_t.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct cudaAsyncNotificationInfo { - * cudaAsyncNotificationType type; - * union { - * struct { - * unsigned long long bytesOverBudget; - * } overBudget; - * } info; - * } cudaAsyncNotificationInfo_t - * } - */ -public class cudaAsyncNotificationInfo_t extends cudaAsyncNotificationInfo { - - cudaAsyncNotificationInfo_t() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChannelFormatDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChannelFormatDesc.java deleted file mode 100644 index 3ea884c120..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChannelFormatDesc.java +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaChannelFormatDesc { - * int x; - * int y; - * int z; - * int w; - * enum cudaChannelFormatKind f; - * } - * } - */ -public class cudaChannelFormatDesc { - - cudaChannelFormatDesc() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x"), - PanamaFFMAPI.C_INT.withName("y"), - PanamaFFMAPI.C_INT.withName("z"), - PanamaFFMAPI.C_INT.withName("w"), - PanamaFFMAPI.C_INT.withName("f") - ).withName("cudaChannelFormatDesc"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * int y - * } - */ - public static final OfInt y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int y - * } - */ - public static int y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int y - * } - */ - public static void y(MemorySegment struct, int fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * int z - * } - */ - public static final OfInt z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * int z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int z - * } - */ - public static int z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int z - * } - */ - public static void z(MemorySegment struct, int fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfInt w$LAYOUT = (OfInt)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * int w - * } - */ - public static final OfInt w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * int w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int w - * } - */ - public static int w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int w - * } - */ - public static void w(MemorySegment struct, int fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - private static final OfInt f$LAYOUT = (OfInt)$LAYOUT.select(groupElement("f")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaChannelFormatKind f - * } - */ - public static final OfInt f$layout() { - return f$LAYOUT; - } - - private static final long f$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaChannelFormatKind f - * } - */ - public static final long f$offset() { - return f$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaChannelFormatKind f - * } - */ - public static int f(MemorySegment struct) { - return struct.get(f$LAYOUT, f$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaChannelFormatKind f - * } - */ - public static void f(MemorySegment struct, int fieldValue) { - struct.set(f$LAYOUT, f$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChildGraphNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChildGraphNodeParams.java deleted file mode 100644 index 08ad90110d..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaChildGraphNodeParams.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaChildGraphNodeParams { - * cudaGraph_t graph; - * } - * } - */ -public class cudaChildGraphNodeParams { - - cudaChildGraphNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("graph") - ).withName("cudaChildGraphNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout graph$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("graph")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaGraph_t graph - * } - */ - public static final AddressLayout graph$layout() { - return graph$LAYOUT; - } - - private static final long graph$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaGraph_t graph - * } - */ - public static final long graph$offset() { - return graph$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaGraph_t graph - * } - */ - public static MemorySegment graph(MemorySegment struct) { - return struct.get(graph$LAYOUT, graph$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaGraph_t graph - * } - */ - public static void graph(MemorySegment struct, MemorySegment fieldValue) { - struct.set(graph$LAYOUT, graph$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaConditionalNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaConditionalNodeParams.java deleted file mode 100644 index 595a5173e2..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaConditionalNodeParams.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaConditionalNodeParams { - * cudaGraphConditionalHandle handle; - * enum cudaGraphConditionalNodeType type; - * unsigned int size; - * cudaGraph_t *phGraph_out; - * } - * } - */ -public class cudaConditionalNodeParams { - - cudaConditionalNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("handle"), - PanamaFFMAPI.C_INT.withName("type"), - PanamaFFMAPI.C_INT.withName("size"), - PanamaFFMAPI.C_POINTER.withName("phGraph_out") - ).withName("cudaConditionalNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong handle$LAYOUT = (OfLong)$LAYOUT.select(groupElement("handle")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaGraphConditionalHandle handle - * } - */ - public static final OfLong handle$layout() { - return handle$LAYOUT; - } - - private static final long handle$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaGraphConditionalHandle handle - * } - */ - public static final long handle$offset() { - return handle$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaGraphConditionalHandle handle - * } - */ - public static long handle(MemorySegment struct) { - return struct.get(handle$LAYOUT, handle$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaGraphConditionalHandle handle - * } - */ - public static void handle(MemorySegment struct, long fieldValue) { - struct.set(handle$LAYOUT, handle$OFFSET, fieldValue); - } - - private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaGraphConditionalNodeType type - * } - */ - public static final OfInt type$layout() { - return type$LAYOUT; - } - - private static final long type$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaGraphConditionalNodeType type - * } - */ - public static final long type$offset() { - return type$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaGraphConditionalNodeType type - * } - */ - public static int type(MemorySegment struct) { - return struct.get(type$LAYOUT, type$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaGraphConditionalNodeType type - * } - */ - public static void type(MemorySegment struct, int fieldValue) { - struct.set(type$LAYOUT, type$OFFSET, fieldValue); - } - - private static final OfInt size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("size")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int size - * } - */ - public static final OfInt size$layout() { - return size$LAYOUT; - } - - private static final long size$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int size - * } - */ - public static final long size$offset() { - return size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int size - * } - */ - public static int size(MemorySegment struct) { - return struct.get(size$LAYOUT, size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int size - * } - */ - public static void size(MemorySegment struct, int fieldValue) { - struct.set(size$LAYOUT, size$OFFSET, fieldValue); - } - - private static final AddressLayout phGraph_out$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("phGraph_out")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaGraph_t *phGraph_out - * } - */ - public static final AddressLayout phGraph_out$layout() { - return phGraph_out$LAYOUT; - } - - private static final long phGraph_out$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaGraph_t *phGraph_out - * } - */ - public static final long phGraph_out$offset() { - return phGraph_out$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaGraph_t *phGraph_out - * } - */ - public static MemorySegment phGraph_out(MemorySegment struct) { - return struct.get(phGraph_out$LAYOUT, phGraph_out$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaGraph_t *phGraph_out - * } - */ - public static void phGraph_out(MemorySegment struct, MemorySegment fieldValue) { - struct.set(phGraph_out$LAYOUT, phGraph_out$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaDeviceProp.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaDeviceProp.java deleted file mode 100644 index 7259c9d8e5..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaDeviceProp.java +++ /dev/null @@ -1,5207 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaDeviceProp { - * char name[256]; - * cudaUUID_t uuid; - * char luid[8]; - * unsigned int luidDeviceNodeMask; - * size_t totalGlobalMem; - * size_t sharedMemPerBlock; - * int regsPerBlock; - * int warpSize; - * size_t memPitch; - * int maxThreadsPerBlock; - * int maxThreadsDim[3]; - * int maxGridSize[3]; - * int clockRate; - * size_t totalConstMem; - * int major; - * int minor; - * size_t textureAlignment; - * size_t texturePitchAlignment; - * int deviceOverlap; - * int multiProcessorCount; - * int kernelExecTimeoutEnabled; - * int integrated; - * int canMapHostMemory; - * int computeMode; - * int maxTexture1D; - * int maxTexture1DMipmap; - * int maxTexture1DLinear; - * int maxTexture2D[2]; - * int maxTexture2DMipmap[2]; - * int maxTexture2DLinear[3]; - * int maxTexture2DGather[2]; - * int maxTexture3D[3]; - * int maxTexture3DAlt[3]; - * int maxTextureCubemap; - * int maxTexture1DLayered[2]; - * int maxTexture2DLayered[3]; - * int maxTextureCubemapLayered[2]; - * int maxSurface1D; - * int maxSurface2D[2]; - * int maxSurface3D[3]; - * int maxSurface1DLayered[2]; - * int maxSurface2DLayered[3]; - * int maxSurfaceCubemap; - * int maxSurfaceCubemapLayered[2]; - * size_t surfaceAlignment; - * int concurrentKernels; - * int ECCEnabled; - * int pciBusID; - * int pciDeviceID; - * int pciDomainID; - * int tccDriver; - * int asyncEngineCount; - * int unifiedAddressing; - * int memoryClockRate; - * int memoryBusWidth; - * int l2CacheSize; - * int persistingL2CacheMaxSize; - * int maxThreadsPerMultiProcessor; - * int streamPrioritiesSupported; - * int globalL1CacheSupported; - * int localL1CacheSupported; - * size_t sharedMemPerMultiprocessor; - * int regsPerMultiprocessor; - * int managedMemory; - * int isMultiGpuBoard; - * int multiGpuBoardGroupID; - * int hostNativeAtomicSupported; - * int singleToDoublePrecisionPerfRatio; - * int pageableMemoryAccess; - * int concurrentManagedAccess; - * int computePreemptionSupported; - * int canUseHostPointerForRegisteredMem; - * int cooperativeLaunch; - * int cooperativeMultiDeviceLaunch; - * size_t sharedMemPerBlockOptin; - * int pageableMemoryAccessUsesHostPageTables; - * int directManagedMemAccessFromHost; - * int maxBlocksPerMultiProcessor; - * int accessPolicyMaxWindowSize; - * size_t reservedSharedMemPerBlock; - * int hostRegisterSupported; - * int sparseCudaArraySupported; - * int hostRegisterReadOnlySupported; - * int timelineSemaphoreInteropSupported; - * int memoryPoolsSupported; - * int gpuDirectRDMASupported; - * unsigned int gpuDirectRDMAFlushWritesOptions; - * int gpuDirectRDMAWritesOrdering; - * unsigned int memoryPoolSupportedHandleTypes; - * int deferredMappingCudaArraySupported; - * int ipcEventSupported; - * int clusterLaunch; - * int unifiedFunctionPointers; - * int reserved2[2]; - * int reserved1[1]; - * int reserved[60]; - * } - * } - */ -public class cudaDeviceProp { - - cudaDeviceProp() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.sequenceLayout(256, PanamaFFMAPI.C_CHAR).withName("name"), - CUuuid_st.layout().withName("uuid"), - MemoryLayout.sequenceLayout(8, PanamaFFMAPI.C_CHAR).withName("luid"), - PanamaFFMAPI.C_INT.withName("luidDeviceNodeMask"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_LONG.withName("totalGlobalMem"), - PanamaFFMAPI.C_LONG.withName("sharedMemPerBlock"), - PanamaFFMAPI.C_INT.withName("regsPerBlock"), - PanamaFFMAPI.C_INT.withName("warpSize"), - PanamaFFMAPI.C_LONG.withName("memPitch"), - PanamaFFMAPI.C_INT.withName("maxThreadsPerBlock"), - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxThreadsDim"), - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxGridSize"), - PanamaFFMAPI.C_INT.withName("clockRate"), - PanamaFFMAPI.C_LONG.withName("totalConstMem"), - PanamaFFMAPI.C_INT.withName("major"), - PanamaFFMAPI.C_INT.withName("minor"), - PanamaFFMAPI.C_LONG.withName("textureAlignment"), - PanamaFFMAPI.C_LONG.withName("texturePitchAlignment"), - PanamaFFMAPI.C_INT.withName("deviceOverlap"), - PanamaFFMAPI.C_INT.withName("multiProcessorCount"), - PanamaFFMAPI.C_INT.withName("kernelExecTimeoutEnabled"), - PanamaFFMAPI.C_INT.withName("integrated"), - PanamaFFMAPI.C_INT.withName("canMapHostMemory"), - PanamaFFMAPI.C_INT.withName("computeMode"), - PanamaFFMAPI.C_INT.withName("maxTexture1D"), - PanamaFFMAPI.C_INT.withName("maxTexture1DMipmap"), - PanamaFFMAPI.C_INT.withName("maxTexture1DLinear"), - MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxTexture2D"), - MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxTexture2DMipmap"), - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxTexture2DLinear"), - MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxTexture2DGather"), - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxTexture3D"), - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxTexture3DAlt"), - PanamaFFMAPI.C_INT.withName("maxTextureCubemap"), - MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxTexture1DLayered"), - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxTexture2DLayered"), - MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxTextureCubemapLayered"), - PanamaFFMAPI.C_INT.withName("maxSurface1D"), - MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxSurface2D"), - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxSurface3D"), - MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxSurface1DLayered"), - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("maxSurface2DLayered"), - PanamaFFMAPI.C_INT.withName("maxSurfaceCubemap"), - MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("maxSurfaceCubemapLayered"), - PanamaFFMAPI.C_LONG.withName("surfaceAlignment"), - PanamaFFMAPI.C_INT.withName("concurrentKernels"), - PanamaFFMAPI.C_INT.withName("ECCEnabled"), - PanamaFFMAPI.C_INT.withName("pciBusID"), - PanamaFFMAPI.C_INT.withName("pciDeviceID"), - PanamaFFMAPI.C_INT.withName("pciDomainID"), - PanamaFFMAPI.C_INT.withName("tccDriver"), - PanamaFFMAPI.C_INT.withName("asyncEngineCount"), - PanamaFFMAPI.C_INT.withName("unifiedAddressing"), - PanamaFFMAPI.C_INT.withName("memoryClockRate"), - PanamaFFMAPI.C_INT.withName("memoryBusWidth"), - PanamaFFMAPI.C_INT.withName("l2CacheSize"), - PanamaFFMAPI.C_INT.withName("persistingL2CacheMaxSize"), - PanamaFFMAPI.C_INT.withName("maxThreadsPerMultiProcessor"), - PanamaFFMAPI.C_INT.withName("streamPrioritiesSupported"), - PanamaFFMAPI.C_INT.withName("globalL1CacheSupported"), - PanamaFFMAPI.C_INT.withName("localL1CacheSupported"), - PanamaFFMAPI.C_LONG.withName("sharedMemPerMultiprocessor"), - PanamaFFMAPI.C_INT.withName("regsPerMultiprocessor"), - PanamaFFMAPI.C_INT.withName("managedMemory"), - PanamaFFMAPI.C_INT.withName("isMultiGpuBoard"), - PanamaFFMAPI.C_INT.withName("multiGpuBoardGroupID"), - PanamaFFMAPI.C_INT.withName("hostNativeAtomicSupported"), - PanamaFFMAPI.C_INT.withName("singleToDoublePrecisionPerfRatio"), - PanamaFFMAPI.C_INT.withName("pageableMemoryAccess"), - PanamaFFMAPI.C_INT.withName("concurrentManagedAccess"), - PanamaFFMAPI.C_INT.withName("computePreemptionSupported"), - PanamaFFMAPI.C_INT.withName("canUseHostPointerForRegisteredMem"), - PanamaFFMAPI.C_INT.withName("cooperativeLaunch"), - PanamaFFMAPI.C_INT.withName("cooperativeMultiDeviceLaunch"), - PanamaFFMAPI.C_LONG.withName("sharedMemPerBlockOptin"), - PanamaFFMAPI.C_INT.withName("pageableMemoryAccessUsesHostPageTables"), - PanamaFFMAPI.C_INT.withName("directManagedMemAccessFromHost"), - PanamaFFMAPI.C_INT.withName("maxBlocksPerMultiProcessor"), - PanamaFFMAPI.C_INT.withName("accessPolicyMaxWindowSize"), - PanamaFFMAPI.C_LONG.withName("reservedSharedMemPerBlock"), - PanamaFFMAPI.C_INT.withName("hostRegisterSupported"), - PanamaFFMAPI.C_INT.withName("sparseCudaArraySupported"), - PanamaFFMAPI.C_INT.withName("hostRegisterReadOnlySupported"), - PanamaFFMAPI.C_INT.withName("timelineSemaphoreInteropSupported"), - PanamaFFMAPI.C_INT.withName("memoryPoolsSupported"), - PanamaFFMAPI.C_INT.withName("gpuDirectRDMASupported"), - PanamaFFMAPI.C_INT.withName("gpuDirectRDMAFlushWritesOptions"), - PanamaFFMAPI.C_INT.withName("gpuDirectRDMAWritesOrdering"), - PanamaFFMAPI.C_INT.withName("memoryPoolSupportedHandleTypes"), - PanamaFFMAPI.C_INT.withName("deferredMappingCudaArraySupported"), - PanamaFFMAPI.C_INT.withName("ipcEventSupported"), - PanamaFFMAPI.C_INT.withName("clusterLaunch"), - PanamaFFMAPI.C_INT.withName("unifiedFunctionPointers"), - MemoryLayout.sequenceLayout(2, PanamaFFMAPI.C_INT).withName("reserved2"), - MemoryLayout.sequenceLayout(1, PanamaFFMAPI.C_INT).withName("reserved1"), - MemoryLayout.sequenceLayout(60, PanamaFFMAPI.C_INT).withName("reserved") - ).withName("cudaDeviceProp"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout name$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("name")); - - /** - * Layout for field: - * {@snippet lang=c : - * char name[256] - * } - */ - public static final SequenceLayout name$layout() { - return name$LAYOUT; - } - - private static final long name$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * char name[256] - * } - */ - public static final long name$offset() { - return name$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char name[256] - * } - */ - public static MemorySegment name(MemorySegment struct) { - return struct.asSlice(name$OFFSET, name$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char name[256] - * } - */ - public static void name(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, name$OFFSET, name$LAYOUT.byteSize()); - } - - private static long[] name$DIMS = { 256 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char name[256] - * } - */ - public static long[] name$dimensions() { - return name$DIMS; - } - private static final VarHandle name$ELEM_HANDLE = name$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char name[256] - * } - */ - public static byte name(MemorySegment struct, long index0) { - return (byte)name$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char name[256] - * } - */ - public static void name(MemorySegment struct, long index0, byte fieldValue) { - name$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final GroupLayout uuid$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("uuid")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaUUID_t uuid - * } - */ - public static final GroupLayout uuid$layout() { - return uuid$LAYOUT; - } - - private static final long uuid$OFFSET = 256; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaUUID_t uuid - * } - */ - public static final long uuid$offset() { - return uuid$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaUUID_t uuid - * } - */ - public static MemorySegment uuid(MemorySegment struct) { - return struct.asSlice(uuid$OFFSET, uuid$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaUUID_t uuid - * } - */ - public static void uuid(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, uuid$OFFSET, uuid$LAYOUT.byteSize()); - } - - private static final SequenceLayout luid$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("luid")); - - /** - * Layout for field: - * {@snippet lang=c : - * char luid[8] - * } - */ - public static final SequenceLayout luid$layout() { - return luid$LAYOUT; - } - - private static final long luid$OFFSET = 272; - - /** - * Offset for field: - * {@snippet lang=c : - * char luid[8] - * } - */ - public static final long luid$offset() { - return luid$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char luid[8] - * } - */ - public static MemorySegment luid(MemorySegment struct) { - return struct.asSlice(luid$OFFSET, luid$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char luid[8] - * } - */ - public static void luid(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, luid$OFFSET, luid$LAYOUT.byteSize()); - } - - private static long[] luid$DIMS = { 8 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char luid[8] - * } - */ - public static long[] luid$dimensions() { - return luid$DIMS; - } - private static final VarHandle luid$ELEM_HANDLE = luid$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char luid[8] - * } - */ - public static byte luid(MemorySegment struct, long index0) { - return (byte)luid$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char luid[8] - * } - */ - public static void luid(MemorySegment struct, long index0, byte fieldValue) { - luid$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final OfInt luidDeviceNodeMask$LAYOUT = (OfInt)$LAYOUT.select(groupElement("luidDeviceNodeMask")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int luidDeviceNodeMask - * } - */ - public static final OfInt luidDeviceNodeMask$layout() { - return luidDeviceNodeMask$LAYOUT; - } - - private static final long luidDeviceNodeMask$OFFSET = 280; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int luidDeviceNodeMask - * } - */ - public static final long luidDeviceNodeMask$offset() { - return luidDeviceNodeMask$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int luidDeviceNodeMask - * } - */ - public static int luidDeviceNodeMask(MemorySegment struct) { - return struct.get(luidDeviceNodeMask$LAYOUT, luidDeviceNodeMask$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int luidDeviceNodeMask - * } - */ - public static void luidDeviceNodeMask(MemorySegment struct, int fieldValue) { - struct.set(luidDeviceNodeMask$LAYOUT, luidDeviceNodeMask$OFFSET, fieldValue); - } - - private static final OfLong totalGlobalMem$LAYOUT = (OfLong)$LAYOUT.select(groupElement("totalGlobalMem")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t totalGlobalMem - * } - */ - public static final OfLong totalGlobalMem$layout() { - return totalGlobalMem$LAYOUT; - } - - private static final long totalGlobalMem$OFFSET = 288; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t totalGlobalMem - * } - */ - public static final long totalGlobalMem$offset() { - return totalGlobalMem$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t totalGlobalMem - * } - */ - public static long totalGlobalMem(MemorySegment struct) { - return struct.get(totalGlobalMem$LAYOUT, totalGlobalMem$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t totalGlobalMem - * } - */ - public static void totalGlobalMem(MemorySegment struct, long fieldValue) { - struct.set(totalGlobalMem$LAYOUT, totalGlobalMem$OFFSET, fieldValue); - } - - private static final OfLong sharedMemPerBlock$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sharedMemPerBlock")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t sharedMemPerBlock - * } - */ - public static final OfLong sharedMemPerBlock$layout() { - return sharedMemPerBlock$LAYOUT; - } - - private static final long sharedMemPerBlock$OFFSET = 296; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t sharedMemPerBlock - * } - */ - public static final long sharedMemPerBlock$offset() { - return sharedMemPerBlock$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t sharedMemPerBlock - * } - */ - public static long sharedMemPerBlock(MemorySegment struct) { - return struct.get(sharedMemPerBlock$LAYOUT, sharedMemPerBlock$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t sharedMemPerBlock - * } - */ - public static void sharedMemPerBlock(MemorySegment struct, long fieldValue) { - struct.set(sharedMemPerBlock$LAYOUT, sharedMemPerBlock$OFFSET, fieldValue); - } - - private static final OfInt regsPerBlock$LAYOUT = (OfInt)$LAYOUT.select(groupElement("regsPerBlock")); - - /** - * Layout for field: - * {@snippet lang=c : - * int regsPerBlock - * } - */ - public static final OfInt regsPerBlock$layout() { - return regsPerBlock$LAYOUT; - } - - private static final long regsPerBlock$OFFSET = 304; - - /** - * Offset for field: - * {@snippet lang=c : - * int regsPerBlock - * } - */ - public static final long regsPerBlock$offset() { - return regsPerBlock$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int regsPerBlock - * } - */ - public static int regsPerBlock(MemorySegment struct) { - return struct.get(regsPerBlock$LAYOUT, regsPerBlock$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int regsPerBlock - * } - */ - public static void regsPerBlock(MemorySegment struct, int fieldValue) { - struct.set(regsPerBlock$LAYOUT, regsPerBlock$OFFSET, fieldValue); - } - - private static final OfInt warpSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("warpSize")); - - /** - * Layout for field: - * {@snippet lang=c : - * int warpSize - * } - */ - public static final OfInt warpSize$layout() { - return warpSize$LAYOUT; - } - - private static final long warpSize$OFFSET = 308; - - /** - * Offset for field: - * {@snippet lang=c : - * int warpSize - * } - */ - public static final long warpSize$offset() { - return warpSize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int warpSize - * } - */ - public static int warpSize(MemorySegment struct) { - return struct.get(warpSize$LAYOUT, warpSize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int warpSize - * } - */ - public static void warpSize(MemorySegment struct, int fieldValue) { - struct.set(warpSize$LAYOUT, warpSize$OFFSET, fieldValue); - } - - private static final OfLong memPitch$LAYOUT = (OfLong)$LAYOUT.select(groupElement("memPitch")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t memPitch - * } - */ - public static final OfLong memPitch$layout() { - return memPitch$LAYOUT; - } - - private static final long memPitch$OFFSET = 312; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t memPitch - * } - */ - public static final long memPitch$offset() { - return memPitch$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t memPitch - * } - */ - public static long memPitch(MemorySegment struct) { - return struct.get(memPitch$LAYOUT, memPitch$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t memPitch - * } - */ - public static void memPitch(MemorySegment struct, long fieldValue) { - struct.set(memPitch$LAYOUT, memPitch$OFFSET, fieldValue); - } - - private static final OfInt maxThreadsPerBlock$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxThreadsPerBlock")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxThreadsPerBlock - * } - */ - public static final OfInt maxThreadsPerBlock$layout() { - return maxThreadsPerBlock$LAYOUT; - } - - private static final long maxThreadsPerBlock$OFFSET = 320; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxThreadsPerBlock - * } - */ - public static final long maxThreadsPerBlock$offset() { - return maxThreadsPerBlock$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxThreadsPerBlock - * } - */ - public static int maxThreadsPerBlock(MemorySegment struct) { - return struct.get(maxThreadsPerBlock$LAYOUT, maxThreadsPerBlock$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxThreadsPerBlock - * } - */ - public static void maxThreadsPerBlock(MemorySegment struct, int fieldValue) { - struct.set(maxThreadsPerBlock$LAYOUT, maxThreadsPerBlock$OFFSET, fieldValue); - } - - private static final SequenceLayout maxThreadsDim$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxThreadsDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxThreadsDim[3] - * } - */ - public static final SequenceLayout maxThreadsDim$layout() { - return maxThreadsDim$LAYOUT; - } - - private static final long maxThreadsDim$OFFSET = 324; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxThreadsDim[3] - * } - */ - public static final long maxThreadsDim$offset() { - return maxThreadsDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxThreadsDim[3] - * } - */ - public static MemorySegment maxThreadsDim(MemorySegment struct) { - return struct.asSlice(maxThreadsDim$OFFSET, maxThreadsDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxThreadsDim[3] - * } - */ - public static void maxThreadsDim(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxThreadsDim$OFFSET, maxThreadsDim$LAYOUT.byteSize()); - } - - private static long[] maxThreadsDim$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxThreadsDim[3] - * } - */ - public static long[] maxThreadsDim$dimensions() { - return maxThreadsDim$DIMS; - } - private static final VarHandle maxThreadsDim$ELEM_HANDLE = maxThreadsDim$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxThreadsDim[3] - * } - */ - public static int maxThreadsDim(MemorySegment struct, long index0) { - return (int)maxThreadsDim$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxThreadsDim[3] - * } - */ - public static void maxThreadsDim(MemorySegment struct, long index0, int fieldValue) { - maxThreadsDim$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxGridSize$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxGridSize")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxGridSize[3] - * } - */ - public static final SequenceLayout maxGridSize$layout() { - return maxGridSize$LAYOUT; - } - - private static final long maxGridSize$OFFSET = 336; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxGridSize[3] - * } - */ - public static final long maxGridSize$offset() { - return maxGridSize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxGridSize[3] - * } - */ - public static MemorySegment maxGridSize(MemorySegment struct) { - return struct.asSlice(maxGridSize$OFFSET, maxGridSize$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxGridSize[3] - * } - */ - public static void maxGridSize(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxGridSize$OFFSET, maxGridSize$LAYOUT.byteSize()); - } - - private static long[] maxGridSize$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxGridSize[3] - * } - */ - public static long[] maxGridSize$dimensions() { - return maxGridSize$DIMS; - } - private static final VarHandle maxGridSize$ELEM_HANDLE = maxGridSize$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxGridSize[3] - * } - */ - public static int maxGridSize(MemorySegment struct, long index0) { - return (int)maxGridSize$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxGridSize[3] - * } - */ - public static void maxGridSize(MemorySegment struct, long index0, int fieldValue) { - maxGridSize$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final OfInt clockRate$LAYOUT = (OfInt)$LAYOUT.select(groupElement("clockRate")); - - /** - * Layout for field: - * {@snippet lang=c : - * int clockRate - * } - */ - public static final OfInt clockRate$layout() { - return clockRate$LAYOUT; - } - - private static final long clockRate$OFFSET = 348; - - /** - * Offset for field: - * {@snippet lang=c : - * int clockRate - * } - */ - public static final long clockRate$offset() { - return clockRate$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int clockRate - * } - */ - public static int clockRate(MemorySegment struct) { - return struct.get(clockRate$LAYOUT, clockRate$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int clockRate - * } - */ - public static void clockRate(MemorySegment struct, int fieldValue) { - struct.set(clockRate$LAYOUT, clockRate$OFFSET, fieldValue); - } - - private static final OfLong totalConstMem$LAYOUT = (OfLong)$LAYOUT.select(groupElement("totalConstMem")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t totalConstMem - * } - */ - public static final OfLong totalConstMem$layout() { - return totalConstMem$LAYOUT; - } - - private static final long totalConstMem$OFFSET = 352; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t totalConstMem - * } - */ - public static final long totalConstMem$offset() { - return totalConstMem$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t totalConstMem - * } - */ - public static long totalConstMem(MemorySegment struct) { - return struct.get(totalConstMem$LAYOUT, totalConstMem$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t totalConstMem - * } - */ - public static void totalConstMem(MemorySegment struct, long fieldValue) { - struct.set(totalConstMem$LAYOUT, totalConstMem$OFFSET, fieldValue); - } - - private static final OfInt major$LAYOUT = (OfInt)$LAYOUT.select(groupElement("major")); - - /** - * Layout for field: - * {@snippet lang=c : - * int major - * } - */ - public static final OfInt major$layout() { - return major$LAYOUT; - } - - private static final long major$OFFSET = 360; - - /** - * Offset for field: - * {@snippet lang=c : - * int major - * } - */ - public static final long major$offset() { - return major$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int major - * } - */ - public static int major(MemorySegment struct) { - return struct.get(major$LAYOUT, major$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int major - * } - */ - public static void major(MemorySegment struct, int fieldValue) { - struct.set(major$LAYOUT, major$OFFSET, fieldValue); - } - - private static final OfInt minor$LAYOUT = (OfInt)$LAYOUT.select(groupElement("minor")); - - /** - * Layout for field: - * {@snippet lang=c : - * int minor - * } - */ - public static final OfInt minor$layout() { - return minor$LAYOUT; - } - - private static final long minor$OFFSET = 364; - - /** - * Offset for field: - * {@snippet lang=c : - * int minor - * } - */ - public static final long minor$offset() { - return minor$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int minor - * } - */ - public static int minor(MemorySegment struct) { - return struct.get(minor$LAYOUT, minor$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int minor - * } - */ - public static void minor(MemorySegment struct, int fieldValue) { - struct.set(minor$LAYOUT, minor$OFFSET, fieldValue); - } - - private static final OfLong textureAlignment$LAYOUT = (OfLong)$LAYOUT.select(groupElement("textureAlignment")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t textureAlignment - * } - */ - public static final OfLong textureAlignment$layout() { - return textureAlignment$LAYOUT; - } - - private static final long textureAlignment$OFFSET = 368; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t textureAlignment - * } - */ - public static final long textureAlignment$offset() { - return textureAlignment$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t textureAlignment - * } - */ - public static long textureAlignment(MemorySegment struct) { - return struct.get(textureAlignment$LAYOUT, textureAlignment$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t textureAlignment - * } - */ - public static void textureAlignment(MemorySegment struct, long fieldValue) { - struct.set(textureAlignment$LAYOUT, textureAlignment$OFFSET, fieldValue); - } - - private static final OfLong texturePitchAlignment$LAYOUT = (OfLong)$LAYOUT.select(groupElement("texturePitchAlignment")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t texturePitchAlignment - * } - */ - public static final OfLong texturePitchAlignment$layout() { - return texturePitchAlignment$LAYOUT; - } - - private static final long texturePitchAlignment$OFFSET = 376; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t texturePitchAlignment - * } - */ - public static final long texturePitchAlignment$offset() { - return texturePitchAlignment$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t texturePitchAlignment - * } - */ - public static long texturePitchAlignment(MemorySegment struct) { - return struct.get(texturePitchAlignment$LAYOUT, texturePitchAlignment$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t texturePitchAlignment - * } - */ - public static void texturePitchAlignment(MemorySegment struct, long fieldValue) { - struct.set(texturePitchAlignment$LAYOUT, texturePitchAlignment$OFFSET, fieldValue); - } - - private static final OfInt deviceOverlap$LAYOUT = (OfInt)$LAYOUT.select(groupElement("deviceOverlap")); - - /** - * Layout for field: - * {@snippet lang=c : - * int deviceOverlap - * } - */ - public static final OfInt deviceOverlap$layout() { - return deviceOverlap$LAYOUT; - } - - private static final long deviceOverlap$OFFSET = 384; - - /** - * Offset for field: - * {@snippet lang=c : - * int deviceOverlap - * } - */ - public static final long deviceOverlap$offset() { - return deviceOverlap$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int deviceOverlap - * } - */ - public static int deviceOverlap(MemorySegment struct) { - return struct.get(deviceOverlap$LAYOUT, deviceOverlap$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int deviceOverlap - * } - */ - public static void deviceOverlap(MemorySegment struct, int fieldValue) { - struct.set(deviceOverlap$LAYOUT, deviceOverlap$OFFSET, fieldValue); - } - - private static final OfInt multiProcessorCount$LAYOUT = (OfInt)$LAYOUT.select(groupElement("multiProcessorCount")); - - /** - * Layout for field: - * {@snippet lang=c : - * int multiProcessorCount - * } - */ - public static final OfInt multiProcessorCount$layout() { - return multiProcessorCount$LAYOUT; - } - - private static final long multiProcessorCount$OFFSET = 388; - - /** - * Offset for field: - * {@snippet lang=c : - * int multiProcessorCount - * } - */ - public static final long multiProcessorCount$offset() { - return multiProcessorCount$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int multiProcessorCount - * } - */ - public static int multiProcessorCount(MemorySegment struct) { - return struct.get(multiProcessorCount$LAYOUT, multiProcessorCount$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int multiProcessorCount - * } - */ - public static void multiProcessorCount(MemorySegment struct, int fieldValue) { - struct.set(multiProcessorCount$LAYOUT, multiProcessorCount$OFFSET, fieldValue); - } - - private static final OfInt kernelExecTimeoutEnabled$LAYOUT = (OfInt)$LAYOUT.select(groupElement("kernelExecTimeoutEnabled")); - - /** - * Layout for field: - * {@snippet lang=c : - * int kernelExecTimeoutEnabled - * } - */ - public static final OfInt kernelExecTimeoutEnabled$layout() { - return kernelExecTimeoutEnabled$LAYOUT; - } - - private static final long kernelExecTimeoutEnabled$OFFSET = 392; - - /** - * Offset for field: - * {@snippet lang=c : - * int kernelExecTimeoutEnabled - * } - */ - public static final long kernelExecTimeoutEnabled$offset() { - return kernelExecTimeoutEnabled$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int kernelExecTimeoutEnabled - * } - */ - public static int kernelExecTimeoutEnabled(MemorySegment struct) { - return struct.get(kernelExecTimeoutEnabled$LAYOUT, kernelExecTimeoutEnabled$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int kernelExecTimeoutEnabled - * } - */ - public static void kernelExecTimeoutEnabled(MemorySegment struct, int fieldValue) { - struct.set(kernelExecTimeoutEnabled$LAYOUT, kernelExecTimeoutEnabled$OFFSET, fieldValue); - } - - private static final OfInt integrated$LAYOUT = (OfInt)$LAYOUT.select(groupElement("integrated")); - - /** - * Layout for field: - * {@snippet lang=c : - * int integrated - * } - */ - public static final OfInt integrated$layout() { - return integrated$LAYOUT; - } - - private static final long integrated$OFFSET = 396; - - /** - * Offset for field: - * {@snippet lang=c : - * int integrated - * } - */ - public static final long integrated$offset() { - return integrated$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int integrated - * } - */ - public static int integrated(MemorySegment struct) { - return struct.get(integrated$LAYOUT, integrated$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int integrated - * } - */ - public static void integrated(MemorySegment struct, int fieldValue) { - struct.set(integrated$LAYOUT, integrated$OFFSET, fieldValue); - } - - private static final OfInt canMapHostMemory$LAYOUT = (OfInt)$LAYOUT.select(groupElement("canMapHostMemory")); - - /** - * Layout for field: - * {@snippet lang=c : - * int canMapHostMemory - * } - */ - public static final OfInt canMapHostMemory$layout() { - return canMapHostMemory$LAYOUT; - } - - private static final long canMapHostMemory$OFFSET = 400; - - /** - * Offset for field: - * {@snippet lang=c : - * int canMapHostMemory - * } - */ - public static final long canMapHostMemory$offset() { - return canMapHostMemory$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int canMapHostMemory - * } - */ - public static int canMapHostMemory(MemorySegment struct) { - return struct.get(canMapHostMemory$LAYOUT, canMapHostMemory$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int canMapHostMemory - * } - */ - public static void canMapHostMemory(MemorySegment struct, int fieldValue) { - struct.set(canMapHostMemory$LAYOUT, canMapHostMemory$OFFSET, fieldValue); - } - - private static final OfInt computeMode$LAYOUT = (OfInt)$LAYOUT.select(groupElement("computeMode")); - - /** - * Layout for field: - * {@snippet lang=c : - * int computeMode - * } - */ - public static final OfInt computeMode$layout() { - return computeMode$LAYOUT; - } - - private static final long computeMode$OFFSET = 404; - - /** - * Offset for field: - * {@snippet lang=c : - * int computeMode - * } - */ - public static final long computeMode$offset() { - return computeMode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int computeMode - * } - */ - public static int computeMode(MemorySegment struct) { - return struct.get(computeMode$LAYOUT, computeMode$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int computeMode - * } - */ - public static void computeMode(MemorySegment struct, int fieldValue) { - struct.set(computeMode$LAYOUT, computeMode$OFFSET, fieldValue); - } - - private static final OfInt maxTexture1D$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxTexture1D")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture1D - * } - */ - public static final OfInt maxTexture1D$layout() { - return maxTexture1D$LAYOUT; - } - - private static final long maxTexture1D$OFFSET = 408; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture1D - * } - */ - public static final long maxTexture1D$offset() { - return maxTexture1D$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture1D - * } - */ - public static int maxTexture1D(MemorySegment struct) { - return struct.get(maxTexture1D$LAYOUT, maxTexture1D$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture1D - * } - */ - public static void maxTexture1D(MemorySegment struct, int fieldValue) { - struct.set(maxTexture1D$LAYOUT, maxTexture1D$OFFSET, fieldValue); - } - - private static final OfInt maxTexture1DMipmap$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxTexture1DMipmap")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture1DMipmap - * } - */ - public static final OfInt maxTexture1DMipmap$layout() { - return maxTexture1DMipmap$LAYOUT; - } - - private static final long maxTexture1DMipmap$OFFSET = 412; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture1DMipmap - * } - */ - public static final long maxTexture1DMipmap$offset() { - return maxTexture1DMipmap$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture1DMipmap - * } - */ - public static int maxTexture1DMipmap(MemorySegment struct) { - return struct.get(maxTexture1DMipmap$LAYOUT, maxTexture1DMipmap$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture1DMipmap - * } - */ - public static void maxTexture1DMipmap(MemorySegment struct, int fieldValue) { - struct.set(maxTexture1DMipmap$LAYOUT, maxTexture1DMipmap$OFFSET, fieldValue); - } - - private static final OfInt maxTexture1DLinear$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxTexture1DLinear")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture1DLinear - * } - */ - public static final OfInt maxTexture1DLinear$layout() { - return maxTexture1DLinear$LAYOUT; - } - - private static final long maxTexture1DLinear$OFFSET = 416; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture1DLinear - * } - */ - public static final long maxTexture1DLinear$offset() { - return maxTexture1DLinear$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture1DLinear - * } - */ - public static int maxTexture1DLinear(MemorySegment struct) { - return struct.get(maxTexture1DLinear$LAYOUT, maxTexture1DLinear$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture1DLinear - * } - */ - public static void maxTexture1DLinear(MemorySegment struct, int fieldValue) { - struct.set(maxTexture1DLinear$LAYOUT, maxTexture1DLinear$OFFSET, fieldValue); - } - - private static final SequenceLayout maxTexture2D$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture2D")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture2D[2] - * } - */ - public static final SequenceLayout maxTexture2D$layout() { - return maxTexture2D$LAYOUT; - } - - private static final long maxTexture2D$OFFSET = 420; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture2D[2] - * } - */ - public static final long maxTexture2D$offset() { - return maxTexture2D$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture2D[2] - * } - */ - public static MemorySegment maxTexture2D(MemorySegment struct) { - return struct.asSlice(maxTexture2D$OFFSET, maxTexture2D$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture2D[2] - * } - */ - public static void maxTexture2D(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxTexture2D$OFFSET, maxTexture2D$LAYOUT.byteSize()); - } - - private static long[] maxTexture2D$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxTexture2D[2] - * } - */ - public static long[] maxTexture2D$dimensions() { - return maxTexture2D$DIMS; - } - private static final VarHandle maxTexture2D$ELEM_HANDLE = maxTexture2D$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxTexture2D[2] - * } - */ - public static int maxTexture2D(MemorySegment struct, long index0) { - return (int)maxTexture2D$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxTexture2D[2] - * } - */ - public static void maxTexture2D(MemorySegment struct, long index0, int fieldValue) { - maxTexture2D$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxTexture2DMipmap$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture2DMipmap")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture2DMipmap[2] - * } - */ - public static final SequenceLayout maxTexture2DMipmap$layout() { - return maxTexture2DMipmap$LAYOUT; - } - - private static final long maxTexture2DMipmap$OFFSET = 428; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture2DMipmap[2] - * } - */ - public static final long maxTexture2DMipmap$offset() { - return maxTexture2DMipmap$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture2DMipmap[2] - * } - */ - public static MemorySegment maxTexture2DMipmap(MemorySegment struct) { - return struct.asSlice(maxTexture2DMipmap$OFFSET, maxTexture2DMipmap$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture2DMipmap[2] - * } - */ - public static void maxTexture2DMipmap(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxTexture2DMipmap$OFFSET, maxTexture2DMipmap$LAYOUT.byteSize()); - } - - private static long[] maxTexture2DMipmap$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxTexture2DMipmap[2] - * } - */ - public static long[] maxTexture2DMipmap$dimensions() { - return maxTexture2DMipmap$DIMS; - } - private static final VarHandle maxTexture2DMipmap$ELEM_HANDLE = maxTexture2DMipmap$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxTexture2DMipmap[2] - * } - */ - public static int maxTexture2DMipmap(MemorySegment struct, long index0) { - return (int)maxTexture2DMipmap$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxTexture2DMipmap[2] - * } - */ - public static void maxTexture2DMipmap(MemorySegment struct, long index0, int fieldValue) { - maxTexture2DMipmap$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxTexture2DLinear$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture2DLinear")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture2DLinear[3] - * } - */ - public static final SequenceLayout maxTexture2DLinear$layout() { - return maxTexture2DLinear$LAYOUT; - } - - private static final long maxTexture2DLinear$OFFSET = 436; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture2DLinear[3] - * } - */ - public static final long maxTexture2DLinear$offset() { - return maxTexture2DLinear$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture2DLinear[3] - * } - */ - public static MemorySegment maxTexture2DLinear(MemorySegment struct) { - return struct.asSlice(maxTexture2DLinear$OFFSET, maxTexture2DLinear$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture2DLinear[3] - * } - */ - public static void maxTexture2DLinear(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxTexture2DLinear$OFFSET, maxTexture2DLinear$LAYOUT.byteSize()); - } - - private static long[] maxTexture2DLinear$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxTexture2DLinear[3] - * } - */ - public static long[] maxTexture2DLinear$dimensions() { - return maxTexture2DLinear$DIMS; - } - private static final VarHandle maxTexture2DLinear$ELEM_HANDLE = maxTexture2DLinear$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxTexture2DLinear[3] - * } - */ - public static int maxTexture2DLinear(MemorySegment struct, long index0) { - return (int)maxTexture2DLinear$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxTexture2DLinear[3] - * } - */ - public static void maxTexture2DLinear(MemorySegment struct, long index0, int fieldValue) { - maxTexture2DLinear$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxTexture2DGather$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture2DGather")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture2DGather[2] - * } - */ - public static final SequenceLayout maxTexture2DGather$layout() { - return maxTexture2DGather$LAYOUT; - } - - private static final long maxTexture2DGather$OFFSET = 448; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture2DGather[2] - * } - */ - public static final long maxTexture2DGather$offset() { - return maxTexture2DGather$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture2DGather[2] - * } - */ - public static MemorySegment maxTexture2DGather(MemorySegment struct) { - return struct.asSlice(maxTexture2DGather$OFFSET, maxTexture2DGather$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture2DGather[2] - * } - */ - public static void maxTexture2DGather(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxTexture2DGather$OFFSET, maxTexture2DGather$LAYOUT.byteSize()); - } - - private static long[] maxTexture2DGather$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxTexture2DGather[2] - * } - */ - public static long[] maxTexture2DGather$dimensions() { - return maxTexture2DGather$DIMS; - } - private static final VarHandle maxTexture2DGather$ELEM_HANDLE = maxTexture2DGather$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxTexture2DGather[2] - * } - */ - public static int maxTexture2DGather(MemorySegment struct, long index0) { - return (int)maxTexture2DGather$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxTexture2DGather[2] - * } - */ - public static void maxTexture2DGather(MemorySegment struct, long index0, int fieldValue) { - maxTexture2DGather$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxTexture3D$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture3D")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture3D[3] - * } - */ - public static final SequenceLayout maxTexture3D$layout() { - return maxTexture3D$LAYOUT; - } - - private static final long maxTexture3D$OFFSET = 456; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture3D[3] - * } - */ - public static final long maxTexture3D$offset() { - return maxTexture3D$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture3D[3] - * } - */ - public static MemorySegment maxTexture3D(MemorySegment struct) { - return struct.asSlice(maxTexture3D$OFFSET, maxTexture3D$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture3D[3] - * } - */ - public static void maxTexture3D(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxTexture3D$OFFSET, maxTexture3D$LAYOUT.byteSize()); - } - - private static long[] maxTexture3D$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxTexture3D[3] - * } - */ - public static long[] maxTexture3D$dimensions() { - return maxTexture3D$DIMS; - } - private static final VarHandle maxTexture3D$ELEM_HANDLE = maxTexture3D$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxTexture3D[3] - * } - */ - public static int maxTexture3D(MemorySegment struct, long index0) { - return (int)maxTexture3D$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxTexture3D[3] - * } - */ - public static void maxTexture3D(MemorySegment struct, long index0, int fieldValue) { - maxTexture3D$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxTexture3DAlt$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture3DAlt")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture3DAlt[3] - * } - */ - public static final SequenceLayout maxTexture3DAlt$layout() { - return maxTexture3DAlt$LAYOUT; - } - - private static final long maxTexture3DAlt$OFFSET = 468; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture3DAlt[3] - * } - */ - public static final long maxTexture3DAlt$offset() { - return maxTexture3DAlt$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture3DAlt[3] - * } - */ - public static MemorySegment maxTexture3DAlt(MemorySegment struct) { - return struct.asSlice(maxTexture3DAlt$OFFSET, maxTexture3DAlt$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture3DAlt[3] - * } - */ - public static void maxTexture3DAlt(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxTexture3DAlt$OFFSET, maxTexture3DAlt$LAYOUT.byteSize()); - } - - private static long[] maxTexture3DAlt$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxTexture3DAlt[3] - * } - */ - public static long[] maxTexture3DAlt$dimensions() { - return maxTexture3DAlt$DIMS; - } - private static final VarHandle maxTexture3DAlt$ELEM_HANDLE = maxTexture3DAlt$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxTexture3DAlt[3] - * } - */ - public static int maxTexture3DAlt(MemorySegment struct, long index0) { - return (int)maxTexture3DAlt$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxTexture3DAlt[3] - * } - */ - public static void maxTexture3DAlt(MemorySegment struct, long index0, int fieldValue) { - maxTexture3DAlt$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final OfInt maxTextureCubemap$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxTextureCubemap")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTextureCubemap - * } - */ - public static final OfInt maxTextureCubemap$layout() { - return maxTextureCubemap$LAYOUT; - } - - private static final long maxTextureCubemap$OFFSET = 480; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTextureCubemap - * } - */ - public static final long maxTextureCubemap$offset() { - return maxTextureCubemap$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTextureCubemap - * } - */ - public static int maxTextureCubemap(MemorySegment struct) { - return struct.get(maxTextureCubemap$LAYOUT, maxTextureCubemap$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTextureCubemap - * } - */ - public static void maxTextureCubemap(MemorySegment struct, int fieldValue) { - struct.set(maxTextureCubemap$LAYOUT, maxTextureCubemap$OFFSET, fieldValue); - } - - private static final SequenceLayout maxTexture1DLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture1DLayered")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture1DLayered[2] - * } - */ - public static final SequenceLayout maxTexture1DLayered$layout() { - return maxTexture1DLayered$LAYOUT; - } - - private static final long maxTexture1DLayered$OFFSET = 484; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture1DLayered[2] - * } - */ - public static final long maxTexture1DLayered$offset() { - return maxTexture1DLayered$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture1DLayered[2] - * } - */ - public static MemorySegment maxTexture1DLayered(MemorySegment struct) { - return struct.asSlice(maxTexture1DLayered$OFFSET, maxTexture1DLayered$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture1DLayered[2] - * } - */ - public static void maxTexture1DLayered(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxTexture1DLayered$OFFSET, maxTexture1DLayered$LAYOUT.byteSize()); - } - - private static long[] maxTexture1DLayered$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxTexture1DLayered[2] - * } - */ - public static long[] maxTexture1DLayered$dimensions() { - return maxTexture1DLayered$DIMS; - } - private static final VarHandle maxTexture1DLayered$ELEM_HANDLE = maxTexture1DLayered$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxTexture1DLayered[2] - * } - */ - public static int maxTexture1DLayered(MemorySegment struct, long index0) { - return (int)maxTexture1DLayered$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxTexture1DLayered[2] - * } - */ - public static void maxTexture1DLayered(MemorySegment struct, long index0, int fieldValue) { - maxTexture1DLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxTexture2DLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTexture2DLayered")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTexture2DLayered[3] - * } - */ - public static final SequenceLayout maxTexture2DLayered$layout() { - return maxTexture2DLayered$LAYOUT; - } - - private static final long maxTexture2DLayered$OFFSET = 492; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTexture2DLayered[3] - * } - */ - public static final long maxTexture2DLayered$offset() { - return maxTexture2DLayered$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTexture2DLayered[3] - * } - */ - public static MemorySegment maxTexture2DLayered(MemorySegment struct) { - return struct.asSlice(maxTexture2DLayered$OFFSET, maxTexture2DLayered$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTexture2DLayered[3] - * } - */ - public static void maxTexture2DLayered(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxTexture2DLayered$OFFSET, maxTexture2DLayered$LAYOUT.byteSize()); - } - - private static long[] maxTexture2DLayered$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxTexture2DLayered[3] - * } - */ - public static long[] maxTexture2DLayered$dimensions() { - return maxTexture2DLayered$DIMS; - } - private static final VarHandle maxTexture2DLayered$ELEM_HANDLE = maxTexture2DLayered$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxTexture2DLayered[3] - * } - */ - public static int maxTexture2DLayered(MemorySegment struct, long index0) { - return (int)maxTexture2DLayered$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxTexture2DLayered[3] - * } - */ - public static void maxTexture2DLayered(MemorySegment struct, long index0, int fieldValue) { - maxTexture2DLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxTextureCubemapLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxTextureCubemapLayered")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxTextureCubemapLayered[2] - * } - */ - public static final SequenceLayout maxTextureCubemapLayered$layout() { - return maxTextureCubemapLayered$LAYOUT; - } - - private static final long maxTextureCubemapLayered$OFFSET = 504; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxTextureCubemapLayered[2] - * } - */ - public static final long maxTextureCubemapLayered$offset() { - return maxTextureCubemapLayered$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxTextureCubemapLayered[2] - * } - */ - public static MemorySegment maxTextureCubemapLayered(MemorySegment struct) { - return struct.asSlice(maxTextureCubemapLayered$OFFSET, maxTextureCubemapLayered$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxTextureCubemapLayered[2] - * } - */ - public static void maxTextureCubemapLayered(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxTextureCubemapLayered$OFFSET, maxTextureCubemapLayered$LAYOUT.byteSize()); - } - - private static long[] maxTextureCubemapLayered$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxTextureCubemapLayered[2] - * } - */ - public static long[] maxTextureCubemapLayered$dimensions() { - return maxTextureCubemapLayered$DIMS; - } - private static final VarHandle maxTextureCubemapLayered$ELEM_HANDLE = maxTextureCubemapLayered$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxTextureCubemapLayered[2] - * } - */ - public static int maxTextureCubemapLayered(MemorySegment struct, long index0) { - return (int)maxTextureCubemapLayered$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxTextureCubemapLayered[2] - * } - */ - public static void maxTextureCubemapLayered(MemorySegment struct, long index0, int fieldValue) { - maxTextureCubemapLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final OfInt maxSurface1D$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxSurface1D")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxSurface1D - * } - */ - public static final OfInt maxSurface1D$layout() { - return maxSurface1D$LAYOUT; - } - - private static final long maxSurface1D$OFFSET = 512; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxSurface1D - * } - */ - public static final long maxSurface1D$offset() { - return maxSurface1D$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxSurface1D - * } - */ - public static int maxSurface1D(MemorySegment struct) { - return struct.get(maxSurface1D$LAYOUT, maxSurface1D$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxSurface1D - * } - */ - public static void maxSurface1D(MemorySegment struct, int fieldValue) { - struct.set(maxSurface1D$LAYOUT, maxSurface1D$OFFSET, fieldValue); - } - - private static final SequenceLayout maxSurface2D$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxSurface2D")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxSurface2D[2] - * } - */ - public static final SequenceLayout maxSurface2D$layout() { - return maxSurface2D$LAYOUT; - } - - private static final long maxSurface2D$OFFSET = 516; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxSurface2D[2] - * } - */ - public static final long maxSurface2D$offset() { - return maxSurface2D$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxSurface2D[2] - * } - */ - public static MemorySegment maxSurface2D(MemorySegment struct) { - return struct.asSlice(maxSurface2D$OFFSET, maxSurface2D$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxSurface2D[2] - * } - */ - public static void maxSurface2D(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxSurface2D$OFFSET, maxSurface2D$LAYOUT.byteSize()); - } - - private static long[] maxSurface2D$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxSurface2D[2] - * } - */ - public static long[] maxSurface2D$dimensions() { - return maxSurface2D$DIMS; - } - private static final VarHandle maxSurface2D$ELEM_HANDLE = maxSurface2D$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxSurface2D[2] - * } - */ - public static int maxSurface2D(MemorySegment struct, long index0) { - return (int)maxSurface2D$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxSurface2D[2] - * } - */ - public static void maxSurface2D(MemorySegment struct, long index0, int fieldValue) { - maxSurface2D$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxSurface3D$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxSurface3D")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxSurface3D[3] - * } - */ - public static final SequenceLayout maxSurface3D$layout() { - return maxSurface3D$LAYOUT; - } - - private static final long maxSurface3D$OFFSET = 524; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxSurface3D[3] - * } - */ - public static final long maxSurface3D$offset() { - return maxSurface3D$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxSurface3D[3] - * } - */ - public static MemorySegment maxSurface3D(MemorySegment struct) { - return struct.asSlice(maxSurface3D$OFFSET, maxSurface3D$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxSurface3D[3] - * } - */ - public static void maxSurface3D(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxSurface3D$OFFSET, maxSurface3D$LAYOUT.byteSize()); - } - - private static long[] maxSurface3D$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxSurface3D[3] - * } - */ - public static long[] maxSurface3D$dimensions() { - return maxSurface3D$DIMS; - } - private static final VarHandle maxSurface3D$ELEM_HANDLE = maxSurface3D$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxSurface3D[3] - * } - */ - public static int maxSurface3D(MemorySegment struct, long index0) { - return (int)maxSurface3D$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxSurface3D[3] - * } - */ - public static void maxSurface3D(MemorySegment struct, long index0, int fieldValue) { - maxSurface3D$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxSurface1DLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxSurface1DLayered")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxSurface1DLayered[2] - * } - */ - public static final SequenceLayout maxSurface1DLayered$layout() { - return maxSurface1DLayered$LAYOUT; - } - - private static final long maxSurface1DLayered$OFFSET = 536; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxSurface1DLayered[2] - * } - */ - public static final long maxSurface1DLayered$offset() { - return maxSurface1DLayered$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxSurface1DLayered[2] - * } - */ - public static MemorySegment maxSurface1DLayered(MemorySegment struct) { - return struct.asSlice(maxSurface1DLayered$OFFSET, maxSurface1DLayered$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxSurface1DLayered[2] - * } - */ - public static void maxSurface1DLayered(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxSurface1DLayered$OFFSET, maxSurface1DLayered$LAYOUT.byteSize()); - } - - private static long[] maxSurface1DLayered$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxSurface1DLayered[2] - * } - */ - public static long[] maxSurface1DLayered$dimensions() { - return maxSurface1DLayered$DIMS; - } - private static final VarHandle maxSurface1DLayered$ELEM_HANDLE = maxSurface1DLayered$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxSurface1DLayered[2] - * } - */ - public static int maxSurface1DLayered(MemorySegment struct, long index0) { - return (int)maxSurface1DLayered$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxSurface1DLayered[2] - * } - */ - public static void maxSurface1DLayered(MemorySegment struct, long index0, int fieldValue) { - maxSurface1DLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout maxSurface2DLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxSurface2DLayered")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxSurface2DLayered[3] - * } - */ - public static final SequenceLayout maxSurface2DLayered$layout() { - return maxSurface2DLayered$LAYOUT; - } - - private static final long maxSurface2DLayered$OFFSET = 544; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxSurface2DLayered[3] - * } - */ - public static final long maxSurface2DLayered$offset() { - return maxSurface2DLayered$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxSurface2DLayered[3] - * } - */ - public static MemorySegment maxSurface2DLayered(MemorySegment struct) { - return struct.asSlice(maxSurface2DLayered$OFFSET, maxSurface2DLayered$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxSurface2DLayered[3] - * } - */ - public static void maxSurface2DLayered(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxSurface2DLayered$OFFSET, maxSurface2DLayered$LAYOUT.byteSize()); - } - - private static long[] maxSurface2DLayered$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxSurface2DLayered[3] - * } - */ - public static long[] maxSurface2DLayered$dimensions() { - return maxSurface2DLayered$DIMS; - } - private static final VarHandle maxSurface2DLayered$ELEM_HANDLE = maxSurface2DLayered$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxSurface2DLayered[3] - * } - */ - public static int maxSurface2DLayered(MemorySegment struct, long index0) { - return (int)maxSurface2DLayered$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxSurface2DLayered[3] - * } - */ - public static void maxSurface2DLayered(MemorySegment struct, long index0, int fieldValue) { - maxSurface2DLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final OfInt maxSurfaceCubemap$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxSurfaceCubemap")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxSurfaceCubemap - * } - */ - public static final OfInt maxSurfaceCubemap$layout() { - return maxSurfaceCubemap$LAYOUT; - } - - private static final long maxSurfaceCubemap$OFFSET = 556; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxSurfaceCubemap - * } - */ - public static final long maxSurfaceCubemap$offset() { - return maxSurfaceCubemap$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxSurfaceCubemap - * } - */ - public static int maxSurfaceCubemap(MemorySegment struct) { - return struct.get(maxSurfaceCubemap$LAYOUT, maxSurfaceCubemap$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxSurfaceCubemap - * } - */ - public static void maxSurfaceCubemap(MemorySegment struct, int fieldValue) { - struct.set(maxSurfaceCubemap$LAYOUT, maxSurfaceCubemap$OFFSET, fieldValue); - } - - private static final SequenceLayout maxSurfaceCubemapLayered$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("maxSurfaceCubemapLayered")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxSurfaceCubemapLayered[2] - * } - */ - public static final SequenceLayout maxSurfaceCubemapLayered$layout() { - return maxSurfaceCubemapLayered$LAYOUT; - } - - private static final long maxSurfaceCubemapLayered$OFFSET = 560; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxSurfaceCubemapLayered[2] - * } - */ - public static final long maxSurfaceCubemapLayered$offset() { - return maxSurfaceCubemapLayered$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxSurfaceCubemapLayered[2] - * } - */ - public static MemorySegment maxSurfaceCubemapLayered(MemorySegment struct) { - return struct.asSlice(maxSurfaceCubemapLayered$OFFSET, maxSurfaceCubemapLayered$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxSurfaceCubemapLayered[2] - * } - */ - public static void maxSurfaceCubemapLayered(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, maxSurfaceCubemapLayered$OFFSET, maxSurfaceCubemapLayered$LAYOUT.byteSize()); - } - - private static long[] maxSurfaceCubemapLayered$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int maxSurfaceCubemapLayered[2] - * } - */ - public static long[] maxSurfaceCubemapLayered$dimensions() { - return maxSurfaceCubemapLayered$DIMS; - } - private static final VarHandle maxSurfaceCubemapLayered$ELEM_HANDLE = maxSurfaceCubemapLayered$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int maxSurfaceCubemapLayered[2] - * } - */ - public static int maxSurfaceCubemapLayered(MemorySegment struct, long index0) { - return (int)maxSurfaceCubemapLayered$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int maxSurfaceCubemapLayered[2] - * } - */ - public static void maxSurfaceCubemapLayered(MemorySegment struct, long index0, int fieldValue) { - maxSurfaceCubemapLayered$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final OfLong surfaceAlignment$LAYOUT = (OfLong)$LAYOUT.select(groupElement("surfaceAlignment")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t surfaceAlignment - * } - */ - public static final OfLong surfaceAlignment$layout() { - return surfaceAlignment$LAYOUT; - } - - private static final long surfaceAlignment$OFFSET = 568; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t surfaceAlignment - * } - */ - public static final long surfaceAlignment$offset() { - return surfaceAlignment$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t surfaceAlignment - * } - */ - public static long surfaceAlignment(MemorySegment struct) { - return struct.get(surfaceAlignment$LAYOUT, surfaceAlignment$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t surfaceAlignment - * } - */ - public static void surfaceAlignment(MemorySegment struct, long fieldValue) { - struct.set(surfaceAlignment$LAYOUT, surfaceAlignment$OFFSET, fieldValue); - } - - private static final OfInt concurrentKernels$LAYOUT = (OfInt)$LAYOUT.select(groupElement("concurrentKernels")); - - /** - * Layout for field: - * {@snippet lang=c : - * int concurrentKernels - * } - */ - public static final OfInt concurrentKernels$layout() { - return concurrentKernels$LAYOUT; - } - - private static final long concurrentKernels$OFFSET = 576; - - /** - * Offset for field: - * {@snippet lang=c : - * int concurrentKernels - * } - */ - public static final long concurrentKernels$offset() { - return concurrentKernels$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int concurrentKernels - * } - */ - public static int concurrentKernels(MemorySegment struct) { - return struct.get(concurrentKernels$LAYOUT, concurrentKernels$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int concurrentKernels - * } - */ - public static void concurrentKernels(MemorySegment struct, int fieldValue) { - struct.set(concurrentKernels$LAYOUT, concurrentKernels$OFFSET, fieldValue); - } - - private static final OfInt ECCEnabled$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ECCEnabled")); - - /** - * Layout for field: - * {@snippet lang=c : - * int ECCEnabled - * } - */ - public static final OfInt ECCEnabled$layout() { - return ECCEnabled$LAYOUT; - } - - private static final long ECCEnabled$OFFSET = 580; - - /** - * Offset for field: - * {@snippet lang=c : - * int ECCEnabled - * } - */ - public static final long ECCEnabled$offset() { - return ECCEnabled$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int ECCEnabled - * } - */ - public static int ECCEnabled(MemorySegment struct) { - return struct.get(ECCEnabled$LAYOUT, ECCEnabled$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int ECCEnabled - * } - */ - public static void ECCEnabled(MemorySegment struct, int fieldValue) { - struct.set(ECCEnabled$LAYOUT, ECCEnabled$OFFSET, fieldValue); - } - - private static final OfInt pciBusID$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pciBusID")); - - /** - * Layout for field: - * {@snippet lang=c : - * int pciBusID - * } - */ - public static final OfInt pciBusID$layout() { - return pciBusID$LAYOUT; - } - - private static final long pciBusID$OFFSET = 584; - - /** - * Offset for field: - * {@snippet lang=c : - * int pciBusID - * } - */ - public static final long pciBusID$offset() { - return pciBusID$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int pciBusID - * } - */ - public static int pciBusID(MemorySegment struct) { - return struct.get(pciBusID$LAYOUT, pciBusID$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int pciBusID - * } - */ - public static void pciBusID(MemorySegment struct, int fieldValue) { - struct.set(pciBusID$LAYOUT, pciBusID$OFFSET, fieldValue); - } - - private static final OfInt pciDeviceID$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pciDeviceID")); - - /** - * Layout for field: - * {@snippet lang=c : - * int pciDeviceID - * } - */ - public static final OfInt pciDeviceID$layout() { - return pciDeviceID$LAYOUT; - } - - private static final long pciDeviceID$OFFSET = 588; - - /** - * Offset for field: - * {@snippet lang=c : - * int pciDeviceID - * } - */ - public static final long pciDeviceID$offset() { - return pciDeviceID$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int pciDeviceID - * } - */ - public static int pciDeviceID(MemorySegment struct) { - return struct.get(pciDeviceID$LAYOUT, pciDeviceID$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int pciDeviceID - * } - */ - public static void pciDeviceID(MemorySegment struct, int fieldValue) { - struct.set(pciDeviceID$LAYOUT, pciDeviceID$OFFSET, fieldValue); - } - - private static final OfInt pciDomainID$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pciDomainID")); - - /** - * Layout for field: - * {@snippet lang=c : - * int pciDomainID - * } - */ - public static final OfInt pciDomainID$layout() { - return pciDomainID$LAYOUT; - } - - private static final long pciDomainID$OFFSET = 592; - - /** - * Offset for field: - * {@snippet lang=c : - * int pciDomainID - * } - */ - public static final long pciDomainID$offset() { - return pciDomainID$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int pciDomainID - * } - */ - public static int pciDomainID(MemorySegment struct) { - return struct.get(pciDomainID$LAYOUT, pciDomainID$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int pciDomainID - * } - */ - public static void pciDomainID(MemorySegment struct, int fieldValue) { - struct.set(pciDomainID$LAYOUT, pciDomainID$OFFSET, fieldValue); - } - - private static final OfInt tccDriver$LAYOUT = (OfInt)$LAYOUT.select(groupElement("tccDriver")); - - /** - * Layout for field: - * {@snippet lang=c : - * int tccDriver - * } - */ - public static final OfInt tccDriver$layout() { - return tccDriver$LAYOUT; - } - - private static final long tccDriver$OFFSET = 596; - - /** - * Offset for field: - * {@snippet lang=c : - * int tccDriver - * } - */ - public static final long tccDriver$offset() { - return tccDriver$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int tccDriver - * } - */ - public static int tccDriver(MemorySegment struct) { - return struct.get(tccDriver$LAYOUT, tccDriver$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int tccDriver - * } - */ - public static void tccDriver(MemorySegment struct, int fieldValue) { - struct.set(tccDriver$LAYOUT, tccDriver$OFFSET, fieldValue); - } - - private static final OfInt asyncEngineCount$LAYOUT = (OfInt)$LAYOUT.select(groupElement("asyncEngineCount")); - - /** - * Layout for field: - * {@snippet lang=c : - * int asyncEngineCount - * } - */ - public static final OfInt asyncEngineCount$layout() { - return asyncEngineCount$LAYOUT; - } - - private static final long asyncEngineCount$OFFSET = 600; - - /** - * Offset for field: - * {@snippet lang=c : - * int asyncEngineCount - * } - */ - public static final long asyncEngineCount$offset() { - return asyncEngineCount$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int asyncEngineCount - * } - */ - public static int asyncEngineCount(MemorySegment struct) { - return struct.get(asyncEngineCount$LAYOUT, asyncEngineCount$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int asyncEngineCount - * } - */ - public static void asyncEngineCount(MemorySegment struct, int fieldValue) { - struct.set(asyncEngineCount$LAYOUT, asyncEngineCount$OFFSET, fieldValue); - } - - private static final OfInt unifiedAddressing$LAYOUT = (OfInt)$LAYOUT.select(groupElement("unifiedAddressing")); - - /** - * Layout for field: - * {@snippet lang=c : - * int unifiedAddressing - * } - */ - public static final OfInt unifiedAddressing$layout() { - return unifiedAddressing$LAYOUT; - } - - private static final long unifiedAddressing$OFFSET = 604; - - /** - * Offset for field: - * {@snippet lang=c : - * int unifiedAddressing - * } - */ - public static final long unifiedAddressing$offset() { - return unifiedAddressing$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int unifiedAddressing - * } - */ - public static int unifiedAddressing(MemorySegment struct) { - return struct.get(unifiedAddressing$LAYOUT, unifiedAddressing$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int unifiedAddressing - * } - */ - public static void unifiedAddressing(MemorySegment struct, int fieldValue) { - struct.set(unifiedAddressing$LAYOUT, unifiedAddressing$OFFSET, fieldValue); - } - - private static final OfInt memoryClockRate$LAYOUT = (OfInt)$LAYOUT.select(groupElement("memoryClockRate")); - - /** - * Layout for field: - * {@snippet lang=c : - * int memoryClockRate - * } - */ - public static final OfInt memoryClockRate$layout() { - return memoryClockRate$LAYOUT; - } - - private static final long memoryClockRate$OFFSET = 608; - - /** - * Offset for field: - * {@snippet lang=c : - * int memoryClockRate - * } - */ - public static final long memoryClockRate$offset() { - return memoryClockRate$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int memoryClockRate - * } - */ - public static int memoryClockRate(MemorySegment struct) { - return struct.get(memoryClockRate$LAYOUT, memoryClockRate$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int memoryClockRate - * } - */ - public static void memoryClockRate(MemorySegment struct, int fieldValue) { - struct.set(memoryClockRate$LAYOUT, memoryClockRate$OFFSET, fieldValue); - } - - private static final OfInt memoryBusWidth$LAYOUT = (OfInt)$LAYOUT.select(groupElement("memoryBusWidth")); - - /** - * Layout for field: - * {@snippet lang=c : - * int memoryBusWidth - * } - */ - public static final OfInt memoryBusWidth$layout() { - return memoryBusWidth$LAYOUT; - } - - private static final long memoryBusWidth$OFFSET = 612; - - /** - * Offset for field: - * {@snippet lang=c : - * int memoryBusWidth - * } - */ - public static final long memoryBusWidth$offset() { - return memoryBusWidth$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int memoryBusWidth - * } - */ - public static int memoryBusWidth(MemorySegment struct) { - return struct.get(memoryBusWidth$LAYOUT, memoryBusWidth$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int memoryBusWidth - * } - */ - public static void memoryBusWidth(MemorySegment struct, int fieldValue) { - struct.set(memoryBusWidth$LAYOUT, memoryBusWidth$OFFSET, fieldValue); - } - - private static final OfInt l2CacheSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("l2CacheSize")); - - /** - * Layout for field: - * {@snippet lang=c : - * int l2CacheSize - * } - */ - public static final OfInt l2CacheSize$layout() { - return l2CacheSize$LAYOUT; - } - - private static final long l2CacheSize$OFFSET = 616; - - /** - * Offset for field: - * {@snippet lang=c : - * int l2CacheSize - * } - */ - public static final long l2CacheSize$offset() { - return l2CacheSize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int l2CacheSize - * } - */ - public static int l2CacheSize(MemorySegment struct) { - return struct.get(l2CacheSize$LAYOUT, l2CacheSize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int l2CacheSize - * } - */ - public static void l2CacheSize(MemorySegment struct, int fieldValue) { - struct.set(l2CacheSize$LAYOUT, l2CacheSize$OFFSET, fieldValue); - } - - private static final OfInt persistingL2CacheMaxSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("persistingL2CacheMaxSize")); - - /** - * Layout for field: - * {@snippet lang=c : - * int persistingL2CacheMaxSize - * } - */ - public static final OfInt persistingL2CacheMaxSize$layout() { - return persistingL2CacheMaxSize$LAYOUT; - } - - private static final long persistingL2CacheMaxSize$OFFSET = 620; - - /** - * Offset for field: - * {@snippet lang=c : - * int persistingL2CacheMaxSize - * } - */ - public static final long persistingL2CacheMaxSize$offset() { - return persistingL2CacheMaxSize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int persistingL2CacheMaxSize - * } - */ - public static int persistingL2CacheMaxSize(MemorySegment struct) { - return struct.get(persistingL2CacheMaxSize$LAYOUT, persistingL2CacheMaxSize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int persistingL2CacheMaxSize - * } - */ - public static void persistingL2CacheMaxSize(MemorySegment struct, int fieldValue) { - struct.set(persistingL2CacheMaxSize$LAYOUT, persistingL2CacheMaxSize$OFFSET, fieldValue); - } - - private static final OfInt maxThreadsPerMultiProcessor$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxThreadsPerMultiProcessor")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxThreadsPerMultiProcessor - * } - */ - public static final OfInt maxThreadsPerMultiProcessor$layout() { - return maxThreadsPerMultiProcessor$LAYOUT; - } - - private static final long maxThreadsPerMultiProcessor$OFFSET = 624; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxThreadsPerMultiProcessor - * } - */ - public static final long maxThreadsPerMultiProcessor$offset() { - return maxThreadsPerMultiProcessor$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxThreadsPerMultiProcessor - * } - */ - public static int maxThreadsPerMultiProcessor(MemorySegment struct) { - return struct.get(maxThreadsPerMultiProcessor$LAYOUT, maxThreadsPerMultiProcessor$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxThreadsPerMultiProcessor - * } - */ - public static void maxThreadsPerMultiProcessor(MemorySegment struct, int fieldValue) { - struct.set(maxThreadsPerMultiProcessor$LAYOUT, maxThreadsPerMultiProcessor$OFFSET, fieldValue); - } - - private static final OfInt streamPrioritiesSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("streamPrioritiesSupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int streamPrioritiesSupported - * } - */ - public static final OfInt streamPrioritiesSupported$layout() { - return streamPrioritiesSupported$LAYOUT; - } - - private static final long streamPrioritiesSupported$OFFSET = 628; - - /** - * Offset for field: - * {@snippet lang=c : - * int streamPrioritiesSupported - * } - */ - public static final long streamPrioritiesSupported$offset() { - return streamPrioritiesSupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int streamPrioritiesSupported - * } - */ - public static int streamPrioritiesSupported(MemorySegment struct) { - return struct.get(streamPrioritiesSupported$LAYOUT, streamPrioritiesSupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int streamPrioritiesSupported - * } - */ - public static void streamPrioritiesSupported(MemorySegment struct, int fieldValue) { - struct.set(streamPrioritiesSupported$LAYOUT, streamPrioritiesSupported$OFFSET, fieldValue); - } - - private static final OfInt globalL1CacheSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("globalL1CacheSupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int globalL1CacheSupported - * } - */ - public static final OfInt globalL1CacheSupported$layout() { - return globalL1CacheSupported$LAYOUT; - } - - private static final long globalL1CacheSupported$OFFSET = 632; - - /** - * Offset for field: - * {@snippet lang=c : - * int globalL1CacheSupported - * } - */ - public static final long globalL1CacheSupported$offset() { - return globalL1CacheSupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int globalL1CacheSupported - * } - */ - public static int globalL1CacheSupported(MemorySegment struct) { - return struct.get(globalL1CacheSupported$LAYOUT, globalL1CacheSupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int globalL1CacheSupported - * } - */ - public static void globalL1CacheSupported(MemorySegment struct, int fieldValue) { - struct.set(globalL1CacheSupported$LAYOUT, globalL1CacheSupported$OFFSET, fieldValue); - } - - private static final OfInt localL1CacheSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("localL1CacheSupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int localL1CacheSupported - * } - */ - public static final OfInt localL1CacheSupported$layout() { - return localL1CacheSupported$LAYOUT; - } - - private static final long localL1CacheSupported$OFFSET = 636; - - /** - * Offset for field: - * {@snippet lang=c : - * int localL1CacheSupported - * } - */ - public static final long localL1CacheSupported$offset() { - return localL1CacheSupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int localL1CacheSupported - * } - */ - public static int localL1CacheSupported(MemorySegment struct) { - return struct.get(localL1CacheSupported$LAYOUT, localL1CacheSupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int localL1CacheSupported - * } - */ - public static void localL1CacheSupported(MemorySegment struct, int fieldValue) { - struct.set(localL1CacheSupported$LAYOUT, localL1CacheSupported$OFFSET, fieldValue); - } - - private static final OfLong sharedMemPerMultiprocessor$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sharedMemPerMultiprocessor")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t sharedMemPerMultiprocessor - * } - */ - public static final OfLong sharedMemPerMultiprocessor$layout() { - return sharedMemPerMultiprocessor$LAYOUT; - } - - private static final long sharedMemPerMultiprocessor$OFFSET = 640; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t sharedMemPerMultiprocessor - * } - */ - public static final long sharedMemPerMultiprocessor$offset() { - return sharedMemPerMultiprocessor$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t sharedMemPerMultiprocessor - * } - */ - public static long sharedMemPerMultiprocessor(MemorySegment struct) { - return struct.get(sharedMemPerMultiprocessor$LAYOUT, sharedMemPerMultiprocessor$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t sharedMemPerMultiprocessor - * } - */ - public static void sharedMemPerMultiprocessor(MemorySegment struct, long fieldValue) { - struct.set(sharedMemPerMultiprocessor$LAYOUT, sharedMemPerMultiprocessor$OFFSET, fieldValue); - } - - private static final OfInt regsPerMultiprocessor$LAYOUT = (OfInt)$LAYOUT.select(groupElement("regsPerMultiprocessor")); - - /** - * Layout for field: - * {@snippet lang=c : - * int regsPerMultiprocessor - * } - */ - public static final OfInt regsPerMultiprocessor$layout() { - return regsPerMultiprocessor$LAYOUT; - } - - private static final long regsPerMultiprocessor$OFFSET = 648; - - /** - * Offset for field: - * {@snippet lang=c : - * int regsPerMultiprocessor - * } - */ - public static final long regsPerMultiprocessor$offset() { - return regsPerMultiprocessor$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int regsPerMultiprocessor - * } - */ - public static int regsPerMultiprocessor(MemorySegment struct) { - return struct.get(regsPerMultiprocessor$LAYOUT, regsPerMultiprocessor$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int regsPerMultiprocessor - * } - */ - public static void regsPerMultiprocessor(MemorySegment struct, int fieldValue) { - struct.set(regsPerMultiprocessor$LAYOUT, regsPerMultiprocessor$OFFSET, fieldValue); - } - - private static final OfInt managedMemory$LAYOUT = (OfInt)$LAYOUT.select(groupElement("managedMemory")); - - /** - * Layout for field: - * {@snippet lang=c : - * int managedMemory - * } - */ - public static final OfInt managedMemory$layout() { - return managedMemory$LAYOUT; - } - - private static final long managedMemory$OFFSET = 652; - - /** - * Offset for field: - * {@snippet lang=c : - * int managedMemory - * } - */ - public static final long managedMemory$offset() { - return managedMemory$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int managedMemory - * } - */ - public static int managedMemory(MemorySegment struct) { - return struct.get(managedMemory$LAYOUT, managedMemory$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int managedMemory - * } - */ - public static void managedMemory(MemorySegment struct, int fieldValue) { - struct.set(managedMemory$LAYOUT, managedMemory$OFFSET, fieldValue); - } - - private static final OfInt isMultiGpuBoard$LAYOUT = (OfInt)$LAYOUT.select(groupElement("isMultiGpuBoard")); - - /** - * Layout for field: - * {@snippet lang=c : - * int isMultiGpuBoard - * } - */ - public static final OfInt isMultiGpuBoard$layout() { - return isMultiGpuBoard$LAYOUT; - } - - private static final long isMultiGpuBoard$OFFSET = 656; - - /** - * Offset for field: - * {@snippet lang=c : - * int isMultiGpuBoard - * } - */ - public static final long isMultiGpuBoard$offset() { - return isMultiGpuBoard$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int isMultiGpuBoard - * } - */ - public static int isMultiGpuBoard(MemorySegment struct) { - return struct.get(isMultiGpuBoard$LAYOUT, isMultiGpuBoard$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int isMultiGpuBoard - * } - */ - public static void isMultiGpuBoard(MemorySegment struct, int fieldValue) { - struct.set(isMultiGpuBoard$LAYOUT, isMultiGpuBoard$OFFSET, fieldValue); - } - - private static final OfInt multiGpuBoardGroupID$LAYOUT = (OfInt)$LAYOUT.select(groupElement("multiGpuBoardGroupID")); - - /** - * Layout for field: - * {@snippet lang=c : - * int multiGpuBoardGroupID - * } - */ - public static final OfInt multiGpuBoardGroupID$layout() { - return multiGpuBoardGroupID$LAYOUT; - } - - private static final long multiGpuBoardGroupID$OFFSET = 660; - - /** - * Offset for field: - * {@snippet lang=c : - * int multiGpuBoardGroupID - * } - */ - public static final long multiGpuBoardGroupID$offset() { - return multiGpuBoardGroupID$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int multiGpuBoardGroupID - * } - */ - public static int multiGpuBoardGroupID(MemorySegment struct) { - return struct.get(multiGpuBoardGroupID$LAYOUT, multiGpuBoardGroupID$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int multiGpuBoardGroupID - * } - */ - public static void multiGpuBoardGroupID(MemorySegment struct, int fieldValue) { - struct.set(multiGpuBoardGroupID$LAYOUT, multiGpuBoardGroupID$OFFSET, fieldValue); - } - - private static final OfInt hostNativeAtomicSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hostNativeAtomicSupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int hostNativeAtomicSupported - * } - */ - public static final OfInt hostNativeAtomicSupported$layout() { - return hostNativeAtomicSupported$LAYOUT; - } - - private static final long hostNativeAtomicSupported$OFFSET = 664; - - /** - * Offset for field: - * {@snippet lang=c : - * int hostNativeAtomicSupported - * } - */ - public static final long hostNativeAtomicSupported$offset() { - return hostNativeAtomicSupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int hostNativeAtomicSupported - * } - */ - public static int hostNativeAtomicSupported(MemorySegment struct) { - return struct.get(hostNativeAtomicSupported$LAYOUT, hostNativeAtomicSupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int hostNativeAtomicSupported - * } - */ - public static void hostNativeAtomicSupported(MemorySegment struct, int fieldValue) { - struct.set(hostNativeAtomicSupported$LAYOUT, hostNativeAtomicSupported$OFFSET, fieldValue); - } - - private static final OfInt singleToDoublePrecisionPerfRatio$LAYOUT = (OfInt)$LAYOUT.select(groupElement("singleToDoublePrecisionPerfRatio")); - - /** - * Layout for field: - * {@snippet lang=c : - * int singleToDoublePrecisionPerfRatio - * } - */ - public static final OfInt singleToDoublePrecisionPerfRatio$layout() { - return singleToDoublePrecisionPerfRatio$LAYOUT; - } - - private static final long singleToDoublePrecisionPerfRatio$OFFSET = 668; - - /** - * Offset for field: - * {@snippet lang=c : - * int singleToDoublePrecisionPerfRatio - * } - */ - public static final long singleToDoublePrecisionPerfRatio$offset() { - return singleToDoublePrecisionPerfRatio$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int singleToDoublePrecisionPerfRatio - * } - */ - public static int singleToDoublePrecisionPerfRatio(MemorySegment struct) { - return struct.get(singleToDoublePrecisionPerfRatio$LAYOUT, singleToDoublePrecisionPerfRatio$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int singleToDoublePrecisionPerfRatio - * } - */ - public static void singleToDoublePrecisionPerfRatio(MemorySegment struct, int fieldValue) { - struct.set(singleToDoublePrecisionPerfRatio$LAYOUT, singleToDoublePrecisionPerfRatio$OFFSET, fieldValue); - } - - private static final OfInt pageableMemoryAccess$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pageableMemoryAccess")); - - /** - * Layout for field: - * {@snippet lang=c : - * int pageableMemoryAccess - * } - */ - public static final OfInt pageableMemoryAccess$layout() { - return pageableMemoryAccess$LAYOUT; - } - - private static final long pageableMemoryAccess$OFFSET = 672; - - /** - * Offset for field: - * {@snippet lang=c : - * int pageableMemoryAccess - * } - */ - public static final long pageableMemoryAccess$offset() { - return pageableMemoryAccess$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int pageableMemoryAccess - * } - */ - public static int pageableMemoryAccess(MemorySegment struct) { - return struct.get(pageableMemoryAccess$LAYOUT, pageableMemoryAccess$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int pageableMemoryAccess - * } - */ - public static void pageableMemoryAccess(MemorySegment struct, int fieldValue) { - struct.set(pageableMemoryAccess$LAYOUT, pageableMemoryAccess$OFFSET, fieldValue); - } - - private static final OfInt concurrentManagedAccess$LAYOUT = (OfInt)$LAYOUT.select(groupElement("concurrentManagedAccess")); - - /** - * Layout for field: - * {@snippet lang=c : - * int concurrentManagedAccess - * } - */ - public static final OfInt concurrentManagedAccess$layout() { - return concurrentManagedAccess$LAYOUT; - } - - private static final long concurrentManagedAccess$OFFSET = 676; - - /** - * Offset for field: - * {@snippet lang=c : - * int concurrentManagedAccess - * } - */ - public static final long concurrentManagedAccess$offset() { - return concurrentManagedAccess$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int concurrentManagedAccess - * } - */ - public static int concurrentManagedAccess(MemorySegment struct) { - return struct.get(concurrentManagedAccess$LAYOUT, concurrentManagedAccess$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int concurrentManagedAccess - * } - */ - public static void concurrentManagedAccess(MemorySegment struct, int fieldValue) { - struct.set(concurrentManagedAccess$LAYOUT, concurrentManagedAccess$OFFSET, fieldValue); - } - - private static final OfInt computePreemptionSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("computePreemptionSupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int computePreemptionSupported - * } - */ - public static final OfInt computePreemptionSupported$layout() { - return computePreemptionSupported$LAYOUT; - } - - private static final long computePreemptionSupported$OFFSET = 680; - - /** - * Offset for field: - * {@snippet lang=c : - * int computePreemptionSupported - * } - */ - public static final long computePreemptionSupported$offset() { - return computePreemptionSupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int computePreemptionSupported - * } - */ - public static int computePreemptionSupported(MemorySegment struct) { - return struct.get(computePreemptionSupported$LAYOUT, computePreemptionSupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int computePreemptionSupported - * } - */ - public static void computePreemptionSupported(MemorySegment struct, int fieldValue) { - struct.set(computePreemptionSupported$LAYOUT, computePreemptionSupported$OFFSET, fieldValue); - } - - private static final OfInt canUseHostPointerForRegisteredMem$LAYOUT = (OfInt)$LAYOUT.select(groupElement("canUseHostPointerForRegisteredMem")); - - /** - * Layout for field: - * {@snippet lang=c : - * int canUseHostPointerForRegisteredMem - * } - */ - public static final OfInt canUseHostPointerForRegisteredMem$layout() { - return canUseHostPointerForRegisteredMem$LAYOUT; - } - - private static final long canUseHostPointerForRegisteredMem$OFFSET = 684; - - /** - * Offset for field: - * {@snippet lang=c : - * int canUseHostPointerForRegisteredMem - * } - */ - public static final long canUseHostPointerForRegisteredMem$offset() { - return canUseHostPointerForRegisteredMem$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int canUseHostPointerForRegisteredMem - * } - */ - public static int canUseHostPointerForRegisteredMem(MemorySegment struct) { - return struct.get(canUseHostPointerForRegisteredMem$LAYOUT, canUseHostPointerForRegisteredMem$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int canUseHostPointerForRegisteredMem - * } - */ - public static void canUseHostPointerForRegisteredMem(MemorySegment struct, int fieldValue) { - struct.set(canUseHostPointerForRegisteredMem$LAYOUT, canUseHostPointerForRegisteredMem$OFFSET, fieldValue); - } - - private static final OfInt cooperativeLaunch$LAYOUT = (OfInt)$LAYOUT.select(groupElement("cooperativeLaunch")); - - /** - * Layout for field: - * {@snippet lang=c : - * int cooperativeLaunch - * } - */ - public static final OfInt cooperativeLaunch$layout() { - return cooperativeLaunch$LAYOUT; - } - - private static final long cooperativeLaunch$OFFSET = 688; - - /** - * Offset for field: - * {@snippet lang=c : - * int cooperativeLaunch - * } - */ - public static final long cooperativeLaunch$offset() { - return cooperativeLaunch$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int cooperativeLaunch - * } - */ - public static int cooperativeLaunch(MemorySegment struct) { - return struct.get(cooperativeLaunch$LAYOUT, cooperativeLaunch$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int cooperativeLaunch - * } - */ - public static void cooperativeLaunch(MemorySegment struct, int fieldValue) { - struct.set(cooperativeLaunch$LAYOUT, cooperativeLaunch$OFFSET, fieldValue); - } - - private static final OfInt cooperativeMultiDeviceLaunch$LAYOUT = (OfInt)$LAYOUT.select(groupElement("cooperativeMultiDeviceLaunch")); - - /** - * Layout for field: - * {@snippet lang=c : - * int cooperativeMultiDeviceLaunch - * } - */ - public static final OfInt cooperativeMultiDeviceLaunch$layout() { - return cooperativeMultiDeviceLaunch$LAYOUT; - } - - private static final long cooperativeMultiDeviceLaunch$OFFSET = 692; - - /** - * Offset for field: - * {@snippet lang=c : - * int cooperativeMultiDeviceLaunch - * } - */ - public static final long cooperativeMultiDeviceLaunch$offset() { - return cooperativeMultiDeviceLaunch$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int cooperativeMultiDeviceLaunch - * } - */ - public static int cooperativeMultiDeviceLaunch(MemorySegment struct) { - return struct.get(cooperativeMultiDeviceLaunch$LAYOUT, cooperativeMultiDeviceLaunch$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int cooperativeMultiDeviceLaunch - * } - */ - public static void cooperativeMultiDeviceLaunch(MemorySegment struct, int fieldValue) { - struct.set(cooperativeMultiDeviceLaunch$LAYOUT, cooperativeMultiDeviceLaunch$OFFSET, fieldValue); - } - - private static final OfLong sharedMemPerBlockOptin$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sharedMemPerBlockOptin")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t sharedMemPerBlockOptin - * } - */ - public static final OfLong sharedMemPerBlockOptin$layout() { - return sharedMemPerBlockOptin$LAYOUT; - } - - private static final long sharedMemPerBlockOptin$OFFSET = 696; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t sharedMemPerBlockOptin - * } - */ - public static final long sharedMemPerBlockOptin$offset() { - return sharedMemPerBlockOptin$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t sharedMemPerBlockOptin - * } - */ - public static long sharedMemPerBlockOptin(MemorySegment struct) { - return struct.get(sharedMemPerBlockOptin$LAYOUT, sharedMemPerBlockOptin$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t sharedMemPerBlockOptin - * } - */ - public static void sharedMemPerBlockOptin(MemorySegment struct, long fieldValue) { - struct.set(sharedMemPerBlockOptin$LAYOUT, sharedMemPerBlockOptin$OFFSET, fieldValue); - } - - private static final OfInt pageableMemoryAccessUsesHostPageTables$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pageableMemoryAccessUsesHostPageTables")); - - /** - * Layout for field: - * {@snippet lang=c : - * int pageableMemoryAccessUsesHostPageTables - * } - */ - public static final OfInt pageableMemoryAccessUsesHostPageTables$layout() { - return pageableMemoryAccessUsesHostPageTables$LAYOUT; - } - - private static final long pageableMemoryAccessUsesHostPageTables$OFFSET = 704; - - /** - * Offset for field: - * {@snippet lang=c : - * int pageableMemoryAccessUsesHostPageTables - * } - */ - public static final long pageableMemoryAccessUsesHostPageTables$offset() { - return pageableMemoryAccessUsesHostPageTables$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int pageableMemoryAccessUsesHostPageTables - * } - */ - public static int pageableMemoryAccessUsesHostPageTables(MemorySegment struct) { - return struct.get(pageableMemoryAccessUsesHostPageTables$LAYOUT, pageableMemoryAccessUsesHostPageTables$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int pageableMemoryAccessUsesHostPageTables - * } - */ - public static void pageableMemoryAccessUsesHostPageTables(MemorySegment struct, int fieldValue) { - struct.set(pageableMemoryAccessUsesHostPageTables$LAYOUT, pageableMemoryAccessUsesHostPageTables$OFFSET, fieldValue); - } - - private static final OfInt directManagedMemAccessFromHost$LAYOUT = (OfInt)$LAYOUT.select(groupElement("directManagedMemAccessFromHost")); - - /** - * Layout for field: - * {@snippet lang=c : - * int directManagedMemAccessFromHost - * } - */ - public static final OfInt directManagedMemAccessFromHost$layout() { - return directManagedMemAccessFromHost$LAYOUT; - } - - private static final long directManagedMemAccessFromHost$OFFSET = 708; - - /** - * Offset for field: - * {@snippet lang=c : - * int directManagedMemAccessFromHost - * } - */ - public static final long directManagedMemAccessFromHost$offset() { - return directManagedMemAccessFromHost$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int directManagedMemAccessFromHost - * } - */ - public static int directManagedMemAccessFromHost(MemorySegment struct) { - return struct.get(directManagedMemAccessFromHost$LAYOUT, directManagedMemAccessFromHost$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int directManagedMemAccessFromHost - * } - */ - public static void directManagedMemAccessFromHost(MemorySegment struct, int fieldValue) { - struct.set(directManagedMemAccessFromHost$LAYOUT, directManagedMemAccessFromHost$OFFSET, fieldValue); - } - - private static final OfInt maxBlocksPerMultiProcessor$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxBlocksPerMultiProcessor")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxBlocksPerMultiProcessor - * } - */ - public static final OfInt maxBlocksPerMultiProcessor$layout() { - return maxBlocksPerMultiProcessor$LAYOUT; - } - - private static final long maxBlocksPerMultiProcessor$OFFSET = 712; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxBlocksPerMultiProcessor - * } - */ - public static final long maxBlocksPerMultiProcessor$offset() { - return maxBlocksPerMultiProcessor$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxBlocksPerMultiProcessor - * } - */ - public static int maxBlocksPerMultiProcessor(MemorySegment struct) { - return struct.get(maxBlocksPerMultiProcessor$LAYOUT, maxBlocksPerMultiProcessor$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxBlocksPerMultiProcessor - * } - */ - public static void maxBlocksPerMultiProcessor(MemorySegment struct, int fieldValue) { - struct.set(maxBlocksPerMultiProcessor$LAYOUT, maxBlocksPerMultiProcessor$OFFSET, fieldValue); - } - - private static final OfInt accessPolicyMaxWindowSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("accessPolicyMaxWindowSize")); - - /** - * Layout for field: - * {@snippet lang=c : - * int accessPolicyMaxWindowSize - * } - */ - public static final OfInt accessPolicyMaxWindowSize$layout() { - return accessPolicyMaxWindowSize$LAYOUT; - } - - private static final long accessPolicyMaxWindowSize$OFFSET = 716; - - /** - * Offset for field: - * {@snippet lang=c : - * int accessPolicyMaxWindowSize - * } - */ - public static final long accessPolicyMaxWindowSize$offset() { - return accessPolicyMaxWindowSize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int accessPolicyMaxWindowSize - * } - */ - public static int accessPolicyMaxWindowSize(MemorySegment struct) { - return struct.get(accessPolicyMaxWindowSize$LAYOUT, accessPolicyMaxWindowSize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int accessPolicyMaxWindowSize - * } - */ - public static void accessPolicyMaxWindowSize(MemorySegment struct, int fieldValue) { - struct.set(accessPolicyMaxWindowSize$LAYOUT, accessPolicyMaxWindowSize$OFFSET, fieldValue); - } - - private static final OfLong reservedSharedMemPerBlock$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reservedSharedMemPerBlock")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t reservedSharedMemPerBlock - * } - */ - public static final OfLong reservedSharedMemPerBlock$layout() { - return reservedSharedMemPerBlock$LAYOUT; - } - - private static final long reservedSharedMemPerBlock$OFFSET = 720; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t reservedSharedMemPerBlock - * } - */ - public static final long reservedSharedMemPerBlock$offset() { - return reservedSharedMemPerBlock$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t reservedSharedMemPerBlock - * } - */ - public static long reservedSharedMemPerBlock(MemorySegment struct) { - return struct.get(reservedSharedMemPerBlock$LAYOUT, reservedSharedMemPerBlock$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t reservedSharedMemPerBlock - * } - */ - public static void reservedSharedMemPerBlock(MemorySegment struct, long fieldValue) { - struct.set(reservedSharedMemPerBlock$LAYOUT, reservedSharedMemPerBlock$OFFSET, fieldValue); - } - - private static final OfInt hostRegisterSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hostRegisterSupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int hostRegisterSupported - * } - */ - public static final OfInt hostRegisterSupported$layout() { - return hostRegisterSupported$LAYOUT; - } - - private static final long hostRegisterSupported$OFFSET = 728; - - /** - * Offset for field: - * {@snippet lang=c : - * int hostRegisterSupported - * } - */ - public static final long hostRegisterSupported$offset() { - return hostRegisterSupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int hostRegisterSupported - * } - */ - public static int hostRegisterSupported(MemorySegment struct) { - return struct.get(hostRegisterSupported$LAYOUT, hostRegisterSupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int hostRegisterSupported - * } - */ - public static void hostRegisterSupported(MemorySegment struct, int fieldValue) { - struct.set(hostRegisterSupported$LAYOUT, hostRegisterSupported$OFFSET, fieldValue); - } - - private static final OfInt sparseCudaArraySupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("sparseCudaArraySupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int sparseCudaArraySupported - * } - */ - public static final OfInt sparseCudaArraySupported$layout() { - return sparseCudaArraySupported$LAYOUT; - } - - private static final long sparseCudaArraySupported$OFFSET = 732; - - /** - * Offset for field: - * {@snippet lang=c : - * int sparseCudaArraySupported - * } - */ - public static final long sparseCudaArraySupported$offset() { - return sparseCudaArraySupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int sparseCudaArraySupported - * } - */ - public static int sparseCudaArraySupported(MemorySegment struct) { - return struct.get(sparseCudaArraySupported$LAYOUT, sparseCudaArraySupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int sparseCudaArraySupported - * } - */ - public static void sparseCudaArraySupported(MemorySegment struct, int fieldValue) { - struct.set(sparseCudaArraySupported$LAYOUT, sparseCudaArraySupported$OFFSET, fieldValue); - } - - private static final OfInt hostRegisterReadOnlySupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hostRegisterReadOnlySupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int hostRegisterReadOnlySupported - * } - */ - public static final OfInt hostRegisterReadOnlySupported$layout() { - return hostRegisterReadOnlySupported$LAYOUT; - } - - private static final long hostRegisterReadOnlySupported$OFFSET = 736; - - /** - * Offset for field: - * {@snippet lang=c : - * int hostRegisterReadOnlySupported - * } - */ - public static final long hostRegisterReadOnlySupported$offset() { - return hostRegisterReadOnlySupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int hostRegisterReadOnlySupported - * } - */ - public static int hostRegisterReadOnlySupported(MemorySegment struct) { - return struct.get(hostRegisterReadOnlySupported$LAYOUT, hostRegisterReadOnlySupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int hostRegisterReadOnlySupported - * } - */ - public static void hostRegisterReadOnlySupported(MemorySegment struct, int fieldValue) { - struct.set(hostRegisterReadOnlySupported$LAYOUT, hostRegisterReadOnlySupported$OFFSET, fieldValue); - } - - private static final OfInt timelineSemaphoreInteropSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("timelineSemaphoreInteropSupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int timelineSemaphoreInteropSupported - * } - */ - public static final OfInt timelineSemaphoreInteropSupported$layout() { - return timelineSemaphoreInteropSupported$LAYOUT; - } - - private static final long timelineSemaphoreInteropSupported$OFFSET = 740; - - /** - * Offset for field: - * {@snippet lang=c : - * int timelineSemaphoreInteropSupported - * } - */ - public static final long timelineSemaphoreInteropSupported$offset() { - return timelineSemaphoreInteropSupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int timelineSemaphoreInteropSupported - * } - */ - public static int timelineSemaphoreInteropSupported(MemorySegment struct) { - return struct.get(timelineSemaphoreInteropSupported$LAYOUT, timelineSemaphoreInteropSupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int timelineSemaphoreInteropSupported - * } - */ - public static void timelineSemaphoreInteropSupported(MemorySegment struct, int fieldValue) { - struct.set(timelineSemaphoreInteropSupported$LAYOUT, timelineSemaphoreInteropSupported$OFFSET, fieldValue); - } - - private static final OfInt memoryPoolsSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("memoryPoolsSupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int memoryPoolsSupported - * } - */ - public static final OfInt memoryPoolsSupported$layout() { - return memoryPoolsSupported$LAYOUT; - } - - private static final long memoryPoolsSupported$OFFSET = 744; - - /** - * Offset for field: - * {@snippet lang=c : - * int memoryPoolsSupported - * } - */ - public static final long memoryPoolsSupported$offset() { - return memoryPoolsSupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int memoryPoolsSupported - * } - */ - public static int memoryPoolsSupported(MemorySegment struct) { - return struct.get(memoryPoolsSupported$LAYOUT, memoryPoolsSupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int memoryPoolsSupported - * } - */ - public static void memoryPoolsSupported(MemorySegment struct, int fieldValue) { - struct.set(memoryPoolsSupported$LAYOUT, memoryPoolsSupported$OFFSET, fieldValue); - } - - private static final OfInt gpuDirectRDMASupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("gpuDirectRDMASupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int gpuDirectRDMASupported - * } - */ - public static final OfInt gpuDirectRDMASupported$layout() { - return gpuDirectRDMASupported$LAYOUT; - } - - private static final long gpuDirectRDMASupported$OFFSET = 748; - - /** - * Offset for field: - * {@snippet lang=c : - * int gpuDirectRDMASupported - * } - */ - public static final long gpuDirectRDMASupported$offset() { - return gpuDirectRDMASupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int gpuDirectRDMASupported - * } - */ - public static int gpuDirectRDMASupported(MemorySegment struct) { - return struct.get(gpuDirectRDMASupported$LAYOUT, gpuDirectRDMASupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int gpuDirectRDMASupported - * } - */ - public static void gpuDirectRDMASupported(MemorySegment struct, int fieldValue) { - struct.set(gpuDirectRDMASupported$LAYOUT, gpuDirectRDMASupported$OFFSET, fieldValue); - } - - private static final OfInt gpuDirectRDMAFlushWritesOptions$LAYOUT = (OfInt)$LAYOUT.select(groupElement("gpuDirectRDMAFlushWritesOptions")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int gpuDirectRDMAFlushWritesOptions - * } - */ - public static final OfInt gpuDirectRDMAFlushWritesOptions$layout() { - return gpuDirectRDMAFlushWritesOptions$LAYOUT; - } - - private static final long gpuDirectRDMAFlushWritesOptions$OFFSET = 752; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int gpuDirectRDMAFlushWritesOptions - * } - */ - public static final long gpuDirectRDMAFlushWritesOptions$offset() { - return gpuDirectRDMAFlushWritesOptions$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int gpuDirectRDMAFlushWritesOptions - * } - */ - public static int gpuDirectRDMAFlushWritesOptions(MemorySegment struct) { - return struct.get(gpuDirectRDMAFlushWritesOptions$LAYOUT, gpuDirectRDMAFlushWritesOptions$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int gpuDirectRDMAFlushWritesOptions - * } - */ - public static void gpuDirectRDMAFlushWritesOptions(MemorySegment struct, int fieldValue) { - struct.set(gpuDirectRDMAFlushWritesOptions$LAYOUT, gpuDirectRDMAFlushWritesOptions$OFFSET, fieldValue); - } - - private static final OfInt gpuDirectRDMAWritesOrdering$LAYOUT = (OfInt)$LAYOUT.select(groupElement("gpuDirectRDMAWritesOrdering")); - - /** - * Layout for field: - * {@snippet lang=c : - * int gpuDirectRDMAWritesOrdering - * } - */ - public static final OfInt gpuDirectRDMAWritesOrdering$layout() { - return gpuDirectRDMAWritesOrdering$LAYOUT; - } - - private static final long gpuDirectRDMAWritesOrdering$OFFSET = 756; - - /** - * Offset for field: - * {@snippet lang=c : - * int gpuDirectRDMAWritesOrdering - * } - */ - public static final long gpuDirectRDMAWritesOrdering$offset() { - return gpuDirectRDMAWritesOrdering$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int gpuDirectRDMAWritesOrdering - * } - */ - public static int gpuDirectRDMAWritesOrdering(MemorySegment struct) { - return struct.get(gpuDirectRDMAWritesOrdering$LAYOUT, gpuDirectRDMAWritesOrdering$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int gpuDirectRDMAWritesOrdering - * } - */ - public static void gpuDirectRDMAWritesOrdering(MemorySegment struct, int fieldValue) { - struct.set(gpuDirectRDMAWritesOrdering$LAYOUT, gpuDirectRDMAWritesOrdering$OFFSET, fieldValue); - } - - private static final OfInt memoryPoolSupportedHandleTypes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("memoryPoolSupportedHandleTypes")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int memoryPoolSupportedHandleTypes - * } - */ - public static final OfInt memoryPoolSupportedHandleTypes$layout() { - return memoryPoolSupportedHandleTypes$LAYOUT; - } - - private static final long memoryPoolSupportedHandleTypes$OFFSET = 760; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int memoryPoolSupportedHandleTypes - * } - */ - public static final long memoryPoolSupportedHandleTypes$offset() { - return memoryPoolSupportedHandleTypes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int memoryPoolSupportedHandleTypes - * } - */ - public static int memoryPoolSupportedHandleTypes(MemorySegment struct) { - return struct.get(memoryPoolSupportedHandleTypes$LAYOUT, memoryPoolSupportedHandleTypes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int memoryPoolSupportedHandleTypes - * } - */ - public static void memoryPoolSupportedHandleTypes(MemorySegment struct, int fieldValue) { - struct.set(memoryPoolSupportedHandleTypes$LAYOUT, memoryPoolSupportedHandleTypes$OFFSET, fieldValue); - } - - private static final OfInt deferredMappingCudaArraySupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("deferredMappingCudaArraySupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int deferredMappingCudaArraySupported - * } - */ - public static final OfInt deferredMappingCudaArraySupported$layout() { - return deferredMappingCudaArraySupported$LAYOUT; - } - - private static final long deferredMappingCudaArraySupported$OFFSET = 764; - - /** - * Offset for field: - * {@snippet lang=c : - * int deferredMappingCudaArraySupported - * } - */ - public static final long deferredMappingCudaArraySupported$offset() { - return deferredMappingCudaArraySupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int deferredMappingCudaArraySupported - * } - */ - public static int deferredMappingCudaArraySupported(MemorySegment struct) { - return struct.get(deferredMappingCudaArraySupported$LAYOUT, deferredMappingCudaArraySupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int deferredMappingCudaArraySupported - * } - */ - public static void deferredMappingCudaArraySupported(MemorySegment struct, int fieldValue) { - struct.set(deferredMappingCudaArraySupported$LAYOUT, deferredMappingCudaArraySupported$OFFSET, fieldValue); - } - - private static final OfInt ipcEventSupported$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ipcEventSupported")); - - /** - * Layout for field: - * {@snippet lang=c : - * int ipcEventSupported - * } - */ - public static final OfInt ipcEventSupported$layout() { - return ipcEventSupported$LAYOUT; - } - - private static final long ipcEventSupported$OFFSET = 768; - - /** - * Offset for field: - * {@snippet lang=c : - * int ipcEventSupported - * } - */ - public static final long ipcEventSupported$offset() { - return ipcEventSupported$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int ipcEventSupported - * } - */ - public static int ipcEventSupported(MemorySegment struct) { - return struct.get(ipcEventSupported$LAYOUT, ipcEventSupported$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int ipcEventSupported - * } - */ - public static void ipcEventSupported(MemorySegment struct, int fieldValue) { - struct.set(ipcEventSupported$LAYOUT, ipcEventSupported$OFFSET, fieldValue); - } - - private static final OfInt clusterLaunch$LAYOUT = (OfInt)$LAYOUT.select(groupElement("clusterLaunch")); - - /** - * Layout for field: - * {@snippet lang=c : - * int clusterLaunch - * } - */ - public static final OfInt clusterLaunch$layout() { - return clusterLaunch$LAYOUT; - } - - private static final long clusterLaunch$OFFSET = 772; - - /** - * Offset for field: - * {@snippet lang=c : - * int clusterLaunch - * } - */ - public static final long clusterLaunch$offset() { - return clusterLaunch$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int clusterLaunch - * } - */ - public static int clusterLaunch(MemorySegment struct) { - return struct.get(clusterLaunch$LAYOUT, clusterLaunch$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int clusterLaunch - * } - */ - public static void clusterLaunch(MemorySegment struct, int fieldValue) { - struct.set(clusterLaunch$LAYOUT, clusterLaunch$OFFSET, fieldValue); - } - - private static final OfInt unifiedFunctionPointers$LAYOUT = (OfInt)$LAYOUT.select(groupElement("unifiedFunctionPointers")); - - /** - * Layout for field: - * {@snippet lang=c : - * int unifiedFunctionPointers - * } - */ - public static final OfInt unifiedFunctionPointers$layout() { - return unifiedFunctionPointers$LAYOUT; - } - - private static final long unifiedFunctionPointers$OFFSET = 776; - - /** - * Offset for field: - * {@snippet lang=c : - * int unifiedFunctionPointers - * } - */ - public static final long unifiedFunctionPointers$offset() { - return unifiedFunctionPointers$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int unifiedFunctionPointers - * } - */ - public static int unifiedFunctionPointers(MemorySegment struct) { - return struct.get(unifiedFunctionPointers$LAYOUT, unifiedFunctionPointers$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int unifiedFunctionPointers - * } - */ - public static void unifiedFunctionPointers(MemorySegment struct, int fieldValue) { - struct.set(unifiedFunctionPointers$LAYOUT, unifiedFunctionPointers$OFFSET, fieldValue); - } - - private static final SequenceLayout reserved2$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved2")); - - /** - * Layout for field: - * {@snippet lang=c : - * int reserved2[2] - * } - */ - public static final SequenceLayout reserved2$layout() { - return reserved2$LAYOUT; - } - - private static final long reserved2$OFFSET = 780; - - /** - * Offset for field: - * {@snippet lang=c : - * int reserved2[2] - * } - */ - public static final long reserved2$offset() { - return reserved2$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int reserved2[2] - * } - */ - public static MemorySegment reserved2(MemorySegment struct) { - return struct.asSlice(reserved2$OFFSET, reserved2$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int reserved2[2] - * } - */ - public static void reserved2(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved2$OFFSET, reserved2$LAYOUT.byteSize()); - } - - private static long[] reserved2$DIMS = { 2 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int reserved2[2] - * } - */ - public static long[] reserved2$dimensions() { - return reserved2$DIMS; - } - private static final VarHandle reserved2$ELEM_HANDLE = reserved2$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int reserved2[2] - * } - */ - public static int reserved2(MemorySegment struct, long index0) { - return (int)reserved2$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int reserved2[2] - * } - */ - public static void reserved2(MemorySegment struct, long index0, int fieldValue) { - reserved2$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout reserved1$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved1")); - - /** - * Layout for field: - * {@snippet lang=c : - * int reserved1[1] - * } - */ - public static final SequenceLayout reserved1$layout() { - return reserved1$LAYOUT; - } - - private static final long reserved1$OFFSET = 788; - - /** - * Offset for field: - * {@snippet lang=c : - * int reserved1[1] - * } - */ - public static final long reserved1$offset() { - return reserved1$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int reserved1[1] - * } - */ - public static MemorySegment reserved1(MemorySegment struct) { - return struct.asSlice(reserved1$OFFSET, reserved1$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int reserved1[1] - * } - */ - public static void reserved1(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved1$OFFSET, reserved1$LAYOUT.byteSize()); - } - - private static long[] reserved1$DIMS = { 1 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int reserved1[1] - * } - */ - public static long[] reserved1$dimensions() { - return reserved1$DIMS; - } - private static final VarHandle reserved1$ELEM_HANDLE = reserved1$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int reserved1[1] - * } - */ - public static int reserved1(MemorySegment struct, long index0) { - return (int)reserved1$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int reserved1[1] - * } - */ - public static void reserved1(MemorySegment struct, long index0, int fieldValue) { - reserved1$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * int reserved[60] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 792; - - /** - * Offset for field: - * {@snippet lang=c : - * int reserved[60] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int reserved[60] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int reserved[60] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 60 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int reserved[60] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int reserved[60] - * } - */ - public static int reserved(MemorySegment struct, long index0) { - return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int reserved[60] - * } - */ - public static void reserved(MemorySegment struct, long index0, int fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventRecordNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventRecordNodeParams.java deleted file mode 100644 index af41fbb6b8..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventRecordNodeParams.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaEventRecordNodeParams { - * cudaEvent_t event; - * } - * } - */ -public class cudaEventRecordNodeParams { - - cudaEventRecordNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("event") - ).withName("cudaEventRecordNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout event$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("event")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static final AddressLayout event$layout() { - return event$LAYOUT; - } - - private static final long event$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static final long event$offset() { - return event$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static MemorySegment event(MemorySegment struct) { - return struct.get(event$LAYOUT, event$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static void event(MemorySegment struct, MemorySegment fieldValue) { - struct.set(event$LAYOUT, event$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventWaitNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventWaitNodeParams.java deleted file mode 100644 index 1c9ffc8364..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaEventWaitNodeParams.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaEventWaitNodeParams { - * cudaEvent_t event; - * } - * } - */ -public class cudaEventWaitNodeParams { - - cudaEventWaitNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("event") - ).withName("cudaEventWaitNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout event$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("event")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static final AddressLayout event$layout() { - return event$LAYOUT; - } - - private static final long event$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static final long event$offset() { - return event$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static MemorySegment event(MemorySegment struct) { - return struct.get(event$LAYOUT, event$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static void event(MemorySegment struct, MemorySegment fieldValue) { - struct.set(event$LAYOUT, event$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExtent.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExtent.java deleted file mode 100644 index 3617632cc7..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExtent.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExtent { - * size_t width; - * size_t height; - * size_t depth; - * } - * } - */ -public class cudaExtent { - - cudaExtent() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("width"), - PanamaFFMAPI.C_LONG.withName("height"), - PanamaFFMAPI.C_LONG.withName("depth") - ).withName("cudaExtent"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("width")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static final OfLong width$layout() { - return width$LAYOUT; - } - - private static final long width$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static final long width$offset() { - return width$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static long width(MemorySegment struct) { - return struct.get(width$LAYOUT, width$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static void width(MemorySegment struct, long fieldValue) { - struct.set(width$LAYOUT, width$OFFSET, fieldValue); - } - - private static final OfLong height$LAYOUT = (OfLong)$LAYOUT.select(groupElement("height")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static final OfLong height$layout() { - return height$LAYOUT; - } - - private static final long height$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static final long height$offset() { - return height$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static long height(MemorySegment struct) { - return struct.get(height$LAYOUT, height$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static void height(MemorySegment struct, long fieldValue) { - struct.set(height$LAYOUT, height$OFFSET, fieldValue); - } - - private static final OfLong depth$LAYOUT = (OfLong)$LAYOUT.select(groupElement("depth")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t depth - * } - */ - public static final OfLong depth$layout() { - return depth$LAYOUT; - } - - private static final long depth$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t depth - * } - */ - public static final long depth$offset() { - return depth$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t depth - * } - */ - public static long depth(MemorySegment struct) { - return struct.get(depth$LAYOUT, depth$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t depth - * } - */ - public static void depth(MemorySegment struct, long fieldValue) { - struct.set(depth$LAYOUT, depth$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryBufferDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryBufferDesc.java deleted file mode 100644 index ec82b0948e..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryBufferDesc.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalMemoryBufferDesc { - * unsigned long long offset; - * unsigned long long size; - * unsigned int flags; - * } - * } - */ -public class cudaExternalMemoryBufferDesc { - - cudaExternalMemoryBufferDesc() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("offset"), - PanamaFFMAPI.C_LONG_LONG.withName("size"), - PanamaFFMAPI.C_INT.withName("flags"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalMemoryBufferDesc"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong offset$LAYOUT = (OfLong)$LAYOUT.select(groupElement("offset")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long offset - * } - */ - public static final OfLong offset$layout() { - return offset$LAYOUT; - } - - private static final long offset$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long offset - * } - */ - public static final long offset$offset() { - return offset$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long offset - * } - */ - public static long offset(MemorySegment struct) { - return struct.get(offset$LAYOUT, offset$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long offset - * } - */ - public static void offset(MemorySegment struct, long fieldValue) { - struct.set(offset$LAYOUT, offset$OFFSET, fieldValue); - } - - private static final OfLong size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("size")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long size - * } - */ - public static final OfLong size$layout() { - return size$LAYOUT; - } - - private static final long size$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long size - * } - */ - public static final long size$offset() { - return size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long size - * } - */ - public static long size(MemorySegment struct) { - return struct.get(size$LAYOUT, size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long size - * } - */ - public static void size(MemorySegment struct, long fieldValue) { - struct.set(size$LAYOUT, size$OFFSET, fieldValue); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryHandleDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryHandleDesc.java deleted file mode 100644 index 4e04b7a773..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryHandleDesc.java +++ /dev/null @@ -1,697 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalMemoryHandleDesc { - * enum cudaExternalMemoryHandleType type; - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciBufObject; - * } handle; - * unsigned long long size; - * unsigned int flags; - * } - * } - */ -public class cudaExternalMemoryHandleDesc { - - cudaExternalMemoryHandleDesc() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("type"), - MemoryLayout.paddingLayout(4), - cudaExternalMemoryHandleDesc.handle.layout().withName("handle"), - PanamaFFMAPI.C_LONG_LONG.withName("size"), - PanamaFFMAPI.C_INT.withName("flags"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalMemoryHandleDesc"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType type - * } - */ - public static final OfInt type$layout() { - return type$LAYOUT; - } - - private static final long type$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType type - * } - */ - public static final long type$offset() { - return type$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType type - * } - */ - public static int type(MemorySegment struct) { - return struct.get(type$LAYOUT, type$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaExternalMemoryHandleType type - * } - */ - public static void type(MemorySegment struct, int fieldValue) { - struct.set(type$LAYOUT, type$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciBufObject; - * } - * } - */ - public static class handle { - - handle() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - PanamaFFMAPI.C_INT.withName("fd"), - cudaExternalMemoryHandleDesc.handle.win32.layout().withName("win32"), - PanamaFFMAPI.C_POINTER.withName("nvSciBufObject") - ).withName("$anon$2496:5"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt fd$LAYOUT = (OfInt)$LAYOUT.select(groupElement("fd")); - - /** - * Layout for field: - * {@snippet lang=c : - * int fd - * } - */ - public static final OfInt fd$layout() { - return fd$LAYOUT; - } - - private static final long fd$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int fd - * } - */ - public static final long fd$offset() { - return fd$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int fd - * } - */ - public static int fd(MemorySegment union) { - return union.get(fd$LAYOUT, fd$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int fd - * } - */ - public static void fd(MemorySegment union, int fieldValue) { - union.set(fd$LAYOUT, fd$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * struct { - * void *handle; - * const void *name; - * } - * } - */ - public static class win32 { - - win32() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("handle"), - PanamaFFMAPI.C_POINTER.withName("name") - ).withName("$anon$2518:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout handle$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("handle")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *handle - * } - */ - public static final AddressLayout handle$layout() { - return handle$LAYOUT; - } - - private static final long handle$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *handle - * } - */ - public static final long handle$offset() { - return handle$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *handle - * } - */ - public static MemorySegment handle(MemorySegment struct) { - return struct.get(handle$LAYOUT, handle$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *handle - * } - */ - public static void handle(MemorySegment struct, MemorySegment fieldValue) { - struct.set(handle$LAYOUT, handle$OFFSET, fieldValue); - } - - private static final AddressLayout name$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("name")); - - /** - * Layout for field: - * {@snippet lang=c : - * const void *name - * } - */ - public static final AddressLayout name$layout() { - return name$LAYOUT; - } - - private static final long name$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * const void *name - * } - */ - public static final long name$offset() { - return name$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const void *name - * } - */ - public static MemorySegment name(MemorySegment struct) { - return struct.get(name$LAYOUT, name$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const void *name - * } - */ - public static void name(MemorySegment struct, MemorySegment fieldValue) { - struct.set(name$LAYOUT, name$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout win32$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("win32")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * void *handle; - * const void *name; - * } win32 - * } - */ - public static final GroupLayout win32$layout() { - return win32$LAYOUT; - } - - private static final long win32$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * void *handle; - * const void *name; - * } win32 - * } - */ - public static final long win32$offset() { - return win32$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * void *handle; - * const void *name; - * } win32 - * } - */ - public static MemorySegment win32(MemorySegment union) { - return union.asSlice(win32$OFFSET, win32$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * void *handle; - * const void *name; - * } win32 - * } - */ - public static void win32(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, win32$OFFSET, win32$LAYOUT.byteSize()); - } - - private static final AddressLayout nvSciBufObject$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("nvSciBufObject")); - - /** - * Layout for field: - * {@snippet lang=c : - * const void *nvSciBufObject - * } - */ - public static final AddressLayout nvSciBufObject$layout() { - return nvSciBufObject$LAYOUT; - } - - private static final long nvSciBufObject$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const void *nvSciBufObject - * } - */ - public static final long nvSciBufObject$offset() { - return nvSciBufObject$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const void *nvSciBufObject - * } - */ - public static MemorySegment nvSciBufObject(MemorySegment union) { - return union.get(nvSciBufObject$LAYOUT, nvSciBufObject$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const void *nvSciBufObject - * } - */ - public static void nvSciBufObject(MemorySegment union, MemorySegment fieldValue) { - union.set(nvSciBufObject$LAYOUT, nvSciBufObject$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout handle$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("handle")); - - /** - * Layout for field: - * {@snippet lang=c : - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciBufObject; - * } handle - * } - */ - public static final GroupLayout handle$layout() { - return handle$LAYOUT; - } - - private static final long handle$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciBufObject; - * } handle - * } - */ - public static final long handle$offset() { - return handle$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciBufObject; - * } handle - * } - */ - public static MemorySegment handle(MemorySegment struct) { - return struct.asSlice(handle$OFFSET, handle$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciBufObject; - * } handle - * } - */ - public static void handle(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, handle$OFFSET, handle$LAYOUT.byteSize()); - } - - private static final OfLong size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("size")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long size - * } - */ - public static final OfLong size$layout() { - return size$LAYOUT; - } - - private static final long size$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long size - * } - */ - public static final long size$offset() { - return size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long size - * } - */ - public static long size(MemorySegment struct) { - return struct.get(size$LAYOUT, size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long size - * } - */ - public static void size(MemorySegment struct, long fieldValue) { - struct.set(size$LAYOUT, size$OFFSET, fieldValue); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryMipmappedArrayDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryMipmappedArrayDesc.java deleted file mode 100644 index 4f567f0330..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalMemoryMipmappedArrayDesc.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalMemoryMipmappedArrayDesc { - * unsigned long long offset; - * struct cudaChannelFormatDesc formatDesc; - * struct cudaExtent extent; - * unsigned int flags; - * unsigned int numLevels; - * } - * } - */ -public class cudaExternalMemoryMipmappedArrayDesc { - - cudaExternalMemoryMipmappedArrayDesc() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("offset"), - cudaChannelFormatDesc.layout().withName("formatDesc"), - MemoryLayout.paddingLayout(4), - cudaExtent.layout().withName("extent"), - PanamaFFMAPI.C_INT.withName("flags"), - PanamaFFMAPI.C_INT.withName("numLevels") - ).withName("cudaExternalMemoryMipmappedArrayDesc"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong offset$LAYOUT = (OfLong)$LAYOUT.select(groupElement("offset")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long offset - * } - */ - public static final OfLong offset$layout() { - return offset$LAYOUT; - } - - private static final long offset$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long offset - * } - */ - public static final long offset$offset() { - return offset$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long offset - * } - */ - public static long offset(MemorySegment struct) { - return struct.get(offset$LAYOUT, offset$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long offset - * } - */ - public static void offset(MemorySegment struct, long fieldValue) { - struct.set(offset$LAYOUT, offset$OFFSET, fieldValue); - } - - private static final GroupLayout formatDesc$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("formatDesc")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc formatDesc - * } - */ - public static final GroupLayout formatDesc$layout() { - return formatDesc$LAYOUT; - } - - private static final long formatDesc$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc formatDesc - * } - */ - public static final long formatDesc$offset() { - return formatDesc$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc formatDesc - * } - */ - public static MemorySegment formatDesc(MemorySegment struct) { - return struct.asSlice(formatDesc$OFFSET, formatDesc$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc formatDesc - * } - */ - public static void formatDesc(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, formatDesc$OFFSET, formatDesc$LAYOUT.byteSize()); - } - - private static final GroupLayout extent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("extent")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static final GroupLayout extent$layout() { - return extent$LAYOUT; - } - - private static final long extent$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static final long extent$offset() { - return extent$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static MemorySegment extent(MemorySegment struct) { - return struct.asSlice(extent$OFFSET, extent$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static void extent(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, extent$OFFSET, extent$LAYOUT.byteSize()); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 56; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - private static final OfInt numLevels$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numLevels")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int numLevels - * } - */ - public static final OfInt numLevels$layout() { - return numLevels$LAYOUT; - } - - private static final long numLevels$OFFSET = 60; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int numLevels - * } - */ - public static final long numLevels$offset() { - return numLevels$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int numLevels - * } - */ - public static int numLevels(MemorySegment struct) { - return struct.get(numLevels$LAYOUT, numLevels$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int numLevels - * } - */ - public static void numLevels(MemorySegment struct, int fieldValue) { - struct.set(numLevels$LAYOUT, numLevels$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreHandleDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreHandleDesc.java deleted file mode 100644 index 533362f0b5..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreHandleDesc.java +++ /dev/null @@ -1,651 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalSemaphoreHandleDesc { - * enum cudaExternalSemaphoreHandleType type; - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciSyncObj; - * } handle; - * unsigned int flags; - * } - * } - */ -public class cudaExternalSemaphoreHandleDesc { - - cudaExternalSemaphoreHandleDesc() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("type"), - MemoryLayout.paddingLayout(4), - cudaExternalSemaphoreHandleDesc.handle.layout().withName("handle"), - PanamaFFMAPI.C_INT.withName("flags"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalSemaphoreHandleDesc"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType type - * } - */ - public static final OfInt type$layout() { - return type$LAYOUT; - } - - private static final long type$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType type - * } - */ - public static final long type$offset() { - return type$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType type - * } - */ - public static int type(MemorySegment struct) { - return struct.get(type$LAYOUT, type$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaExternalSemaphoreHandleType type - * } - */ - public static void type(MemorySegment struct, int fieldValue) { - struct.set(type$LAYOUT, type$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciSyncObj; - * } - * } - */ - public static class handle { - - handle() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - PanamaFFMAPI.C_INT.withName("fd"), - cudaExternalSemaphoreHandleDesc.handle.win32.layout().withName("win32"), - PanamaFFMAPI.C_POINTER.withName("nvSciSyncObj") - ).withName("$anon$2645:5"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt fd$LAYOUT = (OfInt)$LAYOUT.select(groupElement("fd")); - - /** - * Layout for field: - * {@snippet lang=c : - * int fd - * } - */ - public static final OfInt fd$layout() { - return fd$LAYOUT; - } - - private static final long fd$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int fd - * } - */ - public static final long fd$offset() { - return fd$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int fd - * } - */ - public static int fd(MemorySegment union) { - return union.get(fd$LAYOUT, fd$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int fd - * } - */ - public static void fd(MemorySegment union, int fieldValue) { - union.set(fd$LAYOUT, fd$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * struct { - * void *handle; - * const void *name; - * } - * } - */ - public static class win32 { - - win32() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("handle"), - PanamaFFMAPI.C_POINTER.withName("name") - ).withName("$anon$2668:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout handle$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("handle")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *handle - * } - */ - public static final AddressLayout handle$layout() { - return handle$LAYOUT; - } - - private static final long handle$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *handle - * } - */ - public static final long handle$offset() { - return handle$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *handle - * } - */ - public static MemorySegment handle(MemorySegment struct) { - return struct.get(handle$LAYOUT, handle$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *handle - * } - */ - public static void handle(MemorySegment struct, MemorySegment fieldValue) { - struct.set(handle$LAYOUT, handle$OFFSET, fieldValue); - } - - private static final AddressLayout name$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("name")); - - /** - * Layout for field: - * {@snippet lang=c : - * const void *name - * } - */ - public static final AddressLayout name$layout() { - return name$LAYOUT; - } - - private static final long name$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * const void *name - * } - */ - public static final long name$offset() { - return name$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const void *name - * } - */ - public static MemorySegment name(MemorySegment struct) { - return struct.get(name$LAYOUT, name$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const void *name - * } - */ - public static void name(MemorySegment struct, MemorySegment fieldValue) { - struct.set(name$LAYOUT, name$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout win32$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("win32")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * void *handle; - * const void *name; - * } win32 - * } - */ - public static final GroupLayout win32$layout() { - return win32$LAYOUT; - } - - private static final long win32$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * void *handle; - * const void *name; - * } win32 - * } - */ - public static final long win32$offset() { - return win32$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * void *handle; - * const void *name; - * } win32 - * } - */ - public static MemorySegment win32(MemorySegment union) { - return union.asSlice(win32$OFFSET, win32$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * void *handle; - * const void *name; - * } win32 - * } - */ - public static void win32(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, win32$OFFSET, win32$LAYOUT.byteSize()); - } - - private static final AddressLayout nvSciSyncObj$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("nvSciSyncObj")); - - /** - * Layout for field: - * {@snippet lang=c : - * const void *nvSciSyncObj - * } - */ - public static final AddressLayout nvSciSyncObj$layout() { - return nvSciSyncObj$LAYOUT; - } - - private static final long nvSciSyncObj$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const void *nvSciSyncObj - * } - */ - public static final long nvSciSyncObj$offset() { - return nvSciSyncObj$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const void *nvSciSyncObj - * } - */ - public static MemorySegment nvSciSyncObj(MemorySegment union) { - return union.get(nvSciSyncObj$LAYOUT, nvSciSyncObj$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const void *nvSciSyncObj - * } - */ - public static void nvSciSyncObj(MemorySegment union, MemorySegment fieldValue) { - union.set(nvSciSyncObj$LAYOUT, nvSciSyncObj$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout handle$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("handle")); - - /** - * Layout for field: - * {@snippet lang=c : - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciSyncObj; - * } handle - * } - */ - public static final GroupLayout handle$layout() { - return handle$LAYOUT; - } - - private static final long handle$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciSyncObj; - * } handle - * } - */ - public static final long handle$offset() { - return handle$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciSyncObj; - * } handle - * } - */ - public static MemorySegment handle(MemorySegment struct) { - return struct.asSlice(handle$OFFSET, handle$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * union { - * int fd; - * struct { - * void *handle; - * const void *name; - * } win32; - * const void *nvSciSyncObj; - * } handle - * } - */ - public static void handle(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, handle$OFFSET, handle$LAYOUT.byteSize()); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParams.java deleted file mode 100644 index c87b5ada28..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParams.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalSemaphoreSignalNodeParams { - * cudaExternalSemaphore_t *extSemArray; - * const struct cudaExternalSemaphoreSignalParams *paramsArray; - * unsigned int numExtSems; - * } - * } - */ -public class cudaExternalSemaphoreSignalNodeParams { - - cudaExternalSemaphoreSignalNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("extSemArray"), - PanamaFFMAPI.C_POINTER.withName("paramsArray"), - PanamaFFMAPI.C_INT.withName("numExtSems"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalSemaphoreSignalNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout extSemArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extSemArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static final AddressLayout extSemArray$layout() { - return extSemArray$LAYOUT; - } - - private static final long extSemArray$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static final long extSemArray$offset() { - return extSemArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static MemorySegment extSemArray(MemorySegment struct) { - return struct.get(extSemArray$LAYOUT, extSemArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static void extSemArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(extSemArray$LAYOUT, extSemArray$OFFSET, fieldValue); - } - - private static final AddressLayout paramsArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("paramsArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreSignalParams *paramsArray - * } - */ - public static final AddressLayout paramsArray$layout() { - return paramsArray$LAYOUT; - } - - private static final long paramsArray$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreSignalParams *paramsArray - * } - */ - public static final long paramsArray$offset() { - return paramsArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreSignalParams *paramsArray - * } - */ - public static MemorySegment paramsArray(MemorySegment struct) { - return struct.get(paramsArray$LAYOUT, paramsArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreSignalParams *paramsArray - * } - */ - public static void paramsArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(paramsArray$LAYOUT, paramsArray$OFFSET, fieldValue); - } - - private static final OfInt numExtSems$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numExtSems")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static final OfInt numExtSems$layout() { - return numExtSems$LAYOUT; - } - - private static final long numExtSems$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static final long numExtSems$offset() { - return numExtSems$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static int numExtSems(MemorySegment struct) { - return struct.get(numExtSems$LAYOUT, numExtSems$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static void numExtSems(MemorySegment struct, int fieldValue) { - struct.set(numExtSems$LAYOUT, numExtSems$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParamsV2.java deleted file mode 100644 index 7a88b6bfa5..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalNodeParamsV2.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalSemaphoreSignalNodeParamsV2 { - * cudaExternalSemaphore_t *extSemArray; - * const struct cudaExternalSemaphoreSignalParams *paramsArray; - * unsigned int numExtSems; - * } - * } - */ -public class cudaExternalSemaphoreSignalNodeParamsV2 { - - cudaExternalSemaphoreSignalNodeParamsV2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("extSemArray"), - PanamaFFMAPI.C_POINTER.withName("paramsArray"), - PanamaFFMAPI.C_INT.withName("numExtSems"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalSemaphoreSignalNodeParamsV2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout extSemArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extSemArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static final AddressLayout extSemArray$layout() { - return extSemArray$LAYOUT; - } - - private static final long extSemArray$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static final long extSemArray$offset() { - return extSemArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static MemorySegment extSemArray(MemorySegment struct) { - return struct.get(extSemArray$LAYOUT, extSemArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static void extSemArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(extSemArray$LAYOUT, extSemArray$OFFSET, fieldValue); - } - - private static final AddressLayout paramsArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("paramsArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreSignalParams *paramsArray - * } - */ - public static final AddressLayout paramsArray$layout() { - return paramsArray$LAYOUT; - } - - private static final long paramsArray$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreSignalParams *paramsArray - * } - */ - public static final long paramsArray$offset() { - return paramsArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreSignalParams *paramsArray - * } - */ - public static MemorySegment paramsArray(MemorySegment struct) { - return struct.get(paramsArray$LAYOUT, paramsArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreSignalParams *paramsArray - * } - */ - public static void paramsArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(paramsArray$LAYOUT, paramsArray$OFFSET, fieldValue); - } - - private static final OfInt numExtSems$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numExtSems")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static final OfInt numExtSems$layout() { - return numExtSems$LAYOUT; - } - - private static final long numExtSems$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static final long numExtSems$offset() { - return numExtSems$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static int numExtSems(MemorySegment struct) { - return struct.get(numExtSems$LAYOUT, numExtSems$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static void numExtSems(MemorySegment struct, int fieldValue) { - struct.set(numExtSems$LAYOUT, numExtSems$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams.java deleted file mode 100644 index 90b0aed802..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams.java +++ /dev/null @@ -1,1033 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalSemaphoreSignalParams { - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * unsigned int reserved[12]; - * } params; - * unsigned int flags; - * unsigned int reserved[16]; - * } - * } - */ -public class cudaExternalSemaphoreSignalParams { - - cudaExternalSemaphoreSignalParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaExternalSemaphoreSignalParams.params.layout().withName("params"), - PanamaFFMAPI.C_INT.withName("flags"), - MemoryLayout.sequenceLayout(16, PanamaFFMAPI.C_INT).withName("reserved"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalSemaphoreSignalParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * unsigned int reserved[12]; - * } - * } - */ - public static class params { - - params() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaExternalSemaphoreSignalParams.params.fence.layout().withName("fence"), - cudaExternalSemaphoreSignalParams.params.nvSciSync.layout().withName("nvSciSync"), - cudaExternalSemaphoreSignalParams.params.keyedMutex.layout().withName("keyedMutex"), - MemoryLayout.sequenceLayout(12, PanamaFFMAPI.C_INT).withName("reserved") - ).withName("$anon$2788:5"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } - * } - */ - public static class fence { - - fence() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("value") - ).withName("$anon$2792:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong value$LAYOUT = (OfLong)$LAYOUT.select(groupElement("value")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static final OfLong value$layout() { - return value$LAYOUT; - } - - private static final long value$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static final long value$offset() { - return value$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static long value(MemorySegment struct) { - return struct.get(value$LAYOUT, value$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static void value(MemorySegment struct, long fieldValue) { - struct.set(value$LAYOUT, value$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout fence$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("fence")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static final GroupLayout fence$layout() { - return fence$LAYOUT; - } - - private static final long fence$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static final long fence$offset() { - return fence$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static MemorySegment fence(MemorySegment struct) { - return struct.asSlice(fence$OFFSET, fence$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static void fence(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, fence$OFFSET, fence$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } - * } - */ - public static class nvSciSync { - - nvSciSync() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - PanamaFFMAPI.C_POINTER.withName("fence"), - PanamaFFMAPI.C_LONG_LONG.withName("reserved") - ).withName("$anon$2798:9"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout fence$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fence")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static final AddressLayout fence$layout() { - return fence$LAYOUT; - } - - private static final long fence$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static final long fence$offset() { - return fence$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static MemorySegment fence(MemorySegment union) { - return union.get(fence$LAYOUT, fence$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static void fence(MemorySegment union, MemorySegment fieldValue) { - union.set(fence$LAYOUT, fence$OFFSET, fieldValue); - } - - private static final OfLong reserved$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static final OfLong reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static long reserved(MemorySegment union) { - return union.get(reserved$LAYOUT, reserved$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static void reserved(MemorySegment union, long fieldValue) { - union.set(reserved$LAYOUT, reserved$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout nvSciSync$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("nvSciSync")); - - /** - * Layout for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static final GroupLayout nvSciSync$layout() { - return nvSciSync$LAYOUT; - } - - private static final long nvSciSync$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static final long nvSciSync$offset() { - return nvSciSync$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static MemorySegment nvSciSync(MemorySegment struct) { - return struct.asSlice(nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static void nvSciSync(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * struct { - * unsigned long long key; - * } - * } - */ - public static class keyedMutex { - - keyedMutex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("key") - ).withName("$anon$2809:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong key$LAYOUT = (OfLong)$LAYOUT.select(groupElement("key")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static final OfLong key$layout() { - return key$LAYOUT; - } - - private static final long key$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static final long key$offset() { - return key$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static long key(MemorySegment struct) { - return struct.get(key$LAYOUT, key$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static void key(MemorySegment struct, long fieldValue) { - struct.set(key$LAYOUT, key$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout keyedMutex$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("keyedMutex")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * } keyedMutex - * } - */ - public static final GroupLayout keyedMutex$layout() { - return keyedMutex$LAYOUT; - } - - private static final long keyedMutex$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * } keyedMutex - * } - */ - public static final long keyedMutex$offset() { - return keyedMutex$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * } keyedMutex - * } - */ - public static MemorySegment keyedMutex(MemorySegment struct) { - return struct.asSlice(keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * } keyedMutex - * } - */ - public static void keyedMutex(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int reserved[12] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int reserved[12] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int reserved[12] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int reserved[12] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 12 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned int reserved[12] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned int reserved[12] - * } - */ - public static int reserved(MemorySegment struct, long index0) { - return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned int reserved[12] - * } - */ - public static void reserved(MemorySegment struct, long index0, int fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout params$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("params")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * unsigned int reserved[12]; - * } params - * } - */ - public static final GroupLayout params$layout() { - return params$LAYOUT; - } - - private static final long params$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * unsigned int reserved[12]; - * } params - * } - */ - public static final long params$offset() { - return params$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * unsigned int reserved[12]; - * } params - * } - */ - public static MemorySegment params(MemorySegment struct) { - return struct.asSlice(params$OFFSET, params$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * unsigned int reserved[12]; - * } params - * } - */ - public static void params(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, params$OFFSET, params$LAYOUT.byteSize()); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 72; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 76; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 16 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static int reserved(MemorySegment struct, long index0) { - return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static void reserved(MemorySegment struct, long index0, int fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams_v1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams_v1.java deleted file mode 100644 index c9a8452b48..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreSignalParams_v1.java +++ /dev/null @@ -1,870 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalSemaphoreSignalParams_v1 { - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * } params; - * unsigned int flags; - * } - * } - */ -public class cudaExternalSemaphoreSignalParams_v1 { - - cudaExternalSemaphoreSignalParams_v1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaExternalSemaphoreSignalParams_v1.params.layout().withName("params"), - PanamaFFMAPI.C_INT.withName("flags"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalSemaphoreSignalParams_v1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * } - * } - */ - public static class params { - - params() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaExternalSemaphoreSignalParams_v1.params.fence.layout().withName("fence"), - cudaExternalSemaphoreSignalParams_v1.params.nvSciSync.layout().withName("nvSciSync"), - cudaExternalSemaphoreSignalParams_v1.params.keyedMutex.layout().withName("keyedMutex") - ).withName("$anon$2694:5"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } - * } - */ - public static class fence { - - fence() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("value") - ).withName("$anon$2698:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong value$LAYOUT = (OfLong)$LAYOUT.select(groupElement("value")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static final OfLong value$layout() { - return value$LAYOUT; - } - - private static final long value$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static final long value$offset() { - return value$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static long value(MemorySegment struct) { - return struct.get(value$LAYOUT, value$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static void value(MemorySegment struct, long fieldValue) { - struct.set(value$LAYOUT, value$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout fence$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("fence")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static final GroupLayout fence$layout() { - return fence$LAYOUT; - } - - private static final long fence$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static final long fence$offset() { - return fence$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static MemorySegment fence(MemorySegment struct) { - return struct.asSlice(fence$OFFSET, fence$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static void fence(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, fence$OFFSET, fence$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } - * } - */ - public static class nvSciSync { - - nvSciSync() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - PanamaFFMAPI.C_POINTER.withName("fence"), - PanamaFFMAPI.C_LONG_LONG.withName("reserved") - ).withName("$anon$2704:9"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout fence$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fence")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static final AddressLayout fence$layout() { - return fence$LAYOUT; - } - - private static final long fence$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static final long fence$offset() { - return fence$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static MemorySegment fence(MemorySegment union) { - return union.get(fence$LAYOUT, fence$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static void fence(MemorySegment union, MemorySegment fieldValue) { - union.set(fence$LAYOUT, fence$OFFSET, fieldValue); - } - - private static final OfLong reserved$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static final OfLong reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static long reserved(MemorySegment union) { - return union.get(reserved$LAYOUT, reserved$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static void reserved(MemorySegment union, long fieldValue) { - union.set(reserved$LAYOUT, reserved$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout nvSciSync$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("nvSciSync")); - - /** - * Layout for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static final GroupLayout nvSciSync$layout() { - return nvSciSync$LAYOUT; - } - - private static final long nvSciSync$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static final long nvSciSync$offset() { - return nvSciSync$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static MemorySegment nvSciSync(MemorySegment struct) { - return struct.asSlice(nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static void nvSciSync(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * struct { - * unsigned long long key; - * } - * } - */ - public static class keyedMutex { - - keyedMutex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("key") - ).withName("$anon$2715:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong key$LAYOUT = (OfLong)$LAYOUT.select(groupElement("key")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static final OfLong key$layout() { - return key$LAYOUT; - } - - private static final long key$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static final long key$offset() { - return key$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static long key(MemorySegment struct) { - return struct.get(key$LAYOUT, key$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static void key(MemorySegment struct, long fieldValue) { - struct.set(key$LAYOUT, key$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout keyedMutex$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("keyedMutex")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * } keyedMutex - * } - */ - public static final GroupLayout keyedMutex$layout() { - return keyedMutex$LAYOUT; - } - - private static final long keyedMutex$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * } keyedMutex - * } - */ - public static final long keyedMutex$offset() { - return keyedMutex$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * } keyedMutex - * } - */ - public static MemorySegment keyedMutex(MemorySegment struct) { - return struct.asSlice(keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * } keyedMutex - * } - */ - public static void keyedMutex(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout params$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("params")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * } params - * } - */ - public static final GroupLayout params$layout() { - return params$LAYOUT; - } - - private static final long params$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * } params - * } - */ - public static final long params$offset() { - return params$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * } params - * } - */ - public static MemorySegment params(MemorySegment struct) { - return struct.asSlice(params$OFFSET, params$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * } keyedMutex; - * } params - * } - */ - public static void params(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, params$OFFSET, params$LAYOUT.byteSize()); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParams.java deleted file mode 100644 index 2a2997ce19..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParams.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalSemaphoreWaitNodeParams { - * cudaExternalSemaphore_t *extSemArray; - * const struct cudaExternalSemaphoreWaitParams *paramsArray; - * unsigned int numExtSems; - * } - * } - */ -public class cudaExternalSemaphoreWaitNodeParams { - - cudaExternalSemaphoreWaitNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("extSemArray"), - PanamaFFMAPI.C_POINTER.withName("paramsArray"), - PanamaFFMAPI.C_INT.withName("numExtSems"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalSemaphoreWaitNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout extSemArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extSemArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static final AddressLayout extSemArray$layout() { - return extSemArray$LAYOUT; - } - - private static final long extSemArray$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static final long extSemArray$offset() { - return extSemArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static MemorySegment extSemArray(MemorySegment struct) { - return struct.get(extSemArray$LAYOUT, extSemArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static void extSemArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(extSemArray$LAYOUT, extSemArray$OFFSET, fieldValue); - } - - private static final AddressLayout paramsArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("paramsArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreWaitParams *paramsArray - * } - */ - public static final AddressLayout paramsArray$layout() { - return paramsArray$LAYOUT; - } - - private static final long paramsArray$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreWaitParams *paramsArray - * } - */ - public static final long paramsArray$offset() { - return paramsArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreWaitParams *paramsArray - * } - */ - public static MemorySegment paramsArray(MemorySegment struct) { - return struct.get(paramsArray$LAYOUT, paramsArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreWaitParams *paramsArray - * } - */ - public static void paramsArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(paramsArray$LAYOUT, paramsArray$OFFSET, fieldValue); - } - - private static final OfInt numExtSems$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numExtSems")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static final OfInt numExtSems$layout() { - return numExtSems$LAYOUT; - } - - private static final long numExtSems$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static final long numExtSems$offset() { - return numExtSems$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static int numExtSems(MemorySegment struct) { - return struct.get(numExtSems$LAYOUT, numExtSems$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static void numExtSems(MemorySegment struct, int fieldValue) { - struct.set(numExtSems$LAYOUT, numExtSems$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParamsV2.java deleted file mode 100644 index a12dd2628f..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitNodeParamsV2.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalSemaphoreWaitNodeParamsV2 { - * cudaExternalSemaphore_t *extSemArray; - * const struct cudaExternalSemaphoreWaitParams *paramsArray; - * unsigned int numExtSems; - * } - * } - */ -public class cudaExternalSemaphoreWaitNodeParamsV2 { - - cudaExternalSemaphoreWaitNodeParamsV2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("extSemArray"), - PanamaFFMAPI.C_POINTER.withName("paramsArray"), - PanamaFFMAPI.C_INT.withName("numExtSems"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalSemaphoreWaitNodeParamsV2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout extSemArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extSemArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static final AddressLayout extSemArray$layout() { - return extSemArray$LAYOUT; - } - - private static final long extSemArray$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static final long extSemArray$offset() { - return extSemArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static MemorySegment extSemArray(MemorySegment struct) { - return struct.get(extSemArray$LAYOUT, extSemArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaExternalSemaphore_t *extSemArray - * } - */ - public static void extSemArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(extSemArray$LAYOUT, extSemArray$OFFSET, fieldValue); - } - - private static final AddressLayout paramsArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("paramsArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreWaitParams *paramsArray - * } - */ - public static final AddressLayout paramsArray$layout() { - return paramsArray$LAYOUT; - } - - private static final long paramsArray$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreWaitParams *paramsArray - * } - */ - public static final long paramsArray$offset() { - return paramsArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreWaitParams *paramsArray - * } - */ - public static MemorySegment paramsArray(MemorySegment struct) { - return struct.get(paramsArray$LAYOUT, paramsArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const struct cudaExternalSemaphoreWaitParams *paramsArray - * } - */ - public static void paramsArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(paramsArray$LAYOUT, paramsArray$OFFSET, fieldValue); - } - - private static final OfInt numExtSems$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numExtSems")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static final OfInt numExtSems$layout() { - return numExtSems$LAYOUT; - } - - private static final long numExtSems$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static final long numExtSems$offset() { - return numExtSems$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static int numExtSems(MemorySegment struct) { - return struct.get(numExtSems$LAYOUT, numExtSems$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int numExtSems - * } - */ - public static void numExtSems(MemorySegment struct, int fieldValue) { - struct.set(numExtSems$LAYOUT, numExtSems$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams.java deleted file mode 100644 index 06aea40d34..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams.java +++ /dev/null @@ -1,1090 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalSemaphoreWaitParams { - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * unsigned int reserved[10]; - * } params; - * unsigned int flags; - * unsigned int reserved[16]; - * } - * } - */ -public class cudaExternalSemaphoreWaitParams { - - cudaExternalSemaphoreWaitParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaExternalSemaphoreWaitParams.params.layout().withName("params"), - PanamaFFMAPI.C_INT.withName("flags"), - MemoryLayout.sequenceLayout(16, PanamaFFMAPI.C_INT).withName("reserved"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalSemaphoreWaitParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * unsigned int reserved[10]; - * } - * } - */ - public static class params { - - params() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaExternalSemaphoreWaitParams.params.fence.layout().withName("fence"), - cudaExternalSemaphoreWaitParams.params.nvSciSync.layout().withName("nvSciSync"), - cudaExternalSemaphoreWaitParams.params.keyedMutex.layout().withName("keyedMutex"), - MemoryLayout.sequenceLayout(10, PanamaFFMAPI.C_INT).withName("reserved") - ).withName("$anon$2835:5"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } - * } - */ - public static class fence { - - fence() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("value") - ).withName("$anon$2839:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong value$LAYOUT = (OfLong)$LAYOUT.select(groupElement("value")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static final OfLong value$layout() { - return value$LAYOUT; - } - - private static final long value$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static final long value$offset() { - return value$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static long value(MemorySegment struct) { - return struct.get(value$LAYOUT, value$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static void value(MemorySegment struct, long fieldValue) { - struct.set(value$LAYOUT, value$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout fence$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("fence")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static final GroupLayout fence$layout() { - return fence$LAYOUT; - } - - private static final long fence$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static final long fence$offset() { - return fence$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static MemorySegment fence(MemorySegment struct) { - return struct.asSlice(fence$OFFSET, fence$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static void fence(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, fence$OFFSET, fence$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } - * } - */ - public static class nvSciSync { - - nvSciSync() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - PanamaFFMAPI.C_POINTER.withName("fence"), - PanamaFFMAPI.C_LONG_LONG.withName("reserved") - ).withName("$anon$2845:9"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout fence$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fence")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static final AddressLayout fence$layout() { - return fence$LAYOUT; - } - - private static final long fence$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static final long fence$offset() { - return fence$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static MemorySegment fence(MemorySegment union) { - return union.get(fence$LAYOUT, fence$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static void fence(MemorySegment union, MemorySegment fieldValue) { - union.set(fence$LAYOUT, fence$OFFSET, fieldValue); - } - - private static final OfLong reserved$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static final OfLong reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static long reserved(MemorySegment union) { - return union.get(reserved$LAYOUT, reserved$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static void reserved(MemorySegment union, long fieldValue) { - union.set(reserved$LAYOUT, reserved$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout nvSciSync$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("nvSciSync")); - - /** - * Layout for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static final GroupLayout nvSciSync$layout() { - return nvSciSync$LAYOUT; - } - - private static final long nvSciSync$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static final long nvSciSync$offset() { - return nvSciSync$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static MemorySegment nvSciSync(MemorySegment struct) { - return struct.asSlice(nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static void nvSciSync(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } - * } - */ - public static class keyedMutex { - - keyedMutex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("key"), - PanamaFFMAPI.C_INT.withName("timeoutMs"), - MemoryLayout.paddingLayout(4) - ).withName("$anon$2856:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong key$LAYOUT = (OfLong)$LAYOUT.select(groupElement("key")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static final OfLong key$layout() { - return key$LAYOUT; - } - - private static final long key$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static final long key$offset() { - return key$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static long key(MemorySegment struct) { - return struct.get(key$LAYOUT, key$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static void key(MemorySegment struct, long fieldValue) { - struct.set(key$LAYOUT, key$OFFSET, fieldValue); - } - - private static final OfInt timeoutMs$LAYOUT = (OfInt)$LAYOUT.select(groupElement("timeoutMs")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int timeoutMs - * } - */ - public static final OfInt timeoutMs$layout() { - return timeoutMs$LAYOUT; - } - - private static final long timeoutMs$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int timeoutMs - * } - */ - public static final long timeoutMs$offset() { - return timeoutMs$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int timeoutMs - * } - */ - public static int timeoutMs(MemorySegment struct) { - return struct.get(timeoutMs$LAYOUT, timeoutMs$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int timeoutMs - * } - */ - public static void timeoutMs(MemorySegment struct, int fieldValue) { - struct.set(timeoutMs$LAYOUT, timeoutMs$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout keyedMutex$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("keyedMutex")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex - * } - */ - public static final GroupLayout keyedMutex$layout() { - return keyedMutex$LAYOUT; - } - - private static final long keyedMutex$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex - * } - */ - public static final long keyedMutex$offset() { - return keyedMutex$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex - * } - */ - public static MemorySegment keyedMutex(MemorySegment struct) { - return struct.asSlice(keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex - * } - */ - public static void keyedMutex(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int reserved[10] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int reserved[10] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int reserved[10] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int reserved[10] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 10 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned int reserved[10] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned int reserved[10] - * } - */ - public static int reserved(MemorySegment struct, long index0) { - return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned int reserved[10] - * } - */ - public static void reserved(MemorySegment struct, long index0, int fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout params$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("params")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * unsigned int reserved[10]; - * } params - * } - */ - public static final GroupLayout params$layout() { - return params$LAYOUT; - } - - private static final long params$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * unsigned int reserved[10]; - * } params - * } - */ - public static final long params$offset() { - return params$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * unsigned int reserved[10]; - * } params - * } - */ - public static MemorySegment params(MemorySegment struct) { - return struct.asSlice(params$OFFSET, params$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * unsigned int reserved[10]; - * } params - * } - */ - public static void params(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, params$OFFSET, params$LAYOUT.byteSize()); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 72; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 76; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 16 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static int reserved(MemorySegment struct, long index0) { - return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned int reserved[16] - * } - */ - public static void reserved(MemorySegment struct, long index0, int fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams_v1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams_v1.java deleted file mode 100644 index c48302456e..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaExternalSemaphoreWaitParams_v1.java +++ /dev/null @@ -1,927 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaExternalSemaphoreWaitParams_v1 { - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * } params; - * unsigned int flags; - * } - * } - */ -public class cudaExternalSemaphoreWaitParams_v1 { - - cudaExternalSemaphoreWaitParams_v1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaExternalSemaphoreWaitParams_v1.params.layout().withName("params"), - PanamaFFMAPI.C_INT.withName("flags"), - MemoryLayout.paddingLayout(4) - ).withName("cudaExternalSemaphoreWaitParams_v1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * } - * } - */ - public static class params { - - params() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaExternalSemaphoreWaitParams_v1.params.fence.layout().withName("fence"), - cudaExternalSemaphoreWaitParams_v1.params.nvSciSync.layout().withName("nvSciSync"), - cudaExternalSemaphoreWaitParams_v1.params.keyedMutex.layout().withName("keyedMutex") - ).withName("$anon$2739:5"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } - * } - */ - public static class fence { - - fence() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("value") - ).withName("$anon$2743:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong value$LAYOUT = (OfLong)$LAYOUT.select(groupElement("value")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static final OfLong value$layout() { - return value$LAYOUT; - } - - private static final long value$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static final long value$offset() { - return value$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static long value(MemorySegment struct) { - return struct.get(value$LAYOUT, value$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long value - * } - */ - public static void value(MemorySegment struct, long fieldValue) { - struct.set(value$LAYOUT, value$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout fence$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("fence")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static final GroupLayout fence$layout() { - return fence$LAYOUT; - } - - private static final long fence$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static final long fence$offset() { - return fence$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static MemorySegment fence(MemorySegment struct) { - return struct.asSlice(fence$OFFSET, fence$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned long long value; - * } fence - * } - */ - public static void fence(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, fence$OFFSET, fence$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } - * } - */ - public static class nvSciSync { - - nvSciSync() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - PanamaFFMAPI.C_POINTER.withName("fence"), - PanamaFFMAPI.C_LONG_LONG.withName("reserved") - ).withName("$anon$2749:9"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout fence$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fence")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static final AddressLayout fence$layout() { - return fence$LAYOUT; - } - - private static final long fence$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static final long fence$offset() { - return fence$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static MemorySegment fence(MemorySegment union) { - return union.get(fence$LAYOUT, fence$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *fence - * } - */ - public static void fence(MemorySegment union, MemorySegment fieldValue) { - union.set(fence$LAYOUT, fence$OFFSET, fieldValue); - } - - private static final OfLong reserved$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static final OfLong reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static long reserved(MemorySegment union) { - return union.get(reserved$LAYOUT, reserved$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long reserved - * } - */ - public static void reserved(MemorySegment union, long fieldValue) { - union.set(reserved$LAYOUT, reserved$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout nvSciSync$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("nvSciSync")); - - /** - * Layout for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static final GroupLayout nvSciSync$layout() { - return nvSciSync$LAYOUT; - } - - private static final long nvSciSync$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static final long nvSciSync$offset() { - return nvSciSync$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static MemorySegment nvSciSync(MemorySegment struct) { - return struct.asSlice(nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync - * } - */ - public static void nvSciSync(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, nvSciSync$OFFSET, nvSciSync$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } - * } - */ - public static class keyedMutex { - - keyedMutex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("key"), - PanamaFFMAPI.C_INT.withName("timeoutMs"), - MemoryLayout.paddingLayout(4) - ).withName("$anon$2760:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong key$LAYOUT = (OfLong)$LAYOUT.select(groupElement("key")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static final OfLong key$layout() { - return key$LAYOUT; - } - - private static final long key$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static final long key$offset() { - return key$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static long key(MemorySegment struct) { - return struct.get(key$LAYOUT, key$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long key - * } - */ - public static void key(MemorySegment struct, long fieldValue) { - struct.set(key$LAYOUT, key$OFFSET, fieldValue); - } - - private static final OfInt timeoutMs$LAYOUT = (OfInt)$LAYOUT.select(groupElement("timeoutMs")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int timeoutMs - * } - */ - public static final OfInt timeoutMs$layout() { - return timeoutMs$LAYOUT; - } - - private static final long timeoutMs$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int timeoutMs - * } - */ - public static final long timeoutMs$offset() { - return timeoutMs$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int timeoutMs - * } - */ - public static int timeoutMs(MemorySegment struct) { - return struct.get(timeoutMs$LAYOUT, timeoutMs$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int timeoutMs - * } - */ - public static void timeoutMs(MemorySegment struct, int fieldValue) { - struct.set(timeoutMs$LAYOUT, timeoutMs$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout keyedMutex$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("keyedMutex")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex - * } - */ - public static final GroupLayout keyedMutex$layout() { - return keyedMutex$LAYOUT; - } - - private static final long keyedMutex$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex - * } - */ - public static final long keyedMutex$offset() { - return keyedMutex$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex - * } - */ - public static MemorySegment keyedMutex(MemorySegment struct) { - return struct.asSlice(keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex - * } - */ - public static void keyedMutex(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, keyedMutex$OFFSET, keyedMutex$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout params$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("params")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * } params - * } - */ - public static final GroupLayout params$layout() { - return params$LAYOUT; - } - - private static final long params$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * } params - * } - */ - public static final long params$offset() { - return params$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * } params - * } - */ - public static MemorySegment params(MemorySegment struct) { - return struct.asSlice(params$OFFSET, params$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * struct { - * unsigned long long value; - * } fence; - * union { - * void *fence; - * unsigned long long reserved; - * } nvSciSync; - * struct { - * unsigned long long key; - * unsigned int timeoutMs; - * } keyedMutex; - * } params - * } - */ - public static void params(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, params$OFFSET, params$LAYOUT.byteSize()); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaFuncAttributes.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaFuncAttributes.java deleted file mode 100644 index 1c0f7bcca2..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaFuncAttributes.java +++ /dev/null @@ -1,913 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaFuncAttributes { - * size_t sharedSizeBytes; - * size_t constSizeBytes; - * size_t localSizeBytes; - * int maxThreadsPerBlock; - * int numRegs; - * int ptxVersion; - * int binaryVersion; - * int cacheModeCA; - * int maxDynamicSharedSizeBytes; - * int preferredShmemCarveout; - * int clusterDimMustBeSet; - * int requiredClusterWidth; - * int requiredClusterHeight; - * int requiredClusterDepth; - * int clusterSchedulingPolicyPreference; - * int nonPortableClusterSizeAllowed; - * int reserved[16]; - * } - * } - */ -public class cudaFuncAttributes { - - cudaFuncAttributes() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("sharedSizeBytes"), - PanamaFFMAPI.C_LONG.withName("constSizeBytes"), - PanamaFFMAPI.C_LONG.withName("localSizeBytes"), - PanamaFFMAPI.C_INT.withName("maxThreadsPerBlock"), - PanamaFFMAPI.C_INT.withName("numRegs"), - PanamaFFMAPI.C_INT.withName("ptxVersion"), - PanamaFFMAPI.C_INT.withName("binaryVersion"), - PanamaFFMAPI.C_INT.withName("cacheModeCA"), - PanamaFFMAPI.C_INT.withName("maxDynamicSharedSizeBytes"), - PanamaFFMAPI.C_INT.withName("preferredShmemCarveout"), - PanamaFFMAPI.C_INT.withName("clusterDimMustBeSet"), - PanamaFFMAPI.C_INT.withName("requiredClusterWidth"), - PanamaFFMAPI.C_INT.withName("requiredClusterHeight"), - PanamaFFMAPI.C_INT.withName("requiredClusterDepth"), - PanamaFFMAPI.C_INT.withName("clusterSchedulingPolicyPreference"), - PanamaFFMAPI.C_INT.withName("nonPortableClusterSizeAllowed"), - MemoryLayout.sequenceLayout(16, PanamaFFMAPI.C_INT).withName("reserved"), - MemoryLayout.paddingLayout(4) - ).withName("cudaFuncAttributes"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong sharedSizeBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sharedSizeBytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t sharedSizeBytes - * } - */ - public static final OfLong sharedSizeBytes$layout() { - return sharedSizeBytes$LAYOUT; - } - - private static final long sharedSizeBytes$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t sharedSizeBytes - * } - */ - public static final long sharedSizeBytes$offset() { - return sharedSizeBytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t sharedSizeBytes - * } - */ - public static long sharedSizeBytes(MemorySegment struct) { - return struct.get(sharedSizeBytes$LAYOUT, sharedSizeBytes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t sharedSizeBytes - * } - */ - public static void sharedSizeBytes(MemorySegment struct, long fieldValue) { - struct.set(sharedSizeBytes$LAYOUT, sharedSizeBytes$OFFSET, fieldValue); - } - - private static final OfLong constSizeBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("constSizeBytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t constSizeBytes - * } - */ - public static final OfLong constSizeBytes$layout() { - return constSizeBytes$LAYOUT; - } - - private static final long constSizeBytes$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t constSizeBytes - * } - */ - public static final long constSizeBytes$offset() { - return constSizeBytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t constSizeBytes - * } - */ - public static long constSizeBytes(MemorySegment struct) { - return struct.get(constSizeBytes$LAYOUT, constSizeBytes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t constSizeBytes - * } - */ - public static void constSizeBytes(MemorySegment struct, long fieldValue) { - struct.set(constSizeBytes$LAYOUT, constSizeBytes$OFFSET, fieldValue); - } - - private static final OfLong localSizeBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("localSizeBytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t localSizeBytes - * } - */ - public static final OfLong localSizeBytes$layout() { - return localSizeBytes$LAYOUT; - } - - private static final long localSizeBytes$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t localSizeBytes - * } - */ - public static final long localSizeBytes$offset() { - return localSizeBytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t localSizeBytes - * } - */ - public static long localSizeBytes(MemorySegment struct) { - return struct.get(localSizeBytes$LAYOUT, localSizeBytes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t localSizeBytes - * } - */ - public static void localSizeBytes(MemorySegment struct, long fieldValue) { - struct.set(localSizeBytes$LAYOUT, localSizeBytes$OFFSET, fieldValue); - } - - private static final OfInt maxThreadsPerBlock$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxThreadsPerBlock")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxThreadsPerBlock - * } - */ - public static final OfInt maxThreadsPerBlock$layout() { - return maxThreadsPerBlock$LAYOUT; - } - - private static final long maxThreadsPerBlock$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxThreadsPerBlock - * } - */ - public static final long maxThreadsPerBlock$offset() { - return maxThreadsPerBlock$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxThreadsPerBlock - * } - */ - public static int maxThreadsPerBlock(MemorySegment struct) { - return struct.get(maxThreadsPerBlock$LAYOUT, maxThreadsPerBlock$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxThreadsPerBlock - * } - */ - public static void maxThreadsPerBlock(MemorySegment struct, int fieldValue) { - struct.set(maxThreadsPerBlock$LAYOUT, maxThreadsPerBlock$OFFSET, fieldValue); - } - - private static final OfInt numRegs$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numRegs")); - - /** - * Layout for field: - * {@snippet lang=c : - * int numRegs - * } - */ - public static final OfInt numRegs$layout() { - return numRegs$LAYOUT; - } - - private static final long numRegs$OFFSET = 28; - - /** - * Offset for field: - * {@snippet lang=c : - * int numRegs - * } - */ - public static final long numRegs$offset() { - return numRegs$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int numRegs - * } - */ - public static int numRegs(MemorySegment struct) { - return struct.get(numRegs$LAYOUT, numRegs$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int numRegs - * } - */ - public static void numRegs(MemorySegment struct, int fieldValue) { - struct.set(numRegs$LAYOUT, numRegs$OFFSET, fieldValue); - } - - private static final OfInt ptxVersion$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ptxVersion")); - - /** - * Layout for field: - * {@snippet lang=c : - * int ptxVersion - * } - */ - public static final OfInt ptxVersion$layout() { - return ptxVersion$LAYOUT; - } - - private static final long ptxVersion$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * int ptxVersion - * } - */ - public static final long ptxVersion$offset() { - return ptxVersion$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int ptxVersion - * } - */ - public static int ptxVersion(MemorySegment struct) { - return struct.get(ptxVersion$LAYOUT, ptxVersion$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int ptxVersion - * } - */ - public static void ptxVersion(MemorySegment struct, int fieldValue) { - struct.set(ptxVersion$LAYOUT, ptxVersion$OFFSET, fieldValue); - } - - private static final OfInt binaryVersion$LAYOUT = (OfInt)$LAYOUT.select(groupElement("binaryVersion")); - - /** - * Layout for field: - * {@snippet lang=c : - * int binaryVersion - * } - */ - public static final OfInt binaryVersion$layout() { - return binaryVersion$LAYOUT; - } - - private static final long binaryVersion$OFFSET = 36; - - /** - * Offset for field: - * {@snippet lang=c : - * int binaryVersion - * } - */ - public static final long binaryVersion$offset() { - return binaryVersion$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int binaryVersion - * } - */ - public static int binaryVersion(MemorySegment struct) { - return struct.get(binaryVersion$LAYOUT, binaryVersion$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int binaryVersion - * } - */ - public static void binaryVersion(MemorySegment struct, int fieldValue) { - struct.set(binaryVersion$LAYOUT, binaryVersion$OFFSET, fieldValue); - } - - private static final OfInt cacheModeCA$LAYOUT = (OfInt)$LAYOUT.select(groupElement("cacheModeCA")); - - /** - * Layout for field: - * {@snippet lang=c : - * int cacheModeCA - * } - */ - public static final OfInt cacheModeCA$layout() { - return cacheModeCA$LAYOUT; - } - - private static final long cacheModeCA$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * int cacheModeCA - * } - */ - public static final long cacheModeCA$offset() { - return cacheModeCA$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int cacheModeCA - * } - */ - public static int cacheModeCA(MemorySegment struct) { - return struct.get(cacheModeCA$LAYOUT, cacheModeCA$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int cacheModeCA - * } - */ - public static void cacheModeCA(MemorySegment struct, int fieldValue) { - struct.set(cacheModeCA$LAYOUT, cacheModeCA$OFFSET, fieldValue); - } - - private static final OfInt maxDynamicSharedSizeBytes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxDynamicSharedSizeBytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * int maxDynamicSharedSizeBytes - * } - */ - public static final OfInt maxDynamicSharedSizeBytes$layout() { - return maxDynamicSharedSizeBytes$LAYOUT; - } - - private static final long maxDynamicSharedSizeBytes$OFFSET = 44; - - /** - * Offset for field: - * {@snippet lang=c : - * int maxDynamicSharedSizeBytes - * } - */ - public static final long maxDynamicSharedSizeBytes$offset() { - return maxDynamicSharedSizeBytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int maxDynamicSharedSizeBytes - * } - */ - public static int maxDynamicSharedSizeBytes(MemorySegment struct) { - return struct.get(maxDynamicSharedSizeBytes$LAYOUT, maxDynamicSharedSizeBytes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int maxDynamicSharedSizeBytes - * } - */ - public static void maxDynamicSharedSizeBytes(MemorySegment struct, int fieldValue) { - struct.set(maxDynamicSharedSizeBytes$LAYOUT, maxDynamicSharedSizeBytes$OFFSET, fieldValue); - } - - private static final OfInt preferredShmemCarveout$LAYOUT = (OfInt)$LAYOUT.select(groupElement("preferredShmemCarveout")); - - /** - * Layout for field: - * {@snippet lang=c : - * int preferredShmemCarveout - * } - */ - public static final OfInt preferredShmemCarveout$layout() { - return preferredShmemCarveout$LAYOUT; - } - - private static final long preferredShmemCarveout$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * int preferredShmemCarveout - * } - */ - public static final long preferredShmemCarveout$offset() { - return preferredShmemCarveout$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int preferredShmemCarveout - * } - */ - public static int preferredShmemCarveout(MemorySegment struct) { - return struct.get(preferredShmemCarveout$LAYOUT, preferredShmemCarveout$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int preferredShmemCarveout - * } - */ - public static void preferredShmemCarveout(MemorySegment struct, int fieldValue) { - struct.set(preferredShmemCarveout$LAYOUT, preferredShmemCarveout$OFFSET, fieldValue); - } - - private static final OfInt clusterDimMustBeSet$LAYOUT = (OfInt)$LAYOUT.select(groupElement("clusterDimMustBeSet")); - - /** - * Layout for field: - * {@snippet lang=c : - * int clusterDimMustBeSet - * } - */ - public static final OfInt clusterDimMustBeSet$layout() { - return clusterDimMustBeSet$LAYOUT; - } - - private static final long clusterDimMustBeSet$OFFSET = 52; - - /** - * Offset for field: - * {@snippet lang=c : - * int clusterDimMustBeSet - * } - */ - public static final long clusterDimMustBeSet$offset() { - return clusterDimMustBeSet$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int clusterDimMustBeSet - * } - */ - public static int clusterDimMustBeSet(MemorySegment struct) { - return struct.get(clusterDimMustBeSet$LAYOUT, clusterDimMustBeSet$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int clusterDimMustBeSet - * } - */ - public static void clusterDimMustBeSet(MemorySegment struct, int fieldValue) { - struct.set(clusterDimMustBeSet$LAYOUT, clusterDimMustBeSet$OFFSET, fieldValue); - } - - private static final OfInt requiredClusterWidth$LAYOUT = (OfInt)$LAYOUT.select(groupElement("requiredClusterWidth")); - - /** - * Layout for field: - * {@snippet lang=c : - * int requiredClusterWidth - * } - */ - public static final OfInt requiredClusterWidth$layout() { - return requiredClusterWidth$LAYOUT; - } - - private static final long requiredClusterWidth$OFFSET = 56; - - /** - * Offset for field: - * {@snippet lang=c : - * int requiredClusterWidth - * } - */ - public static final long requiredClusterWidth$offset() { - return requiredClusterWidth$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int requiredClusterWidth - * } - */ - public static int requiredClusterWidth(MemorySegment struct) { - return struct.get(requiredClusterWidth$LAYOUT, requiredClusterWidth$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int requiredClusterWidth - * } - */ - public static void requiredClusterWidth(MemorySegment struct, int fieldValue) { - struct.set(requiredClusterWidth$LAYOUT, requiredClusterWidth$OFFSET, fieldValue); - } - - private static final OfInt requiredClusterHeight$LAYOUT = (OfInt)$LAYOUT.select(groupElement("requiredClusterHeight")); - - /** - * Layout for field: - * {@snippet lang=c : - * int requiredClusterHeight - * } - */ - public static final OfInt requiredClusterHeight$layout() { - return requiredClusterHeight$LAYOUT; - } - - private static final long requiredClusterHeight$OFFSET = 60; - - /** - * Offset for field: - * {@snippet lang=c : - * int requiredClusterHeight - * } - */ - public static final long requiredClusterHeight$offset() { - return requiredClusterHeight$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int requiredClusterHeight - * } - */ - public static int requiredClusterHeight(MemorySegment struct) { - return struct.get(requiredClusterHeight$LAYOUT, requiredClusterHeight$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int requiredClusterHeight - * } - */ - public static void requiredClusterHeight(MemorySegment struct, int fieldValue) { - struct.set(requiredClusterHeight$LAYOUT, requiredClusterHeight$OFFSET, fieldValue); - } - - private static final OfInt requiredClusterDepth$LAYOUT = (OfInt)$LAYOUT.select(groupElement("requiredClusterDepth")); - - /** - * Layout for field: - * {@snippet lang=c : - * int requiredClusterDepth - * } - */ - public static final OfInt requiredClusterDepth$layout() { - return requiredClusterDepth$LAYOUT; - } - - private static final long requiredClusterDepth$OFFSET = 64; - - /** - * Offset for field: - * {@snippet lang=c : - * int requiredClusterDepth - * } - */ - public static final long requiredClusterDepth$offset() { - return requiredClusterDepth$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int requiredClusterDepth - * } - */ - public static int requiredClusterDepth(MemorySegment struct) { - return struct.get(requiredClusterDepth$LAYOUT, requiredClusterDepth$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int requiredClusterDepth - * } - */ - public static void requiredClusterDepth(MemorySegment struct, int fieldValue) { - struct.set(requiredClusterDepth$LAYOUT, requiredClusterDepth$OFFSET, fieldValue); - } - - private static final OfInt clusterSchedulingPolicyPreference$LAYOUT = (OfInt)$LAYOUT.select(groupElement("clusterSchedulingPolicyPreference")); - - /** - * Layout for field: - * {@snippet lang=c : - * int clusterSchedulingPolicyPreference - * } - */ - public static final OfInt clusterSchedulingPolicyPreference$layout() { - return clusterSchedulingPolicyPreference$LAYOUT; - } - - private static final long clusterSchedulingPolicyPreference$OFFSET = 68; - - /** - * Offset for field: - * {@snippet lang=c : - * int clusterSchedulingPolicyPreference - * } - */ - public static final long clusterSchedulingPolicyPreference$offset() { - return clusterSchedulingPolicyPreference$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int clusterSchedulingPolicyPreference - * } - */ - public static int clusterSchedulingPolicyPreference(MemorySegment struct) { - return struct.get(clusterSchedulingPolicyPreference$LAYOUT, clusterSchedulingPolicyPreference$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int clusterSchedulingPolicyPreference - * } - */ - public static void clusterSchedulingPolicyPreference(MemorySegment struct, int fieldValue) { - struct.set(clusterSchedulingPolicyPreference$LAYOUT, clusterSchedulingPolicyPreference$OFFSET, fieldValue); - } - - private static final OfInt nonPortableClusterSizeAllowed$LAYOUT = (OfInt)$LAYOUT.select(groupElement("nonPortableClusterSizeAllowed")); - - /** - * Layout for field: - * {@snippet lang=c : - * int nonPortableClusterSizeAllowed - * } - */ - public static final OfInt nonPortableClusterSizeAllowed$layout() { - return nonPortableClusterSizeAllowed$LAYOUT; - } - - private static final long nonPortableClusterSizeAllowed$OFFSET = 72; - - /** - * Offset for field: - * {@snippet lang=c : - * int nonPortableClusterSizeAllowed - * } - */ - public static final long nonPortableClusterSizeAllowed$offset() { - return nonPortableClusterSizeAllowed$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int nonPortableClusterSizeAllowed - * } - */ - public static int nonPortableClusterSizeAllowed(MemorySegment struct) { - return struct.get(nonPortableClusterSizeAllowed$LAYOUT, nonPortableClusterSizeAllowed$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int nonPortableClusterSizeAllowed - * } - */ - public static void nonPortableClusterSizeAllowed(MemorySegment struct, int fieldValue) { - struct.set(nonPortableClusterSizeAllowed$LAYOUT, nonPortableClusterSizeAllowed$OFFSET, fieldValue); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * int reserved[16] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 76; - - /** - * Offset for field: - * {@snippet lang=c : - * int reserved[16] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int reserved[16] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int reserved[16] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 16 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int reserved[16] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int reserved[16] - * } - */ - public static int reserved(MemorySegment struct, long index0) { - return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int reserved[16] - * } - */ - public static void reserved(MemorySegment struct, long index0, int fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData.java deleted file mode 100644 index ea7dd0af2c..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct cudaGraphEdgeData_st { - * unsigned char from_port; - * unsigned char to_port; - * unsigned char type; - * unsigned char reserved[5]; - * } cudaGraphEdgeData - * } - */ -public class cudaGraphEdgeData extends cudaGraphEdgeData_st { - - cudaGraphEdgeData() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData_st.java deleted file mode 100644 index 57c36fb6b0..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphEdgeData_st.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaGraphEdgeData_st { - * unsigned char from_port; - * unsigned char to_port; - * unsigned char type; - * unsigned char reserved[5]; - * } - * } - */ -public class cudaGraphEdgeData_st { - - cudaGraphEdgeData_st() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("from_port"), - PanamaFFMAPI.C_CHAR.withName("to_port"), - PanamaFFMAPI.C_CHAR.withName("type"), - MemoryLayout.sequenceLayout(5, PanamaFFMAPI.C_CHAR).withName("reserved") - ).withName("cudaGraphEdgeData_st"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte from_port$LAYOUT = (OfByte)$LAYOUT.select(groupElement("from_port")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char from_port - * } - */ - public static final OfByte from_port$layout() { - return from_port$LAYOUT; - } - - private static final long from_port$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char from_port - * } - */ - public static final long from_port$offset() { - return from_port$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char from_port - * } - */ - public static byte from_port(MemorySegment struct) { - return struct.get(from_port$LAYOUT, from_port$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char from_port - * } - */ - public static void from_port(MemorySegment struct, byte fieldValue) { - struct.set(from_port$LAYOUT, from_port$OFFSET, fieldValue); - } - - private static final OfByte to_port$LAYOUT = (OfByte)$LAYOUT.select(groupElement("to_port")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char to_port - * } - */ - public static final OfByte to_port$layout() { - return to_port$LAYOUT; - } - - private static final long to_port$OFFSET = 1; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char to_port - * } - */ - public static final long to_port$offset() { - return to_port$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char to_port - * } - */ - public static byte to_port(MemorySegment struct) { - return struct.get(to_port$LAYOUT, to_port$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char to_port - * } - */ - public static void to_port(MemorySegment struct, byte fieldValue) { - struct.set(to_port$LAYOUT, to_port$OFFSET, fieldValue); - } - - private static final OfByte type$LAYOUT = (OfByte)$LAYOUT.select(groupElement("type")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char type - * } - */ - public static final OfByte type$layout() { - return type$LAYOUT; - } - - private static final long type$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char type - * } - */ - public static final long type$offset() { - return type$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char type - * } - */ - public static byte type(MemorySegment struct) { - return struct.get(type$LAYOUT, type$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char type - * } - */ - public static void type(MemorySegment struct, byte fieldValue) { - struct.set(type$LAYOUT, type$OFFSET, fieldValue); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char reserved[5] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 3; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char reserved[5] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char reserved[5] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char reserved[5] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 5 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned char reserved[5] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned char reserved[5] - * } - */ - public static byte reserved(MemorySegment struct, long index0) { - return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned char reserved[5] - * } - */ - public static void reserved(MemorySegment struct, long index0, byte fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo.java deleted file mode 100644 index cb180dffa4..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct cudaGraphExecUpdateResultInfo_st { - * enum cudaGraphExecUpdateResult result; - * cudaGraphNode_t errorNode; - * cudaGraphNode_t errorFromNode; - * } cudaGraphExecUpdateResultInfo - * } - */ -public class cudaGraphExecUpdateResultInfo extends cudaGraphExecUpdateResultInfo_st { - - cudaGraphExecUpdateResultInfo() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo_st.java deleted file mode 100644 index 751233db15..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphExecUpdateResultInfo_st.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaGraphExecUpdateResultInfo_st { - * enum cudaGraphExecUpdateResult result; - * cudaGraphNode_t errorNode; - * cudaGraphNode_t errorFromNode; - * } - * } - */ -public class cudaGraphExecUpdateResultInfo_st { - - cudaGraphExecUpdateResultInfo_st() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("result"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_POINTER.withName("errorNode"), - PanamaFFMAPI.C_POINTER.withName("errorFromNode") - ).withName("cudaGraphExecUpdateResultInfo_st"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt result$LAYOUT = (OfInt)$LAYOUT.select(groupElement("result")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult result - * } - */ - public static final OfInt result$layout() { - return result$LAYOUT; - } - - private static final long result$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult result - * } - */ - public static final long result$offset() { - return result$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult result - * } - */ - public static int result(MemorySegment struct) { - return struct.get(result$LAYOUT, result$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaGraphExecUpdateResult result - * } - */ - public static void result(MemorySegment struct, int fieldValue) { - struct.set(result$LAYOUT, result$OFFSET, fieldValue); - } - - private static final AddressLayout errorNode$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("errorNode")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaGraphNode_t errorNode - * } - */ - public static final AddressLayout errorNode$layout() { - return errorNode$LAYOUT; - } - - private static final long errorNode$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaGraphNode_t errorNode - * } - */ - public static final long errorNode$offset() { - return errorNode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaGraphNode_t errorNode - * } - */ - public static MemorySegment errorNode(MemorySegment struct) { - return struct.get(errorNode$LAYOUT, errorNode$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaGraphNode_t errorNode - * } - */ - public static void errorNode(MemorySegment struct, MemorySegment fieldValue) { - struct.set(errorNode$LAYOUT, errorNode$OFFSET, fieldValue); - } - - private static final AddressLayout errorFromNode$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("errorFromNode")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaGraphNode_t errorFromNode - * } - */ - public static final AddressLayout errorFromNode$layout() { - return errorFromNode$LAYOUT; - } - - private static final long errorFromNode$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaGraphNode_t errorFromNode - * } - */ - public static final long errorFromNode$offset() { - return errorFromNode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaGraphNode_t errorFromNode - * } - */ - public static MemorySegment errorFromNode(MemorySegment struct) { - return struct.get(errorFromNode$LAYOUT, errorFromNode$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaGraphNode_t errorFromNode - * } - */ - public static void errorFromNode(MemorySegment struct, MemorySegment fieldValue) { - struct.set(errorFromNode$LAYOUT, errorFromNode$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams.java deleted file mode 100644 index a70cb140d8..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct cudaGraphInstantiateParams_st { - * unsigned long long flags; - * cudaStream_t uploadStream; - * cudaGraphNode_t errNode_out; - * cudaGraphInstantiateResult result_out; - * } cudaGraphInstantiateParams - * } - */ -public class cudaGraphInstantiateParams extends cudaGraphInstantiateParams_st { - - cudaGraphInstantiateParams() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams_st.java deleted file mode 100644 index 27c874879c..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphInstantiateParams_st.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaGraphInstantiateParams_st { - * unsigned long long flags; - * cudaStream_t uploadStream; - * cudaGraphNode_t errNode_out; - * cudaGraphInstantiateResult result_out; - * } - * } - */ -public class cudaGraphInstantiateParams_st { - - cudaGraphInstantiateParams_st() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("flags"), - PanamaFFMAPI.C_POINTER.withName("uploadStream"), - PanamaFFMAPI.C_POINTER.withName("errNode_out"), - PanamaFFMAPI.C_INT.withName("result_out"), - MemoryLayout.paddingLayout(4) - ).withName("cudaGraphInstantiateParams_st"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong flags$LAYOUT = (OfLong)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long flags - * } - */ - public static final OfLong flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long flags - * } - */ - public static long flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long flags - * } - */ - public static void flags(MemorySegment struct, long fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - private static final AddressLayout uploadStream$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("uploadStream")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaStream_t uploadStream - * } - */ - public static final AddressLayout uploadStream$layout() { - return uploadStream$LAYOUT; - } - - private static final long uploadStream$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaStream_t uploadStream - * } - */ - public static final long uploadStream$offset() { - return uploadStream$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaStream_t uploadStream - * } - */ - public static MemorySegment uploadStream(MemorySegment struct) { - return struct.get(uploadStream$LAYOUT, uploadStream$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaStream_t uploadStream - * } - */ - public static void uploadStream(MemorySegment struct, MemorySegment fieldValue) { - struct.set(uploadStream$LAYOUT, uploadStream$OFFSET, fieldValue); - } - - private static final AddressLayout errNode_out$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("errNode_out")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaGraphNode_t errNode_out - * } - */ - public static final AddressLayout errNode_out$layout() { - return errNode_out$LAYOUT; - } - - private static final long errNode_out$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaGraphNode_t errNode_out - * } - */ - public static final long errNode_out$offset() { - return errNode_out$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaGraphNode_t errNode_out - * } - */ - public static MemorySegment errNode_out(MemorySegment struct) { - return struct.get(errNode_out$LAYOUT, errNode_out$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaGraphNode_t errNode_out - * } - */ - public static void errNode_out(MemorySegment struct, MemorySegment fieldValue) { - struct.set(errNode_out$LAYOUT, errNode_out$OFFSET, fieldValue); - } - - private static final OfInt result_out$LAYOUT = (OfInt)$LAYOUT.select(groupElement("result_out")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaGraphInstantiateResult result_out - * } - */ - public static final OfInt result_out$layout() { - return result_out$LAYOUT; - } - - private static final long result_out$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaGraphInstantiateResult result_out - * } - */ - public static final long result_out$offset() { - return result_out$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaGraphInstantiateResult result_out - * } - */ - public static int result_out(MemorySegment struct) { - return struct.get(result_out$LAYOUT, result_out$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaGraphInstantiateResult result_out - * } - */ - public static void result_out(MemorySegment struct, int fieldValue) { - struct.set(result_out$LAYOUT, result_out$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphKernelNodeUpdate.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphKernelNodeUpdate.java deleted file mode 100644 index 2b3d40dcac..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphKernelNodeUpdate.java +++ /dev/null @@ -1,706 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaGraphKernelNodeUpdate { - * cudaGraphDeviceNode_t node; - * enum cudaGraphKernelNodeField field; - * union { - * dim3 gridDim; - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } param; - * unsigned int isEnabled; - * } updateData; - * } - * } - */ -public class cudaGraphKernelNodeUpdate { - - cudaGraphKernelNodeUpdate() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("node"), - PanamaFFMAPI.C_INT.withName("field"), - MemoryLayout.paddingLayout(4), - cudaGraphKernelNodeUpdate.updateData.layout().withName("updateData") - ).withName("cudaGraphKernelNodeUpdate"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout node$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("node")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaGraphDeviceNode_t node - * } - */ - public static final AddressLayout node$layout() { - return node$LAYOUT; - } - - private static final long node$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaGraphDeviceNode_t node - * } - */ - public static final long node$offset() { - return node$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaGraphDeviceNode_t node - * } - */ - public static MemorySegment node(MemorySegment struct) { - return struct.get(node$LAYOUT, node$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaGraphDeviceNode_t node - * } - */ - public static void node(MemorySegment struct, MemorySegment fieldValue) { - struct.set(node$LAYOUT, node$OFFSET, fieldValue); - } - - private static final OfInt field$LAYOUT = (OfInt)$LAYOUT.select(groupElement("field")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaGraphKernelNodeField field - * } - */ - public static final OfInt field$layout() { - return field$LAYOUT; - } - - private static final long field$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaGraphKernelNodeField field - * } - */ - public static final long field$offset() { - return field$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaGraphKernelNodeField field - * } - */ - public static int field(MemorySegment struct) { - return struct.get(field$LAYOUT, field$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaGraphKernelNodeField field - * } - */ - public static void field(MemorySegment struct, int fieldValue) { - struct.set(field$LAYOUT, field$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * union { - * dim3 gridDim; - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } param; - * unsigned int isEnabled; - * } - * } - */ - public static class updateData { - - updateData() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - dim3.layout().withName("gridDim"), - cudaGraphKernelNodeUpdate.updateData.param.layout().withName("param"), - PanamaFFMAPI.C_INT.withName("isEnabled") - ).withName("$anon$3302:5"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final GroupLayout gridDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("gridDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static final GroupLayout gridDim$layout() { - return gridDim$LAYOUT; - } - - private static final long gridDim$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static final long gridDim$offset() { - return gridDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static MemorySegment gridDim(MemorySegment union) { - return union.asSlice(gridDim$OFFSET, gridDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static void gridDim(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, gridDim$OFFSET, gridDim$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } - * } - */ - public static class param { - - param() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("pValue"), - PanamaFFMAPI.C_LONG.withName("offset"), - PanamaFFMAPI.C_LONG.withName("size") - ).withName("$anon$3309:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout pValue$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("pValue")); - - /** - * Layout for field: - * {@snippet lang=c : - * const void *pValue - * } - */ - public static final AddressLayout pValue$layout() { - return pValue$LAYOUT; - } - - private static final long pValue$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * const void *pValue - * } - */ - public static final long pValue$offset() { - return pValue$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const void *pValue - * } - */ - public static MemorySegment pValue(MemorySegment struct) { - return struct.get(pValue$LAYOUT, pValue$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const void *pValue - * } - */ - public static void pValue(MemorySegment struct, MemorySegment fieldValue) { - struct.set(pValue$LAYOUT, pValue$OFFSET, fieldValue); - } - - private static final OfLong offset$LAYOUT = (OfLong)$LAYOUT.select(groupElement("offset")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t offset - * } - */ - public static final OfLong offset$layout() { - return offset$LAYOUT; - } - - private static final long offset$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t offset - * } - */ - public static final long offset$offset() { - return offset$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t offset - * } - */ - public static long offset(MemorySegment struct) { - return struct.get(offset$LAYOUT, offset$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t offset - * } - */ - public static void offset(MemorySegment struct, long fieldValue) { - struct.set(offset$LAYOUT, offset$OFFSET, fieldValue); - } - - private static final OfLong size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("size")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t size - * } - */ - public static final OfLong size$layout() { - return size$LAYOUT; - } - - private static final long size$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t size - * } - */ - public static final long size$offset() { - return size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t size - * } - */ - public static long size(MemorySegment struct) { - return struct.get(size$LAYOUT, size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t size - * } - */ - public static void size(MemorySegment struct, long fieldValue) { - struct.set(size$LAYOUT, size$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout param$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("param")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } param - * } - */ - public static final GroupLayout param$layout() { - return param$LAYOUT; - } - - private static final long param$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } param - * } - */ - public static final long param$offset() { - return param$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } param - * } - */ - public static MemorySegment param(MemorySegment union) { - return union.asSlice(param$OFFSET, param$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } param - * } - */ - public static void param(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, param$OFFSET, param$LAYOUT.byteSize()); - } - - private static final OfInt isEnabled$LAYOUT = (OfInt)$LAYOUT.select(groupElement("isEnabled")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int isEnabled - * } - */ - public static final OfInt isEnabled$layout() { - return isEnabled$LAYOUT; - } - - private static final long isEnabled$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int isEnabled - * } - */ - public static final long isEnabled$offset() { - return isEnabled$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int isEnabled - * } - */ - public static int isEnabled(MemorySegment union) { - return union.get(isEnabled$LAYOUT, isEnabled$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int isEnabled - * } - */ - public static void isEnabled(MemorySegment union, int fieldValue) { - union.set(isEnabled$LAYOUT, isEnabled$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout updateData$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("updateData")); - - /** - * Layout for field: - * {@snippet lang=c : - * union { - * dim3 gridDim; - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } param; - * unsigned int isEnabled; - * } updateData - * } - */ - public static final GroupLayout updateData$layout() { - return updateData$LAYOUT; - } - - private static final long updateData$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * union { - * dim3 gridDim; - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } param; - * unsigned int isEnabled; - * } updateData - * } - */ - public static final long updateData$offset() { - return updateData$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * union { - * dim3 gridDim; - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } param; - * unsigned int isEnabled; - * } updateData - * } - */ - public static MemorySegment updateData(MemorySegment struct) { - return struct.asSlice(updateData$OFFSET, updateData$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * union { - * dim3 gridDim; - * struct { - * const void *pValue; - * size_t offset; - * size_t size; - * } param; - * unsigned int isEnabled; - * } updateData - * } - */ - public static void updateData(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, updateData$OFFSET, updateData$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphNodeParams.java deleted file mode 100644 index 64ec95c834..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaGraphNodeParams.java +++ /dev/null @@ -1,903 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaGraphNodeParams { - * enum cudaGraphNodeType type; - * int reserved0[3]; - * union { - * long long reserved1[29]; - * struct cudaKernelNodeParamsV2 kernel; - * struct cudaMemcpyNodeParams memcpy; - * struct cudaMemsetParamsV2 memset; - * struct cudaHostNodeParamsV2 host; - * struct cudaChildGraphNodeParams graph; - * struct cudaEventWaitNodeParams eventWait; - * struct cudaEventRecordNodeParams eventRecord; - * struct cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal; - * struct cudaExternalSemaphoreWaitNodeParamsV2 extSemWait; - * struct cudaMemAllocNodeParamsV2 alloc; - * struct cudaMemFreeNodeParams free; - * struct cudaConditionalNodeParams conditional; - * }; - * long long reserved2; - * } - * } - */ -public class cudaGraphNodeParams { - - cudaGraphNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("type"), - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("reserved0"), - MemoryLayout.unionLayout( - MemoryLayout.sequenceLayout(29, PanamaFFMAPI.C_LONG_LONG).withName("reserved1"), - cudaKernelNodeParamsV2.layout().withName("kernel"), - cudaMemcpyNodeParams.layout().withName("memcpy"), - cudaMemsetParamsV2.layout().withName("memset"), - cudaHostNodeParamsV2.layout().withName("host"), - cudaChildGraphNodeParams.layout().withName("graph"), - cudaEventWaitNodeParams.layout().withName("eventWait"), - cudaEventRecordNodeParams.layout().withName("eventRecord"), - cudaExternalSemaphoreSignalNodeParamsV2.layout().withName("extSemSignal"), - cudaExternalSemaphoreWaitNodeParamsV2.layout().withName("extSemWait"), - cudaMemAllocNodeParamsV2.layout().withName("alloc"), - cudaMemFreeNodeParams.layout().withName("free"), - cudaConditionalNodeParams.layout().withName("conditional") - ).withName("$anon$3139:5"), - PanamaFFMAPI.C_LONG_LONG.withName("reserved2") - ).withName("cudaGraphNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaGraphNodeType type - * } - */ - public static final OfInt type$layout() { - return type$LAYOUT; - } - - private static final long type$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaGraphNodeType type - * } - */ - public static final long type$offset() { - return type$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaGraphNodeType type - * } - */ - public static int type(MemorySegment struct) { - return struct.get(type$LAYOUT, type$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaGraphNodeType type - * } - */ - public static void type(MemorySegment struct, int fieldValue) { - struct.set(type$LAYOUT, type$OFFSET, fieldValue); - } - - private static final SequenceLayout reserved0$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved0")); - - /** - * Layout for field: - * {@snippet lang=c : - * int reserved0[3] - * } - */ - public static final SequenceLayout reserved0$layout() { - return reserved0$LAYOUT; - } - - private static final long reserved0$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int reserved0[3] - * } - */ - public static final long reserved0$offset() { - return reserved0$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int reserved0[3] - * } - */ - public static MemorySegment reserved0(MemorySegment struct) { - return struct.asSlice(reserved0$OFFSET, reserved0$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int reserved0[3] - * } - */ - public static void reserved0(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved0$OFFSET, reserved0$LAYOUT.byteSize()); - } - - private static long[] reserved0$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int reserved0[3] - * } - */ - public static long[] reserved0$dimensions() { - return reserved0$DIMS; - } - private static final VarHandle reserved0$ELEM_HANDLE = reserved0$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int reserved0[3] - * } - */ - public static int reserved0(MemorySegment struct, long index0) { - return (int)reserved0$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int reserved0[3] - * } - */ - public static void reserved0(MemorySegment struct, long index0, int fieldValue) { - reserved0$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final SequenceLayout reserved1$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("reserved1")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long reserved1[29] - * } - */ - public static final SequenceLayout reserved1$layout() { - return reserved1$LAYOUT; - } - - private static final long reserved1$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * long long reserved1[29] - * } - */ - public static final long reserved1$offset() { - return reserved1$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long reserved1[29] - * } - */ - public static MemorySegment reserved1(MemorySegment struct) { - return struct.asSlice(reserved1$OFFSET, reserved1$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long reserved1[29] - * } - */ - public static void reserved1(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved1$OFFSET, reserved1$LAYOUT.byteSize()); - } - - private static long[] reserved1$DIMS = { 29 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * long long reserved1[29] - * } - */ - public static long[] reserved1$dimensions() { - return reserved1$DIMS; - } - private static final VarHandle reserved1$ELEM_HANDLE = reserved1$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * long long reserved1[29] - * } - */ - public static long reserved1(MemorySegment struct, long index0) { - return (long)reserved1$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * long long reserved1[29] - * } - */ - public static void reserved1(MemorySegment struct, long index0, long fieldValue) { - reserved1$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final GroupLayout kernel$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("kernel")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaKernelNodeParamsV2 kernel - * } - */ - public static final GroupLayout kernel$layout() { - return kernel$LAYOUT; - } - - private static final long kernel$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaKernelNodeParamsV2 kernel - * } - */ - public static final long kernel$offset() { - return kernel$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaKernelNodeParamsV2 kernel - * } - */ - public static MemorySegment kernel(MemorySegment struct) { - return struct.asSlice(kernel$OFFSET, kernel$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaKernelNodeParamsV2 kernel - * } - */ - public static void kernel(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, kernel$OFFSET, kernel$LAYOUT.byteSize()); - } - - private static final GroupLayout memcpy$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("memcpy")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaMemcpyNodeParams memcpy - * } - */ - public static final GroupLayout memcpy$layout() { - return memcpy$LAYOUT; - } - - private static final long memcpy$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaMemcpyNodeParams memcpy - * } - */ - public static final long memcpy$offset() { - return memcpy$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaMemcpyNodeParams memcpy - * } - */ - public static MemorySegment memcpy(MemorySegment struct) { - return struct.asSlice(memcpy$OFFSET, memcpy$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaMemcpyNodeParams memcpy - * } - */ - public static void memcpy(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, memcpy$OFFSET, memcpy$LAYOUT.byteSize()); - } - - private static final GroupLayout memset$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("memset")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaMemsetParamsV2 memset - * } - */ - public static final GroupLayout memset$layout() { - return memset$LAYOUT; - } - - private static final long memset$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaMemsetParamsV2 memset - * } - */ - public static final long memset$offset() { - return memset$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaMemsetParamsV2 memset - * } - */ - public static MemorySegment memset(MemorySegment struct) { - return struct.asSlice(memset$OFFSET, memset$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaMemsetParamsV2 memset - * } - */ - public static void memset(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, memset$OFFSET, memset$LAYOUT.byteSize()); - } - - private static final GroupLayout host$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("host")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaHostNodeParamsV2 host - * } - */ - public static final GroupLayout host$layout() { - return host$LAYOUT; - } - - private static final long host$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaHostNodeParamsV2 host - * } - */ - public static final long host$offset() { - return host$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaHostNodeParamsV2 host - * } - */ - public static MemorySegment host(MemorySegment struct) { - return struct.asSlice(host$OFFSET, host$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaHostNodeParamsV2 host - * } - */ - public static void host(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, host$OFFSET, host$LAYOUT.byteSize()); - } - - private static final GroupLayout graph$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("graph")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaChildGraphNodeParams graph - * } - */ - public static final GroupLayout graph$layout() { - return graph$LAYOUT; - } - - private static final long graph$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaChildGraphNodeParams graph - * } - */ - public static final long graph$offset() { - return graph$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaChildGraphNodeParams graph - * } - */ - public static MemorySegment graph(MemorySegment struct) { - return struct.asSlice(graph$OFFSET, graph$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaChildGraphNodeParams graph - * } - */ - public static void graph(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, graph$OFFSET, graph$LAYOUT.byteSize()); - } - - private static final GroupLayout eventWait$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("eventWait")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaEventWaitNodeParams eventWait - * } - */ - public static final GroupLayout eventWait$layout() { - return eventWait$LAYOUT; - } - - private static final long eventWait$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaEventWaitNodeParams eventWait - * } - */ - public static final long eventWait$offset() { - return eventWait$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaEventWaitNodeParams eventWait - * } - */ - public static MemorySegment eventWait(MemorySegment struct) { - return struct.asSlice(eventWait$OFFSET, eventWait$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaEventWaitNodeParams eventWait - * } - */ - public static void eventWait(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, eventWait$OFFSET, eventWait$LAYOUT.byteSize()); - } - - private static final GroupLayout eventRecord$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("eventRecord")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaEventRecordNodeParams eventRecord - * } - */ - public static final GroupLayout eventRecord$layout() { - return eventRecord$LAYOUT; - } - - private static final long eventRecord$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaEventRecordNodeParams eventRecord - * } - */ - public static final long eventRecord$offset() { - return eventRecord$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaEventRecordNodeParams eventRecord - * } - */ - public static MemorySegment eventRecord(MemorySegment struct) { - return struct.asSlice(eventRecord$OFFSET, eventRecord$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaEventRecordNodeParams eventRecord - * } - */ - public static void eventRecord(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, eventRecord$OFFSET, eventRecord$LAYOUT.byteSize()); - } - - private static final GroupLayout extSemSignal$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("extSemSignal")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal - * } - */ - public static final GroupLayout extSemSignal$layout() { - return extSemSignal$LAYOUT; - } - - private static final long extSemSignal$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal - * } - */ - public static final long extSemSignal$offset() { - return extSemSignal$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal - * } - */ - public static MemorySegment extSemSignal(MemorySegment struct) { - return struct.asSlice(extSemSignal$OFFSET, extSemSignal$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaExternalSemaphoreSignalNodeParamsV2 extSemSignal - * } - */ - public static void extSemSignal(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, extSemSignal$OFFSET, extSemSignal$LAYOUT.byteSize()); - } - - private static final GroupLayout extSemWait$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("extSemWait")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaExternalSemaphoreWaitNodeParamsV2 extSemWait - * } - */ - public static final GroupLayout extSemWait$layout() { - return extSemWait$LAYOUT; - } - - private static final long extSemWait$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaExternalSemaphoreWaitNodeParamsV2 extSemWait - * } - */ - public static final long extSemWait$offset() { - return extSemWait$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaExternalSemaphoreWaitNodeParamsV2 extSemWait - * } - */ - public static MemorySegment extSemWait(MemorySegment struct) { - return struct.asSlice(extSemWait$OFFSET, extSemWait$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaExternalSemaphoreWaitNodeParamsV2 extSemWait - * } - */ - public static void extSemWait(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, extSemWait$OFFSET, extSemWait$LAYOUT.byteSize()); - } - - private static final GroupLayout alloc$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("alloc")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaMemAllocNodeParamsV2 alloc - * } - */ - public static final GroupLayout alloc$layout() { - return alloc$LAYOUT; - } - - private static final long alloc$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaMemAllocNodeParamsV2 alloc - * } - */ - public static final long alloc$offset() { - return alloc$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaMemAllocNodeParamsV2 alloc - * } - */ - public static MemorySegment alloc(MemorySegment struct) { - return struct.asSlice(alloc$OFFSET, alloc$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaMemAllocNodeParamsV2 alloc - * } - */ - public static void alloc(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, alloc$OFFSET, alloc$LAYOUT.byteSize()); - } - - private static final GroupLayout free$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("free")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaMemFreeNodeParams free - * } - */ - public static final GroupLayout free$layout() { - return free$LAYOUT; - } - - private static final long free$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaMemFreeNodeParams free - * } - */ - public static final long free$offset() { - return free$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaMemFreeNodeParams free - * } - */ - public static MemorySegment free(MemorySegment struct) { - return struct.asSlice(free$OFFSET, free$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaMemFreeNodeParams free - * } - */ - public static void free(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, free$OFFSET, free$LAYOUT.byteSize()); - } - - private static final GroupLayout conditional$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("$anon$3139:5"), groupElement("conditional")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaConditionalNodeParams conditional - * } - */ - public static final GroupLayout conditional$layout() { - return conditional$LAYOUT; - } - - private static final long conditional$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaConditionalNodeParams conditional - * } - */ - public static final long conditional$offset() { - return conditional$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaConditionalNodeParams conditional - * } - */ - public static MemorySegment conditional(MemorySegment struct) { - return struct.asSlice(conditional$OFFSET, conditional$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaConditionalNodeParams conditional - * } - */ - public static void conditional(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, conditional$OFFSET, conditional$LAYOUT.byteSize()); - } - - private static final OfLong reserved2$LAYOUT = (OfLong)$LAYOUT.select(groupElement("reserved2")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long reserved2 - * } - */ - public static final OfLong reserved2$layout() { - return reserved2$LAYOUT; - } - - private static final long reserved2$OFFSET = 248; - - /** - * Offset for field: - * {@snippet lang=c : - * long long reserved2 - * } - */ - public static final long reserved2$offset() { - return reserved2$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long reserved2 - * } - */ - public static long reserved2(MemorySegment struct) { - return struct.get(reserved2$LAYOUT, reserved2$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long reserved2 - * } - */ - public static void reserved2(MemorySegment struct, long fieldValue) { - struct.set(reserved2$LAYOUT, reserved2$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostFn_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostFn_t.java deleted file mode 100644 index 1a8416b6fd..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostFn_t.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef void (*cudaHostFn_t)(void *) - * } - */ -public class cudaHostFn_t { - - cudaHostFn_t() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - void apply(MemorySegment userData); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( - PanamaFFMAPI.C_POINTER - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = PanamaFFMAPI.upcallHandle(cudaHostFn_t.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(cudaHostFn_t.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static void invoke(MemorySegment funcPtr,MemorySegment userData) { - try { - DOWN$MH.invokeExact(funcPtr, userData); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParams.java deleted file mode 100644 index f0d2174c97..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParams.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaHostNodeParams { - * cudaHostFn_t fn; - * void *userData; - * } - * } - */ -public class cudaHostNodeParams { - - cudaHostNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("fn"), - PanamaFFMAPI.C_POINTER.withName("userData") - ).withName("cudaHostNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout fn$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fn")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaHostFn_t fn - * } - */ - public static final AddressLayout fn$layout() { - return fn$LAYOUT; - } - - private static final long fn$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaHostFn_t fn - * } - */ - public static final long fn$offset() { - return fn$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaHostFn_t fn - * } - */ - public static MemorySegment fn(MemorySegment struct) { - return struct.get(fn$LAYOUT, fn$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaHostFn_t fn - * } - */ - public static void fn(MemorySegment struct, MemorySegment fieldValue) { - struct.set(fn$LAYOUT, fn$OFFSET, fieldValue); - } - - private static final AddressLayout userData$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("userData")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *userData - * } - */ - public static final AddressLayout userData$layout() { - return userData$LAYOUT; - } - - private static final long userData$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * void *userData - * } - */ - public static final long userData$offset() { - return userData$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *userData - * } - */ - public static MemorySegment userData(MemorySegment struct) { - return struct.get(userData$LAYOUT, userData$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *userData - * } - */ - public static void userData(MemorySegment struct, MemorySegment fieldValue) { - struct.set(userData$LAYOUT, userData$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParamsV2.java deleted file mode 100644 index a16fcc58ce..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaHostNodeParamsV2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaHostNodeParamsV2 { - * cudaHostFn_t fn; - * void *userData; - * } - * } - */ -public class cudaHostNodeParamsV2 { - - cudaHostNodeParamsV2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("fn"), - PanamaFFMAPI.C_POINTER.withName("userData") - ).withName("cudaHostNodeParamsV2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout fn$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("fn")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaHostFn_t fn - * } - */ - public static final AddressLayout fn$layout() { - return fn$LAYOUT; - } - - private static final long fn$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaHostFn_t fn - * } - */ - public static final long fn$offset() { - return fn$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaHostFn_t fn - * } - */ - public static MemorySegment fn(MemorySegment struct) { - return struct.get(fn$LAYOUT, fn$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaHostFn_t fn - * } - */ - public static void fn(MemorySegment struct, MemorySegment fieldValue) { - struct.set(fn$LAYOUT, fn$OFFSET, fieldValue); - } - - private static final AddressLayout userData$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("userData")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *userData - * } - */ - public static final AddressLayout userData$layout() { - return userData$LAYOUT; - } - - private static final long userData$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * void *userData - * } - */ - public static final long userData$offset() { - return userData$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *userData - * } - */ - public static MemorySegment userData(MemorySegment struct) { - return struct.get(userData$LAYOUT, userData$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *userData - * } - */ - public static void userData(MemorySegment struct, MemorySegment fieldValue) { - struct.set(userData$LAYOUT, userData$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_st.java deleted file mode 100644 index c75c390917..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_st.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaIpcEventHandle_st { - * char reserved[64]; - * } - * } - */ -public class cudaIpcEventHandle_st { - - cudaIpcEventHandle_st() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.sequenceLayout(64, PanamaFFMAPI.C_CHAR).withName("reserved") - ).withName("cudaIpcEventHandle_st"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 64 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static byte reserved(MemorySegment struct, long index0) { - return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static void reserved(MemorySegment struct, long index0, byte fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_t.java deleted file mode 100644 index d27abeec3a..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcEventHandle_t.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct cudaIpcEventHandle_st { - * char reserved[64]; - * } cudaIpcEventHandle_t - * } - */ -public class cudaIpcEventHandle_t extends cudaIpcEventHandle_st { - - cudaIpcEventHandle_t() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_st.java deleted file mode 100644 index 7339328fe6..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_st.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaIpcMemHandle_st { - * char reserved[64]; - * } - * } - */ -public class cudaIpcMemHandle_st { - - cudaIpcMemHandle_st() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.sequenceLayout(64, PanamaFFMAPI.C_CHAR).withName("reserved") - ).withName("cudaIpcMemHandle_st"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 64 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static byte reserved(MemorySegment struct, long index0) { - return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static void reserved(MemorySegment struct, long index0, byte fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_t.java deleted file mode 100644 index 8109af2f59..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaIpcMemHandle_t.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct cudaIpcMemHandle_st { - * char reserved[64]; - * } cudaIpcMemHandle_t - * } - */ -public class cudaIpcMemHandle_t extends cudaIpcMemHandle_st { - - cudaIpcMemHandle_t() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParams.java deleted file mode 100644 index 21de29e43c..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParams.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaKernelNodeParams { - * void *func; - * dim3 gridDim; - * dim3 blockDim; - * unsigned int sharedMemBytes; - * void **kernelParams; - * void **extra; - * } - * } - */ -public class cudaKernelNodeParams { - - cudaKernelNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("func"), - dim3.layout().withName("gridDim"), - dim3.layout().withName("blockDim"), - PanamaFFMAPI.C_INT.withName("sharedMemBytes"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_POINTER.withName("kernelParams"), - PanamaFFMAPI.C_POINTER.withName("extra") - ).withName("cudaKernelNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout func$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("func")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *func - * } - */ - public static final AddressLayout func$layout() { - return func$LAYOUT; - } - - private static final long func$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *func - * } - */ - public static final long func$offset() { - return func$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *func - * } - */ - public static MemorySegment func(MemorySegment struct) { - return struct.get(func$LAYOUT, func$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *func - * } - */ - public static void func(MemorySegment struct, MemorySegment fieldValue) { - struct.set(func$LAYOUT, func$OFFSET, fieldValue); - } - - private static final GroupLayout gridDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("gridDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static final GroupLayout gridDim$layout() { - return gridDim$LAYOUT; - } - - private static final long gridDim$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static final long gridDim$offset() { - return gridDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static MemorySegment gridDim(MemorySegment struct) { - return struct.asSlice(gridDim$OFFSET, gridDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static void gridDim(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, gridDim$OFFSET, gridDim$LAYOUT.byteSize()); - } - - private static final GroupLayout blockDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("blockDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static final GroupLayout blockDim$layout() { - return blockDim$LAYOUT; - } - - private static final long blockDim$OFFSET = 20; - - /** - * Offset for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static final long blockDim$offset() { - return blockDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static MemorySegment blockDim(MemorySegment struct) { - return struct.asSlice(blockDim$OFFSET, blockDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static void blockDim(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, blockDim$OFFSET, blockDim$LAYOUT.byteSize()); - } - - private static final OfInt sharedMemBytes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("sharedMemBytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int sharedMemBytes - * } - */ - public static final OfInt sharedMemBytes$layout() { - return sharedMemBytes$LAYOUT; - } - - private static final long sharedMemBytes$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int sharedMemBytes - * } - */ - public static final long sharedMemBytes$offset() { - return sharedMemBytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int sharedMemBytes - * } - */ - public static int sharedMemBytes(MemorySegment struct) { - return struct.get(sharedMemBytes$LAYOUT, sharedMemBytes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int sharedMemBytes - * } - */ - public static void sharedMemBytes(MemorySegment struct, int fieldValue) { - struct.set(sharedMemBytes$LAYOUT, sharedMemBytes$OFFSET, fieldValue); - } - - private static final AddressLayout kernelParams$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("kernelParams")); - - /** - * Layout for field: - * {@snippet lang=c : - * void **kernelParams - * } - */ - public static final AddressLayout kernelParams$layout() { - return kernelParams$LAYOUT; - } - - private static final long kernelParams$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * void **kernelParams - * } - */ - public static final long kernelParams$offset() { - return kernelParams$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void **kernelParams - * } - */ - public static MemorySegment kernelParams(MemorySegment struct) { - return struct.get(kernelParams$LAYOUT, kernelParams$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void **kernelParams - * } - */ - public static void kernelParams(MemorySegment struct, MemorySegment fieldValue) { - struct.set(kernelParams$LAYOUT, kernelParams$OFFSET, fieldValue); - } - - private static final AddressLayout extra$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extra")); - - /** - * Layout for field: - * {@snippet lang=c : - * void **extra - * } - */ - public static final AddressLayout extra$layout() { - return extra$LAYOUT; - } - - private static final long extra$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * void **extra - * } - */ - public static final long extra$offset() { - return extra$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void **extra - * } - */ - public static MemorySegment extra(MemorySegment struct) { - return struct.get(extra$LAYOUT, extra$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void **extra - * } - */ - public static void extra(MemorySegment struct, MemorySegment fieldValue) { - struct.set(extra$LAYOUT, extra$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParamsV2.java deleted file mode 100644 index a0b9d1597c..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaKernelNodeParamsV2.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaKernelNodeParamsV2 { - * void *func; - * dim3 gridDim; - * dim3 blockDim; - * unsigned int sharedMemBytes; - * void **kernelParams; - * void **extra; - * } - * } - */ -public class cudaKernelNodeParamsV2 { - - cudaKernelNodeParamsV2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("func"), - dim3.layout().withName("gridDim"), - dim3.layout().withName("blockDim"), - PanamaFFMAPI.C_INT.withName("sharedMemBytes"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_POINTER.withName("kernelParams"), - PanamaFFMAPI.C_POINTER.withName("extra") - ).withName("cudaKernelNodeParamsV2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout func$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("func")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *func - * } - */ - public static final AddressLayout func$layout() { - return func$LAYOUT; - } - - private static final long func$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *func - * } - */ - public static final long func$offset() { - return func$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *func - * } - */ - public static MemorySegment func(MemorySegment struct) { - return struct.get(func$LAYOUT, func$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *func - * } - */ - public static void func(MemorySegment struct, MemorySegment fieldValue) { - struct.set(func$LAYOUT, func$OFFSET, fieldValue); - } - - private static final GroupLayout gridDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("gridDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static final GroupLayout gridDim$layout() { - return gridDim$LAYOUT; - } - - private static final long gridDim$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static final long gridDim$offset() { - return gridDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static MemorySegment gridDim(MemorySegment struct) { - return struct.asSlice(gridDim$OFFSET, gridDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static void gridDim(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, gridDim$OFFSET, gridDim$LAYOUT.byteSize()); - } - - private static final GroupLayout blockDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("blockDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static final GroupLayout blockDim$layout() { - return blockDim$LAYOUT; - } - - private static final long blockDim$OFFSET = 20; - - /** - * Offset for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static final long blockDim$offset() { - return blockDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static MemorySegment blockDim(MemorySegment struct) { - return struct.asSlice(blockDim$OFFSET, blockDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static void blockDim(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, blockDim$OFFSET, blockDim$LAYOUT.byteSize()); - } - - private static final OfInt sharedMemBytes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("sharedMemBytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int sharedMemBytes - * } - */ - public static final OfInt sharedMemBytes$layout() { - return sharedMemBytes$LAYOUT; - } - - private static final long sharedMemBytes$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int sharedMemBytes - * } - */ - public static final long sharedMemBytes$offset() { - return sharedMemBytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int sharedMemBytes - * } - */ - public static int sharedMemBytes(MemorySegment struct) { - return struct.get(sharedMemBytes$LAYOUT, sharedMemBytes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int sharedMemBytes - * } - */ - public static void sharedMemBytes(MemorySegment struct, int fieldValue) { - struct.set(sharedMemBytes$LAYOUT, sharedMemBytes$OFFSET, fieldValue); - } - - private static final AddressLayout kernelParams$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("kernelParams")); - - /** - * Layout for field: - * {@snippet lang=c : - * void **kernelParams - * } - */ - public static final AddressLayout kernelParams$layout() { - return kernelParams$LAYOUT; - } - - private static final long kernelParams$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * void **kernelParams - * } - */ - public static final long kernelParams$offset() { - return kernelParams$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void **kernelParams - * } - */ - public static MemorySegment kernelParams(MemorySegment struct) { - return struct.get(kernelParams$LAYOUT, kernelParams$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void **kernelParams - * } - */ - public static void kernelParams(MemorySegment struct, MemorySegment fieldValue) { - struct.set(kernelParams$LAYOUT, kernelParams$OFFSET, fieldValue); - } - - private static final AddressLayout extra$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("extra")); - - /** - * Layout for field: - * {@snippet lang=c : - * void **extra - * } - */ - public static final AddressLayout extra$layout() { - return extra$LAYOUT; - } - - private static final long extra$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * void **extra - * } - */ - public static final long extra$offset() { - return extra$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void **extra - * } - */ - public static MemorySegment extra(MemorySegment struct) { - return struct.get(extra$LAYOUT, extra$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void **extra - * } - */ - public static void extra(MemorySegment struct, MemorySegment fieldValue) { - struct.set(extra$LAYOUT, extra$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute.java deleted file mode 100644 index bfd42f0ad2..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct cudaLaunchAttribute_st { - * cudaLaunchAttributeID id; - * char pad[4]; - * cudaLaunchAttributeValue val; - * } cudaLaunchAttribute - * } - */ -public class cudaLaunchAttribute extends cudaLaunchAttribute_st { - - cudaLaunchAttribute() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttributeValue.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttributeValue.java deleted file mode 100644 index 026854026c..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttributeValue.java +++ /dev/null @@ -1,1574 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * union cudaLaunchAttributeValue { - * char pad[64]; - * struct cudaAccessPolicyWindow accessPolicyWindow; - * int cooperative; - * enum cudaSynchronizationPolicy syncPolicy; - * struct { - * unsigned int x; - * unsigned int y; - * unsigned int z; - * } clusterDim; - * enum cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference; - * int programmaticStreamSerializationAllowed; - * struct { - * cudaEvent_t event; - * int flags; - * int triggerAtBlockStart; - * } programmaticEvent; - * int priority; - * cudaLaunchMemSyncDomainMap memSyncDomainMap; - * cudaLaunchMemSyncDomain memSyncDomain; - * struct { - * cudaEvent_t event; - * int flags; - * } launchCompletionEvent; - * struct { - * int deviceUpdatable; - * cudaGraphDeviceNode_t devNode; - * } deviceUpdatableKernelNode; - * unsigned int sharedMemCarveout; - * } - * } - */ -public class cudaLaunchAttributeValue { - - cudaLaunchAttributeValue() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - MemoryLayout.sequenceLayout(64, PanamaFFMAPI.C_CHAR).withName("pad"), - cudaAccessPolicyWindow.layout().withName("accessPolicyWindow"), - PanamaFFMAPI.C_INT.withName("cooperative"), - PanamaFFMAPI.C_INT.withName("syncPolicy"), - cudaLaunchAttributeValue.clusterDim.layout().withName("clusterDim"), - PanamaFFMAPI.C_INT.withName("clusterSchedulingPolicyPreference"), - PanamaFFMAPI.C_INT.withName("programmaticStreamSerializationAllowed"), - cudaLaunchAttributeValue.programmaticEvent.layout().withName("programmaticEvent"), - PanamaFFMAPI.C_INT.withName("priority"), - cudaLaunchMemSyncDomainMap_st.layout().withName("memSyncDomainMap"), - PanamaFFMAPI.C_INT.withName("memSyncDomain"), - cudaLaunchAttributeValue.launchCompletionEvent.layout().withName("launchCompletionEvent"), - cudaLaunchAttributeValue.deviceUpdatableKernelNode.layout().withName("deviceUpdatableKernelNode"), - PanamaFFMAPI.C_INT.withName("sharedMemCarveout") - ).withName("cudaLaunchAttributeValue"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout pad$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("pad")); - - /** - * Layout for field: - * {@snippet lang=c : - * char pad[64] - * } - */ - public static final SequenceLayout pad$layout() { - return pad$LAYOUT; - } - - private static final long pad$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * char pad[64] - * } - */ - public static final long pad$offset() { - return pad$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char pad[64] - * } - */ - public static MemorySegment pad(MemorySegment union) { - return union.asSlice(pad$OFFSET, pad$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char pad[64] - * } - */ - public static void pad(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, pad$OFFSET, pad$LAYOUT.byteSize()); - } - - private static long[] pad$DIMS = { 64 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char pad[64] - * } - */ - public static long[] pad$dimensions() { - return pad$DIMS; - } - private static final VarHandle pad$ELEM_HANDLE = pad$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char pad[64] - * } - */ - public static byte pad(MemorySegment union, long index0) { - return (byte)pad$ELEM_HANDLE.get(union, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char pad[64] - * } - */ - public static void pad(MemorySegment union, long index0, byte fieldValue) { - pad$ELEM_HANDLE.set(union, 0L, index0, fieldValue); - } - - private static final GroupLayout accessPolicyWindow$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("accessPolicyWindow")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaAccessPolicyWindow accessPolicyWindow - * } - */ - public static final GroupLayout accessPolicyWindow$layout() { - return accessPolicyWindow$LAYOUT; - } - - private static final long accessPolicyWindow$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaAccessPolicyWindow accessPolicyWindow - * } - */ - public static final long accessPolicyWindow$offset() { - return accessPolicyWindow$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaAccessPolicyWindow accessPolicyWindow - * } - */ - public static MemorySegment accessPolicyWindow(MemorySegment union) { - return union.asSlice(accessPolicyWindow$OFFSET, accessPolicyWindow$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaAccessPolicyWindow accessPolicyWindow - * } - */ - public static void accessPolicyWindow(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, accessPolicyWindow$OFFSET, accessPolicyWindow$LAYOUT.byteSize()); - } - - private static final OfInt cooperative$LAYOUT = (OfInt)$LAYOUT.select(groupElement("cooperative")); - - /** - * Layout for field: - * {@snippet lang=c : - * int cooperative - * } - */ - public static final OfInt cooperative$layout() { - return cooperative$LAYOUT; - } - - private static final long cooperative$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int cooperative - * } - */ - public static final long cooperative$offset() { - return cooperative$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int cooperative - * } - */ - public static int cooperative(MemorySegment union) { - return union.get(cooperative$LAYOUT, cooperative$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int cooperative - * } - */ - public static void cooperative(MemorySegment union, int fieldValue) { - union.set(cooperative$LAYOUT, cooperative$OFFSET, fieldValue); - } - - private static final OfInt syncPolicy$LAYOUT = (OfInt)$LAYOUT.select(groupElement("syncPolicy")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaSynchronizationPolicy syncPolicy - * } - */ - public static final OfInt syncPolicy$layout() { - return syncPolicy$LAYOUT; - } - - private static final long syncPolicy$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaSynchronizationPolicy syncPolicy - * } - */ - public static final long syncPolicy$offset() { - return syncPolicy$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaSynchronizationPolicy syncPolicy - * } - */ - public static int syncPolicy(MemorySegment union) { - return union.get(syncPolicy$LAYOUT, syncPolicy$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaSynchronizationPolicy syncPolicy - * } - */ - public static void syncPolicy(MemorySegment union, int fieldValue) { - union.set(syncPolicy$LAYOUT, syncPolicy$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * struct { - * unsigned int x; - * unsigned int y; - * unsigned int z; - * } - * } - */ - public static class clusterDim { - - clusterDim() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x"), - PanamaFFMAPI.C_INT.withName("y"), - PanamaFFMAPI.C_INT.withName("z") - ).withName("$anon$3544:5"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static final OfInt y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static int y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static void y(MemorySegment struct, int fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static final OfInt z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static int z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static void z(MemorySegment struct, int fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout clusterDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("clusterDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * unsigned int x; - * unsigned int y; - * unsigned int z; - * } clusterDim - * } - */ - public static final GroupLayout clusterDim$layout() { - return clusterDim$LAYOUT; - } - - private static final long clusterDim$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * unsigned int x; - * unsigned int y; - * unsigned int z; - * } clusterDim - * } - */ - public static final long clusterDim$offset() { - return clusterDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * unsigned int x; - * unsigned int y; - * unsigned int z; - * } clusterDim - * } - */ - public static MemorySegment clusterDim(MemorySegment union) { - return union.asSlice(clusterDim$OFFSET, clusterDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * unsigned int x; - * unsigned int y; - * unsigned int z; - * } clusterDim - * } - */ - public static void clusterDim(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, clusterDim$OFFSET, clusterDim$LAYOUT.byteSize()); - } - - private static final OfInt clusterSchedulingPolicyPreference$LAYOUT = (OfInt)$LAYOUT.select(groupElement("clusterSchedulingPolicyPreference")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference - * } - */ - public static final OfInt clusterSchedulingPolicyPreference$layout() { - return clusterSchedulingPolicyPreference$LAYOUT; - } - - private static final long clusterSchedulingPolicyPreference$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference - * } - */ - public static final long clusterSchedulingPolicyPreference$offset() { - return clusterSchedulingPolicyPreference$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference - * } - */ - public static int clusterSchedulingPolicyPreference(MemorySegment union) { - return union.get(clusterSchedulingPolicyPreference$LAYOUT, clusterSchedulingPolicyPreference$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference - * } - */ - public static void clusterSchedulingPolicyPreference(MemorySegment union, int fieldValue) { - union.set(clusterSchedulingPolicyPreference$LAYOUT, clusterSchedulingPolicyPreference$OFFSET, fieldValue); - } - - private static final OfInt programmaticStreamSerializationAllowed$LAYOUT = (OfInt)$LAYOUT.select(groupElement("programmaticStreamSerializationAllowed")); - - /** - * Layout for field: - * {@snippet lang=c : - * int programmaticStreamSerializationAllowed - * } - */ - public static final OfInt programmaticStreamSerializationAllowed$layout() { - return programmaticStreamSerializationAllowed$LAYOUT; - } - - private static final long programmaticStreamSerializationAllowed$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int programmaticStreamSerializationAllowed - * } - */ - public static final long programmaticStreamSerializationAllowed$offset() { - return programmaticStreamSerializationAllowed$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int programmaticStreamSerializationAllowed - * } - */ - public static int programmaticStreamSerializationAllowed(MemorySegment union) { - return union.get(programmaticStreamSerializationAllowed$LAYOUT, programmaticStreamSerializationAllowed$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int programmaticStreamSerializationAllowed - * } - */ - public static void programmaticStreamSerializationAllowed(MemorySegment union, int fieldValue) { - union.set(programmaticStreamSerializationAllowed$LAYOUT, programmaticStreamSerializationAllowed$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * struct { - * cudaEvent_t event; - * int flags; - * int triggerAtBlockStart; - * } - * } - */ - public static class programmaticEvent { - - programmaticEvent() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("event"), - PanamaFFMAPI.C_INT.withName("flags"), - PanamaFFMAPI.C_INT.withName("triggerAtBlockStart") - ).withName("$anon$3563:5"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout event$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("event")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static final AddressLayout event$layout() { - return event$LAYOUT; - } - - private static final long event$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static final long event$offset() { - return event$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static MemorySegment event(MemorySegment struct) { - return struct.get(event$LAYOUT, event$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static void event(MemorySegment struct, MemorySegment fieldValue) { - struct.set(event$LAYOUT, event$OFFSET, fieldValue); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - private static final OfInt triggerAtBlockStart$LAYOUT = (OfInt)$LAYOUT.select(groupElement("triggerAtBlockStart")); - - /** - * Layout for field: - * {@snippet lang=c : - * int triggerAtBlockStart - * } - */ - public static final OfInt triggerAtBlockStart$layout() { - return triggerAtBlockStart$LAYOUT; - } - - private static final long triggerAtBlockStart$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * int triggerAtBlockStart - * } - */ - public static final long triggerAtBlockStart$offset() { - return triggerAtBlockStart$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int triggerAtBlockStart - * } - */ - public static int triggerAtBlockStart(MemorySegment struct) { - return struct.get(triggerAtBlockStart$LAYOUT, triggerAtBlockStart$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int triggerAtBlockStart - * } - */ - public static void triggerAtBlockStart(MemorySegment struct, int fieldValue) { - struct.set(triggerAtBlockStart$LAYOUT, triggerAtBlockStart$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout programmaticEvent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("programmaticEvent")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * cudaEvent_t event; - * int flags; - * int triggerAtBlockStart; - * } programmaticEvent - * } - */ - public static final GroupLayout programmaticEvent$layout() { - return programmaticEvent$LAYOUT; - } - - private static final long programmaticEvent$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * cudaEvent_t event; - * int flags; - * int triggerAtBlockStart; - * } programmaticEvent - * } - */ - public static final long programmaticEvent$offset() { - return programmaticEvent$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * cudaEvent_t event; - * int flags; - * int triggerAtBlockStart; - * } programmaticEvent - * } - */ - public static MemorySegment programmaticEvent(MemorySegment union) { - return union.asSlice(programmaticEvent$OFFSET, programmaticEvent$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * cudaEvent_t event; - * int flags; - * int triggerAtBlockStart; - * } programmaticEvent - * } - */ - public static void programmaticEvent(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, programmaticEvent$OFFSET, programmaticEvent$LAYOUT.byteSize()); - } - - private static final OfInt priority$LAYOUT = (OfInt)$LAYOUT.select(groupElement("priority")); - - /** - * Layout for field: - * {@snippet lang=c : - * int priority - * } - */ - public static final OfInt priority$layout() { - return priority$LAYOUT; - } - - private static final long priority$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int priority - * } - */ - public static final long priority$offset() { - return priority$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int priority - * } - */ - public static int priority(MemorySegment union) { - return union.get(priority$LAYOUT, priority$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int priority - * } - */ - public static void priority(MemorySegment union, int fieldValue) { - union.set(priority$LAYOUT, priority$OFFSET, fieldValue); - } - - private static final GroupLayout memSyncDomainMap$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("memSyncDomainMap")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaLaunchMemSyncDomainMap memSyncDomainMap - * } - */ - public static final GroupLayout memSyncDomainMap$layout() { - return memSyncDomainMap$LAYOUT; - } - - private static final long memSyncDomainMap$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaLaunchMemSyncDomainMap memSyncDomainMap - * } - */ - public static final long memSyncDomainMap$offset() { - return memSyncDomainMap$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaLaunchMemSyncDomainMap memSyncDomainMap - * } - */ - public static MemorySegment memSyncDomainMap(MemorySegment union) { - return union.asSlice(memSyncDomainMap$OFFSET, memSyncDomainMap$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaLaunchMemSyncDomainMap memSyncDomainMap - * } - */ - public static void memSyncDomainMap(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, memSyncDomainMap$OFFSET, memSyncDomainMap$LAYOUT.byteSize()); - } - - private static final OfInt memSyncDomain$LAYOUT = (OfInt)$LAYOUT.select(groupElement("memSyncDomain")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaLaunchMemSyncDomain memSyncDomain - * } - */ - public static final OfInt memSyncDomain$layout() { - return memSyncDomain$LAYOUT; - } - - private static final long memSyncDomain$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaLaunchMemSyncDomain memSyncDomain - * } - */ - public static final long memSyncDomain$offset() { - return memSyncDomain$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaLaunchMemSyncDomain memSyncDomain - * } - */ - public static int memSyncDomain(MemorySegment union) { - return union.get(memSyncDomain$LAYOUT, memSyncDomain$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaLaunchMemSyncDomain memSyncDomain - * } - */ - public static void memSyncDomain(MemorySegment union, int fieldValue) { - union.set(memSyncDomain$LAYOUT, memSyncDomain$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * struct { - * cudaEvent_t event; - * int flags; - * } - * } - */ - public static class launchCompletionEvent { - - launchCompletionEvent() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("event"), - PanamaFFMAPI.C_INT.withName("flags"), - MemoryLayout.paddingLayout(4) - ).withName("$anon$3581:5"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout event$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("event")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static final AddressLayout event$layout() { - return event$LAYOUT; - } - - private static final long event$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static final long event$offset() { - return event$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static MemorySegment event(MemorySegment struct) { - return struct.get(event$LAYOUT, event$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaEvent_t event - * } - */ - public static void event(MemorySegment struct, MemorySegment fieldValue) { - struct.set(event$LAYOUT, event$OFFSET, fieldValue); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout launchCompletionEvent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("launchCompletionEvent")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * cudaEvent_t event; - * int flags; - * } launchCompletionEvent - * } - */ - public static final GroupLayout launchCompletionEvent$layout() { - return launchCompletionEvent$LAYOUT; - } - - private static final long launchCompletionEvent$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * cudaEvent_t event; - * int flags; - * } launchCompletionEvent - * } - */ - public static final long launchCompletionEvent$offset() { - return launchCompletionEvent$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * cudaEvent_t event; - * int flags; - * } launchCompletionEvent - * } - */ - public static MemorySegment launchCompletionEvent(MemorySegment union) { - return union.asSlice(launchCompletionEvent$OFFSET, launchCompletionEvent$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * cudaEvent_t event; - * int flags; - * } launchCompletionEvent - * } - */ - public static void launchCompletionEvent(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, launchCompletionEvent$OFFSET, launchCompletionEvent$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * struct { - * int deviceUpdatable; - * cudaGraphDeviceNode_t devNode; - * } - * } - */ - public static class deviceUpdatableKernelNode { - - deviceUpdatableKernelNode() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("deviceUpdatable"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_POINTER.withName("devNode") - ).withName("$anon$3592:5"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt deviceUpdatable$LAYOUT = (OfInt)$LAYOUT.select(groupElement("deviceUpdatable")); - - /** - * Layout for field: - * {@snippet lang=c : - * int deviceUpdatable - * } - */ - public static final OfInt deviceUpdatable$layout() { - return deviceUpdatable$LAYOUT; - } - - private static final long deviceUpdatable$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int deviceUpdatable - * } - */ - public static final long deviceUpdatable$offset() { - return deviceUpdatable$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int deviceUpdatable - * } - */ - public static int deviceUpdatable(MemorySegment struct) { - return struct.get(deviceUpdatable$LAYOUT, deviceUpdatable$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int deviceUpdatable - * } - */ - public static void deviceUpdatable(MemorySegment struct, int fieldValue) { - struct.set(deviceUpdatable$LAYOUT, deviceUpdatable$OFFSET, fieldValue); - } - - private static final AddressLayout devNode$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("devNode")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaGraphDeviceNode_t devNode - * } - */ - public static final AddressLayout devNode$layout() { - return devNode$LAYOUT; - } - - private static final long devNode$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaGraphDeviceNode_t devNode - * } - */ - public static final long devNode$offset() { - return devNode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaGraphDeviceNode_t devNode - * } - */ - public static MemorySegment devNode(MemorySegment struct) { - return struct.get(devNode$LAYOUT, devNode$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaGraphDeviceNode_t devNode - * } - */ - public static void devNode(MemorySegment struct, MemorySegment fieldValue) { - struct.set(devNode$LAYOUT, devNode$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout deviceUpdatableKernelNode$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("deviceUpdatableKernelNode")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * int deviceUpdatable; - * cudaGraphDeviceNode_t devNode; - * } deviceUpdatableKernelNode - * } - */ - public static final GroupLayout deviceUpdatableKernelNode$layout() { - return deviceUpdatableKernelNode$LAYOUT; - } - - private static final long deviceUpdatableKernelNode$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * int deviceUpdatable; - * cudaGraphDeviceNode_t devNode; - * } deviceUpdatableKernelNode - * } - */ - public static final long deviceUpdatableKernelNode$offset() { - return deviceUpdatableKernelNode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * int deviceUpdatable; - * cudaGraphDeviceNode_t devNode; - * } deviceUpdatableKernelNode - * } - */ - public static MemorySegment deviceUpdatableKernelNode(MemorySegment union) { - return union.asSlice(deviceUpdatableKernelNode$OFFSET, deviceUpdatableKernelNode$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * int deviceUpdatable; - * cudaGraphDeviceNode_t devNode; - * } deviceUpdatableKernelNode - * } - */ - public static void deviceUpdatableKernelNode(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, deviceUpdatableKernelNode$OFFSET, deviceUpdatableKernelNode$LAYOUT.byteSize()); - } - - private static final OfInt sharedMemCarveout$LAYOUT = (OfInt)$LAYOUT.select(groupElement("sharedMemCarveout")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int sharedMemCarveout - * } - */ - public static final OfInt sharedMemCarveout$layout() { - return sharedMemCarveout$LAYOUT; - } - - private static final long sharedMemCarveout$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int sharedMemCarveout - * } - */ - public static final long sharedMemCarveout$offset() { - return sharedMemCarveout$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int sharedMemCarveout - * } - */ - public static int sharedMemCarveout(MemorySegment union) { - return union.get(sharedMemCarveout$LAYOUT, sharedMemCarveout$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int sharedMemCarveout - * } - */ - public static void sharedMemCarveout(MemorySegment union, int fieldValue) { - union.set(sharedMemCarveout$LAYOUT, sharedMemCarveout$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute_st.java deleted file mode 100644 index fb3ad22fe3..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchAttribute_st.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaLaunchAttribute_st { - * cudaLaunchAttributeID id; - * char pad[4]; - * cudaLaunchAttributeValue val; - * } - * } - */ -public class cudaLaunchAttribute_st { - - cudaLaunchAttribute_st() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("id"), - MemoryLayout.sequenceLayout(4, PanamaFFMAPI.C_CHAR).withName("pad"), - cudaLaunchAttributeValue.layout().withName("val") - ).withName("cudaLaunchAttribute_st"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("id")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaLaunchAttributeID id - * } - */ - public static final OfInt id$layout() { - return id$LAYOUT; - } - - private static final long id$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaLaunchAttributeID id - * } - */ - public static final long id$offset() { - return id$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaLaunchAttributeID id - * } - */ - public static int id(MemorySegment struct) { - return struct.get(id$LAYOUT, id$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaLaunchAttributeID id - * } - */ - public static void id(MemorySegment struct, int fieldValue) { - struct.set(id$LAYOUT, id$OFFSET, fieldValue); - } - - private static final SequenceLayout pad$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("pad")); - - /** - * Layout for field: - * {@snippet lang=c : - * char pad[4] - * } - */ - public static final SequenceLayout pad$layout() { - return pad$LAYOUT; - } - - private static final long pad$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * char pad[4] - * } - */ - public static final long pad$offset() { - return pad$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char pad[4] - * } - */ - public static MemorySegment pad(MemorySegment struct) { - return struct.asSlice(pad$OFFSET, pad$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char pad[4] - * } - */ - public static void pad(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, pad$OFFSET, pad$LAYOUT.byteSize()); - } - - private static long[] pad$DIMS = { 4 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char pad[4] - * } - */ - public static long[] pad$dimensions() { - return pad$DIMS; - } - private static final VarHandle pad$ELEM_HANDLE = pad$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char pad[4] - * } - */ - public static byte pad(MemorySegment struct, long index0) { - return (byte)pad$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char pad[4] - * } - */ - public static void pad(MemorySegment struct, long index0, byte fieldValue) { - pad$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final GroupLayout val$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("val")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaLaunchAttributeValue val - * } - */ - public static final GroupLayout val$layout() { - return val$LAYOUT; - } - - private static final long val$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaLaunchAttributeValue val - * } - */ - public static final long val$offset() { - return val$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaLaunchAttributeValue val - * } - */ - public static MemorySegment val(MemorySegment struct) { - return struct.asSlice(val$OFFSET, val$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaLaunchAttributeValue val - * } - */ - public static void val(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, val$OFFSET, val$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_st.java deleted file mode 100644 index f8654a34f3..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_st.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaLaunchConfig_st { - * dim3 gridDim; - * dim3 blockDim; - * size_t dynamicSmemBytes; - * cudaStream_t stream; - * cudaLaunchAttribute *attrs; - * unsigned int numAttrs; - * } - * } - */ -public class cudaLaunchConfig_st { - - cudaLaunchConfig_st() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - dim3.layout().withName("gridDim"), - dim3.layout().withName("blockDim"), - PanamaFFMAPI.C_LONG.withName("dynamicSmemBytes"), - PanamaFFMAPI.C_POINTER.withName("stream"), - PanamaFFMAPI.C_POINTER.withName("attrs"), - PanamaFFMAPI.C_INT.withName("numAttrs"), - MemoryLayout.paddingLayout(4) - ).withName("cudaLaunchConfig_st"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final GroupLayout gridDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("gridDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static final GroupLayout gridDim$layout() { - return gridDim$LAYOUT; - } - - private static final long gridDim$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static final long gridDim$offset() { - return gridDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static MemorySegment gridDim(MemorySegment struct) { - return struct.asSlice(gridDim$OFFSET, gridDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static void gridDim(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, gridDim$OFFSET, gridDim$LAYOUT.byteSize()); - } - - private static final GroupLayout blockDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("blockDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static final GroupLayout blockDim$layout() { - return blockDim$LAYOUT; - } - - private static final long blockDim$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static final long blockDim$offset() { - return blockDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static MemorySegment blockDim(MemorySegment struct) { - return struct.asSlice(blockDim$OFFSET, blockDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static void blockDim(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, blockDim$OFFSET, blockDim$LAYOUT.byteSize()); - } - - private static final OfLong dynamicSmemBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("dynamicSmemBytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t dynamicSmemBytes - * } - */ - public static final OfLong dynamicSmemBytes$layout() { - return dynamicSmemBytes$LAYOUT; - } - - private static final long dynamicSmemBytes$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t dynamicSmemBytes - * } - */ - public static final long dynamicSmemBytes$offset() { - return dynamicSmemBytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t dynamicSmemBytes - * } - */ - public static long dynamicSmemBytes(MemorySegment struct) { - return struct.get(dynamicSmemBytes$LAYOUT, dynamicSmemBytes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t dynamicSmemBytes - * } - */ - public static void dynamicSmemBytes(MemorySegment struct, long fieldValue) { - struct.set(dynamicSmemBytes$LAYOUT, dynamicSmemBytes$OFFSET, fieldValue); - } - - private static final AddressLayout stream$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("stream")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaStream_t stream - * } - */ - public static final AddressLayout stream$layout() { - return stream$LAYOUT; - } - - private static final long stream$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaStream_t stream - * } - */ - public static final long stream$offset() { - return stream$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaStream_t stream - * } - */ - public static MemorySegment stream(MemorySegment struct) { - return struct.get(stream$LAYOUT, stream$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaStream_t stream - * } - */ - public static void stream(MemorySegment struct, MemorySegment fieldValue) { - struct.set(stream$LAYOUT, stream$OFFSET, fieldValue); - } - - private static final AddressLayout attrs$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("attrs")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaLaunchAttribute *attrs - * } - */ - public static final AddressLayout attrs$layout() { - return attrs$LAYOUT; - } - - private static final long attrs$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaLaunchAttribute *attrs - * } - */ - public static final long attrs$offset() { - return attrs$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaLaunchAttribute *attrs - * } - */ - public static MemorySegment attrs(MemorySegment struct) { - return struct.get(attrs$LAYOUT, attrs$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaLaunchAttribute *attrs - * } - */ - public static void attrs(MemorySegment struct, MemorySegment fieldValue) { - struct.set(attrs$LAYOUT, attrs$OFFSET, fieldValue); - } - - private static final OfInt numAttrs$LAYOUT = (OfInt)$LAYOUT.select(groupElement("numAttrs")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int numAttrs - * } - */ - public static final OfInt numAttrs$layout() { - return numAttrs$LAYOUT; - } - - private static final long numAttrs$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int numAttrs - * } - */ - public static final long numAttrs$offset() { - return numAttrs$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int numAttrs - * } - */ - public static int numAttrs(MemorySegment struct) { - return struct.get(numAttrs$LAYOUT, numAttrs$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int numAttrs - * } - */ - public static void numAttrs(MemorySegment struct, int fieldValue) { - struct.set(numAttrs$LAYOUT, numAttrs$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_t.java deleted file mode 100644 index 16b38398cd..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchConfig_t.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct cudaLaunchConfig_st { - * dim3 gridDim; - * dim3 blockDim; - * size_t dynamicSmemBytes; - * cudaStream_t stream; - * cudaLaunchAttribute *attrs; - * unsigned int numAttrs; - * } cudaLaunchConfig_t - * } - */ -public class cudaLaunchConfig_t extends cudaLaunchConfig_st { - - cudaLaunchConfig_t() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap.java deleted file mode 100644 index 0c76d4713d..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct cudaLaunchMemSyncDomainMap_st { - * unsigned char default_; - * unsigned char remote; - * } cudaLaunchMemSyncDomainMap - * } - */ -public class cudaLaunchMemSyncDomainMap extends cudaLaunchMemSyncDomainMap_st { - - cudaLaunchMemSyncDomainMap() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap_st.java deleted file mode 100644 index 8372e58646..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchMemSyncDomainMap_st.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaLaunchMemSyncDomainMap_st { - * unsigned char default_; - * unsigned char remote; - * } - * } - */ -public class cudaLaunchMemSyncDomainMap_st { - - cudaLaunchMemSyncDomainMap_st() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("default_"), - PanamaFFMAPI.C_CHAR.withName("remote") - ).withName("cudaLaunchMemSyncDomainMap_st"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte default_$LAYOUT = (OfByte)$LAYOUT.select(groupElement("default_")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char default_ - * } - */ - public static final OfByte default_$layout() { - return default_$LAYOUT; - } - - private static final long default_$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char default_ - * } - */ - public static final long default_$offset() { - return default_$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char default_ - * } - */ - public static byte default_(MemorySegment struct) { - return struct.get(default_$LAYOUT, default_$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char default_ - * } - */ - public static void default_(MemorySegment struct, byte fieldValue) { - struct.set(default_$LAYOUT, default_$OFFSET, fieldValue); - } - - private static final OfByte remote$LAYOUT = (OfByte)$LAYOUT.select(groupElement("remote")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char remote - * } - */ - public static final OfByte remote$layout() { - return remote$LAYOUT; - } - - private static final long remote$OFFSET = 1; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char remote - * } - */ - public static final long remote$offset() { - return remote$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char remote - * } - */ - public static byte remote(MemorySegment struct) { - return struct.get(remote$LAYOUT, remote$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char remote - * } - */ - public static void remote(MemorySegment struct, byte fieldValue) { - struct.set(remote$LAYOUT, remote$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchParams.java deleted file mode 100644 index 3a7efd2c5a..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaLaunchParams.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaLaunchParams { - * void *func; - * dim3 gridDim; - * dim3 blockDim; - * void **args; - * size_t sharedMem; - * cudaStream_t stream; - * } - * } - */ -public class cudaLaunchParams { - - cudaLaunchParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("func"), - dim3.layout().withName("gridDim"), - dim3.layout().withName("blockDim"), - PanamaFFMAPI.C_POINTER.withName("args"), - PanamaFFMAPI.C_LONG.withName("sharedMem"), - PanamaFFMAPI.C_POINTER.withName("stream") - ).withName("cudaLaunchParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout func$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("func")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *func - * } - */ - public static final AddressLayout func$layout() { - return func$LAYOUT; - } - - private static final long func$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *func - * } - */ - public static final long func$offset() { - return func$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *func - * } - */ - public static MemorySegment func(MemorySegment struct) { - return struct.get(func$LAYOUT, func$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *func - * } - */ - public static void func(MemorySegment struct, MemorySegment fieldValue) { - struct.set(func$LAYOUT, func$OFFSET, fieldValue); - } - - private static final GroupLayout gridDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("gridDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static final GroupLayout gridDim$layout() { - return gridDim$LAYOUT; - } - - private static final long gridDim$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static final long gridDim$offset() { - return gridDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static MemorySegment gridDim(MemorySegment struct) { - return struct.asSlice(gridDim$OFFSET, gridDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * dim3 gridDim - * } - */ - public static void gridDim(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, gridDim$OFFSET, gridDim$LAYOUT.byteSize()); - } - - private static final GroupLayout blockDim$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("blockDim")); - - /** - * Layout for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static final GroupLayout blockDim$layout() { - return blockDim$LAYOUT; - } - - private static final long blockDim$OFFSET = 20; - - /** - * Offset for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static final long blockDim$offset() { - return blockDim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static MemorySegment blockDim(MemorySegment struct) { - return struct.asSlice(blockDim$OFFSET, blockDim$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * dim3 blockDim - * } - */ - public static void blockDim(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, blockDim$OFFSET, blockDim$LAYOUT.byteSize()); - } - - private static final AddressLayout args$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("args")); - - /** - * Layout for field: - * {@snippet lang=c : - * void **args - * } - */ - public static final AddressLayout args$layout() { - return args$LAYOUT; - } - - private static final long args$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * void **args - * } - */ - public static final long args$offset() { - return args$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void **args - * } - */ - public static MemorySegment args(MemorySegment struct) { - return struct.get(args$LAYOUT, args$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void **args - * } - */ - public static void args(MemorySegment struct, MemorySegment fieldValue) { - struct.set(args$LAYOUT, args$OFFSET, fieldValue); - } - - private static final OfLong sharedMem$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sharedMem")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t sharedMem - * } - */ - public static final OfLong sharedMem$layout() { - return sharedMem$LAYOUT; - } - - private static final long sharedMem$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t sharedMem - * } - */ - public static final long sharedMem$offset() { - return sharedMem$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t sharedMem - * } - */ - public static long sharedMem(MemorySegment struct) { - return struct.get(sharedMem$LAYOUT, sharedMem$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t sharedMem - * } - */ - public static void sharedMem(MemorySegment struct, long fieldValue) { - struct.set(sharedMem$LAYOUT, sharedMem$OFFSET, fieldValue); - } - - private static final AddressLayout stream$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("stream")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaStream_t stream - * } - */ - public static final AddressLayout stream$layout() { - return stream$LAYOUT; - } - - private static final long stream$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaStream_t stream - * } - */ - public static final long stream$offset() { - return stream$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaStream_t stream - * } - */ - public static MemorySegment stream(MemorySegment struct) { - return struct.get(stream$LAYOUT, stream$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaStream_t stream - * } - */ - public static void stream(MemorySegment struct, MemorySegment fieldValue) { - struct.set(stream$LAYOUT, stream$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAccessDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAccessDesc.java deleted file mode 100644 index ec9ed09d37..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAccessDesc.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemAccessDesc { - * struct cudaMemLocation location; - * enum cudaMemAccessFlags flags; - * } - * } - */ -public class cudaMemAccessDesc { - - cudaMemAccessDesc() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaMemLocation.layout().withName("location"), - PanamaFFMAPI.C_INT.withName("flags") - ).withName("cudaMemAccessDesc"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final GroupLayout location$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("location")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaMemLocation location - * } - */ - public static final GroupLayout location$layout() { - return location$LAYOUT; - } - - private static final long location$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaMemLocation location - * } - */ - public static final long location$offset() { - return location$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaMemLocation location - * } - */ - public static MemorySegment location(MemorySegment struct) { - return struct.asSlice(location$OFFSET, location$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaMemLocation location - * } - */ - public static void location(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, location$OFFSET, location$LAYOUT.byteSize()); - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaMemAccessFlags flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaMemAccessFlags flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaMemAccessFlags flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaMemAccessFlags flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParams.java deleted file mode 100644 index 200737bf35..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParams.java +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemAllocNodeParams { - * struct cudaMemPoolProps poolProps; - * const struct cudaMemAccessDesc *accessDescs; - * size_t accessDescCount; - * size_t bytesize; - * void *dptr; - * } - * } - */ -public class cudaMemAllocNodeParams { - - cudaMemAllocNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaMemPoolProps.layout().withName("poolProps"), - PanamaFFMAPI.C_POINTER.withName("accessDescs"), - PanamaFFMAPI.C_LONG.withName("accessDescCount"), - PanamaFFMAPI.C_LONG.withName("bytesize"), - PanamaFFMAPI.C_POINTER.withName("dptr") - ).withName("cudaMemAllocNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final GroupLayout poolProps$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("poolProps")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaMemPoolProps poolProps - * } - */ - public static final GroupLayout poolProps$layout() { - return poolProps$LAYOUT; - } - - private static final long poolProps$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaMemPoolProps poolProps - * } - */ - public static final long poolProps$offset() { - return poolProps$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaMemPoolProps poolProps - * } - */ - public static MemorySegment poolProps(MemorySegment struct) { - return struct.asSlice(poolProps$OFFSET, poolProps$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaMemPoolProps poolProps - * } - */ - public static void poolProps(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, poolProps$OFFSET, poolProps$LAYOUT.byteSize()); - } - - private static final AddressLayout accessDescs$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("accessDescs")); - - /** - * Layout for field: - * {@snippet lang=c : - * const struct cudaMemAccessDesc *accessDescs - * } - */ - public static final AddressLayout accessDescs$layout() { - return accessDescs$LAYOUT; - } - - private static final long accessDescs$OFFSET = 88; - - /** - * Offset for field: - * {@snippet lang=c : - * const struct cudaMemAccessDesc *accessDescs - * } - */ - public static final long accessDescs$offset() { - return accessDescs$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const struct cudaMemAccessDesc *accessDescs - * } - */ - public static MemorySegment accessDescs(MemorySegment struct) { - return struct.get(accessDescs$LAYOUT, accessDescs$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const struct cudaMemAccessDesc *accessDescs - * } - */ - public static void accessDescs(MemorySegment struct, MemorySegment fieldValue) { - struct.set(accessDescs$LAYOUT, accessDescs$OFFSET, fieldValue); - } - - private static final OfLong accessDescCount$LAYOUT = (OfLong)$LAYOUT.select(groupElement("accessDescCount")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t accessDescCount - * } - */ - public static final OfLong accessDescCount$layout() { - return accessDescCount$LAYOUT; - } - - private static final long accessDescCount$OFFSET = 96; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t accessDescCount - * } - */ - public static final long accessDescCount$offset() { - return accessDescCount$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t accessDescCount - * } - */ - public static long accessDescCount(MemorySegment struct) { - return struct.get(accessDescCount$LAYOUT, accessDescCount$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t accessDescCount - * } - */ - public static void accessDescCount(MemorySegment struct, long fieldValue) { - struct.set(accessDescCount$LAYOUT, accessDescCount$OFFSET, fieldValue); - } - - private static final OfLong bytesize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("bytesize")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t bytesize - * } - */ - public static final OfLong bytesize$layout() { - return bytesize$LAYOUT; - } - - private static final long bytesize$OFFSET = 104; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t bytesize - * } - */ - public static final long bytesize$offset() { - return bytesize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t bytesize - * } - */ - public static long bytesize(MemorySegment struct) { - return struct.get(bytesize$LAYOUT, bytesize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t bytesize - * } - */ - public static void bytesize(MemorySegment struct, long fieldValue) { - struct.set(bytesize$LAYOUT, bytesize$OFFSET, fieldValue); - } - - private static final AddressLayout dptr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dptr")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static final AddressLayout dptr$layout() { - return dptr$LAYOUT; - } - - private static final long dptr$OFFSET = 112; - - /** - * Offset for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static final long dptr$offset() { - return dptr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static MemorySegment dptr(MemorySegment struct) { - return struct.get(dptr$LAYOUT, dptr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static void dptr(MemorySegment struct, MemorySegment fieldValue) { - struct.set(dptr$LAYOUT, dptr$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParamsV2.java deleted file mode 100644 index fc1af4201f..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemAllocNodeParamsV2.java +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemAllocNodeParamsV2 { - * struct cudaMemPoolProps poolProps; - * const struct cudaMemAccessDesc *accessDescs; - * size_t accessDescCount; - * size_t bytesize; - * void *dptr; - * } - * } - */ -public class cudaMemAllocNodeParamsV2 { - - cudaMemAllocNodeParamsV2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - cudaMemPoolProps.layout().withName("poolProps"), - PanamaFFMAPI.C_POINTER.withName("accessDescs"), - PanamaFFMAPI.C_LONG.withName("accessDescCount"), - PanamaFFMAPI.C_LONG.withName("bytesize"), - PanamaFFMAPI.C_POINTER.withName("dptr") - ).withName("cudaMemAllocNodeParamsV2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final GroupLayout poolProps$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("poolProps")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaMemPoolProps poolProps - * } - */ - public static final GroupLayout poolProps$layout() { - return poolProps$LAYOUT; - } - - private static final long poolProps$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaMemPoolProps poolProps - * } - */ - public static final long poolProps$offset() { - return poolProps$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaMemPoolProps poolProps - * } - */ - public static MemorySegment poolProps(MemorySegment struct) { - return struct.asSlice(poolProps$OFFSET, poolProps$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaMemPoolProps poolProps - * } - */ - public static void poolProps(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, poolProps$OFFSET, poolProps$LAYOUT.byteSize()); - } - - private static final AddressLayout accessDescs$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("accessDescs")); - - /** - * Layout for field: - * {@snippet lang=c : - * const struct cudaMemAccessDesc *accessDescs - * } - */ - public static final AddressLayout accessDescs$layout() { - return accessDescs$LAYOUT; - } - - private static final long accessDescs$OFFSET = 88; - - /** - * Offset for field: - * {@snippet lang=c : - * const struct cudaMemAccessDesc *accessDescs - * } - */ - public static final long accessDescs$offset() { - return accessDescs$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * const struct cudaMemAccessDesc *accessDescs - * } - */ - public static MemorySegment accessDescs(MemorySegment struct) { - return struct.get(accessDescs$LAYOUT, accessDescs$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * const struct cudaMemAccessDesc *accessDescs - * } - */ - public static void accessDescs(MemorySegment struct, MemorySegment fieldValue) { - struct.set(accessDescs$LAYOUT, accessDescs$OFFSET, fieldValue); - } - - private static final OfLong accessDescCount$LAYOUT = (OfLong)$LAYOUT.select(groupElement("accessDescCount")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t accessDescCount - * } - */ - public static final OfLong accessDescCount$layout() { - return accessDescCount$LAYOUT; - } - - private static final long accessDescCount$OFFSET = 96; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t accessDescCount - * } - */ - public static final long accessDescCount$offset() { - return accessDescCount$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t accessDescCount - * } - */ - public static long accessDescCount(MemorySegment struct) { - return struct.get(accessDescCount$LAYOUT, accessDescCount$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t accessDescCount - * } - */ - public static void accessDescCount(MemorySegment struct, long fieldValue) { - struct.set(accessDescCount$LAYOUT, accessDescCount$OFFSET, fieldValue); - } - - private static final OfLong bytesize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("bytesize")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t bytesize - * } - */ - public static final OfLong bytesize$layout() { - return bytesize$LAYOUT; - } - - private static final long bytesize$OFFSET = 104; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t bytesize - * } - */ - public static final long bytesize$offset() { - return bytesize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t bytesize - * } - */ - public static long bytesize(MemorySegment struct) { - return struct.get(bytesize$LAYOUT, bytesize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t bytesize - * } - */ - public static void bytesize(MemorySegment struct, long fieldValue) { - struct.set(bytesize$LAYOUT, bytesize$OFFSET, fieldValue); - } - - private static final AddressLayout dptr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dptr")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static final AddressLayout dptr$layout() { - return dptr$LAYOUT; - } - - private static final long dptr$OFFSET = 112; - - /** - * Offset for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static final long dptr$offset() { - return dptr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static MemorySegment dptr(MemorySegment struct) { - return struct.get(dptr$LAYOUT, dptr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static void dptr(MemorySegment struct, MemorySegment fieldValue) { - struct.set(dptr$LAYOUT, dptr$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_st.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_st.java deleted file mode 100644 index e6881523eb..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_st.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemFabricHandle_st { - * char reserved[64]; - * } - * } - */ -public class cudaMemFabricHandle_st { - - cudaMemFabricHandle_st() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.sequenceLayout(64, PanamaFFMAPI.C_CHAR).withName("reserved") - ).withName("cudaMemFabricHandle_st"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 64 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static byte reserved(MemorySegment struct, long index0) { - return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * char reserved[64] - * } - */ - public static void reserved(MemorySegment struct, long index0, byte fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_t.java deleted file mode 100644 index 51f9bb75e8..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFabricHandle_t.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct cudaMemFabricHandle_st { - * char reserved[64]; - * } cudaMemFabricHandle_t - * } - */ -public class cudaMemFabricHandle_t extends cudaMemFabricHandle_st { - - cudaMemFabricHandle_t() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFreeNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFreeNodeParams.java deleted file mode 100644 index a81e389d26..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemFreeNodeParams.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemFreeNodeParams { - * void *dptr; - * } - * } - */ -public class cudaMemFreeNodeParams { - - cudaMemFreeNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("dptr") - ).withName("cudaMemFreeNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout dptr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dptr")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static final AddressLayout dptr$layout() { - return dptr$LAYOUT; - } - - private static final long dptr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static final long dptr$offset() { - return dptr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static MemorySegment dptr(MemorySegment struct) { - return struct.get(dptr$LAYOUT, dptr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *dptr - * } - */ - public static void dptr(MemorySegment struct, MemorySegment fieldValue) { - struct.set(dptr$LAYOUT, dptr$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemLocation.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemLocation.java deleted file mode 100644 index e41966adad..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemLocation.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemLocation { - * enum cudaMemLocationType type; - * int id; - * } - * } - */ -public class cudaMemLocation { - - cudaMemLocation() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("type"), - PanamaFFMAPI.C_INT.withName("id") - ).withName("cudaMemLocation"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaMemLocationType type - * } - */ - public static final OfInt type$layout() { - return type$LAYOUT; - } - - private static final long type$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaMemLocationType type - * } - */ - public static final long type$offset() { - return type$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaMemLocationType type - * } - */ - public static int type(MemorySegment struct) { - return struct.get(type$LAYOUT, type$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaMemLocationType type - * } - */ - public static void type(MemorySegment struct, int fieldValue) { - struct.set(type$LAYOUT, type$OFFSET, fieldValue); - } - - private static final OfInt id$LAYOUT = (OfInt)$LAYOUT.select(groupElement("id")); - - /** - * Layout for field: - * {@snippet lang=c : - * int id - * } - */ - public static final OfInt id$layout() { - return id$LAYOUT; - } - - private static final long id$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int id - * } - */ - public static final long id$offset() { - return id$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int id - * } - */ - public static int id(MemorySegment struct) { - return struct.get(id$LAYOUT, id$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int id - * } - */ - public static void id(MemorySegment struct, int fieldValue) { - struct.set(id$LAYOUT, id$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolProps.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolProps.java deleted file mode 100644 index 31a3d15543..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolProps.java +++ /dev/null @@ -1,452 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemPoolProps { - * enum cudaMemAllocationType allocType; - * enum cudaMemAllocationHandleType handleTypes; - * struct cudaMemLocation location; - * void *win32SecurityAttributes; - * size_t maxSize; - * unsigned short usage; - * unsigned char reserved[54]; - * } - * } - */ -public class cudaMemPoolProps { - - cudaMemPoolProps() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("allocType"), - PanamaFFMAPI.C_INT.withName("handleTypes"), - cudaMemLocation.layout().withName("location"), - PanamaFFMAPI.C_POINTER.withName("win32SecurityAttributes"), - PanamaFFMAPI.C_LONG.withName("maxSize"), - PanamaFFMAPI.C_SHORT.withName("usage"), - MemoryLayout.sequenceLayout(54, PanamaFFMAPI.C_CHAR).withName("reserved") - ).withName("cudaMemPoolProps"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt allocType$LAYOUT = (OfInt)$LAYOUT.select(groupElement("allocType")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaMemAllocationType allocType - * } - */ - public static final OfInt allocType$layout() { - return allocType$LAYOUT; - } - - private static final long allocType$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaMemAllocationType allocType - * } - */ - public static final long allocType$offset() { - return allocType$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaMemAllocationType allocType - * } - */ - public static int allocType(MemorySegment struct) { - return struct.get(allocType$LAYOUT, allocType$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaMemAllocationType allocType - * } - */ - public static void allocType(MemorySegment struct, int fieldValue) { - struct.set(allocType$LAYOUT, allocType$OFFSET, fieldValue); - } - - private static final OfInt handleTypes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("handleTypes")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaMemAllocationHandleType handleTypes - * } - */ - public static final OfInt handleTypes$layout() { - return handleTypes$LAYOUT; - } - - private static final long handleTypes$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaMemAllocationHandleType handleTypes - * } - */ - public static final long handleTypes$offset() { - return handleTypes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaMemAllocationHandleType handleTypes - * } - */ - public static int handleTypes(MemorySegment struct) { - return struct.get(handleTypes$LAYOUT, handleTypes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaMemAllocationHandleType handleTypes - * } - */ - public static void handleTypes(MemorySegment struct, int fieldValue) { - struct.set(handleTypes$LAYOUT, handleTypes$OFFSET, fieldValue); - } - - private static final GroupLayout location$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("location")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaMemLocation location - * } - */ - public static final GroupLayout location$layout() { - return location$LAYOUT; - } - - private static final long location$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaMemLocation location - * } - */ - public static final long location$offset() { - return location$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaMemLocation location - * } - */ - public static MemorySegment location(MemorySegment struct) { - return struct.asSlice(location$OFFSET, location$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaMemLocation location - * } - */ - public static void location(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, location$OFFSET, location$LAYOUT.byteSize()); - } - - private static final AddressLayout win32SecurityAttributes$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("win32SecurityAttributes")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *win32SecurityAttributes - * } - */ - public static final AddressLayout win32SecurityAttributes$layout() { - return win32SecurityAttributes$LAYOUT; - } - - private static final long win32SecurityAttributes$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * void *win32SecurityAttributes - * } - */ - public static final long win32SecurityAttributes$offset() { - return win32SecurityAttributes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *win32SecurityAttributes - * } - */ - public static MemorySegment win32SecurityAttributes(MemorySegment struct) { - return struct.get(win32SecurityAttributes$LAYOUT, win32SecurityAttributes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *win32SecurityAttributes - * } - */ - public static void win32SecurityAttributes(MemorySegment struct, MemorySegment fieldValue) { - struct.set(win32SecurityAttributes$LAYOUT, win32SecurityAttributes$OFFSET, fieldValue); - } - - private static final OfLong maxSize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("maxSize")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t maxSize - * } - */ - public static final OfLong maxSize$layout() { - return maxSize$LAYOUT; - } - - private static final long maxSize$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t maxSize - * } - */ - public static final long maxSize$offset() { - return maxSize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t maxSize - * } - */ - public static long maxSize(MemorySegment struct) { - return struct.get(maxSize$LAYOUT, maxSize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t maxSize - * } - */ - public static void maxSize(MemorySegment struct, long fieldValue) { - struct.set(maxSize$LAYOUT, maxSize$OFFSET, fieldValue); - } - - private static final OfShort usage$LAYOUT = (OfShort)$LAYOUT.select(groupElement("usage")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short usage - * } - */ - public static final OfShort usage$layout() { - return usage$LAYOUT; - } - - private static final long usage$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short usage - * } - */ - public static final long usage$offset() { - return usage$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short usage - * } - */ - public static short usage(MemorySegment struct) { - return struct.get(usage$LAYOUT, usage$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short usage - * } - */ - public static void usage(MemorySegment struct, short fieldValue) { - struct.set(usage$LAYOUT, usage$OFFSET, fieldValue); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char reserved[54] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 34; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char reserved[54] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char reserved[54] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char reserved[54] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 54 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned char reserved[54] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned char reserved[54] - * } - */ - public static byte reserved(MemorySegment struct, long index0) { - return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned char reserved[54] - * } - */ - public static void reserved(MemorySegment struct, long index0, byte fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolPtrExportData.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolPtrExportData.java deleted file mode 100644 index 01c9bb03c6..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemPoolPtrExportData.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemPoolPtrExportData { - * unsigned char reserved[64]; - * } - * } - */ -public class cudaMemPoolPtrExportData { - - cudaMemPoolPtrExportData() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.sequenceLayout(64, PanamaFFMAPI.C_CHAR).withName("reserved") - ).withName("cudaMemPoolPtrExportData"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char reserved[64] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char reserved[64] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char reserved[64] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char reserved[64] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 64 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * unsigned char reserved[64] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * unsigned char reserved[64] - * } - */ - public static byte reserved(MemorySegment struct, long index0) { - return (byte)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * unsigned char reserved[64] - * } - */ - public static void reserved(MemorySegment struct, long index0, byte fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DParms.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DParms.java deleted file mode 100644 index 5a543cc3cb..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DParms.java +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemcpy3DParms { - * cudaArray_t srcArray; - * struct cudaPos srcPos; - * struct cudaPitchedPtr srcPtr; - * cudaArray_t dstArray; - * struct cudaPos dstPos; - * struct cudaPitchedPtr dstPtr; - * struct cudaExtent extent; - * enum cudaMemcpyKind kind; - * } - * } - */ -public class cudaMemcpy3DParms { - - cudaMemcpy3DParms() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("srcArray"), - cudaPos.layout().withName("srcPos"), - cudaPitchedPtr.layout().withName("srcPtr"), - PanamaFFMAPI.C_POINTER.withName("dstArray"), - cudaPos.layout().withName("dstPos"), - cudaPitchedPtr.layout().withName("dstPtr"), - cudaExtent.layout().withName("extent"), - PanamaFFMAPI.C_INT.withName("kind"), - MemoryLayout.paddingLayout(4) - ).withName("cudaMemcpy3DParms"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout srcArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("srcArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaArray_t srcArray - * } - */ - public static final AddressLayout srcArray$layout() { - return srcArray$LAYOUT; - } - - private static final long srcArray$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaArray_t srcArray - * } - */ - public static final long srcArray$offset() { - return srcArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaArray_t srcArray - * } - */ - public static MemorySegment srcArray(MemorySegment struct) { - return struct.get(srcArray$LAYOUT, srcArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaArray_t srcArray - * } - */ - public static void srcArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(srcArray$LAYOUT, srcArray$OFFSET, fieldValue); - } - - private static final GroupLayout srcPos$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("srcPos")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaPos srcPos - * } - */ - public static final GroupLayout srcPos$layout() { - return srcPos$LAYOUT; - } - - private static final long srcPos$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaPos srcPos - * } - */ - public static final long srcPos$offset() { - return srcPos$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaPos srcPos - * } - */ - public static MemorySegment srcPos(MemorySegment struct) { - return struct.asSlice(srcPos$OFFSET, srcPos$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaPos srcPos - * } - */ - public static void srcPos(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, srcPos$OFFSET, srcPos$LAYOUT.byteSize()); - } - - private static final GroupLayout srcPtr$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("srcPtr")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaPitchedPtr srcPtr - * } - */ - public static final GroupLayout srcPtr$layout() { - return srcPtr$LAYOUT; - } - - private static final long srcPtr$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaPitchedPtr srcPtr - * } - */ - public static final long srcPtr$offset() { - return srcPtr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaPitchedPtr srcPtr - * } - */ - public static MemorySegment srcPtr(MemorySegment struct) { - return struct.asSlice(srcPtr$OFFSET, srcPtr$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaPitchedPtr srcPtr - * } - */ - public static void srcPtr(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, srcPtr$OFFSET, srcPtr$LAYOUT.byteSize()); - } - - private static final AddressLayout dstArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dstArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaArray_t dstArray - * } - */ - public static final AddressLayout dstArray$layout() { - return dstArray$LAYOUT; - } - - private static final long dstArray$OFFSET = 64; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaArray_t dstArray - * } - */ - public static final long dstArray$offset() { - return dstArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaArray_t dstArray - * } - */ - public static MemorySegment dstArray(MemorySegment struct) { - return struct.get(dstArray$LAYOUT, dstArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaArray_t dstArray - * } - */ - public static void dstArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(dstArray$LAYOUT, dstArray$OFFSET, fieldValue); - } - - private static final GroupLayout dstPos$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dstPos")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaPos dstPos - * } - */ - public static final GroupLayout dstPos$layout() { - return dstPos$LAYOUT; - } - - private static final long dstPos$OFFSET = 72; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaPos dstPos - * } - */ - public static final long dstPos$offset() { - return dstPos$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaPos dstPos - * } - */ - public static MemorySegment dstPos(MemorySegment struct) { - return struct.asSlice(dstPos$OFFSET, dstPos$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaPos dstPos - * } - */ - public static void dstPos(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dstPos$OFFSET, dstPos$LAYOUT.byteSize()); - } - - private static final GroupLayout dstPtr$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dstPtr")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaPitchedPtr dstPtr - * } - */ - public static final GroupLayout dstPtr$layout() { - return dstPtr$LAYOUT; - } - - private static final long dstPtr$OFFSET = 96; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaPitchedPtr dstPtr - * } - */ - public static final long dstPtr$offset() { - return dstPtr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaPitchedPtr dstPtr - * } - */ - public static MemorySegment dstPtr(MemorySegment struct) { - return struct.asSlice(dstPtr$OFFSET, dstPtr$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaPitchedPtr dstPtr - * } - */ - public static void dstPtr(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dstPtr$OFFSET, dstPtr$LAYOUT.byteSize()); - } - - private static final GroupLayout extent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("extent")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static final GroupLayout extent$layout() { - return extent$LAYOUT; - } - - private static final long extent$OFFSET = 128; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static final long extent$offset() { - return extent$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static MemorySegment extent(MemorySegment struct) { - return struct.asSlice(extent$OFFSET, extent$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static void extent(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, extent$OFFSET, extent$LAYOUT.byteSize()); - } - - private static final OfInt kind$LAYOUT = (OfInt)$LAYOUT.select(groupElement("kind")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaMemcpyKind kind - * } - */ - public static final OfInt kind$layout() { - return kind$LAYOUT; - } - - private static final long kind$OFFSET = 152; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaMemcpyKind kind - * } - */ - public static final long kind$offset() { - return kind$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaMemcpyKind kind - * } - */ - public static int kind(MemorySegment struct) { - return struct.get(kind$LAYOUT, kind$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaMemcpyKind kind - * } - */ - public static void kind(MemorySegment struct, int fieldValue) { - struct.set(kind$LAYOUT, kind$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DPeerParms.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DPeerParms.java deleted file mode 100644 index dc66c9f6d6..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpy3DPeerParms.java +++ /dev/null @@ -1,513 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemcpy3DPeerParms { - * cudaArray_t srcArray; - * struct cudaPos srcPos; - * struct cudaPitchedPtr srcPtr; - * int srcDevice; - * cudaArray_t dstArray; - * struct cudaPos dstPos; - * struct cudaPitchedPtr dstPtr; - * int dstDevice; - * struct cudaExtent extent; - * } - * } - */ -public class cudaMemcpy3DPeerParms { - - cudaMemcpy3DPeerParms() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("srcArray"), - cudaPos.layout().withName("srcPos"), - cudaPitchedPtr.layout().withName("srcPtr"), - PanamaFFMAPI.C_INT.withName("srcDevice"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_POINTER.withName("dstArray"), - cudaPos.layout().withName("dstPos"), - cudaPitchedPtr.layout().withName("dstPtr"), - PanamaFFMAPI.C_INT.withName("dstDevice"), - MemoryLayout.paddingLayout(4), - cudaExtent.layout().withName("extent") - ).withName("cudaMemcpy3DPeerParms"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout srcArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("srcArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaArray_t srcArray - * } - */ - public static final AddressLayout srcArray$layout() { - return srcArray$LAYOUT; - } - - private static final long srcArray$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaArray_t srcArray - * } - */ - public static final long srcArray$offset() { - return srcArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaArray_t srcArray - * } - */ - public static MemorySegment srcArray(MemorySegment struct) { - return struct.get(srcArray$LAYOUT, srcArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaArray_t srcArray - * } - */ - public static void srcArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(srcArray$LAYOUT, srcArray$OFFSET, fieldValue); - } - - private static final GroupLayout srcPos$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("srcPos")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaPos srcPos - * } - */ - public static final GroupLayout srcPos$layout() { - return srcPos$LAYOUT; - } - - private static final long srcPos$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaPos srcPos - * } - */ - public static final long srcPos$offset() { - return srcPos$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaPos srcPos - * } - */ - public static MemorySegment srcPos(MemorySegment struct) { - return struct.asSlice(srcPos$OFFSET, srcPos$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaPos srcPos - * } - */ - public static void srcPos(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, srcPos$OFFSET, srcPos$LAYOUT.byteSize()); - } - - private static final GroupLayout srcPtr$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("srcPtr")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaPitchedPtr srcPtr - * } - */ - public static final GroupLayout srcPtr$layout() { - return srcPtr$LAYOUT; - } - - private static final long srcPtr$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaPitchedPtr srcPtr - * } - */ - public static final long srcPtr$offset() { - return srcPtr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaPitchedPtr srcPtr - * } - */ - public static MemorySegment srcPtr(MemorySegment struct) { - return struct.asSlice(srcPtr$OFFSET, srcPtr$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaPitchedPtr srcPtr - * } - */ - public static void srcPtr(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, srcPtr$OFFSET, srcPtr$LAYOUT.byteSize()); - } - - private static final OfInt srcDevice$LAYOUT = (OfInt)$LAYOUT.select(groupElement("srcDevice")); - - /** - * Layout for field: - * {@snippet lang=c : - * int srcDevice - * } - */ - public static final OfInt srcDevice$layout() { - return srcDevice$LAYOUT; - } - - private static final long srcDevice$OFFSET = 64; - - /** - * Offset for field: - * {@snippet lang=c : - * int srcDevice - * } - */ - public static final long srcDevice$offset() { - return srcDevice$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int srcDevice - * } - */ - public static int srcDevice(MemorySegment struct) { - return struct.get(srcDevice$LAYOUT, srcDevice$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int srcDevice - * } - */ - public static void srcDevice(MemorySegment struct, int fieldValue) { - struct.set(srcDevice$LAYOUT, srcDevice$OFFSET, fieldValue); - } - - private static final AddressLayout dstArray$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dstArray")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaArray_t dstArray - * } - */ - public static final AddressLayout dstArray$layout() { - return dstArray$LAYOUT; - } - - private static final long dstArray$OFFSET = 72; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaArray_t dstArray - * } - */ - public static final long dstArray$offset() { - return dstArray$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaArray_t dstArray - * } - */ - public static MemorySegment dstArray(MemorySegment struct) { - return struct.get(dstArray$LAYOUT, dstArray$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaArray_t dstArray - * } - */ - public static void dstArray(MemorySegment struct, MemorySegment fieldValue) { - struct.set(dstArray$LAYOUT, dstArray$OFFSET, fieldValue); - } - - private static final GroupLayout dstPos$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dstPos")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaPos dstPos - * } - */ - public static final GroupLayout dstPos$layout() { - return dstPos$LAYOUT; - } - - private static final long dstPos$OFFSET = 80; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaPos dstPos - * } - */ - public static final long dstPos$offset() { - return dstPos$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaPos dstPos - * } - */ - public static MemorySegment dstPos(MemorySegment struct) { - return struct.asSlice(dstPos$OFFSET, dstPos$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaPos dstPos - * } - */ - public static void dstPos(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dstPos$OFFSET, dstPos$LAYOUT.byteSize()); - } - - private static final GroupLayout dstPtr$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dstPtr")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaPitchedPtr dstPtr - * } - */ - public static final GroupLayout dstPtr$layout() { - return dstPtr$LAYOUT; - } - - private static final long dstPtr$OFFSET = 104; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaPitchedPtr dstPtr - * } - */ - public static final long dstPtr$offset() { - return dstPtr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaPitchedPtr dstPtr - * } - */ - public static MemorySegment dstPtr(MemorySegment struct) { - return struct.asSlice(dstPtr$OFFSET, dstPtr$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaPitchedPtr dstPtr - * } - */ - public static void dstPtr(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dstPtr$OFFSET, dstPtr$LAYOUT.byteSize()); - } - - private static final OfInt dstDevice$LAYOUT = (OfInt)$LAYOUT.select(groupElement("dstDevice")); - - /** - * Layout for field: - * {@snippet lang=c : - * int dstDevice - * } - */ - public static final OfInt dstDevice$layout() { - return dstDevice$LAYOUT; - } - - private static final long dstDevice$OFFSET = 136; - - /** - * Offset for field: - * {@snippet lang=c : - * int dstDevice - * } - */ - public static final long dstDevice$offset() { - return dstDevice$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int dstDevice - * } - */ - public static int dstDevice(MemorySegment struct) { - return struct.get(dstDevice$LAYOUT, dstDevice$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int dstDevice - * } - */ - public static void dstDevice(MemorySegment struct, int fieldValue) { - struct.set(dstDevice$LAYOUT, dstDevice$OFFSET, fieldValue); - } - - private static final GroupLayout extent$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("extent")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static final GroupLayout extent$layout() { - return extent$LAYOUT; - } - - private static final long extent$OFFSET = 144; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static final long extent$offset() { - return extent$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static MemorySegment extent(MemorySegment struct) { - return struct.asSlice(extent$OFFSET, extent$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaExtent extent - * } - */ - public static void extent(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, extent$OFFSET, extent$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpyNodeParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpyNodeParams.java deleted file mode 100644 index fe85ee793a..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemcpyNodeParams.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemcpyNodeParams { - * int flags; - * int reserved[3]; - * struct cudaMemcpy3DParms copyParams; - * } - * } - */ -public class cudaMemcpyNodeParams { - - cudaMemcpyNodeParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("flags"), - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("reserved"), - cudaMemcpy3DParms.layout().withName("copyParams") - ).withName("cudaMemcpyNodeParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt flags$LAYOUT = (OfInt)$LAYOUT.select(groupElement("flags")); - - /** - * Layout for field: - * {@snippet lang=c : - * int flags - * } - */ - public static final OfInt flags$layout() { - return flags$LAYOUT; - } - - private static final long flags$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int flags - * } - */ - public static final long flags$offset() { - return flags$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int flags - * } - */ - public static int flags(MemorySegment struct) { - return struct.get(flags$LAYOUT, flags$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int flags - * } - */ - public static void flags(MemorySegment struct, int fieldValue) { - struct.set(flags$LAYOUT, flags$OFFSET, fieldValue); - } - - private static final SequenceLayout reserved$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("reserved")); - - /** - * Layout for field: - * {@snippet lang=c : - * int reserved[3] - * } - */ - public static final SequenceLayout reserved$layout() { - return reserved$LAYOUT; - } - - private static final long reserved$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int reserved[3] - * } - */ - public static final long reserved$offset() { - return reserved$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int reserved[3] - * } - */ - public static MemorySegment reserved(MemorySegment struct) { - return struct.asSlice(reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int reserved[3] - * } - */ - public static void reserved(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, reserved$OFFSET, reserved$LAYOUT.byteSize()); - } - - private static long[] reserved$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * int reserved[3] - * } - */ - public static long[] reserved$dimensions() { - return reserved$DIMS; - } - private static final VarHandle reserved$ELEM_HANDLE = reserved$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * int reserved[3] - * } - */ - public static int reserved(MemorySegment struct, long index0) { - return (int)reserved$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * int reserved[3] - * } - */ - public static void reserved(MemorySegment struct, long index0, int fieldValue) { - reserved$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final GroupLayout copyParams$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("copyParams")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaMemcpy3DParms copyParams - * } - */ - public static final GroupLayout copyParams$layout() { - return copyParams$LAYOUT; - } - - private static final long copyParams$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaMemcpy3DParms copyParams - * } - */ - public static final long copyParams$offset() { - return copyParams$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaMemcpy3DParms copyParams - * } - */ - public static MemorySegment copyParams(MemorySegment struct) { - return struct.asSlice(copyParams$OFFSET, copyParams$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaMemcpy3DParms copyParams - * } - */ - public static void copyParams(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, copyParams$OFFSET, copyParams$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParams.java deleted file mode 100644 index 69f51851f5..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParams.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemsetParams { - * void *dst; - * size_t pitch; - * unsigned int value; - * unsigned int elementSize; - * size_t width; - * size_t height; - * } - * } - */ -public class cudaMemsetParams { - - cudaMemsetParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("dst"), - PanamaFFMAPI.C_LONG.withName("pitch"), - PanamaFFMAPI.C_INT.withName("value"), - PanamaFFMAPI.C_INT.withName("elementSize"), - PanamaFFMAPI.C_LONG.withName("width"), - PanamaFFMAPI.C_LONG.withName("height") - ).withName("cudaMemsetParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout dst$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dst")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *dst - * } - */ - public static final AddressLayout dst$layout() { - return dst$LAYOUT; - } - - private static final long dst$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *dst - * } - */ - public static final long dst$offset() { - return dst$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *dst - * } - */ - public static MemorySegment dst(MemorySegment struct) { - return struct.get(dst$LAYOUT, dst$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *dst - * } - */ - public static void dst(MemorySegment struct, MemorySegment fieldValue) { - struct.set(dst$LAYOUT, dst$OFFSET, fieldValue); - } - - private static final OfLong pitch$LAYOUT = (OfLong)$LAYOUT.select(groupElement("pitch")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static final OfLong pitch$layout() { - return pitch$LAYOUT; - } - - private static final long pitch$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static final long pitch$offset() { - return pitch$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static long pitch(MemorySegment struct) { - return struct.get(pitch$LAYOUT, pitch$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static void pitch(MemorySegment struct, long fieldValue) { - struct.set(pitch$LAYOUT, pitch$OFFSET, fieldValue); - } - - private static final OfInt value$LAYOUT = (OfInt)$LAYOUT.select(groupElement("value")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int value - * } - */ - public static final OfInt value$layout() { - return value$LAYOUT; - } - - private static final long value$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int value - * } - */ - public static final long value$offset() { - return value$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int value - * } - */ - public static int value(MemorySegment struct) { - return struct.get(value$LAYOUT, value$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int value - * } - */ - public static void value(MemorySegment struct, int fieldValue) { - struct.set(value$LAYOUT, value$OFFSET, fieldValue); - } - - private static final OfInt elementSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("elementSize")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int elementSize - * } - */ - public static final OfInt elementSize$layout() { - return elementSize$LAYOUT; - } - - private static final long elementSize$OFFSET = 20; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int elementSize - * } - */ - public static final long elementSize$offset() { - return elementSize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int elementSize - * } - */ - public static int elementSize(MemorySegment struct) { - return struct.get(elementSize$LAYOUT, elementSize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int elementSize - * } - */ - public static void elementSize(MemorySegment struct, int fieldValue) { - struct.set(elementSize$LAYOUT, elementSize$OFFSET, fieldValue); - } - - private static final OfLong width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("width")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static final OfLong width$layout() { - return width$LAYOUT; - } - - private static final long width$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static final long width$offset() { - return width$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static long width(MemorySegment struct) { - return struct.get(width$LAYOUT, width$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static void width(MemorySegment struct, long fieldValue) { - struct.set(width$LAYOUT, width$OFFSET, fieldValue); - } - - private static final OfLong height$LAYOUT = (OfLong)$LAYOUT.select(groupElement("height")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static final OfLong height$layout() { - return height$LAYOUT; - } - - private static final long height$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static final long height$offset() { - return height$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static long height(MemorySegment struct) { - return struct.get(height$LAYOUT, height$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static void height(MemorySegment struct, long fieldValue) { - struct.set(height$LAYOUT, height$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParamsV2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParamsV2.java deleted file mode 100644 index a6d6884a55..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaMemsetParamsV2.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaMemsetParamsV2 { - * void *dst; - * size_t pitch; - * unsigned int value; - * unsigned int elementSize; - * size_t width; - * size_t height; - * } - * } - */ -public class cudaMemsetParamsV2 { - - cudaMemsetParamsV2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("dst"), - PanamaFFMAPI.C_LONG.withName("pitch"), - PanamaFFMAPI.C_INT.withName("value"), - PanamaFFMAPI.C_INT.withName("elementSize"), - PanamaFFMAPI.C_LONG.withName("width"), - PanamaFFMAPI.C_LONG.withName("height") - ).withName("cudaMemsetParamsV2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout dst$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("dst")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *dst - * } - */ - public static final AddressLayout dst$layout() { - return dst$LAYOUT; - } - - private static final long dst$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *dst - * } - */ - public static final long dst$offset() { - return dst$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *dst - * } - */ - public static MemorySegment dst(MemorySegment struct) { - return struct.get(dst$LAYOUT, dst$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *dst - * } - */ - public static void dst(MemorySegment struct, MemorySegment fieldValue) { - struct.set(dst$LAYOUT, dst$OFFSET, fieldValue); - } - - private static final OfLong pitch$LAYOUT = (OfLong)$LAYOUT.select(groupElement("pitch")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static final OfLong pitch$layout() { - return pitch$LAYOUT; - } - - private static final long pitch$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static final long pitch$offset() { - return pitch$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static long pitch(MemorySegment struct) { - return struct.get(pitch$LAYOUT, pitch$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static void pitch(MemorySegment struct, long fieldValue) { - struct.set(pitch$LAYOUT, pitch$OFFSET, fieldValue); - } - - private static final OfInt value$LAYOUT = (OfInt)$LAYOUT.select(groupElement("value")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int value - * } - */ - public static final OfInt value$layout() { - return value$LAYOUT; - } - - private static final long value$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int value - * } - */ - public static final long value$offset() { - return value$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int value - * } - */ - public static int value(MemorySegment struct) { - return struct.get(value$LAYOUT, value$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int value - * } - */ - public static void value(MemorySegment struct, int fieldValue) { - struct.set(value$LAYOUT, value$OFFSET, fieldValue); - } - - private static final OfInt elementSize$LAYOUT = (OfInt)$LAYOUT.select(groupElement("elementSize")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int elementSize - * } - */ - public static final OfInt elementSize$layout() { - return elementSize$LAYOUT; - } - - private static final long elementSize$OFFSET = 20; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int elementSize - * } - */ - public static final long elementSize$offset() { - return elementSize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int elementSize - * } - */ - public static int elementSize(MemorySegment struct) { - return struct.get(elementSize$LAYOUT, elementSize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int elementSize - * } - */ - public static void elementSize(MemorySegment struct, int fieldValue) { - struct.set(elementSize$LAYOUT, elementSize$OFFSET, fieldValue); - } - - private static final OfLong width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("width")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static final OfLong width$layout() { - return width$LAYOUT; - } - - private static final long width$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static final long width$offset() { - return width$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static long width(MemorySegment struct) { - return struct.get(width$LAYOUT, width$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static void width(MemorySegment struct, long fieldValue) { - struct.set(width$LAYOUT, width$OFFSET, fieldValue); - } - - private static final OfLong height$LAYOUT = (OfLong)$LAYOUT.select(groupElement("height")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static final OfLong height$layout() { - return height$LAYOUT; - } - - private static final long height$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static final long height$offset() { - return height$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static long height(MemorySegment struct) { - return struct.get(height$LAYOUT, height$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static void height(MemorySegment struct, long fieldValue) { - struct.set(height$LAYOUT, height$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPitchedPtr.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPitchedPtr.java deleted file mode 100644 index e06294b00e..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPitchedPtr.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaPitchedPtr { - * void *ptr; - * size_t pitch; - * size_t xsize; - * size_t ysize; - * } - * } - */ -public class cudaPitchedPtr { - - cudaPitchedPtr() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("ptr"), - PanamaFFMAPI.C_LONG.withName("pitch"), - PanamaFFMAPI.C_LONG.withName("xsize"), - PanamaFFMAPI.C_LONG.withName("ysize") - ).withName("cudaPitchedPtr"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout ptr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("ptr")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *ptr - * } - */ - public static final AddressLayout ptr$layout() { - return ptr$LAYOUT; - } - - private static final long ptr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *ptr - * } - */ - public static final long ptr$offset() { - return ptr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *ptr - * } - */ - public static MemorySegment ptr(MemorySegment struct) { - return struct.get(ptr$LAYOUT, ptr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *ptr - * } - */ - public static void ptr(MemorySegment struct, MemorySegment fieldValue) { - struct.set(ptr$LAYOUT, ptr$OFFSET, fieldValue); - } - - private static final OfLong pitch$LAYOUT = (OfLong)$LAYOUT.select(groupElement("pitch")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static final OfLong pitch$layout() { - return pitch$LAYOUT; - } - - private static final long pitch$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static final long pitch$offset() { - return pitch$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static long pitch(MemorySegment struct) { - return struct.get(pitch$LAYOUT, pitch$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t pitch - * } - */ - public static void pitch(MemorySegment struct, long fieldValue) { - struct.set(pitch$LAYOUT, pitch$OFFSET, fieldValue); - } - - private static final OfLong xsize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("xsize")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t xsize - * } - */ - public static final OfLong xsize$layout() { - return xsize$LAYOUT; - } - - private static final long xsize$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t xsize - * } - */ - public static final long xsize$offset() { - return xsize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t xsize - * } - */ - public static long xsize(MemorySegment struct) { - return struct.get(xsize$LAYOUT, xsize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t xsize - * } - */ - public static void xsize(MemorySegment struct, long fieldValue) { - struct.set(xsize$LAYOUT, xsize$OFFSET, fieldValue); - } - - private static final OfLong ysize$LAYOUT = (OfLong)$LAYOUT.select(groupElement("ysize")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t ysize - * } - */ - public static final OfLong ysize$layout() { - return ysize$LAYOUT; - } - - private static final long ysize$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t ysize - * } - */ - public static final long ysize$offset() { - return ysize$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t ysize - * } - */ - public static long ysize(MemorySegment struct) { - return struct.get(ysize$LAYOUT, ysize$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t ysize - * } - */ - public static void ysize(MemorySegment struct, long fieldValue) { - struct.set(ysize$LAYOUT, ysize$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPointerAttributes.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPointerAttributes.java deleted file mode 100644 index 2f7e7ef7f2..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPointerAttributes.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaPointerAttributes { - * enum cudaMemoryType type; - * int device; - * void *devicePointer; - * void *hostPointer; - * } - * } - */ -public class cudaPointerAttributes { - - cudaPointerAttributes() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("type"), - PanamaFFMAPI.C_INT.withName("device"), - PanamaFFMAPI.C_POINTER.withName("devicePointer"), - PanamaFFMAPI.C_POINTER.withName("hostPointer") - ).withName("cudaPointerAttributes"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaMemoryType type - * } - */ - public static final OfInt type$layout() { - return type$LAYOUT; - } - - private static final long type$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaMemoryType type - * } - */ - public static final long type$offset() { - return type$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaMemoryType type - * } - */ - public static int type(MemorySegment struct) { - return struct.get(type$LAYOUT, type$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaMemoryType type - * } - */ - public static void type(MemorySegment struct, int fieldValue) { - struct.set(type$LAYOUT, type$OFFSET, fieldValue); - } - - private static final OfInt device$LAYOUT = (OfInt)$LAYOUT.select(groupElement("device")); - - /** - * Layout for field: - * {@snippet lang=c : - * int device - * } - */ - public static final OfInt device$layout() { - return device$LAYOUT; - } - - private static final long device$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int device - * } - */ - public static final long device$offset() { - return device$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int device - * } - */ - public static int device(MemorySegment struct) { - return struct.get(device$LAYOUT, device$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int device - * } - */ - public static void device(MemorySegment struct, int fieldValue) { - struct.set(device$LAYOUT, device$OFFSET, fieldValue); - } - - private static final AddressLayout devicePointer$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("devicePointer")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *devicePointer - * } - */ - public static final AddressLayout devicePointer$layout() { - return devicePointer$LAYOUT; - } - - private static final long devicePointer$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * void *devicePointer - * } - */ - public static final long devicePointer$offset() { - return devicePointer$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *devicePointer - * } - */ - public static MemorySegment devicePointer(MemorySegment struct) { - return struct.get(devicePointer$LAYOUT, devicePointer$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *devicePointer - * } - */ - public static void devicePointer(MemorySegment struct, MemorySegment fieldValue) { - struct.set(devicePointer$LAYOUT, devicePointer$OFFSET, fieldValue); - } - - private static final AddressLayout hostPointer$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("hostPointer")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *hostPointer - * } - */ - public static final AddressLayout hostPointer$layout() { - return hostPointer$LAYOUT; - } - - private static final long hostPointer$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * void *hostPointer - * } - */ - public static final long hostPointer$offset() { - return hostPointer$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *hostPointer - * } - */ - public static MemorySegment hostPointer(MemorySegment struct) { - return struct.get(hostPointer$LAYOUT, hostPointer$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *hostPointer - * } - */ - public static void hostPointer(MemorySegment struct, MemorySegment fieldValue) { - struct.set(hostPointer$LAYOUT, hostPointer$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPos.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPos.java deleted file mode 100644 index 85c75e933b..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaPos.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaPos { - * size_t x; - * size_t y; - * size_t z; - * } - * } - */ -public class cudaPos { - - cudaPos() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("x"), - PanamaFFMAPI.C_LONG.withName("y"), - PanamaFFMAPI.C_LONG.withName("z") - ).withName("cudaPos"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t z - * } - */ - public static final OfLong z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t z - * } - */ - public static long z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t z - * } - */ - public static void z(MemorySegment struct, long fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceDesc.java deleted file mode 100644 index 3b0f0d696f..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceDesc.java +++ /dev/null @@ -1,1336 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaResourceDesc { - * enum cudaResourceType resType; - * union { - * struct { - * cudaArray_t array; - * } array; - * struct { - * cudaMipmappedArray_t mipmap; - * } mipmap; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } linear; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } pitch2D; - * } res; - * } - * } - */ -public class cudaResourceDesc { - - cudaResourceDesc() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("resType"), - MemoryLayout.paddingLayout(4), - cudaResourceDesc.res.layout().withName("res") - ).withName("cudaResourceDesc"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt resType$LAYOUT = (OfInt)$LAYOUT.select(groupElement("resType")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaResourceType resType - * } - */ - public static final OfInt resType$layout() { - return resType$LAYOUT; - } - - private static final long resType$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaResourceType resType - * } - */ - public static final long resType$offset() { - return resType$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaResourceType resType - * } - */ - public static int resType(MemorySegment struct) { - return struct.get(resType$LAYOUT, resType$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaResourceType resType - * } - */ - public static void resType(MemorySegment struct, int fieldValue) { - struct.set(resType$LAYOUT, resType$OFFSET, fieldValue); - } - - /** - * {@snippet lang=c : - * union { - * struct { - * cudaArray_t array; - * } array; - * struct { - * cudaMipmappedArray_t mipmap; - * } mipmap; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } linear; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } pitch2D; - * } - * } - */ - public static class res { - - res() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.unionLayout( - cudaResourceDesc.res.array.layout().withName("array"), - cudaResourceDesc.res.mipmap.layout().withName("mipmap"), - cudaResourceDesc.res.linear.layout().withName("linear"), - cudaResourceDesc.res.pitch2D.layout().withName("pitch2D") - ).withName("$anon$1564:5"); - - /** - * The layout of this union - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - /** - * {@snippet lang=c : - * struct { - * cudaArray_t array; - * } - * } - */ - public static class array { - - array() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("array") - ).withName("$anon$1565:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout array$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("array")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaArray_t array - * } - */ - public static final AddressLayout array$layout() { - return array$LAYOUT; - } - - private static final long array$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaArray_t array - * } - */ - public static final long array$offset() { - return array$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaArray_t array - * } - */ - public static MemorySegment array(MemorySegment struct) { - return struct.get(array$LAYOUT, array$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaArray_t array - * } - */ - public static void array(MemorySegment struct, MemorySegment fieldValue) { - struct.set(array$LAYOUT, array$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array$, long index) { - return array$.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout array$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("array")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * cudaArray_t array; - * } array - * } - */ - public static final GroupLayout array$layout() { - return array$LAYOUT; - } - - private static final long array$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * cudaArray_t array; - * } array - * } - */ - public static final long array$offset() { - return array$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * cudaArray_t array; - * } array - * } - */ - public static MemorySegment array(MemorySegment union) { - return union.asSlice(array$OFFSET, array$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * cudaArray_t array; - * } array - * } - */ - public static void array(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, array$OFFSET, array$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * struct { - * cudaMipmappedArray_t mipmap; - * } - * } - */ - public static class mipmap { - - mipmap() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("mipmap") - ).withName("$anon$1568:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout mipmap$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("mipmap")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaMipmappedArray_t mipmap - * } - */ - public static final AddressLayout mipmap$layout() { - return mipmap$LAYOUT; - } - - private static final long mipmap$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaMipmappedArray_t mipmap - * } - */ - public static final long mipmap$offset() { - return mipmap$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaMipmappedArray_t mipmap - * } - */ - public static MemorySegment mipmap(MemorySegment struct) { - return struct.get(mipmap$LAYOUT, mipmap$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaMipmappedArray_t mipmap - * } - */ - public static void mipmap(MemorySegment struct, MemorySegment fieldValue) { - struct.set(mipmap$LAYOUT, mipmap$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout mipmap$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("mipmap")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * cudaMipmappedArray_t mipmap; - * } mipmap - * } - */ - public static final GroupLayout mipmap$layout() { - return mipmap$LAYOUT; - } - - private static final long mipmap$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * cudaMipmappedArray_t mipmap; - * } mipmap - * } - */ - public static final long mipmap$offset() { - return mipmap$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * cudaMipmappedArray_t mipmap; - * } mipmap - * } - */ - public static MemorySegment mipmap(MemorySegment union) { - return union.asSlice(mipmap$OFFSET, mipmap$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * cudaMipmappedArray_t mipmap; - * } mipmap - * } - */ - public static void mipmap(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, mipmap$OFFSET, mipmap$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } - * } - */ - public static class linear { - - linear() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("devPtr"), - cudaChannelFormatDesc.layout().withName("desc"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_LONG.withName("sizeInBytes") - ).withName("$anon$1571:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout devPtr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("devPtr")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *devPtr - * } - */ - public static final AddressLayout devPtr$layout() { - return devPtr$LAYOUT; - } - - private static final long devPtr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *devPtr - * } - */ - public static final long devPtr$offset() { - return devPtr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *devPtr - * } - */ - public static MemorySegment devPtr(MemorySegment struct) { - return struct.get(devPtr$LAYOUT, devPtr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *devPtr - * } - */ - public static void devPtr(MemorySegment struct, MemorySegment fieldValue) { - struct.set(devPtr$LAYOUT, devPtr$OFFSET, fieldValue); - } - - private static final GroupLayout desc$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("desc")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc desc - * } - */ - public static final GroupLayout desc$layout() { - return desc$LAYOUT; - } - - private static final long desc$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc desc - * } - */ - public static final long desc$offset() { - return desc$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc desc - * } - */ - public static MemorySegment desc(MemorySegment struct) { - return struct.asSlice(desc$OFFSET, desc$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc desc - * } - */ - public static void desc(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, desc$OFFSET, desc$LAYOUT.byteSize()); - } - - private static final OfLong sizeInBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("sizeInBytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t sizeInBytes - * } - */ - public static final OfLong sizeInBytes$layout() { - return sizeInBytes$LAYOUT; - } - - private static final long sizeInBytes$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t sizeInBytes - * } - */ - public static final long sizeInBytes$offset() { - return sizeInBytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t sizeInBytes - * } - */ - public static long sizeInBytes(MemorySegment struct) { - return struct.get(sizeInBytes$LAYOUT, sizeInBytes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t sizeInBytes - * } - */ - public static void sizeInBytes(MemorySegment struct, long fieldValue) { - struct.set(sizeInBytes$LAYOUT, sizeInBytes$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout linear$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("linear")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } linear - * } - */ - public static final GroupLayout linear$layout() { - return linear$LAYOUT; - } - - private static final long linear$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } linear - * } - */ - public static final long linear$offset() { - return linear$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } linear - * } - */ - public static MemorySegment linear(MemorySegment union) { - return union.asSlice(linear$OFFSET, linear$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } linear - * } - */ - public static void linear(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, linear$OFFSET, linear$LAYOUT.byteSize()); - } - - /** - * {@snippet lang=c : - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } - * } - */ - public static class pitch2D { - - pitch2D() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("devPtr"), - cudaChannelFormatDesc.layout().withName("desc"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_LONG.withName("width"), - PanamaFFMAPI.C_LONG.withName("height"), - PanamaFFMAPI.C_LONG.withName("pitchInBytes") - ).withName("$anon$1576:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout devPtr$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("devPtr")); - - /** - * Layout for field: - * {@snippet lang=c : - * void *devPtr - * } - */ - public static final AddressLayout devPtr$layout() { - return devPtr$LAYOUT; - } - - private static final long devPtr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * void *devPtr - * } - */ - public static final long devPtr$offset() { - return devPtr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * void *devPtr - * } - */ - public static MemorySegment devPtr(MemorySegment struct) { - return struct.get(devPtr$LAYOUT, devPtr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * void *devPtr - * } - */ - public static void devPtr(MemorySegment struct, MemorySegment fieldValue) { - struct.set(devPtr$LAYOUT, devPtr$OFFSET, fieldValue); - } - - private static final GroupLayout desc$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("desc")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc desc - * } - */ - public static final GroupLayout desc$layout() { - return desc$LAYOUT; - } - - private static final long desc$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc desc - * } - */ - public static final long desc$offset() { - return desc$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc desc - * } - */ - public static MemorySegment desc(MemorySegment struct) { - return struct.asSlice(desc$OFFSET, desc$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct cudaChannelFormatDesc desc - * } - */ - public static void desc(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, desc$OFFSET, desc$LAYOUT.byteSize()); - } - - private static final OfLong width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("width")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static final OfLong width$layout() { - return width$LAYOUT; - } - - private static final long width$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static final long width$offset() { - return width$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static long width(MemorySegment struct) { - return struct.get(width$LAYOUT, width$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static void width(MemorySegment struct, long fieldValue) { - struct.set(width$LAYOUT, width$OFFSET, fieldValue); - } - - private static final OfLong height$LAYOUT = (OfLong)$LAYOUT.select(groupElement("height")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static final OfLong height$layout() { - return height$LAYOUT; - } - - private static final long height$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static final long height$offset() { - return height$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static long height(MemorySegment struct) { - return struct.get(height$LAYOUT, height$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static void height(MemorySegment struct, long fieldValue) { - struct.set(height$LAYOUT, height$OFFSET, fieldValue); - } - - private static final OfLong pitchInBytes$LAYOUT = (OfLong)$LAYOUT.select(groupElement("pitchInBytes")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t pitchInBytes - * } - */ - public static final OfLong pitchInBytes$layout() { - return pitchInBytes$LAYOUT; - } - - private static final long pitchInBytes$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t pitchInBytes - * } - */ - public static final long pitchInBytes$offset() { - return pitchInBytes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t pitchInBytes - * } - */ - public static long pitchInBytes(MemorySegment struct) { - return struct.get(pitchInBytes$LAYOUT, pitchInBytes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t pitchInBytes - * } - */ - public static void pitchInBytes(MemorySegment struct, long fieldValue) { - struct.set(pitchInBytes$LAYOUT, pitchInBytes$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout pitch2D$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("pitch2D")); - - /** - * Layout for field: - * {@snippet lang=c : - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } pitch2D - * } - */ - public static final GroupLayout pitch2D$layout() { - return pitch2D$LAYOUT; - } - - private static final long pitch2D$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } pitch2D - * } - */ - public static final long pitch2D$offset() { - return pitch2D$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } pitch2D - * } - */ - public static MemorySegment pitch2D(MemorySegment union) { - return union.asSlice(pitch2D$OFFSET, pitch2D$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } pitch2D - * } - */ - public static void pitch2D(MemorySegment union, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, union, pitch2D$OFFSET, pitch2D$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this union - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } - } - - private static final GroupLayout res$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("res")); - - /** - * Layout for field: - * {@snippet lang=c : - * union { - * struct { - * cudaArray_t array; - * } array; - * struct { - * cudaMipmappedArray_t mipmap; - * } mipmap; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } linear; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } pitch2D; - * } res - * } - */ - public static final GroupLayout res$layout() { - return res$LAYOUT; - } - - private static final long res$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * union { - * struct { - * cudaArray_t array; - * } array; - * struct { - * cudaMipmappedArray_t mipmap; - * } mipmap; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } linear; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } pitch2D; - * } res - * } - */ - public static final long res$offset() { - return res$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * union { - * struct { - * cudaArray_t array; - * } array; - * struct { - * cudaMipmappedArray_t mipmap; - * } mipmap; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } linear; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } pitch2D; - * } res - * } - */ - public static MemorySegment res(MemorySegment struct) { - return struct.asSlice(res$OFFSET, res$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * union { - * struct { - * cudaArray_t array; - * } array; - * struct { - * cudaMipmappedArray_t mipmap; - * } mipmap; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t sizeInBytes; - * } linear; - * struct { - * void *devPtr; - * struct cudaChannelFormatDesc desc; - * size_t width; - * size_t height; - * size_t pitchInBytes; - * } pitch2D; - * } res - * } - */ - public static void res(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, res$OFFSET, res$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceViewDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceViewDesc.java deleted file mode 100644 index d36d721017..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaResourceViewDesc.java +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaResourceViewDesc { - * enum cudaResourceViewFormat format; - * size_t width; - * size_t height; - * size_t depth; - * unsigned int firstMipmapLevel; - * unsigned int lastMipmapLevel; - * unsigned int firstLayer; - * unsigned int lastLayer; - * } - * } - */ -public class cudaResourceViewDesc { - - cudaResourceViewDesc() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("format"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_LONG.withName("width"), - PanamaFFMAPI.C_LONG.withName("height"), - PanamaFFMAPI.C_LONG.withName("depth"), - PanamaFFMAPI.C_INT.withName("firstMipmapLevel"), - PanamaFFMAPI.C_INT.withName("lastMipmapLevel"), - PanamaFFMAPI.C_INT.withName("firstLayer"), - PanamaFFMAPI.C_INT.withName("lastLayer") - ).withName("cudaResourceViewDesc"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt format$LAYOUT = (OfInt)$LAYOUT.select(groupElement("format")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaResourceViewFormat format - * } - */ - public static final OfInt format$layout() { - return format$LAYOUT; - } - - private static final long format$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaResourceViewFormat format - * } - */ - public static final long format$offset() { - return format$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaResourceViewFormat format - * } - */ - public static int format(MemorySegment struct) { - return struct.get(format$LAYOUT, format$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaResourceViewFormat format - * } - */ - public static void format(MemorySegment struct, int fieldValue) { - struct.set(format$LAYOUT, format$OFFSET, fieldValue); - } - - private static final OfLong width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("width")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static final OfLong width$layout() { - return width$LAYOUT; - } - - private static final long width$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static final long width$offset() { - return width$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static long width(MemorySegment struct) { - return struct.get(width$LAYOUT, width$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t width - * } - */ - public static void width(MemorySegment struct, long fieldValue) { - struct.set(width$LAYOUT, width$OFFSET, fieldValue); - } - - private static final OfLong height$LAYOUT = (OfLong)$LAYOUT.select(groupElement("height")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static final OfLong height$layout() { - return height$LAYOUT; - } - - private static final long height$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static final long height$offset() { - return height$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static long height(MemorySegment struct) { - return struct.get(height$LAYOUT, height$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t height - * } - */ - public static void height(MemorySegment struct, long fieldValue) { - struct.set(height$LAYOUT, height$OFFSET, fieldValue); - } - - private static final OfLong depth$LAYOUT = (OfLong)$LAYOUT.select(groupElement("depth")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t depth - * } - */ - public static final OfLong depth$layout() { - return depth$LAYOUT; - } - - private static final long depth$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t depth - * } - */ - public static final long depth$offset() { - return depth$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t depth - * } - */ - public static long depth(MemorySegment struct) { - return struct.get(depth$LAYOUT, depth$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t depth - * } - */ - public static void depth(MemorySegment struct, long fieldValue) { - struct.set(depth$LAYOUT, depth$OFFSET, fieldValue); - } - - private static final OfInt firstMipmapLevel$LAYOUT = (OfInt)$LAYOUT.select(groupElement("firstMipmapLevel")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int firstMipmapLevel - * } - */ - public static final OfInt firstMipmapLevel$layout() { - return firstMipmapLevel$LAYOUT; - } - - private static final long firstMipmapLevel$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int firstMipmapLevel - * } - */ - public static final long firstMipmapLevel$offset() { - return firstMipmapLevel$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int firstMipmapLevel - * } - */ - public static int firstMipmapLevel(MemorySegment struct) { - return struct.get(firstMipmapLevel$LAYOUT, firstMipmapLevel$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int firstMipmapLevel - * } - */ - public static void firstMipmapLevel(MemorySegment struct, int fieldValue) { - struct.set(firstMipmapLevel$LAYOUT, firstMipmapLevel$OFFSET, fieldValue); - } - - private static final OfInt lastMipmapLevel$LAYOUT = (OfInt)$LAYOUT.select(groupElement("lastMipmapLevel")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int lastMipmapLevel - * } - */ - public static final OfInt lastMipmapLevel$layout() { - return lastMipmapLevel$LAYOUT; - } - - private static final long lastMipmapLevel$OFFSET = 36; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int lastMipmapLevel - * } - */ - public static final long lastMipmapLevel$offset() { - return lastMipmapLevel$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int lastMipmapLevel - * } - */ - public static int lastMipmapLevel(MemorySegment struct) { - return struct.get(lastMipmapLevel$LAYOUT, lastMipmapLevel$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int lastMipmapLevel - * } - */ - public static void lastMipmapLevel(MemorySegment struct, int fieldValue) { - struct.set(lastMipmapLevel$LAYOUT, lastMipmapLevel$OFFSET, fieldValue); - } - - private static final OfInt firstLayer$LAYOUT = (OfInt)$LAYOUT.select(groupElement("firstLayer")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int firstLayer - * } - */ - public static final OfInt firstLayer$layout() { - return firstLayer$LAYOUT; - } - - private static final long firstLayer$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int firstLayer - * } - */ - public static final long firstLayer$offset() { - return firstLayer$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int firstLayer - * } - */ - public static int firstLayer(MemorySegment struct) { - return struct.get(firstLayer$LAYOUT, firstLayer$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int firstLayer - * } - */ - public static void firstLayer(MemorySegment struct, int fieldValue) { - struct.set(firstLayer$LAYOUT, firstLayer$OFFSET, fieldValue); - } - - private static final OfInt lastLayer$LAYOUT = (OfInt)$LAYOUT.select(groupElement("lastLayer")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int lastLayer - * } - */ - public static final OfInt lastLayer$layout() { - return lastLayer$LAYOUT; - } - - private static final long lastLayer$OFFSET = 44; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int lastLayer - * } - */ - public static final long lastLayer$offset() { - return lastLayer$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int lastLayer - * } - */ - public static int lastLayer(MemorySegment struct) { - return struct.get(lastLayer$LAYOUT, lastLayer$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int lastLayer - * } - */ - public static void lastLayer(MemorySegment struct, int fieldValue) { - struct.set(lastLayer$LAYOUT, lastLayer$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaStreamCallback_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaStreamCallback_t.java deleted file mode 100644 index 84a8cc9346..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaStreamCallback_t.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef void (*cudaStreamCallback_t)(cudaStream_t, cudaError_t, void *) - * } - */ -public class cudaStreamCallback_t { - - cudaStreamCallback_t() { - // Should not be called directly - } - - /** - * The function pointer signature, expressed as a functional interface - */ - public interface Function { - void apply(MemorySegment stream, int status, MemorySegment userData); - } - - private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid( - PanamaFFMAPI.C_POINTER, - PanamaFFMAPI.C_INT, - PanamaFFMAPI.C_POINTER - ); - - /** - * The descriptor of this function pointer - */ - public static FunctionDescriptor descriptor() { - return $DESC; - } - - private static final MethodHandle UP$MH = PanamaFFMAPI.upcallHandle(cudaStreamCallback_t.Function.class, "apply", $DESC); - - /** - * Allocates a new upcall stub, whose implementation is defined by {@code fi}. - * The lifetime of the returned segment is managed by {@code arena} - */ - public static MemorySegment allocate(cudaStreamCallback_t.Function fi, Arena arena) { - return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena); - } - - private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); - - /** - * Invoke the upcall stub {@code funcPtr}, with given parameters - */ - public static void invoke(MemorySegment funcPtr,MemorySegment stream, int status, MemorySegment userData) { - try { - DOWN$MH.invokeExact(funcPtr, stream, status, userData); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaTextureDesc.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaTextureDesc.java deleted file mode 100644 index 7fcf5946df..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaTextureDesc.java +++ /dev/null @@ -1,761 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cudaTextureDesc { - * enum cudaTextureAddressMode addressMode[3]; - * enum cudaTextureFilterMode filterMode; - * enum cudaTextureReadMode readMode; - * int sRGB; - * float borderColor[4]; - * int normalizedCoords; - * unsigned int maxAnisotropy; - * enum cudaTextureFilterMode mipmapFilterMode; - * float mipmapLevelBias; - * float minMipmapLevelClamp; - * float maxMipmapLevelClamp; - * int disableTrilinearOptimization; - * int seamlessCubemap; - * } - * } - */ -public class cudaTextureDesc { - - cudaTextureDesc() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - MemoryLayout.sequenceLayout(3, PanamaFFMAPI.C_INT).withName("addressMode"), - PanamaFFMAPI.C_INT.withName("filterMode"), - PanamaFFMAPI.C_INT.withName("readMode"), - PanamaFFMAPI.C_INT.withName("sRGB"), - MemoryLayout.sequenceLayout(4, PanamaFFMAPI.C_FLOAT).withName("borderColor"), - PanamaFFMAPI.C_INT.withName("normalizedCoords"), - PanamaFFMAPI.C_INT.withName("maxAnisotropy"), - PanamaFFMAPI.C_INT.withName("mipmapFilterMode"), - PanamaFFMAPI.C_FLOAT.withName("mipmapLevelBias"), - PanamaFFMAPI.C_FLOAT.withName("minMipmapLevelClamp"), - PanamaFFMAPI.C_FLOAT.withName("maxMipmapLevelClamp"), - PanamaFFMAPI.C_INT.withName("disableTrilinearOptimization"), - PanamaFFMAPI.C_INT.withName("seamlessCubemap") - ).withName("cudaTextureDesc"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final SequenceLayout addressMode$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("addressMode")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaTextureAddressMode addressMode[3] - * } - */ - public static final SequenceLayout addressMode$layout() { - return addressMode$LAYOUT; - } - - private static final long addressMode$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaTextureAddressMode addressMode[3] - * } - */ - public static final long addressMode$offset() { - return addressMode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaTextureAddressMode addressMode[3] - * } - */ - public static MemorySegment addressMode(MemorySegment struct) { - return struct.asSlice(addressMode$OFFSET, addressMode$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaTextureAddressMode addressMode[3] - * } - */ - public static void addressMode(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, addressMode$OFFSET, addressMode$LAYOUT.byteSize()); - } - - private static long[] addressMode$DIMS = { 3 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * enum cudaTextureAddressMode addressMode[3] - * } - */ - public static long[] addressMode$dimensions() { - return addressMode$DIMS; - } - private static final VarHandle addressMode$ELEM_HANDLE = addressMode$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * enum cudaTextureAddressMode addressMode[3] - * } - */ - public static int addressMode(MemorySegment struct, long index0) { - return (int)addressMode$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * enum cudaTextureAddressMode addressMode[3] - * } - */ - public static void addressMode(MemorySegment struct, long index0, int fieldValue) { - addressMode$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final OfInt filterMode$LAYOUT = (OfInt)$LAYOUT.select(groupElement("filterMode")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaTextureFilterMode filterMode - * } - */ - public static final OfInt filterMode$layout() { - return filterMode$LAYOUT; - } - - private static final long filterMode$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaTextureFilterMode filterMode - * } - */ - public static final long filterMode$offset() { - return filterMode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaTextureFilterMode filterMode - * } - */ - public static int filterMode(MemorySegment struct) { - return struct.get(filterMode$LAYOUT, filterMode$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaTextureFilterMode filterMode - * } - */ - public static void filterMode(MemorySegment struct, int fieldValue) { - struct.set(filterMode$LAYOUT, filterMode$OFFSET, fieldValue); - } - - private static final OfInt readMode$LAYOUT = (OfInt)$LAYOUT.select(groupElement("readMode")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaTextureReadMode readMode - * } - */ - public static final OfInt readMode$layout() { - return readMode$LAYOUT; - } - - private static final long readMode$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaTextureReadMode readMode - * } - */ - public static final long readMode$offset() { - return readMode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaTextureReadMode readMode - * } - */ - public static int readMode(MemorySegment struct) { - return struct.get(readMode$LAYOUT, readMode$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaTextureReadMode readMode - * } - */ - public static void readMode(MemorySegment struct, int fieldValue) { - struct.set(readMode$LAYOUT, readMode$OFFSET, fieldValue); - } - - private static final OfInt sRGB$LAYOUT = (OfInt)$LAYOUT.select(groupElement("sRGB")); - - /** - * Layout for field: - * {@snippet lang=c : - * int sRGB - * } - */ - public static final OfInt sRGB$layout() { - return sRGB$LAYOUT; - } - - private static final long sRGB$OFFSET = 20; - - /** - * Offset for field: - * {@snippet lang=c : - * int sRGB - * } - */ - public static final long sRGB$offset() { - return sRGB$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int sRGB - * } - */ - public static int sRGB(MemorySegment struct) { - return struct.get(sRGB$LAYOUT, sRGB$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int sRGB - * } - */ - public static void sRGB(MemorySegment struct, int fieldValue) { - struct.set(sRGB$LAYOUT, sRGB$OFFSET, fieldValue); - } - - private static final SequenceLayout borderColor$LAYOUT = (SequenceLayout)$LAYOUT.select(groupElement("borderColor")); - - /** - * Layout for field: - * {@snippet lang=c : - * float borderColor[4] - * } - */ - public static final SequenceLayout borderColor$layout() { - return borderColor$LAYOUT; - } - - private static final long borderColor$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * float borderColor[4] - * } - */ - public static final long borderColor$offset() { - return borderColor$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float borderColor[4] - * } - */ - public static MemorySegment borderColor(MemorySegment struct) { - return struct.asSlice(borderColor$OFFSET, borderColor$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float borderColor[4] - * } - */ - public static void borderColor(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, borderColor$OFFSET, borderColor$LAYOUT.byteSize()); - } - - private static long[] borderColor$DIMS = { 4 }; - - /** - * Dimensions for array field: - * {@snippet lang=c : - * float borderColor[4] - * } - */ - public static long[] borderColor$dimensions() { - return borderColor$DIMS; - } - private static final VarHandle borderColor$ELEM_HANDLE = borderColor$LAYOUT.varHandle(sequenceElement()); - - /** - * Indexed getter for field: - * {@snippet lang=c : - * float borderColor[4] - * } - */ - public static float borderColor(MemorySegment struct, long index0) { - return (float)borderColor$ELEM_HANDLE.get(struct, 0L, index0); - } - - /** - * Indexed setter for field: - * {@snippet lang=c : - * float borderColor[4] - * } - */ - public static void borderColor(MemorySegment struct, long index0, float fieldValue) { - borderColor$ELEM_HANDLE.set(struct, 0L, index0, fieldValue); - } - - private static final OfInt normalizedCoords$LAYOUT = (OfInt)$LAYOUT.select(groupElement("normalizedCoords")); - - /** - * Layout for field: - * {@snippet lang=c : - * int normalizedCoords - * } - */ - public static final OfInt normalizedCoords$layout() { - return normalizedCoords$LAYOUT; - } - - private static final long normalizedCoords$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * int normalizedCoords - * } - */ - public static final long normalizedCoords$offset() { - return normalizedCoords$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int normalizedCoords - * } - */ - public static int normalizedCoords(MemorySegment struct) { - return struct.get(normalizedCoords$LAYOUT, normalizedCoords$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int normalizedCoords - * } - */ - public static void normalizedCoords(MemorySegment struct, int fieldValue) { - struct.set(normalizedCoords$LAYOUT, normalizedCoords$OFFSET, fieldValue); - } - - private static final OfInt maxAnisotropy$LAYOUT = (OfInt)$LAYOUT.select(groupElement("maxAnisotropy")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int maxAnisotropy - * } - */ - public static final OfInt maxAnisotropy$layout() { - return maxAnisotropy$LAYOUT; - } - - private static final long maxAnisotropy$OFFSET = 44; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int maxAnisotropy - * } - */ - public static final long maxAnisotropy$offset() { - return maxAnisotropy$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int maxAnisotropy - * } - */ - public static int maxAnisotropy(MemorySegment struct) { - return struct.get(maxAnisotropy$LAYOUT, maxAnisotropy$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int maxAnisotropy - * } - */ - public static void maxAnisotropy(MemorySegment struct, int fieldValue) { - struct.set(maxAnisotropy$LAYOUT, maxAnisotropy$OFFSET, fieldValue); - } - - private static final OfInt mipmapFilterMode$LAYOUT = (OfInt)$LAYOUT.select(groupElement("mipmapFilterMode")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cudaTextureFilterMode mipmapFilterMode - * } - */ - public static final OfInt mipmapFilterMode$layout() { - return mipmapFilterMode$LAYOUT; - } - - private static final long mipmapFilterMode$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cudaTextureFilterMode mipmapFilterMode - * } - */ - public static final long mipmapFilterMode$offset() { - return mipmapFilterMode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cudaTextureFilterMode mipmapFilterMode - * } - */ - public static int mipmapFilterMode(MemorySegment struct) { - return struct.get(mipmapFilterMode$LAYOUT, mipmapFilterMode$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cudaTextureFilterMode mipmapFilterMode - * } - */ - public static void mipmapFilterMode(MemorySegment struct, int fieldValue) { - struct.set(mipmapFilterMode$LAYOUT, mipmapFilterMode$OFFSET, fieldValue); - } - - private static final OfFloat mipmapLevelBias$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("mipmapLevelBias")); - - /** - * Layout for field: - * {@snippet lang=c : - * float mipmapLevelBias - * } - */ - public static final OfFloat mipmapLevelBias$layout() { - return mipmapLevelBias$LAYOUT; - } - - private static final long mipmapLevelBias$OFFSET = 52; - - /** - * Offset for field: - * {@snippet lang=c : - * float mipmapLevelBias - * } - */ - public static final long mipmapLevelBias$offset() { - return mipmapLevelBias$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float mipmapLevelBias - * } - */ - public static float mipmapLevelBias(MemorySegment struct) { - return struct.get(mipmapLevelBias$LAYOUT, mipmapLevelBias$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float mipmapLevelBias - * } - */ - public static void mipmapLevelBias(MemorySegment struct, float fieldValue) { - struct.set(mipmapLevelBias$LAYOUT, mipmapLevelBias$OFFSET, fieldValue); - } - - private static final OfFloat minMipmapLevelClamp$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("minMipmapLevelClamp")); - - /** - * Layout for field: - * {@snippet lang=c : - * float minMipmapLevelClamp - * } - */ - public static final OfFloat minMipmapLevelClamp$layout() { - return minMipmapLevelClamp$LAYOUT; - } - - private static final long minMipmapLevelClamp$OFFSET = 56; - - /** - * Offset for field: - * {@snippet lang=c : - * float minMipmapLevelClamp - * } - */ - public static final long minMipmapLevelClamp$offset() { - return minMipmapLevelClamp$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float minMipmapLevelClamp - * } - */ - public static float minMipmapLevelClamp(MemorySegment struct) { - return struct.get(minMipmapLevelClamp$LAYOUT, minMipmapLevelClamp$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float minMipmapLevelClamp - * } - */ - public static void minMipmapLevelClamp(MemorySegment struct, float fieldValue) { - struct.set(minMipmapLevelClamp$LAYOUT, minMipmapLevelClamp$OFFSET, fieldValue); - } - - private static final OfFloat maxMipmapLevelClamp$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("maxMipmapLevelClamp")); - - /** - * Layout for field: - * {@snippet lang=c : - * float maxMipmapLevelClamp - * } - */ - public static final OfFloat maxMipmapLevelClamp$layout() { - return maxMipmapLevelClamp$LAYOUT; - } - - private static final long maxMipmapLevelClamp$OFFSET = 60; - - /** - * Offset for field: - * {@snippet lang=c : - * float maxMipmapLevelClamp - * } - */ - public static final long maxMipmapLevelClamp$offset() { - return maxMipmapLevelClamp$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float maxMipmapLevelClamp - * } - */ - public static float maxMipmapLevelClamp(MemorySegment struct) { - return struct.get(maxMipmapLevelClamp$LAYOUT, maxMipmapLevelClamp$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float maxMipmapLevelClamp - * } - */ - public static void maxMipmapLevelClamp(MemorySegment struct, float fieldValue) { - struct.set(maxMipmapLevelClamp$LAYOUT, maxMipmapLevelClamp$OFFSET, fieldValue); - } - - private static final OfInt disableTrilinearOptimization$LAYOUT = (OfInt)$LAYOUT.select(groupElement("disableTrilinearOptimization")); - - /** - * Layout for field: - * {@snippet lang=c : - * int disableTrilinearOptimization - * } - */ - public static final OfInt disableTrilinearOptimization$layout() { - return disableTrilinearOptimization$LAYOUT; - } - - private static final long disableTrilinearOptimization$OFFSET = 64; - - /** - * Offset for field: - * {@snippet lang=c : - * int disableTrilinearOptimization - * } - */ - public static final long disableTrilinearOptimization$offset() { - return disableTrilinearOptimization$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int disableTrilinearOptimization - * } - */ - public static int disableTrilinearOptimization(MemorySegment struct) { - return struct.get(disableTrilinearOptimization$LAYOUT, disableTrilinearOptimization$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int disableTrilinearOptimization - * } - */ - public static void disableTrilinearOptimization(MemorySegment struct, int fieldValue) { - struct.set(disableTrilinearOptimization$LAYOUT, disableTrilinearOptimization$OFFSET, fieldValue); - } - - private static final OfInt seamlessCubemap$LAYOUT = (OfInt)$LAYOUT.select(groupElement("seamlessCubemap")); - - /** - * Layout for field: - * {@snippet lang=c : - * int seamlessCubemap - * } - */ - public static final OfInt seamlessCubemap$layout() { - return seamlessCubemap$LAYOUT; - } - - private static final long seamlessCubemap$OFFSET = 68; - - /** - * Offset for field: - * {@snippet lang=c : - * int seamlessCubemap - * } - */ - public static final long seamlessCubemap$offset() { - return seamlessCubemap$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int seamlessCubemap - * } - */ - public static int seamlessCubemap(MemorySegment struct) { - return struct.get(seamlessCubemap$LAYOUT, seamlessCubemap$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int seamlessCubemap - * } - */ - public static void seamlessCubemap(MemorySegment struct, int fieldValue) { - struct.set(seamlessCubemap$LAYOUT, seamlessCubemap$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaUUID_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaUUID_t.java deleted file mode 100644 index 4e66f44ac1..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cudaUUID_t.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * typedef struct CUuuid_st { - * char bytes[16]; - * } cudaUUID_t - * } - */ -public class cudaUUID_t extends CUuuid_st { - - cudaUUID_t() { - // Should not be called directly - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsBruteForceIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsBruteForceIndex.java deleted file mode 100644 index 494902f9f5..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsBruteForceIndex.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct { - * uintptr_t addr; - * DLDataType dtype; - * } - * } - */ -public class cuvsBruteForceIndex { - - cuvsBruteForceIndex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("addr"), - DLDataType.layout().withName("dtype"), - MemoryLayout.paddingLayout(4) - ).withName("$anon$37:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addr")); - - /** - * Layout for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static final OfLong addr$layout() { - return addr$LAYOUT; - } - - private static final long addr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static final long addr$offset() { - return addr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static long addr(MemorySegment struct) { - return struct.get(addr$LAYOUT, addr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static void addr(MemorySegment struct, long fieldValue) { - struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); - } - - private static final GroupLayout dtype$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dtype")); - - /** - * Layout for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static final GroupLayout dtype$layout() { - return dtype$LAYOUT; - } - - private static final long dtype$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static final long dtype$offset() { - return dtype$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static MemorySegment dtype(MemorySegment struct) { - return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static void dtype(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraCompressionParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraCompressionParams.java deleted file mode 100644 index f3b48a4f85..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraCompressionParams.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cuvsCagraCompressionParams { - * uint32_t pq_bits; - * uint32_t pq_dim; - * uint32_t vq_n_centers; - * uint32_t kmeans_n_iters; - * double vq_kmeans_trainset_fraction; - * double pq_kmeans_trainset_fraction; - * } - * } - */ -public class cuvsCagraCompressionParams { - - cuvsCagraCompressionParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("pq_bits"), - PanamaFFMAPI.C_INT.withName("pq_dim"), - PanamaFFMAPI.C_INT.withName("vq_n_centers"), - PanamaFFMAPI.C_INT.withName("kmeans_n_iters"), - PanamaFFMAPI.C_DOUBLE.withName("vq_kmeans_trainset_fraction"), - PanamaFFMAPI.C_DOUBLE.withName("pq_kmeans_trainset_fraction") - ).withName("cuvsCagraCompressionParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt pq_bits$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pq_bits")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t pq_bits - * } - */ - public static final OfInt pq_bits$layout() { - return pq_bits$LAYOUT; - } - - private static final long pq_bits$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t pq_bits - * } - */ - public static final long pq_bits$offset() { - return pq_bits$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t pq_bits - * } - */ - public static int pq_bits(MemorySegment struct) { - return struct.get(pq_bits$LAYOUT, pq_bits$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t pq_bits - * } - */ - public static void pq_bits(MemorySegment struct, int fieldValue) { - struct.set(pq_bits$LAYOUT, pq_bits$OFFSET, fieldValue); - } - - private static final OfInt pq_dim$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pq_dim")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t pq_dim - * } - */ - public static final OfInt pq_dim$layout() { - return pq_dim$LAYOUT; - } - - private static final long pq_dim$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t pq_dim - * } - */ - public static final long pq_dim$offset() { - return pq_dim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t pq_dim - * } - */ - public static int pq_dim(MemorySegment struct) { - return struct.get(pq_dim$LAYOUT, pq_dim$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t pq_dim - * } - */ - public static void pq_dim(MemorySegment struct, int fieldValue) { - struct.set(pq_dim$LAYOUT, pq_dim$OFFSET, fieldValue); - } - - private static final OfInt vq_n_centers$LAYOUT = (OfInt)$LAYOUT.select(groupElement("vq_n_centers")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t vq_n_centers - * } - */ - public static final OfInt vq_n_centers$layout() { - return vq_n_centers$LAYOUT; - } - - private static final long vq_n_centers$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t vq_n_centers - * } - */ - public static final long vq_n_centers$offset() { - return vq_n_centers$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t vq_n_centers - * } - */ - public static int vq_n_centers(MemorySegment struct) { - return struct.get(vq_n_centers$LAYOUT, vq_n_centers$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t vq_n_centers - * } - */ - public static void vq_n_centers(MemorySegment struct, int fieldValue) { - struct.set(vq_n_centers$LAYOUT, vq_n_centers$OFFSET, fieldValue); - } - - private static final OfInt kmeans_n_iters$LAYOUT = (OfInt)$LAYOUT.select(groupElement("kmeans_n_iters")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t kmeans_n_iters - * } - */ - public static final OfInt kmeans_n_iters$layout() { - return kmeans_n_iters$LAYOUT; - } - - private static final long kmeans_n_iters$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t kmeans_n_iters - * } - */ - public static final long kmeans_n_iters$offset() { - return kmeans_n_iters$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t kmeans_n_iters - * } - */ - public static int kmeans_n_iters(MemorySegment struct) { - return struct.get(kmeans_n_iters$LAYOUT, kmeans_n_iters$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t kmeans_n_iters - * } - */ - public static void kmeans_n_iters(MemorySegment struct, int fieldValue) { - struct.set(kmeans_n_iters$LAYOUT, kmeans_n_iters$OFFSET, fieldValue); - } - - private static final OfDouble vq_kmeans_trainset_fraction$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("vq_kmeans_trainset_fraction")); - - /** - * Layout for field: - * {@snippet lang=c : - * double vq_kmeans_trainset_fraction - * } - */ - public static final OfDouble vq_kmeans_trainset_fraction$layout() { - return vq_kmeans_trainset_fraction$LAYOUT; - } - - private static final long vq_kmeans_trainset_fraction$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * double vq_kmeans_trainset_fraction - * } - */ - public static final long vq_kmeans_trainset_fraction$offset() { - return vq_kmeans_trainset_fraction$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double vq_kmeans_trainset_fraction - * } - */ - public static double vq_kmeans_trainset_fraction(MemorySegment struct) { - return struct.get(vq_kmeans_trainset_fraction$LAYOUT, vq_kmeans_trainset_fraction$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double vq_kmeans_trainset_fraction - * } - */ - public static void vq_kmeans_trainset_fraction(MemorySegment struct, double fieldValue) { - struct.set(vq_kmeans_trainset_fraction$LAYOUT, vq_kmeans_trainset_fraction$OFFSET, fieldValue); - } - - private static final OfDouble pq_kmeans_trainset_fraction$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("pq_kmeans_trainset_fraction")); - - /** - * Layout for field: - * {@snippet lang=c : - * double pq_kmeans_trainset_fraction - * } - */ - public static final OfDouble pq_kmeans_trainset_fraction$layout() { - return pq_kmeans_trainset_fraction$LAYOUT; - } - - private static final long pq_kmeans_trainset_fraction$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * double pq_kmeans_trainset_fraction - * } - */ - public static final long pq_kmeans_trainset_fraction$offset() { - return pq_kmeans_trainset_fraction$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double pq_kmeans_trainset_fraction - * } - */ - public static double pq_kmeans_trainset_fraction(MemorySegment struct) { - return struct.get(pq_kmeans_trainset_fraction$LAYOUT, pq_kmeans_trainset_fraction$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double pq_kmeans_trainset_fraction - * } - */ - public static void pq_kmeans_trainset_fraction(MemorySegment struct, double fieldValue) { - struct.set(pq_kmeans_trainset_fraction$LAYOUT, pq_kmeans_trainset_fraction$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraExtendParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraExtendParams.java deleted file mode 100644 index 7697b79b9a..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraExtendParams.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cuvsCagraExtendParams { - * uint32_t max_chunk_size; - * } - * } - */ -public class cuvsCagraExtendParams { - - cuvsCagraExtendParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("max_chunk_size") - ).withName("cuvsCagraExtendParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt max_chunk_size$LAYOUT = (OfInt)$LAYOUT.select(groupElement("max_chunk_size")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t max_chunk_size - * } - */ - public static final OfInt max_chunk_size$layout() { - return max_chunk_size$LAYOUT; - } - - private static final long max_chunk_size$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t max_chunk_size - * } - */ - public static final long max_chunk_size$offset() { - return max_chunk_size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t max_chunk_size - * } - */ - public static int max_chunk_size(MemorySegment struct) { - return struct.get(max_chunk_size$LAYOUT, max_chunk_size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t max_chunk_size - * } - */ - public static void max_chunk_size(MemorySegment struct, int fieldValue) { - struct.set(max_chunk_size$LAYOUT, max_chunk_size$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndex.java deleted file mode 100644 index c0c813178d..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndex.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct { - * uintptr_t addr; - * DLDataType dtype; - * } - * } - */ -public class cuvsCagraIndex { - - cuvsCagraIndex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("addr"), - DLDataType.layout().withName("dtype"), - MemoryLayout.paddingLayout(4) - ).withName("$anon$305:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addr")); - - /** - * Layout for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static final OfLong addr$layout() { - return addr$LAYOUT; - } - - private static final long addr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static final long addr$offset() { - return addr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static long addr(MemorySegment struct) { - return struct.get(addr$LAYOUT, addr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static void addr(MemorySegment struct, long fieldValue) { - struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); - } - - private static final GroupLayout dtype$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dtype")); - - /** - * Layout for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static final GroupLayout dtype$layout() { - return dtype$LAYOUT; - } - - private static final long dtype$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static final long dtype$offset() { - return dtype$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static MemorySegment dtype(MemorySegment struct) { - return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static void dtype(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndexParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndexParams.java deleted file mode 100644 index 9ba026c1c6..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraIndexParams.java +++ /dev/null @@ -1,421 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cuvsCagraIndexParams { - * cuvsDistanceType metric; - * size_t intermediate_graph_degree; - * size_t graph_degree; - * enum cuvsCagraGraphBuildAlgo build_algo; - * size_t nn_descent_niter; - * cuvsCagraCompressionParams_t compression; - * cuvsIvfPqParams_t graph_build_params; - * } - * } - */ -public class cuvsCagraIndexParams { - - cuvsCagraIndexParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("metric"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_LONG.withName("intermediate_graph_degree"), - PanamaFFMAPI.C_LONG.withName("graph_degree"), - PanamaFFMAPI.C_INT.withName("build_algo"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_LONG.withName("nn_descent_niter"), - PanamaFFMAPI.C_POINTER.withName("compression"), - PanamaFFMAPI.C_POINTER.withName("graph_build_params") - ).withName("cuvsCagraIndexParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt metric$LAYOUT = (OfInt)$LAYOUT.select(groupElement("metric")); - - /** - * Layout for field: - * {@snippet lang=c : - * cuvsDistanceType metric - * } - */ - public static final OfInt metric$layout() { - return metric$LAYOUT; - } - - private static final long metric$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cuvsDistanceType metric - * } - */ - public static final long metric$offset() { - return metric$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cuvsDistanceType metric - * } - */ - public static int metric(MemorySegment struct) { - return struct.get(metric$LAYOUT, metric$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cuvsDistanceType metric - * } - */ - public static void metric(MemorySegment struct, int fieldValue) { - struct.set(metric$LAYOUT, metric$OFFSET, fieldValue); - } - - private static final OfLong intermediate_graph_degree$LAYOUT = (OfLong)$LAYOUT.select(groupElement("intermediate_graph_degree")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t intermediate_graph_degree - * } - */ - public static final OfLong intermediate_graph_degree$layout() { - return intermediate_graph_degree$LAYOUT; - } - - private static final long intermediate_graph_degree$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t intermediate_graph_degree - * } - */ - public static final long intermediate_graph_degree$offset() { - return intermediate_graph_degree$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t intermediate_graph_degree - * } - */ - public static long intermediate_graph_degree(MemorySegment struct) { - return struct.get(intermediate_graph_degree$LAYOUT, intermediate_graph_degree$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t intermediate_graph_degree - * } - */ - public static void intermediate_graph_degree(MemorySegment struct, long fieldValue) { - struct.set(intermediate_graph_degree$LAYOUT, intermediate_graph_degree$OFFSET, fieldValue); - } - - private static final OfLong graph_degree$LAYOUT = (OfLong)$LAYOUT.select(groupElement("graph_degree")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t graph_degree - * } - */ - public static final OfLong graph_degree$layout() { - return graph_degree$LAYOUT; - } - - private static final long graph_degree$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t graph_degree - * } - */ - public static final long graph_degree$offset() { - return graph_degree$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t graph_degree - * } - */ - public static long graph_degree(MemorySegment struct) { - return struct.get(graph_degree$LAYOUT, graph_degree$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t graph_degree - * } - */ - public static void graph_degree(MemorySegment struct, long fieldValue) { - struct.set(graph_degree$LAYOUT, graph_degree$OFFSET, fieldValue); - } - - private static final OfInt build_algo$LAYOUT = (OfInt)$LAYOUT.select(groupElement("build_algo")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cuvsCagraGraphBuildAlgo build_algo - * } - */ - public static final OfInt build_algo$layout() { - return build_algo$LAYOUT; - } - - private static final long build_algo$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cuvsCagraGraphBuildAlgo build_algo - * } - */ - public static final long build_algo$offset() { - return build_algo$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cuvsCagraGraphBuildAlgo build_algo - * } - */ - public static int build_algo(MemorySegment struct) { - return struct.get(build_algo$LAYOUT, build_algo$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cuvsCagraGraphBuildAlgo build_algo - * } - */ - public static void build_algo(MemorySegment struct, int fieldValue) { - struct.set(build_algo$LAYOUT, build_algo$OFFSET, fieldValue); - } - - private static final OfLong nn_descent_niter$LAYOUT = (OfLong)$LAYOUT.select(groupElement("nn_descent_niter")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t nn_descent_niter - * } - */ - public static final OfLong nn_descent_niter$layout() { - return nn_descent_niter$LAYOUT; - } - - private static final long nn_descent_niter$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t nn_descent_niter - * } - */ - public static final long nn_descent_niter$offset() { - return nn_descent_niter$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t nn_descent_niter - * } - */ - public static long nn_descent_niter(MemorySegment struct) { - return struct.get(nn_descent_niter$LAYOUT, nn_descent_niter$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t nn_descent_niter - * } - */ - public static void nn_descent_niter(MemorySegment struct, long fieldValue) { - struct.set(nn_descent_niter$LAYOUT, nn_descent_niter$OFFSET, fieldValue); - } - - private static final AddressLayout compression$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("compression")); - - /** - * Layout for field: - * {@snippet lang=c : - * cuvsCagraCompressionParams_t compression - * } - */ - public static final AddressLayout compression$layout() { - return compression$LAYOUT; - } - - private static final long compression$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * cuvsCagraCompressionParams_t compression - * } - */ - public static final long compression$offset() { - return compression$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cuvsCagraCompressionParams_t compression - * } - */ - public static MemorySegment compression(MemorySegment struct) { - return struct.get(compression$LAYOUT, compression$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cuvsCagraCompressionParams_t compression - * } - */ - public static void compression(MemorySegment struct, MemorySegment fieldValue) { - struct.set(compression$LAYOUT, compression$OFFSET, fieldValue); - } - - private static final AddressLayout graph_build_params$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("graph_build_params")); - - /** - * Layout for field: - * {@snippet lang=c : - * cuvsIvfPqParams_t graph_build_params - * } - */ - public static final AddressLayout graph_build_params$layout() { - return graph_build_params$LAYOUT; - } - - private static final long graph_build_params$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * cuvsIvfPqParams_t graph_build_params - * } - */ - public static final long graph_build_params$offset() { - return graph_build_params$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cuvsIvfPqParams_t graph_build_params - * } - */ - public static MemorySegment graph_build_params(MemorySegment struct) { - return struct.get(graph_build_params$LAYOUT, graph_build_params$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cuvsIvfPqParams_t graph_build_params - * } - */ - public static void graph_build_params(MemorySegment struct, MemorySegment fieldValue) { - struct.set(graph_build_params$LAYOUT, graph_build_params$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraSearchParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraSearchParams.java deleted file mode 100644 index b192765985..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsCagraSearchParams.java +++ /dev/null @@ -1,697 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cuvsCagraSearchParams { - * size_t max_queries; - * size_t itopk_size; - * size_t max_iterations; - * enum cuvsCagraSearchAlgo algo; - * size_t team_size; - * size_t search_width; - * size_t min_iterations; - * size_t thread_block_size; - * enum cuvsCagraHashMode hashmap_mode; - * size_t hashmap_min_bitlen; - * float hashmap_max_fill_rate; - * uint32_t num_random_samplings; - * uint64_t rand_xor_mask; - * } - * } - */ -public class cuvsCagraSearchParams { - - cuvsCagraSearchParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("max_queries"), - PanamaFFMAPI.C_LONG.withName("itopk_size"), - PanamaFFMAPI.C_LONG.withName("max_iterations"), - PanamaFFMAPI.C_INT.withName("algo"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_LONG.withName("team_size"), - PanamaFFMAPI.C_LONG.withName("search_width"), - PanamaFFMAPI.C_LONG.withName("min_iterations"), - PanamaFFMAPI.C_LONG.withName("thread_block_size"), - PanamaFFMAPI.C_INT.withName("hashmap_mode"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_LONG.withName("hashmap_min_bitlen"), - PanamaFFMAPI.C_FLOAT.withName("hashmap_max_fill_rate"), - PanamaFFMAPI.C_INT.withName("num_random_samplings"), - PanamaFFMAPI.C_LONG.withName("rand_xor_mask") - ).withName("cuvsCagraSearchParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong max_queries$LAYOUT = (OfLong)$LAYOUT.select(groupElement("max_queries")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t max_queries - * } - */ - public static final OfLong max_queries$layout() { - return max_queries$LAYOUT; - } - - private static final long max_queries$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t max_queries - * } - */ - public static final long max_queries$offset() { - return max_queries$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t max_queries - * } - */ - public static long max_queries(MemorySegment struct) { - return struct.get(max_queries$LAYOUT, max_queries$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t max_queries - * } - */ - public static void max_queries(MemorySegment struct, long fieldValue) { - struct.set(max_queries$LAYOUT, max_queries$OFFSET, fieldValue); - } - - private static final OfLong itopk_size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("itopk_size")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t itopk_size - * } - */ - public static final OfLong itopk_size$layout() { - return itopk_size$LAYOUT; - } - - private static final long itopk_size$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t itopk_size - * } - */ - public static final long itopk_size$offset() { - return itopk_size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t itopk_size - * } - */ - public static long itopk_size(MemorySegment struct) { - return struct.get(itopk_size$LAYOUT, itopk_size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t itopk_size - * } - */ - public static void itopk_size(MemorySegment struct, long fieldValue) { - struct.set(itopk_size$LAYOUT, itopk_size$OFFSET, fieldValue); - } - - private static final OfLong max_iterations$LAYOUT = (OfLong)$LAYOUT.select(groupElement("max_iterations")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t max_iterations - * } - */ - public static final OfLong max_iterations$layout() { - return max_iterations$LAYOUT; - } - - private static final long max_iterations$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t max_iterations - * } - */ - public static final long max_iterations$offset() { - return max_iterations$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t max_iterations - * } - */ - public static long max_iterations(MemorySegment struct) { - return struct.get(max_iterations$LAYOUT, max_iterations$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t max_iterations - * } - */ - public static void max_iterations(MemorySegment struct, long fieldValue) { - struct.set(max_iterations$LAYOUT, max_iterations$OFFSET, fieldValue); - } - - private static final OfInt algo$LAYOUT = (OfInt)$LAYOUT.select(groupElement("algo")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cuvsCagraSearchAlgo algo - * } - */ - public static final OfInt algo$layout() { - return algo$LAYOUT; - } - - private static final long algo$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cuvsCagraSearchAlgo algo - * } - */ - public static final long algo$offset() { - return algo$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cuvsCagraSearchAlgo algo - * } - */ - public static int algo(MemorySegment struct) { - return struct.get(algo$LAYOUT, algo$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cuvsCagraSearchAlgo algo - * } - */ - public static void algo(MemorySegment struct, int fieldValue) { - struct.set(algo$LAYOUT, algo$OFFSET, fieldValue); - } - - private static final OfLong team_size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("team_size")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t team_size - * } - */ - public static final OfLong team_size$layout() { - return team_size$LAYOUT; - } - - private static final long team_size$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t team_size - * } - */ - public static final long team_size$offset() { - return team_size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t team_size - * } - */ - public static long team_size(MemorySegment struct) { - return struct.get(team_size$LAYOUT, team_size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t team_size - * } - */ - public static void team_size(MemorySegment struct, long fieldValue) { - struct.set(team_size$LAYOUT, team_size$OFFSET, fieldValue); - } - - private static final OfLong search_width$LAYOUT = (OfLong)$LAYOUT.select(groupElement("search_width")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t search_width - * } - */ - public static final OfLong search_width$layout() { - return search_width$LAYOUT; - } - - private static final long search_width$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t search_width - * } - */ - public static final long search_width$offset() { - return search_width$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t search_width - * } - */ - public static long search_width(MemorySegment struct) { - return struct.get(search_width$LAYOUT, search_width$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t search_width - * } - */ - public static void search_width(MemorySegment struct, long fieldValue) { - struct.set(search_width$LAYOUT, search_width$OFFSET, fieldValue); - } - - private static final OfLong min_iterations$LAYOUT = (OfLong)$LAYOUT.select(groupElement("min_iterations")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t min_iterations - * } - */ - public static final OfLong min_iterations$layout() { - return min_iterations$LAYOUT; - } - - private static final long min_iterations$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t min_iterations - * } - */ - public static final long min_iterations$offset() { - return min_iterations$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t min_iterations - * } - */ - public static long min_iterations(MemorySegment struct) { - return struct.get(min_iterations$LAYOUT, min_iterations$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t min_iterations - * } - */ - public static void min_iterations(MemorySegment struct, long fieldValue) { - struct.set(min_iterations$LAYOUT, min_iterations$OFFSET, fieldValue); - } - - private static final OfLong thread_block_size$LAYOUT = (OfLong)$LAYOUT.select(groupElement("thread_block_size")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t thread_block_size - * } - */ - public static final OfLong thread_block_size$layout() { - return thread_block_size$LAYOUT; - } - - private static final long thread_block_size$OFFSET = 56; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t thread_block_size - * } - */ - public static final long thread_block_size$offset() { - return thread_block_size$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t thread_block_size - * } - */ - public static long thread_block_size(MemorySegment struct) { - return struct.get(thread_block_size$LAYOUT, thread_block_size$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t thread_block_size - * } - */ - public static void thread_block_size(MemorySegment struct, long fieldValue) { - struct.set(thread_block_size$LAYOUT, thread_block_size$OFFSET, fieldValue); - } - - private static final OfInt hashmap_mode$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hashmap_mode")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cuvsCagraHashMode hashmap_mode - * } - */ - public static final OfInt hashmap_mode$layout() { - return hashmap_mode$LAYOUT; - } - - private static final long hashmap_mode$OFFSET = 64; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cuvsCagraHashMode hashmap_mode - * } - */ - public static final long hashmap_mode$offset() { - return hashmap_mode$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cuvsCagraHashMode hashmap_mode - * } - */ - public static int hashmap_mode(MemorySegment struct) { - return struct.get(hashmap_mode$LAYOUT, hashmap_mode$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cuvsCagraHashMode hashmap_mode - * } - */ - public static void hashmap_mode(MemorySegment struct, int fieldValue) { - struct.set(hashmap_mode$LAYOUT, hashmap_mode$OFFSET, fieldValue); - } - - private static final OfLong hashmap_min_bitlen$LAYOUT = (OfLong)$LAYOUT.select(groupElement("hashmap_min_bitlen")); - - /** - * Layout for field: - * {@snippet lang=c : - * size_t hashmap_min_bitlen - * } - */ - public static final OfLong hashmap_min_bitlen$layout() { - return hashmap_min_bitlen$LAYOUT; - } - - private static final long hashmap_min_bitlen$OFFSET = 72; - - /** - * Offset for field: - * {@snippet lang=c : - * size_t hashmap_min_bitlen - * } - */ - public static final long hashmap_min_bitlen$offset() { - return hashmap_min_bitlen$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * size_t hashmap_min_bitlen - * } - */ - public static long hashmap_min_bitlen(MemorySegment struct) { - return struct.get(hashmap_min_bitlen$LAYOUT, hashmap_min_bitlen$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * size_t hashmap_min_bitlen - * } - */ - public static void hashmap_min_bitlen(MemorySegment struct, long fieldValue) { - struct.set(hashmap_min_bitlen$LAYOUT, hashmap_min_bitlen$OFFSET, fieldValue); - } - - private static final OfFloat hashmap_max_fill_rate$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("hashmap_max_fill_rate")); - - /** - * Layout for field: - * {@snippet lang=c : - * float hashmap_max_fill_rate - * } - */ - public static final OfFloat hashmap_max_fill_rate$layout() { - return hashmap_max_fill_rate$LAYOUT; - } - - private static final long hashmap_max_fill_rate$OFFSET = 80; - - /** - * Offset for field: - * {@snippet lang=c : - * float hashmap_max_fill_rate - * } - */ - public static final long hashmap_max_fill_rate$offset() { - return hashmap_max_fill_rate$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float hashmap_max_fill_rate - * } - */ - public static float hashmap_max_fill_rate(MemorySegment struct) { - return struct.get(hashmap_max_fill_rate$LAYOUT, hashmap_max_fill_rate$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float hashmap_max_fill_rate - * } - */ - public static void hashmap_max_fill_rate(MemorySegment struct, float fieldValue) { - struct.set(hashmap_max_fill_rate$LAYOUT, hashmap_max_fill_rate$OFFSET, fieldValue); - } - - private static final OfInt num_random_samplings$LAYOUT = (OfInt)$LAYOUT.select(groupElement("num_random_samplings")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t num_random_samplings - * } - */ - public static final OfInt num_random_samplings$layout() { - return num_random_samplings$LAYOUT; - } - - private static final long num_random_samplings$OFFSET = 84; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t num_random_samplings - * } - */ - public static final long num_random_samplings$offset() { - return num_random_samplings$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t num_random_samplings - * } - */ - public static int num_random_samplings(MemorySegment struct) { - return struct.get(num_random_samplings$LAYOUT, num_random_samplings$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t num_random_samplings - * } - */ - public static void num_random_samplings(MemorySegment struct, int fieldValue) { - struct.set(num_random_samplings$LAYOUT, num_random_samplings$OFFSET, fieldValue); - } - - private static final OfLong rand_xor_mask$LAYOUT = (OfLong)$LAYOUT.select(groupElement("rand_xor_mask")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint64_t rand_xor_mask - * } - */ - public static final OfLong rand_xor_mask$layout() { - return rand_xor_mask$LAYOUT; - } - - private static final long rand_xor_mask$OFFSET = 88; - - /** - * Offset for field: - * {@snippet lang=c : - * uint64_t rand_xor_mask - * } - */ - public static final long rand_xor_mask$offset() { - return rand_xor_mask$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint64_t rand_xor_mask - * } - */ - public static long rand_xor_mask(MemorySegment struct) { - return struct.get(rand_xor_mask$LAYOUT, rand_xor_mask$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint64_t rand_xor_mask - * } - */ - public static void rand_xor_mask(MemorySegment struct, long fieldValue) { - struct.set(rand_xor_mask$LAYOUT, rand_xor_mask$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsFilter.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsFilter.java deleted file mode 100644 index 84d1450270..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsFilter.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct { - * uintptr_t addr; - * enum cuvsFilterType type; - * } - * } - */ -public class cuvsFilter { - - cuvsFilter() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("addr"), - PanamaFFMAPI.C_INT.withName("type"), - MemoryLayout.paddingLayout(4) - ).withName("$anon$50:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addr")); - - /** - * Layout for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static final OfLong addr$layout() { - return addr$LAYOUT; - } - - private static final long addr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static final long addr$offset() { - return addr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static long addr(MemorySegment struct) { - return struct.get(addr$LAYOUT, addr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static void addr(MemorySegment struct, long fieldValue) { - struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); - } - - private static final OfInt type$LAYOUT = (OfInt)$LAYOUT.select(groupElement("type")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cuvsFilterType type - * } - */ - public static final OfInt type$layout() { - return type$LAYOUT; - } - - private static final long type$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cuvsFilterType type - * } - */ - public static final long type$offset() { - return type$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cuvsFilterType type - * } - */ - public static int type(MemorySegment struct) { - return struct.get(type$LAYOUT, type$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cuvsFilterType type - * } - */ - public static void type(MemorySegment struct, int fieldValue) { - struct.set(type$LAYOUT, type$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswExtendParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswExtendParams.java deleted file mode 100644 index e82848bf4e..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswExtendParams.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cuvsHnswExtendParams { - * int num_threads; - * } - * } - */ -public class cuvsHnswExtendParams { - - cuvsHnswExtendParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("num_threads") - ).withName("cuvsHnswExtendParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt num_threads$LAYOUT = (OfInt)$LAYOUT.select(groupElement("num_threads")); - - /** - * Layout for field: - * {@snippet lang=c : - * int num_threads - * } - */ - public static final OfInt num_threads$layout() { - return num_threads$LAYOUT; - } - - private static final long num_threads$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int num_threads - * } - */ - public static final long num_threads$offset() { - return num_threads$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int num_threads - * } - */ - public static int num_threads(MemorySegment struct) { - return struct.get(num_threads$LAYOUT, num_threads$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int num_threads - * } - */ - public static void num_threads(MemorySegment struct, int fieldValue) { - struct.set(num_threads$LAYOUT, num_threads$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndex.java deleted file mode 100644 index 911fa6c389..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndex.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct { - * uintptr_t addr; - * DLDataType dtype; - * } - * } - */ -public class cuvsHnswIndex { - - cuvsHnswIndex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("addr"), - DLDataType.layout().withName("dtype"), - MemoryLayout.paddingLayout(4) - ).withName("$anon$96:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addr")); - - /** - * Layout for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static final OfLong addr$layout() { - return addr$LAYOUT; - } - - private static final long addr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static final long addr$offset() { - return addr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static long addr(MemorySegment struct) { - return struct.get(addr$LAYOUT, addr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static void addr(MemorySegment struct, long fieldValue) { - struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); - } - - private static final GroupLayout dtype$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dtype")); - - /** - * Layout for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static final GroupLayout dtype$layout() { - return dtype$LAYOUT; - } - - private static final long dtype$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static final long dtype$offset() { - return dtype$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static MemorySegment dtype(MemorySegment struct) { - return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static void dtype(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndexParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndexParams.java deleted file mode 100644 index 9dc3f7b4a3..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswIndexParams.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cuvsHnswIndexParams { - * enum cuvsHnswHierarchy hierarchy; - * int ef_construction; - * int num_threads; - * } - * } - */ -public class cuvsHnswIndexParams { - - cuvsHnswIndexParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("hierarchy"), - PanamaFFMAPI.C_INT.withName("ef_construction"), - PanamaFFMAPI.C_INT.withName("num_threads") - ).withName("cuvsHnswIndexParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt hierarchy$LAYOUT = (OfInt)$LAYOUT.select(groupElement("hierarchy")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum cuvsHnswHierarchy hierarchy - * } - */ - public static final OfInt hierarchy$layout() { - return hierarchy$LAYOUT; - } - - private static final long hierarchy$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * enum cuvsHnswHierarchy hierarchy - * } - */ - public static final long hierarchy$offset() { - return hierarchy$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum cuvsHnswHierarchy hierarchy - * } - */ - public static int hierarchy(MemorySegment struct) { - return struct.get(hierarchy$LAYOUT, hierarchy$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum cuvsHnswHierarchy hierarchy - * } - */ - public static void hierarchy(MemorySegment struct, int fieldValue) { - struct.set(hierarchy$LAYOUT, hierarchy$OFFSET, fieldValue); - } - - private static final OfInt ef_construction$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ef_construction")); - - /** - * Layout for field: - * {@snippet lang=c : - * int ef_construction - * } - */ - public static final OfInt ef_construction$layout() { - return ef_construction$LAYOUT; - } - - private static final long ef_construction$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int ef_construction - * } - */ - public static final long ef_construction$offset() { - return ef_construction$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int ef_construction - * } - */ - public static int ef_construction(MemorySegment struct) { - return struct.get(ef_construction$LAYOUT, ef_construction$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int ef_construction - * } - */ - public static void ef_construction(MemorySegment struct, int fieldValue) { - struct.set(ef_construction$LAYOUT, ef_construction$OFFSET, fieldValue); - } - - private static final OfInt num_threads$LAYOUT = (OfInt)$LAYOUT.select(groupElement("num_threads")); - - /** - * Layout for field: - * {@snippet lang=c : - * int num_threads - * } - */ - public static final OfInt num_threads$layout() { - return num_threads$LAYOUT; - } - - private static final long num_threads$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * int num_threads - * } - */ - public static final long num_threads$offset() { - return num_threads$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int num_threads - * } - */ - public static int num_threads(MemorySegment struct) { - return struct.get(num_threads$LAYOUT, num_threads$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int num_threads - * } - */ - public static void num_threads(MemorySegment struct, int fieldValue) { - struct.set(num_threads$LAYOUT, num_threads$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswSearchParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswSearchParams.java deleted file mode 100644 index 66c1d5e0ae..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsHnswSearchParams.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cuvsHnswSearchParams { - * int32_t ef; - * int32_t num_threads; - * } - * } - */ -public class cuvsHnswSearchParams { - - cuvsHnswSearchParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("ef"), - PanamaFFMAPI.C_INT.withName("num_threads") - ).withName("cuvsHnswSearchParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt ef$LAYOUT = (OfInt)$LAYOUT.select(groupElement("ef")); - - /** - * Layout for field: - * {@snippet lang=c : - * int32_t ef - * } - */ - public static final OfInt ef$layout() { - return ef$LAYOUT; - } - - private static final long ef$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int32_t ef - * } - */ - public static final long ef$offset() { - return ef$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int32_t ef - * } - */ - public static int ef(MemorySegment struct) { - return struct.get(ef$LAYOUT, ef$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int32_t ef - * } - */ - public static void ef(MemorySegment struct, int fieldValue) { - struct.set(ef$LAYOUT, ef$OFFSET, fieldValue); - } - - private static final OfInt num_threads$LAYOUT = (OfInt)$LAYOUT.select(groupElement("num_threads")); - - /** - * Layout for field: - * {@snippet lang=c : - * int32_t num_threads - * } - */ - public static final OfInt num_threads$layout() { - return num_threads$LAYOUT; - } - - private static final long num_threads$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int32_t num_threads - * } - */ - public static final long num_threads$offset() { - return num_threads$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int32_t num_threads - * } - */ - public static int num_threads(MemorySegment struct) { - return struct.get(num_threads$LAYOUT, num_threads$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int32_t num_threads - * } - */ - public static void num_threads(MemorySegment struct, int fieldValue) { - struct.set(num_threads$LAYOUT, num_threads$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndex.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndex.java deleted file mode 100644 index 9f48b1259b..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndex.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct { - * uintptr_t addr; - * DLDataType dtype; - * } - * } - */ -public class cuvsIvfPqIndex { - - cuvsIvfPqIndex() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("addr"), - DLDataType.layout().withName("dtype"), - MemoryLayout.paddingLayout(4) - ).withName("$anon$227:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong addr$LAYOUT = (OfLong)$LAYOUT.select(groupElement("addr")); - - /** - * Layout for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static final OfLong addr$layout() { - return addr$LAYOUT; - } - - private static final long addr$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static final long addr$offset() { - return addr$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static long addr(MemorySegment struct) { - return struct.get(addr$LAYOUT, addr$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uintptr_t addr - * } - */ - public static void addr(MemorySegment struct, long fieldValue) { - struct.set(addr$LAYOUT, addr$OFFSET, fieldValue); - } - - private static final GroupLayout dtype$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("dtype")); - - /** - * Layout for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static final GroupLayout dtype$layout() { - return dtype$LAYOUT; - } - - private static final long dtype$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static final long dtype$offset() { - return dtype$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static MemorySegment dtype(MemorySegment struct) { - return struct.asSlice(dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Setter for field: - * {@snippet lang=c : - * DLDataType dtype - * } - */ - public static void dtype(MemorySegment struct, MemorySegment fieldValue) { - MemorySegment.copy(fieldValue, 0L, struct, dtype$OFFSET, dtype$LAYOUT.byteSize()); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndexParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndexParams.java deleted file mode 100644 index 83153a7ba1..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqIndexParams.java +++ /dev/null @@ -1,653 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cuvsIvfPqIndexParams { - * cuvsDistanceType metric; - * float metric_arg; - * bool add_data_on_build; - * uint32_t n_lists; - * uint32_t kmeans_n_iters; - * double kmeans_trainset_fraction; - * uint32_t pq_bits; - * uint32_t pq_dim; - * enum codebook_gen codebook_kind; - * bool force_random_rotation; - * bool conservative_memory_allocation; - * uint32_t max_train_points_per_pq_code; - * } - * } - */ -public class cuvsIvfPqIndexParams { - - cuvsIvfPqIndexParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("metric"), - PanamaFFMAPI.C_FLOAT.withName("metric_arg"), - PanamaFFMAPI.C_BOOL.withName("add_data_on_build"), - MemoryLayout.paddingLayout(3), - PanamaFFMAPI.C_INT.withName("n_lists"), - PanamaFFMAPI.C_INT.withName("kmeans_n_iters"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_DOUBLE.withName("kmeans_trainset_fraction"), - PanamaFFMAPI.C_INT.withName("pq_bits"), - PanamaFFMAPI.C_INT.withName("pq_dim"), - PanamaFFMAPI.C_INT.withName("codebook_kind"), - PanamaFFMAPI.C_BOOL.withName("force_random_rotation"), - PanamaFFMAPI.C_BOOL.withName("conservative_memory_allocation"), - MemoryLayout.paddingLayout(2), - PanamaFFMAPI.C_INT.withName("max_train_points_per_pq_code"), - MemoryLayout.paddingLayout(4) - ).withName("cuvsIvfPqIndexParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt metric$LAYOUT = (OfInt)$LAYOUT.select(groupElement("metric")); - - /** - * Layout for field: - * {@snippet lang=c : - * cuvsDistanceType metric - * } - */ - public static final OfInt metric$layout() { - return metric$LAYOUT; - } - - private static final long metric$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cuvsDistanceType metric - * } - */ - public static final long metric$offset() { - return metric$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cuvsDistanceType metric - * } - */ - public static int metric(MemorySegment struct) { - return struct.get(metric$LAYOUT, metric$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cuvsDistanceType metric - * } - */ - public static void metric(MemorySegment struct, int fieldValue) { - struct.set(metric$LAYOUT, metric$OFFSET, fieldValue); - } - - private static final OfFloat metric_arg$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("metric_arg")); - - /** - * Layout for field: - * {@snippet lang=c : - * float metric_arg - * } - */ - public static final OfFloat metric_arg$layout() { - return metric_arg$LAYOUT; - } - - private static final long metric_arg$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * float metric_arg - * } - */ - public static final long metric_arg$offset() { - return metric_arg$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float metric_arg - * } - */ - public static float metric_arg(MemorySegment struct) { - return struct.get(metric_arg$LAYOUT, metric_arg$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float metric_arg - * } - */ - public static void metric_arg(MemorySegment struct, float fieldValue) { - struct.set(metric_arg$LAYOUT, metric_arg$OFFSET, fieldValue); - } - - private static final OfBoolean add_data_on_build$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("add_data_on_build")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool add_data_on_build - * } - */ - public static final OfBoolean add_data_on_build$layout() { - return add_data_on_build$LAYOUT; - } - - private static final long add_data_on_build$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * bool add_data_on_build - * } - */ - public static final long add_data_on_build$offset() { - return add_data_on_build$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool add_data_on_build - * } - */ - public static boolean add_data_on_build(MemorySegment struct) { - return struct.get(add_data_on_build$LAYOUT, add_data_on_build$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool add_data_on_build - * } - */ - public static void add_data_on_build(MemorySegment struct, boolean fieldValue) { - struct.set(add_data_on_build$LAYOUT, add_data_on_build$OFFSET, fieldValue); - } - - private static final OfInt n_lists$LAYOUT = (OfInt)$LAYOUT.select(groupElement("n_lists")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t n_lists - * } - */ - public static final OfInt n_lists$layout() { - return n_lists$LAYOUT; - } - - private static final long n_lists$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t n_lists - * } - */ - public static final long n_lists$offset() { - return n_lists$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t n_lists - * } - */ - public static int n_lists(MemorySegment struct) { - return struct.get(n_lists$LAYOUT, n_lists$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t n_lists - * } - */ - public static void n_lists(MemorySegment struct, int fieldValue) { - struct.set(n_lists$LAYOUT, n_lists$OFFSET, fieldValue); - } - - private static final OfInt kmeans_n_iters$LAYOUT = (OfInt)$LAYOUT.select(groupElement("kmeans_n_iters")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t kmeans_n_iters - * } - */ - public static final OfInt kmeans_n_iters$layout() { - return kmeans_n_iters$LAYOUT; - } - - private static final long kmeans_n_iters$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t kmeans_n_iters - * } - */ - public static final long kmeans_n_iters$offset() { - return kmeans_n_iters$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t kmeans_n_iters - * } - */ - public static int kmeans_n_iters(MemorySegment struct) { - return struct.get(kmeans_n_iters$LAYOUT, kmeans_n_iters$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t kmeans_n_iters - * } - */ - public static void kmeans_n_iters(MemorySegment struct, int fieldValue) { - struct.set(kmeans_n_iters$LAYOUT, kmeans_n_iters$OFFSET, fieldValue); - } - - private static final OfDouble kmeans_trainset_fraction$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("kmeans_trainset_fraction")); - - /** - * Layout for field: - * {@snippet lang=c : - * double kmeans_trainset_fraction - * } - */ - public static final OfDouble kmeans_trainset_fraction$layout() { - return kmeans_trainset_fraction$LAYOUT; - } - - private static final long kmeans_trainset_fraction$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * double kmeans_trainset_fraction - * } - */ - public static final long kmeans_trainset_fraction$offset() { - return kmeans_trainset_fraction$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double kmeans_trainset_fraction - * } - */ - public static double kmeans_trainset_fraction(MemorySegment struct) { - return struct.get(kmeans_trainset_fraction$LAYOUT, kmeans_trainset_fraction$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double kmeans_trainset_fraction - * } - */ - public static void kmeans_trainset_fraction(MemorySegment struct, double fieldValue) { - struct.set(kmeans_trainset_fraction$LAYOUT, kmeans_trainset_fraction$OFFSET, fieldValue); - } - - private static final OfInt pq_bits$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pq_bits")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t pq_bits - * } - */ - public static final OfInt pq_bits$layout() { - return pq_bits$LAYOUT; - } - - private static final long pq_bits$OFFSET = 32; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t pq_bits - * } - */ - public static final long pq_bits$offset() { - return pq_bits$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t pq_bits - * } - */ - public static int pq_bits(MemorySegment struct) { - return struct.get(pq_bits$LAYOUT, pq_bits$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t pq_bits - * } - */ - public static void pq_bits(MemorySegment struct, int fieldValue) { - struct.set(pq_bits$LAYOUT, pq_bits$OFFSET, fieldValue); - } - - private static final OfInt pq_dim$LAYOUT = (OfInt)$LAYOUT.select(groupElement("pq_dim")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t pq_dim - * } - */ - public static final OfInt pq_dim$layout() { - return pq_dim$LAYOUT; - } - - private static final long pq_dim$OFFSET = 36; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t pq_dim - * } - */ - public static final long pq_dim$offset() { - return pq_dim$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t pq_dim - * } - */ - public static int pq_dim(MemorySegment struct) { - return struct.get(pq_dim$LAYOUT, pq_dim$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t pq_dim - * } - */ - public static void pq_dim(MemorySegment struct, int fieldValue) { - struct.set(pq_dim$LAYOUT, pq_dim$OFFSET, fieldValue); - } - - private static final OfInt codebook_kind$LAYOUT = (OfInt)$LAYOUT.select(groupElement("codebook_kind")); - - /** - * Layout for field: - * {@snippet lang=c : - * enum codebook_gen codebook_kind - * } - */ - public static final OfInt codebook_kind$layout() { - return codebook_kind$LAYOUT; - } - - private static final long codebook_kind$OFFSET = 40; - - /** - * Offset for field: - * {@snippet lang=c : - * enum codebook_gen codebook_kind - * } - */ - public static final long codebook_kind$offset() { - return codebook_kind$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * enum codebook_gen codebook_kind - * } - */ - public static int codebook_kind(MemorySegment struct) { - return struct.get(codebook_kind$LAYOUT, codebook_kind$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * enum codebook_gen codebook_kind - * } - */ - public static void codebook_kind(MemorySegment struct, int fieldValue) { - struct.set(codebook_kind$LAYOUT, codebook_kind$OFFSET, fieldValue); - } - - private static final OfBoolean force_random_rotation$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("force_random_rotation")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool force_random_rotation - * } - */ - public static final OfBoolean force_random_rotation$layout() { - return force_random_rotation$LAYOUT; - } - - private static final long force_random_rotation$OFFSET = 44; - - /** - * Offset for field: - * {@snippet lang=c : - * bool force_random_rotation - * } - */ - public static final long force_random_rotation$offset() { - return force_random_rotation$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool force_random_rotation - * } - */ - public static boolean force_random_rotation(MemorySegment struct) { - return struct.get(force_random_rotation$LAYOUT, force_random_rotation$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool force_random_rotation - * } - */ - public static void force_random_rotation(MemorySegment struct, boolean fieldValue) { - struct.set(force_random_rotation$LAYOUT, force_random_rotation$OFFSET, fieldValue); - } - - private static final OfBoolean conservative_memory_allocation$LAYOUT = (OfBoolean)$LAYOUT.select(groupElement("conservative_memory_allocation")); - - /** - * Layout for field: - * {@snippet lang=c : - * bool conservative_memory_allocation - * } - */ - public static final OfBoolean conservative_memory_allocation$layout() { - return conservative_memory_allocation$LAYOUT; - } - - private static final long conservative_memory_allocation$OFFSET = 45; - - /** - * Offset for field: - * {@snippet lang=c : - * bool conservative_memory_allocation - * } - */ - public static final long conservative_memory_allocation$offset() { - return conservative_memory_allocation$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * bool conservative_memory_allocation - * } - */ - public static boolean conservative_memory_allocation(MemorySegment struct) { - return struct.get(conservative_memory_allocation$LAYOUT, conservative_memory_allocation$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * bool conservative_memory_allocation - * } - */ - public static void conservative_memory_allocation(MemorySegment struct, boolean fieldValue) { - struct.set(conservative_memory_allocation$LAYOUT, conservative_memory_allocation$OFFSET, fieldValue); - } - - private static final OfInt max_train_points_per_pq_code$LAYOUT = (OfInt)$LAYOUT.select(groupElement("max_train_points_per_pq_code")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t max_train_points_per_pq_code - * } - */ - public static final OfInt max_train_points_per_pq_code$layout() { - return max_train_points_per_pq_code$LAYOUT; - } - - private static final long max_train_points_per_pq_code$OFFSET = 48; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t max_train_points_per_pq_code - * } - */ - public static final long max_train_points_per_pq_code$offset() { - return max_train_points_per_pq_code$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t max_train_points_per_pq_code - * } - */ - public static int max_train_points_per_pq_code(MemorySegment struct) { - return struct.get(max_train_points_per_pq_code$LAYOUT, max_train_points_per_pq_code$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t max_train_points_per_pq_code - * } - */ - public static void max_train_points_per_pq_code(MemorySegment struct, int fieldValue) { - struct.set(max_train_points_per_pq_code$LAYOUT, max_train_points_per_pq_code$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqParams.java deleted file mode 100644 index b86e49f7ee..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqParams.java +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cuvsIvfPqParams { - * cuvsIvfPqIndexParams_t ivf_pq_build_params; - * cuvsIvfPqSearchParams_t ivf_pq_search_params; - * float refinement_rate; - * } - * } - */ -public class cuvsIvfPqParams { - - cuvsIvfPqParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_POINTER.withName("ivf_pq_build_params"), - PanamaFFMAPI.C_POINTER.withName("ivf_pq_search_params"), - PanamaFFMAPI.C_FLOAT.withName("refinement_rate"), - MemoryLayout.paddingLayout(4) - ).withName("cuvsIvfPqParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final AddressLayout ivf_pq_build_params$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("ivf_pq_build_params")); - - /** - * Layout for field: - * {@snippet lang=c : - * cuvsIvfPqIndexParams_t ivf_pq_build_params - * } - */ - public static final AddressLayout ivf_pq_build_params$layout() { - return ivf_pq_build_params$LAYOUT; - } - - private static final long ivf_pq_build_params$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * cuvsIvfPqIndexParams_t ivf_pq_build_params - * } - */ - public static final long ivf_pq_build_params$offset() { - return ivf_pq_build_params$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cuvsIvfPqIndexParams_t ivf_pq_build_params - * } - */ - public static MemorySegment ivf_pq_build_params(MemorySegment struct) { - return struct.get(ivf_pq_build_params$LAYOUT, ivf_pq_build_params$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cuvsIvfPqIndexParams_t ivf_pq_build_params - * } - */ - public static void ivf_pq_build_params(MemorySegment struct, MemorySegment fieldValue) { - struct.set(ivf_pq_build_params$LAYOUT, ivf_pq_build_params$OFFSET, fieldValue); - } - - private static final AddressLayout ivf_pq_search_params$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("ivf_pq_search_params")); - - /** - * Layout for field: - * {@snippet lang=c : - * cuvsIvfPqSearchParams_t ivf_pq_search_params - * } - */ - public static final AddressLayout ivf_pq_search_params$layout() { - return ivf_pq_search_params$LAYOUT; - } - - private static final long ivf_pq_search_params$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * cuvsIvfPqSearchParams_t ivf_pq_search_params - * } - */ - public static final long ivf_pq_search_params$offset() { - return ivf_pq_search_params$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cuvsIvfPqSearchParams_t ivf_pq_search_params - * } - */ - public static MemorySegment ivf_pq_search_params(MemorySegment struct) { - return struct.get(ivf_pq_search_params$LAYOUT, ivf_pq_search_params$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cuvsIvfPqSearchParams_t ivf_pq_search_params - * } - */ - public static void ivf_pq_search_params(MemorySegment struct, MemorySegment fieldValue) { - struct.set(ivf_pq_search_params$LAYOUT, ivf_pq_search_params$OFFSET, fieldValue); - } - - private static final OfFloat refinement_rate$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("refinement_rate")); - - /** - * Layout for field: - * {@snippet lang=c : - * float refinement_rate - * } - */ - public static final OfFloat refinement_rate$layout() { - return refinement_rate$LAYOUT; - } - - private static final long refinement_rate$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * float refinement_rate - * } - */ - public static final long refinement_rate$offset() { - return refinement_rate$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float refinement_rate - * } - */ - public static float refinement_rate(MemorySegment struct) { - return struct.get(refinement_rate$LAYOUT, refinement_rate$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float refinement_rate - * } - */ - public static void refinement_rate(MemorySegment struct, float fieldValue) { - struct.set(refinement_rate$LAYOUT, refinement_rate$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqSearchParams.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqSearchParams.java deleted file mode 100644 index bea9076642..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/cuvsIvfPqSearchParams.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct cuvsIvfPqSearchParams { - * uint32_t n_probes; - * cudaDataType_t lut_dtype; - * cudaDataType_t internal_distance_dtype; - * double preferred_shmem_carveout; - * } - * } - */ -public class cuvsIvfPqSearchParams { - - cuvsIvfPqSearchParams() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("n_probes"), - PanamaFFMAPI.C_INT.withName("lut_dtype"), - PanamaFFMAPI.C_INT.withName("internal_distance_dtype"), - MemoryLayout.paddingLayout(4), - PanamaFFMAPI.C_DOUBLE.withName("preferred_shmem_carveout") - ).withName("cuvsIvfPqSearchParams"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt n_probes$LAYOUT = (OfInt)$LAYOUT.select(groupElement("n_probes")); - - /** - * Layout for field: - * {@snippet lang=c : - * uint32_t n_probes - * } - */ - public static final OfInt n_probes$layout() { - return n_probes$LAYOUT; - } - - private static final long n_probes$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * uint32_t n_probes - * } - */ - public static final long n_probes$offset() { - return n_probes$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * uint32_t n_probes - * } - */ - public static int n_probes(MemorySegment struct) { - return struct.get(n_probes$LAYOUT, n_probes$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * uint32_t n_probes - * } - */ - public static void n_probes(MemorySegment struct, int fieldValue) { - struct.set(n_probes$LAYOUT, n_probes$OFFSET, fieldValue); - } - - private static final OfInt lut_dtype$LAYOUT = (OfInt)$LAYOUT.select(groupElement("lut_dtype")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaDataType_t lut_dtype - * } - */ - public static final OfInt lut_dtype$layout() { - return lut_dtype$LAYOUT; - } - - private static final long lut_dtype$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaDataType_t lut_dtype - * } - */ - public static final long lut_dtype$offset() { - return lut_dtype$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaDataType_t lut_dtype - * } - */ - public static int lut_dtype(MemorySegment struct) { - return struct.get(lut_dtype$LAYOUT, lut_dtype$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaDataType_t lut_dtype - * } - */ - public static void lut_dtype(MemorySegment struct, int fieldValue) { - struct.set(lut_dtype$LAYOUT, lut_dtype$OFFSET, fieldValue); - } - - private static final OfInt internal_distance_dtype$LAYOUT = (OfInt)$LAYOUT.select(groupElement("internal_distance_dtype")); - - /** - * Layout for field: - * {@snippet lang=c : - * cudaDataType_t internal_distance_dtype - * } - */ - public static final OfInt internal_distance_dtype$layout() { - return internal_distance_dtype$LAYOUT; - } - - private static final long internal_distance_dtype$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * cudaDataType_t internal_distance_dtype - * } - */ - public static final long internal_distance_dtype$offset() { - return internal_distance_dtype$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * cudaDataType_t internal_distance_dtype - * } - */ - public static int internal_distance_dtype(MemorySegment struct) { - return struct.get(internal_distance_dtype$LAYOUT, internal_distance_dtype$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * cudaDataType_t internal_distance_dtype - * } - */ - public static void internal_distance_dtype(MemorySegment struct, int fieldValue) { - struct.set(internal_distance_dtype$LAYOUT, internal_distance_dtype$OFFSET, fieldValue); - } - - private static final OfDouble preferred_shmem_carveout$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("preferred_shmem_carveout")); - - /** - * Layout for field: - * {@snippet lang=c : - * double preferred_shmem_carveout - * } - */ - public static final OfDouble preferred_shmem_carveout$layout() { - return preferred_shmem_carveout$LAYOUT; - } - - private static final long preferred_shmem_carveout$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * double preferred_shmem_carveout - * } - */ - public static final long preferred_shmem_carveout$offset() { - return preferred_shmem_carveout$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double preferred_shmem_carveout - * } - */ - public static double preferred_shmem_carveout(MemorySegment struct) { - return struct.get(preferred_shmem_carveout$LAYOUT, preferred_shmem_carveout$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double preferred_shmem_carveout - * } - */ - public static void preferred_shmem_carveout(MemorySegment struct, double fieldValue) { - struct.set(preferred_shmem_carveout$LAYOUT, preferred_shmem_carveout$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/dim3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/dim3.java deleted file mode 100644 index 94a23f5118..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/dim3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct dim3 { - * unsigned int x; - * unsigned int y; - * unsigned int z; - * } - * } - */ -public class dim3 { - - dim3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x"), - PanamaFFMAPI.C_INT.withName("y"), - PanamaFFMAPI.C_INT.withName("z") - ).withName("dim3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static final OfInt y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static int y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static void y(MemorySegment struct, int fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static final OfInt z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static int z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static void z(MemorySegment struct, int fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double1.java deleted file mode 100644 index 575b919417..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct double1 { - * double x; - * } - * } - */ -public class double1 { - - double1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_DOUBLE.withName("x") - ).withName("double1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfDouble x$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * double x - * } - */ - public static final OfDouble x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * double x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double x - * } - */ - public static double x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double x - * } - */ - public static void x(MemorySegment struct, double fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double2.java deleted file mode 100644 index 98122f39fd..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct double2 { - * double x; - * double y; - * } - * } - */ -public class double2 { - - double2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_DOUBLE.withName("x"), - PanamaFFMAPI.C_DOUBLE.withName("y") - ).withName("double2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfDouble x$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * double x - * } - */ - public static final OfDouble x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * double x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double x - * } - */ - public static double x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double x - * } - */ - public static void x(MemorySegment struct, double fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfDouble y$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * double y - * } - */ - public static final OfDouble y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * double y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double y - * } - */ - public static double y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double y - * } - */ - public static void y(MemorySegment struct, double fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double3.java deleted file mode 100644 index 75aef9d92a..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct double3 { - * double x; - * double y; - * double z; - * } - * } - */ -public class double3 { - - double3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_DOUBLE.withName("x"), - PanamaFFMAPI.C_DOUBLE.withName("y"), - PanamaFFMAPI.C_DOUBLE.withName("z") - ).withName("double3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfDouble x$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * double x - * } - */ - public static final OfDouble x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * double x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double x - * } - */ - public static double x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double x - * } - */ - public static void x(MemorySegment struct, double fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfDouble y$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * double y - * } - */ - public static final OfDouble y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * double y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double y - * } - */ - public static double y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double y - * } - */ - public static void y(MemorySegment struct, double fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfDouble z$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * double z - * } - */ - public static final OfDouble z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * double z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double z - * } - */ - public static double z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double z - * } - */ - public static void z(MemorySegment struct, double fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double4.java deleted file mode 100644 index 6760aa5d8a..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/double4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct double4 { - * double x; - * double y; - * double z; - * double w; - * } - * } - */ -public class double4 { - - double4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_DOUBLE.withName("x"), - PanamaFFMAPI.C_DOUBLE.withName("y"), - PanamaFFMAPI.C_DOUBLE.withName("z"), - PanamaFFMAPI.C_DOUBLE.withName("w") - ).withName("double4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfDouble x$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * double x - * } - */ - public static final OfDouble x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * double x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double x - * } - */ - public static double x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double x - * } - */ - public static void x(MemorySegment struct, double fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfDouble y$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * double y - * } - */ - public static final OfDouble y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * double y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double y - * } - */ - public static double y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double y - * } - */ - public static void y(MemorySegment struct, double fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfDouble z$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * double z - * } - */ - public static final OfDouble z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * double z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double z - * } - */ - public static double z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double z - * } - */ - public static void z(MemorySegment struct, double fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfDouble w$LAYOUT = (OfDouble)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * double w - * } - */ - public static final OfDouble w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * double w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * double w - * } - */ - public static double w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * double w - * } - */ - public static void w(MemorySegment struct, double fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float1.java deleted file mode 100644 index dc3270e28f..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct float1 { - * float x; - * } - * } - */ -public class float1 { - - float1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_FLOAT.withName("x") - ).withName("float1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfFloat x$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * float x - * } - */ - public static final OfFloat x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * float x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float x - * } - */ - public static float x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float x - * } - */ - public static void x(MemorySegment struct, float fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float2.java deleted file mode 100644 index 8362997ea8..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct float2 { - * float x; - * float y; - * } - * } - */ -public class float2 { - - float2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_FLOAT.withName("x"), - PanamaFFMAPI.C_FLOAT.withName("y") - ).withName("float2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfFloat x$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * float x - * } - */ - public static final OfFloat x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * float x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float x - * } - */ - public static float x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float x - * } - */ - public static void x(MemorySegment struct, float fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfFloat y$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * float y - * } - */ - public static final OfFloat y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * float y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float y - * } - */ - public static float y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float y - * } - */ - public static void y(MemorySegment struct, float fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float3.java deleted file mode 100644 index c10ce7b533..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct float3 { - * float x; - * float y; - * float z; - * } - * } - */ -public class float3 { - - float3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_FLOAT.withName("x"), - PanamaFFMAPI.C_FLOAT.withName("y"), - PanamaFFMAPI.C_FLOAT.withName("z") - ).withName("float3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfFloat x$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * float x - * } - */ - public static final OfFloat x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * float x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float x - * } - */ - public static float x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float x - * } - */ - public static void x(MemorySegment struct, float fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfFloat y$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * float y - * } - */ - public static final OfFloat y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * float y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float y - * } - */ - public static float y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float y - * } - */ - public static void y(MemorySegment struct, float fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfFloat z$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * float z - * } - */ - public static final OfFloat z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * float z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float z - * } - */ - public static float z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float z - * } - */ - public static void z(MemorySegment struct, float fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float4.java deleted file mode 100644 index 327bc75734..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/float4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct float4 { - * float x; - * float y; - * float z; - * float w; - * } - * } - */ -public class float4 { - - float4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_FLOAT.withName("x"), - PanamaFFMAPI.C_FLOAT.withName("y"), - PanamaFFMAPI.C_FLOAT.withName("z"), - PanamaFFMAPI.C_FLOAT.withName("w") - ).withName("float4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfFloat x$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * float x - * } - */ - public static final OfFloat x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * float x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float x - * } - */ - public static float x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float x - * } - */ - public static void x(MemorySegment struct, float fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfFloat y$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * float y - * } - */ - public static final OfFloat y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * float y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float y - * } - */ - public static float y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float y - * } - */ - public static void y(MemorySegment struct, float fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfFloat z$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * float z - * } - */ - public static final OfFloat z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * float z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float z - * } - */ - public static float z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float z - * } - */ - public static void z(MemorySegment struct, float fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfFloat w$LAYOUT = (OfFloat)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * float w - * } - */ - public static final OfFloat w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * float w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * float w - * } - */ - public static float w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * float w - * } - */ - public static void w(MemorySegment struct, float fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int1.java deleted file mode 100644 index 46a454be8b..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct int1 { - * int x; - * } - * } - */ -public class int1 { - - int1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x") - ).withName("int1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int2.java deleted file mode 100644 index a435e99805..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct int2 { - * int x; - * int y; - * } - * } - */ -public class int2 { - - int2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x"), - PanamaFFMAPI.C_INT.withName("y") - ).withName("int2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * int y - * } - */ - public static final OfInt y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int y - * } - */ - public static int y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int y - * } - */ - public static void y(MemorySegment struct, int fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int3.java deleted file mode 100644 index 6d538c47b2..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct int3 { - * int x; - * int y; - * int z; - * } - * } - */ -public class int3 { - - int3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x"), - PanamaFFMAPI.C_INT.withName("y"), - PanamaFFMAPI.C_INT.withName("z") - ).withName("int3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * int y - * } - */ - public static final OfInt y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int y - * } - */ - public static int y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int y - * } - */ - public static void y(MemorySegment struct, int fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * int z - * } - */ - public static final OfInt z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * int z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int z - * } - */ - public static int z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int z - * } - */ - public static void z(MemorySegment struct, int fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int4.java deleted file mode 100644 index 79b7f4a4ec..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/int4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct int4 { - * int x; - * int y; - * int z; - * int w; - * } - * } - */ -public class int4 { - - int4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x"), - PanamaFFMAPI.C_INT.withName("y"), - PanamaFFMAPI.C_INT.withName("z"), - PanamaFFMAPI.C_INT.withName("w") - ).withName("int4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * int y - * } - */ - public static final OfInt y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * int y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int y - * } - */ - public static int y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int y - * } - */ - public static void y(MemorySegment struct, int fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * int z - * } - */ - public static final OfInt z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * int z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int z - * } - */ - public static int z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int z - * } - */ - public static void z(MemorySegment struct, int fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfInt w$LAYOUT = (OfInt)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * int w - * } - */ - public static final OfInt w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * int w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * int w - * } - */ - public static int w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * int w - * } - */ - public static void w(MemorySegment struct, int fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long1.java deleted file mode 100644 index 3803bbd7d3..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct long1 { - * long x; - * } - * } - */ -public class long1 { - - long1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("x") - ).withName("long1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long2.java deleted file mode 100644 index 1570cf2f74..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct long2 { - * long x; - * long y; - * } - * } - */ -public class long2 { - - long2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("x"), - PanamaFFMAPI.C_LONG.withName("y") - ).withName("long2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long3.java deleted file mode 100644 index da4fe39901..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct long3 { - * long x; - * long y; - * long z; - * } - * } - */ -public class long3 { - - long3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("x"), - PanamaFFMAPI.C_LONG.withName("y"), - PanamaFFMAPI.C_LONG.withName("z") - ).withName("long3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * long z - * } - */ - public static final OfLong z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * long z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long z - * } - */ - public static long z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long z - * } - */ - public static void z(MemorySegment struct, long fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long4.java deleted file mode 100644 index 43095d882d..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/long4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct long4 { - * long x; - * long y; - * long z; - * long w; - * } - * } - */ -public class long4 { - - long4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("x"), - PanamaFFMAPI.C_LONG.withName("y"), - PanamaFFMAPI.C_LONG.withName("z"), - PanamaFFMAPI.C_LONG.withName("w") - ).withName("long4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * long z - * } - */ - public static final OfLong z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * long z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long z - * } - */ - public static long z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long z - * } - */ - public static void z(MemorySegment struct, long fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfLong w$LAYOUT = (OfLong)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * long w - * } - */ - public static final OfLong w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * long w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long w - * } - */ - public static long w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long w - * } - */ - public static void w(MemorySegment struct, long fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong1.java deleted file mode 100644 index d1c3dcbcfd..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct longlong1 { - * long long x; - * } - * } - */ -public class longlong1 { - - longlong1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("x") - ).withName("longlong1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong2.java deleted file mode 100644 index ec97651d98..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct longlong2 { - * long long x; - * long long y; - * } - * } - */ -public class longlong2 { - - longlong2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("x"), - PanamaFFMAPI.C_LONG_LONG.withName("y") - ).withName("longlong2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * long long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong3.java deleted file mode 100644 index 24be48e3f4..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct longlong3 { - * long long x; - * long long y; - * long long z; - * } - * } - */ -public class longlong3 { - - longlong3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("x"), - PanamaFFMAPI.C_LONG_LONG.withName("y"), - PanamaFFMAPI.C_LONG_LONG.withName("z") - ).withName("longlong3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * long long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long z - * } - */ - public static final OfLong z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * long long z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long z - * } - */ - public static long z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long z - * } - */ - public static void z(MemorySegment struct, long fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong4.java deleted file mode 100644 index 7aa417c7c4..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/longlong4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct longlong4 { - * long long x; - * long long y; - * long long z; - * long long w; - * } - * } - */ -public class longlong4 { - - longlong4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("x"), - PanamaFFMAPI.C_LONG_LONG.withName("y"), - PanamaFFMAPI.C_LONG_LONG.withName("z"), - PanamaFFMAPI.C_LONG_LONG.withName("w") - ).withName("longlong4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * long long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long z - * } - */ - public static final OfLong z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * long long z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long z - * } - */ - public static long z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long z - * } - */ - public static void z(MemorySegment struct, long fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfLong w$LAYOUT = (OfLong)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long w - * } - */ - public static final OfLong w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * long long w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long w - * } - */ - public static long w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long w - * } - */ - public static void w(MemorySegment struct, long fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/max_align_t.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/max_align_t.java deleted file mode 100644 index 5bad1b4e79..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/max_align_t.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct { - * long long __clang_max_align_nonce1; - * long double __clang_max_align_nonce2; - * } - * } - */ -public class max_align_t { - - max_align_t() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("__clang_max_align_nonce1"), - MemoryLayout.paddingLayout(24) - ).withName("$anon$19:9"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong __clang_max_align_nonce1$LAYOUT = (OfLong)$LAYOUT.select(groupElement("__clang_max_align_nonce1")); - - /** - * Layout for field: - * {@snippet lang=c : - * long long __clang_max_align_nonce1 - * } - */ - public static final OfLong __clang_max_align_nonce1$layout() { - return __clang_max_align_nonce1$LAYOUT; - } - - private static final long __clang_max_align_nonce1$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * long long __clang_max_align_nonce1 - * } - */ - public static final long __clang_max_align_nonce1$offset() { - return __clang_max_align_nonce1$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * long long __clang_max_align_nonce1 - * } - */ - public static long __clang_max_align_nonce1(MemorySegment struct) { - return struct.get(__clang_max_align_nonce1$LAYOUT, __clang_max_align_nonce1$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * long long __clang_max_align_nonce1 - * } - */ - public static void __clang_max_align_nonce1(MemorySegment struct, long fieldValue) { - struct.set(__clang_max_align_nonce1$LAYOUT, __clang_max_align_nonce1$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short1.java deleted file mode 100644 index 97507bc89d..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct short1 { - * short x; - * } - * } - */ -public class short1 { - - short1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_SHORT.withName("x") - ).withName("short1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * short x - * } - */ - public static final OfShort x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * short x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short x - * } - */ - public static short x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short x - * } - */ - public static void x(MemorySegment struct, short fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short2.java deleted file mode 100644 index a28a7daf36..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct short2 { - * short x; - * short y; - * } - * } - */ -public class short2 { - - short2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_SHORT.withName("x"), - PanamaFFMAPI.C_SHORT.withName("y") - ).withName("short2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * short x - * } - */ - public static final OfShort x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * short x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short x - * } - */ - public static short x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short x - * } - */ - public static void x(MemorySegment struct, short fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * short y - * } - */ - public static final OfShort y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * short y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short y - * } - */ - public static short y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short y - * } - */ - public static void y(MemorySegment struct, short fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short3.java deleted file mode 100644 index cc90c7d1de..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct short3 { - * short x; - * short y; - * short z; - * } - * } - */ -public class short3 { - - short3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_SHORT.withName("x"), - PanamaFFMAPI.C_SHORT.withName("y"), - PanamaFFMAPI.C_SHORT.withName("z") - ).withName("short3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * short x - * } - */ - public static final OfShort x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * short x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short x - * } - */ - public static short x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short x - * } - */ - public static void x(MemorySegment struct, short fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * short y - * } - */ - public static final OfShort y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * short y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short y - * } - */ - public static short y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short y - * } - */ - public static void y(MemorySegment struct, short fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfShort z$LAYOUT = (OfShort)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * short z - * } - */ - public static final OfShort z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * short z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short z - * } - */ - public static short z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short z - * } - */ - public static void z(MemorySegment struct, short fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short4.java deleted file mode 100644 index de94846397..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/short4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct short4 { - * short x; - * short y; - * short z; - * short w; - * } - * } - */ -public class short4 { - - short4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_SHORT.withName("x"), - PanamaFFMAPI.C_SHORT.withName("y"), - PanamaFFMAPI.C_SHORT.withName("z"), - PanamaFFMAPI.C_SHORT.withName("w") - ).withName("short4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * short x - * } - */ - public static final OfShort x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * short x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short x - * } - */ - public static short x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short x - * } - */ - public static void x(MemorySegment struct, short fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * short y - * } - */ - public static final OfShort y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * short y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short y - * } - */ - public static short y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short y - * } - */ - public static void y(MemorySegment struct, short fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfShort z$LAYOUT = (OfShort)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * short z - * } - */ - public static final OfShort z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * short z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short z - * } - */ - public static short z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short z - * } - */ - public static void z(MemorySegment struct, short fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfShort w$LAYOUT = (OfShort)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * short w - * } - */ - public static final OfShort w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 6; - - /** - * Offset for field: - * {@snippet lang=c : - * short w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * short w - * } - */ - public static short w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * short w - * } - */ - public static void w(MemorySegment struct, short fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar1.java deleted file mode 100644 index efbae3cabc..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct uchar1 { - * unsigned char x; - * } - * } - */ -public class uchar1 { - - uchar1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("x") - ).withName("uchar1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static final OfByte x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static byte x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static void x(MemorySegment struct, byte fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar2.java deleted file mode 100644 index 45a30f3017..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct uchar2 { - * unsigned char x; - * unsigned char y; - * } - * } - */ -public class uchar2 { - - uchar2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("x"), - PanamaFFMAPI.C_CHAR.withName("y") - ).withName("uchar2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static final OfByte x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static byte x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static void x(MemorySegment struct, byte fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static final OfByte y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 1; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static byte y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static void y(MemorySegment struct, byte fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar3.java deleted file mode 100644 index 5d25e05701..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct uchar3 { - * unsigned char x; - * unsigned char y; - * unsigned char z; - * } - * } - */ -public class uchar3 { - - uchar3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("x"), - PanamaFFMAPI.C_CHAR.withName("y"), - PanamaFFMAPI.C_CHAR.withName("z") - ).withName("uchar3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static final OfByte x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static byte x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static void x(MemorySegment struct, byte fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static final OfByte y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 1; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static byte y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static void y(MemorySegment struct, byte fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfByte z$LAYOUT = (OfByte)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char z - * } - */ - public static final OfByte z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char z - * } - */ - public static byte z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char z - * } - */ - public static void z(MemorySegment struct, byte fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar4.java deleted file mode 100644 index 02de3c8418..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uchar4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct uchar4 { - * unsigned char x; - * unsigned char y; - * unsigned char z; - * unsigned char w; - * } - * } - */ -public class uchar4 { - - uchar4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_CHAR.withName("x"), - PanamaFFMAPI.C_CHAR.withName("y"), - PanamaFFMAPI.C_CHAR.withName("z"), - PanamaFFMAPI.C_CHAR.withName("w") - ).withName("uchar4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfByte x$LAYOUT = (OfByte)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static final OfByte x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static byte x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char x - * } - */ - public static void x(MemorySegment struct, byte fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfByte y$LAYOUT = (OfByte)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static final OfByte y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 1; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static byte y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char y - * } - */ - public static void y(MemorySegment struct, byte fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfByte z$LAYOUT = (OfByte)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char z - * } - */ - public static final OfByte z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char z - * } - */ - public static byte z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char z - * } - */ - public static void z(MemorySegment struct, byte fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfByte w$LAYOUT = (OfByte)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned char w - * } - */ - public static final OfByte w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 3; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned char w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned char w - * } - */ - public static byte w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned char w - * } - */ - public static void w(MemorySegment struct, byte fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint1.java deleted file mode 100644 index 8fee0dd4c7..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct uint1 { - * unsigned int x; - * } - * } - */ -public class uint1 { - - uint1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x") - ).withName("uint1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint2.java deleted file mode 100644 index ead3d501b5..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct uint2 { - * unsigned int x; - * unsigned int y; - * } - * } - */ -public class uint2 { - - uint2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x"), - PanamaFFMAPI.C_INT.withName("y") - ).withName("uint2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static final OfInt y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static int y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static void y(MemorySegment struct, int fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint3.java deleted file mode 100644 index b27b5be9fa..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct uint3 { - * unsigned int x; - * unsigned int y; - * unsigned int z; - * } - * } - */ -public class uint3 { - - uint3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x"), - PanamaFFMAPI.C_INT.withName("y"), - PanamaFFMAPI.C_INT.withName("z") - ).withName("uint3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static final OfInt y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static int y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static void y(MemorySegment struct, int fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static final OfInt z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static int z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static void z(MemorySegment struct, int fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint4.java deleted file mode 100644 index 271644377f..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/uint4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct uint4 { - * unsigned int x; - * unsigned int y; - * unsigned int z; - * unsigned int w; - * } - * } - */ -public class uint4 { - - uint4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_INT.withName("x"), - PanamaFFMAPI.C_INT.withName("y"), - PanamaFFMAPI.C_INT.withName("z"), - PanamaFFMAPI.C_INT.withName("w") - ).withName("uint4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfInt x$LAYOUT = (OfInt)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final OfInt x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static int x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int x - * } - */ - public static void x(MemorySegment struct, int fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfInt y$LAYOUT = (OfInt)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static final OfInt y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static int y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int y - * } - */ - public static void y(MemorySegment struct, int fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfInt z$LAYOUT = (OfInt)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static final OfInt z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static int z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int z - * } - */ - public static void z(MemorySegment struct, int fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfInt w$LAYOUT = (OfInt)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned int w - * } - */ - public static final OfInt w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 12; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned int w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned int w - * } - */ - public static int w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned int w - * } - */ - public static void w(MemorySegment struct, int fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong1.java deleted file mode 100644 index 5d620bd467..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ulong1 { - * unsigned long x; - * } - * } - */ -public class ulong1 { - - ulong1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("x") - ).withName("ulong1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong2.java deleted file mode 100644 index bb442743d2..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ulong2 { - * unsigned long x; - * unsigned long y; - * } - * } - */ -public class ulong2 { - - ulong2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("x"), - PanamaFFMAPI.C_LONG.withName("y") - ).withName("ulong2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong3.java deleted file mode 100644 index 983e694b6f..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ulong3 { - * unsigned long x; - * unsigned long y; - * unsigned long z; - * } - * } - */ -public class ulong3 { - - ulong3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("x"), - PanamaFFMAPI.C_LONG.withName("y"), - PanamaFFMAPI.C_LONG.withName("z") - ).withName("ulong3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long z - * } - */ - public static final OfLong z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long z - * } - */ - public static long z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long z - * } - */ - public static void z(MemorySegment struct, long fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong4.java deleted file mode 100644 index 19f33badbd..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulong4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ulong4 { - * unsigned long x; - * unsigned long y; - * unsigned long z; - * unsigned long w; - * } - * } - */ -public class ulong4 { - - ulong4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG.withName("x"), - PanamaFFMAPI.C_LONG.withName("y"), - PanamaFFMAPI.C_LONG.withName("z"), - PanamaFFMAPI.C_LONG.withName("w") - ).withName("ulong4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long z - * } - */ - public static final OfLong z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long z - * } - */ - public static long z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long z - * } - */ - public static void z(MemorySegment struct, long fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfLong w$LAYOUT = (OfLong)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long w - * } - */ - public static final OfLong w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long w - * } - */ - public static long w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long w - * } - */ - public static void w(MemorySegment struct, long fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong1.java deleted file mode 100644 index 8b2918012b..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ulonglong1 { - * unsigned long long x; - * } - * } - */ -public class ulonglong1 { - - ulonglong1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("x") - ).withName("ulonglong1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong2.java deleted file mode 100644 index 276af59c3a..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ulonglong2 { - * unsigned long long x; - * unsigned long long y; - * } - * } - */ -public class ulonglong2 { - - ulonglong2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("x"), - PanamaFFMAPI.C_LONG_LONG.withName("y") - ).withName("ulonglong2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong3.java deleted file mode 100644 index 3fefbeaa8a..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ulonglong3 { - * unsigned long long x; - * unsigned long long y; - * unsigned long long z; - * } - * } - */ -public class ulonglong3 { - - ulonglong3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("x"), - PanamaFFMAPI.C_LONG_LONG.withName("y"), - PanamaFFMAPI.C_LONG_LONG.withName("z") - ).withName("ulonglong3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long z - * } - */ - public static final OfLong z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long z - * } - */ - public static long z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long z - * } - */ - public static void z(MemorySegment struct, long fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong4.java deleted file mode 100644 index 8eed05a1fa..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ulonglong4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ulonglong4 { - * unsigned long long x; - * unsigned long long y; - * unsigned long long z; - * unsigned long long w; - * } - * } - */ -public class ulonglong4 { - - ulonglong4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_LONG_LONG.withName("x"), - PanamaFFMAPI.C_LONG_LONG.withName("y"), - PanamaFFMAPI.C_LONG_LONG.withName("z"), - PanamaFFMAPI.C_LONG_LONG.withName("w") - ).withName("ulonglong4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfLong x$LAYOUT = (OfLong)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static final OfLong x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static long x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long x - * } - */ - public static void x(MemorySegment struct, long fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfLong y$LAYOUT = (OfLong)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static final OfLong y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 8; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static long y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long y - * } - */ - public static void y(MemorySegment struct, long fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfLong z$LAYOUT = (OfLong)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long z - * } - */ - public static final OfLong z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 16; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long z - * } - */ - public static long z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long z - * } - */ - public static void z(MemorySegment struct, long fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfLong w$LAYOUT = (OfLong)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned long long w - * } - */ - public static final OfLong w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 24; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned long long w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned long long w - * } - */ - public static long w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned long long w - * } - */ - public static void w(MemorySegment struct, long fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort1.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort1.java deleted file mode 100644 index db70a8acc9..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ushort1 { - * unsigned short x; - * } - * } - */ -public class ushort1 { - - ushort1() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_SHORT.withName("x") - ).withName("ushort1"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static final OfShort x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static short x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static void x(MemorySegment struct, short fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort2.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort2.java deleted file mode 100644 index d3fe7461b7..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort2.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ushort2 { - * unsigned short x; - * unsigned short y; - * } - * } - */ -public class ushort2 { - - ushort2() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_SHORT.withName("x"), - PanamaFFMAPI.C_SHORT.withName("y") - ).withName("ushort2"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static final OfShort x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static short x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static void x(MemorySegment struct, short fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static final OfShort y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static short y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static void y(MemorySegment struct, short fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort3.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort3.java deleted file mode 100644 index fec929d453..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort3.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ushort3 { - * unsigned short x; - * unsigned short y; - * unsigned short z; - * } - * } - */ -public class ushort3 { - - ushort3() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_SHORT.withName("x"), - PanamaFFMAPI.C_SHORT.withName("y"), - PanamaFFMAPI.C_SHORT.withName("z") - ).withName("ushort3"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static final OfShort x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static short x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static void x(MemorySegment struct, short fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static final OfShort y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static short y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static void y(MemorySegment struct, short fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfShort z$LAYOUT = (OfShort)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short z - * } - */ - public static final OfShort z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short z - * } - */ - public static short z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short z - * } - */ - public static void z(MemorySegment struct, short fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort4.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort4.java deleted file mode 100644 index c39c84b334..0000000000 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ushort4.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY -// Generated by jextract - -package com.nvidia.cuvs.internal.panama; - -import java.lang.invoke.*; -import java.lang.foreign.*; -import java.nio.ByteOrder; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import static java.lang.foreign.ValueLayout.*; -import static java.lang.foreign.MemoryLayout.PathElement.*; - -/** - * {@snippet lang=c : - * struct ushort4 { - * unsigned short x; - * unsigned short y; - * unsigned short z; - * unsigned short w; - * } - * } - */ -public class ushort4 { - - ushort4() { - // Should not be called directly - } - - private static final GroupLayout $LAYOUT = MemoryLayout.structLayout( - PanamaFFMAPI.C_SHORT.withName("x"), - PanamaFFMAPI.C_SHORT.withName("y"), - PanamaFFMAPI.C_SHORT.withName("z"), - PanamaFFMAPI.C_SHORT.withName("w") - ).withName("ushort4"); - - /** - * The layout of this struct - */ - public static final GroupLayout layout() { - return $LAYOUT; - } - - private static final OfShort x$LAYOUT = (OfShort)$LAYOUT.select(groupElement("x")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static final OfShort x$layout() { - return x$LAYOUT; - } - - private static final long x$OFFSET = 0; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static final long x$offset() { - return x$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static short x(MemorySegment struct) { - return struct.get(x$LAYOUT, x$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short x - * } - */ - public static void x(MemorySegment struct, short fieldValue) { - struct.set(x$LAYOUT, x$OFFSET, fieldValue); - } - - private static final OfShort y$LAYOUT = (OfShort)$LAYOUT.select(groupElement("y")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static final OfShort y$layout() { - return y$LAYOUT; - } - - private static final long y$OFFSET = 2; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static final long y$offset() { - return y$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static short y(MemorySegment struct) { - return struct.get(y$LAYOUT, y$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short y - * } - */ - public static void y(MemorySegment struct, short fieldValue) { - struct.set(y$LAYOUT, y$OFFSET, fieldValue); - } - - private static final OfShort z$LAYOUT = (OfShort)$LAYOUT.select(groupElement("z")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short z - * } - */ - public static final OfShort z$layout() { - return z$LAYOUT; - } - - private static final long z$OFFSET = 4; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short z - * } - */ - public static final long z$offset() { - return z$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short z - * } - */ - public static short z(MemorySegment struct) { - return struct.get(z$LAYOUT, z$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short z - * } - */ - public static void z(MemorySegment struct, short fieldValue) { - struct.set(z$LAYOUT, z$OFFSET, fieldValue); - } - - private static final OfShort w$LAYOUT = (OfShort)$LAYOUT.select(groupElement("w")); - - /** - * Layout for field: - * {@snippet lang=c : - * unsigned short w - * } - */ - public static final OfShort w$layout() { - return w$LAYOUT; - } - - private static final long w$OFFSET = 6; - - /** - * Offset for field: - * {@snippet lang=c : - * unsigned short w - * } - */ - public static final long w$offset() { - return w$OFFSET; - } - - /** - * Getter for field: - * {@snippet lang=c : - * unsigned short w - * } - */ - public static short w(MemorySegment struct) { - return struct.get(w$LAYOUT, w$OFFSET); - } - - /** - * Setter for field: - * {@snippet lang=c : - * unsigned short w - * } - */ - public static void w(MemorySegment struct, short fieldValue) { - struct.set(w$LAYOUT, w$OFFSET, fieldValue); - } - - /** - * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}. - * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()} - */ - public static MemorySegment asSlice(MemorySegment array, long index) { - return array.asSlice(layout().byteSize() * index); - } - - /** - * The size (in bytes) of this struct - */ - public static long sizeof() { return layout().byteSize(); } - - /** - * Allocate a segment of size {@code layout().byteSize()} using {@code allocator} - */ - public static MemorySegment allocate(SegmentAllocator allocator) { - return allocator.allocate(layout()); - } - - /** - * Allocate an array of size {@code elementCount} using {@code allocator}. - * The returned segment has size {@code elementCount * layout().byteSize()}. - */ - public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout())); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) { - return reinterpret(addr, 1, arena, cleanup); - } - - /** - * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction} (if any). - * The returned segment has size {@code elementCount * layout().byteSize()} - */ - public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) { - return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup); - } -} From 37cc0d42e2b8444a034a848db95a956de248cbdc Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Mon, 21 Apr 2025 11:44:47 +0530 Subject: [PATCH 17/26] update gitignore --- java/.gitignore | 17 +++++++++++++++++ java/cuvs-java/.gitignore | 2 -- java/examples/.gitignore | 1 - 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 java/.gitignore delete mode 100644 java/cuvs-java/.gitignore delete mode 100644 java/examples/.gitignore diff --git a/java/.gitignore b/java/.gitignore new file mode 100644 index 0000000000..90b22e689e --- /dev/null +++ b/java/.gitignore @@ -0,0 +1,17 @@ +# cuvs-java +/cuvs-java/target/ +/cuvs-java/bin/ +/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ +# internal +/internal/.ninja_deps +/internal/.ninja_log +/internal/CMakeCache.txt +/internal/CMakeFiles/ +/internal/CPM_modules/ +/internal/_deps/ +/internal/build.ninja +/internal/cmake/ +/internal/cmake_install.cmake +/internal/cpm-package-lock.cmake +# examples +/examples/target/ diff --git a/java/cuvs-java/.gitignore b/java/cuvs-java/.gitignore deleted file mode 100644 index 0f630157f4..0000000000 --- a/java/cuvs-java/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/target/ -/bin/ diff --git a/java/examples/.gitignore b/java/examples/.gitignore deleted file mode 100644 index b83d22266a..0000000000 --- a/java/examples/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ From 02cc69f0d2b75bd1ad1ee6530f8ba07934a940ca Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Mon, 21 Apr 2025 12:19:50 +0530 Subject: [PATCH 18/26] update gitignore, add source gpuinfo struct, and simplify script --- java/.gitignore | 1 + .../com/nvidia/cuvs/internal/common/Util.java | 6 +++--- java/panama-bindings/generate-bindings.sh | 21 ++----------------- java/panama-bindings/headers.h | 11 ++++++++++ 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/java/.gitignore b/java/.gitignore index 90b22e689e..7fecd86c00 100644 --- a/java/.gitignore +++ b/java/.gitignore @@ -2,6 +2,7 @@ /cuvs-java/target/ /cuvs-java/bin/ /cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ +/cuvs-java/*.cag # internal /internal/.ninja_deps /internal/.ninja_log diff --git a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/common/Util.java b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/common/Util.java index d628ea34ad..ddf1ea4d7e 100644 --- a/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/common/Util.java +++ b/java/cuvs-java/src/main/java22/com/nvidia/cuvs/internal/common/Util.java @@ -36,7 +36,7 @@ import java.util.List; import com.nvidia.cuvs.GPUInfo; -import com.nvidia.cuvs.internal.panama.GpuInfo; +import com.nvidia.cuvs.internal.panama.gpuInfo; public class Util { @@ -123,10 +123,10 @@ public static List availableGPUs() throws Throwable { * before the function is invoked as cudaGetDeviceCount is inside the * get_gpu_info function. */ - MemorySegment GpuInfoArrayMemorySegment = GpuInfo.allocateArray(1024, localArena); + MemorySegment GpuInfoArrayMemorySegment = gpuInfo.allocateArray(1024, localArena); getGpuInfoMethodHandle.invokeExact(returnValueMemorySegment, numGpuMemorySegment, GpuInfoArrayMemorySegment); int numGPUs = numGpuMemorySegment.get(ValueLayout.JAVA_INT, 0); - MemoryLayout ml = MemoryLayout.sequenceLayout(numGPUs, GpuInfo.layout()); + MemoryLayout ml = MemoryLayout.sequenceLayout(numGPUs, gpuInfo.layout()); for (int i = 0; i < numGPUs; i++) { VarHandle gpuIdVarHandle = ml.varHandle(PathElement.sequenceElement(i), PathElement.groupElement("gpu_id")); VarHandle freeMemoryVarHandle = ml.varHandle(PathElement.sequenceElement(i), diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index dd8a9e0902..b2daf93ace 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -35,26 +35,9 @@ for BINDING_FILE in ${GENERATED_PANAMA_BINDINGS_PATH}/*; do cat ${CURDIR}/license-header.txt $BINDING_FILE > temp && mv temp $BINDING_FILE done -# Update/Add the panama binding classes in the panama java folder (if existing or not present) +# Add the panama binding classes in the panama java folder for GENERATED_PANAMA_JAVA_FILE in ${GENERATED_PANAMA_BINDINGS_PATH}/*; do - CURR_FILENAME=$(basename $GENERATED_PANAMA_JAVA_FILE) - EXISTING_PANAMA_JAVA_FILE="${PANAMA_JAVA_FILES_PATH}/${CURR_FILENAME}" - sed -i '${/^$/d}' $GENERATED_PANAMA_JAVA_FILE # remove last blank line - - if ! test -f $EXISTING_PANAMA_JAVA_FILE; - then - echo "[NEW] ${CURR_FILENAME}" - mv ${GENERATED_PANAMA_BINDINGS_PATH}/${CURR_FILENAME} $PANAMA_JAVA_FILES_PATH - else - if ! cmp --silent -- "$EXISTING_PANAMA_JAVA_FILE" "$GENERATED_PANAMA_JAVA_FILE"; - then - echo "[UPDATE] ${CURR_FILENAME}" - truncate -s 0 $EXISTING_PANAMA_JAVA_FILE # remove current source from the file - cat $GENERATED_PANAMA_JAVA_FILE > $EXISTING_PANAMA_JAVA_FILE # put updated source - else - echo "[IGNORE] ${CURR_FILENAME} (already exists and not changed)" - fi - fi + mv $GENERATED_PANAMA_JAVA_FILE $PANAMA_JAVA_FILES_PATH done # Cleanup diff --git a/java/panama-bindings/headers.h b/java/panama-bindings/headers.h index ee1d46ddc0..d44b997d4d 100644 --- a/java/panama-bindings/headers.h +++ b/java/panama-bindings/headers.h @@ -20,3 +20,14 @@ #include #include #include + +/** + * @brief struct for containing gpu information + */ +typedef struct gpuInfo { + int gpu_id; + char name[256]; + long free_memory; + long total_memory; + float compute_capability; + } gpuInfo; From 53fddbb122afc4603101b96b051e235fc2d15607 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Mon, 21 Apr 2025 13:58:50 +0530 Subject: [PATCH 19/26] add gpuinfo header and simplify script --- java/.gitignore | 1 + java/panama-bindings/generate-bindings.sh | 21 +----------------- java/panama-bindings/gpuinfo.h | 26 +++++++++++++++++++++++ java/panama-bindings/headers.h | 12 +---------- 4 files changed, 29 insertions(+), 31 deletions(-) create mode 100644 java/panama-bindings/gpuinfo.h diff --git a/java/.gitignore b/java/.gitignore index 7fecd86c00..19115ac15e 100644 --- a/java/.gitignore +++ b/java/.gitignore @@ -14,5 +14,6 @@ /internal/cmake/ /internal/cmake_install.cmake /internal/cpm-package-lock.cmake +/internal/Makefile # examples /examples/target/ diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index b2daf93ace..84f44f082f 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -4,17 +4,14 @@ echo "Starting Panama FFM API bindings generation ..." REPODIR=$(cd $(dirname $0); cd ../../ ; pwd) CURDIR=$(cd $(dirname $0); pwd) CUDA_HOME=$(which nvcc | cut -d/ -f-4) -OUTPUT_FOLDER="${CURDIR}/bindings" TARGET_PACKAGE="com.nvidia.cuvs.internal.panama" -GENERATED_PANAMA_BINDINGS_PATH="${OUTPUT_FOLDER}/${TARGET_PACKAGE//./\/}" -PANAMA_JAVA_FILES_PATH="${REPODIR}/java/cuvs-java/src/main/java22/${TARGET_PACKAGE//./\/}" # Use Jextract utility to generate panama bindings jextract \ --include-dir ${REPODIR}/cpp/build/_deps/dlpack-src/include/ \ --include-dir ${CUDA_HOME}/include \ --include-dir ${REPODIR}/cpp/include \ - --output ${OUTPUT_FOLDER} \ + --output "${REPODIR}/java/cuvs-java/src/main/java22/" \ --target-package ${TARGET_PACKAGE} \ --header-class-name PanamaFFMAPI \ ${CURDIR}/headers.h @@ -29,20 +26,4 @@ else exit $JEXTRACT_RETURN_VALUE fi -# Insert license headers in the generated files -for BINDING_FILE in ${GENERATED_PANAMA_BINDINGS_PATH}/*; do - sed -i '1s/^/\n\/\/ NOTE: PLEASE DO NOT EDIT THIS FILE MANUALLY\n/' $BINDING_FILE - cat ${CURDIR}/license-header.txt $BINDING_FILE > temp && mv temp $BINDING_FILE -done - -# Add the panama binding classes in the panama java folder -for GENERATED_PANAMA_JAVA_FILE in ${GENERATED_PANAMA_BINDINGS_PATH}/*; do - mv $GENERATED_PANAMA_JAVA_FILE $PANAMA_JAVA_FILES_PATH -done - -# Cleanup -if test -d $OUTPUT_FOLDER; then - rm -rf $OUTPUT_FOLDER -fi - echo "Panama FFM API bindings generation done" diff --git a/java/panama-bindings/gpuinfo.h b/java/panama-bindings/gpuinfo.h new file mode 100644 index 0000000000..dfd7e7444b --- /dev/null +++ b/java/panama-bindings/gpuinfo.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2025, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @brief struct for containing gpu information + */ +typedef struct gpuInfo { + int gpu_id; + char name[256]; + long free_memory; + long total_memory; + float compute_capability; +} gpuInfo; diff --git a/java/panama-bindings/headers.h b/java/panama-bindings/headers.h index d44b997d4d..2b035f23d3 100644 --- a/java/panama-bindings/headers.h +++ b/java/panama-bindings/headers.h @@ -20,14 +20,4 @@ #include #include #include - -/** - * @brief struct for containing gpu information - */ -typedef struct gpuInfo { - int gpu_id; - char name[256]; - long free_memory; - long total_memory; - float compute_capability; - } gpuInfo; +#include "gpuinfo.h" From 806af86a5b9e9140dde97db3fea9565100b460c2 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Mon, 21 Apr 2025 14:01:41 +0530 Subject: [PATCH 20/26] remove license header and a gitignore file --- java/panama-bindings/.gitignore | 1 - java/panama-bindings/license-header.txt | 15 --------------- 2 files changed, 16 deletions(-) delete mode 100644 java/panama-bindings/.gitignore delete mode 100644 java/panama-bindings/license-header.txt diff --git a/java/panama-bindings/.gitignore b/java/panama-bindings/.gitignore deleted file mode 100644 index a1277a61cf..0000000000 --- a/java/panama-bindings/.gitignore +++ /dev/null @@ -1 +0,0 @@ -bindings/ diff --git a/java/panama-bindings/license-header.txt b/java/panama-bindings/license-header.txt deleted file mode 100644 index 2001ad3d3a..0000000000 --- a/java/panama-bindings/license-header.txt +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2025, NVIDIA CORPORATION. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ From b516348f0cd50d324b9a74d666e41dfc057107b4 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Thu, 24 Apr 2025 13:17:54 +0530 Subject: [PATCH 21/26] adding jextract to prerequisites in readme --- java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/java/README.md b/java/README.md index bc9c27f638..24ce92881f 100644 --- a/java/README.md +++ b/java/README.md @@ -11,6 +11,7 @@ CuVS Java API provides a Java based simple, efficient, and a robust vector searc - [CuVS libraries](https://docs.rapids.ai/api/cuvs/stable/build/#build-from-source) - [maven 3.9.6 or above](https://maven.apache.org/download.cgi) - [JDK 22](https://openjdk.org/projects/jdk/22/) +- [jextract for JDK 22](https://jdk.java.net/jextract/) ## Building From 570fa2a7a792b39cb70c4ff1232661481ba8ecaa Mon Sep 17 00:00:00 2001 From: Ishan Chattopadhyaya Date: Thu, 24 Apr 2025 13:53:10 +0530 Subject: [PATCH 22/26] Download jextract-22 if not already present --- java/README.md | 2 +- java/panama-bindings/generate-bindings.sh | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/java/README.md b/java/README.md index 24ce92881f..c032fa36fe 100644 --- a/java/README.md +++ b/java/README.md @@ -11,7 +11,7 @@ CuVS Java API provides a Java based simple, efficient, and a robust vector searc - [CuVS libraries](https://docs.rapids.ai/api/cuvs/stable/build/#build-from-source) - [maven 3.9.6 or above](https://maven.apache.org/download.cgi) - [JDK 22](https://openjdk.org/projects/jdk/22/) -- [jextract for JDK 22](https://jdk.java.net/jextract/) +- [jextract for JDK 22](https://jdk.java.net/jextract/) (If not already installed, the build script downloads it) ## Building diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index 84f44f082f..7e1bb72a4f 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -6,8 +6,20 @@ CURDIR=$(cd $(dirname $0); pwd) CUDA_HOME=$(which nvcc | cut -d/ -f-4) TARGET_PACKAGE="com.nvidia.cuvs.internal.panama" +JEXTRACT_COMMAND="jextract" + +if [[ `command -v jextract` == "" ]]; +then + JEXTRACT_DOWNLOAD_URL="https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz" + echo "jextract doesn't exist. Downloading it from $JEXTRACT_DOWNLOAD_URL."; + wget -c $JEXTRACT_DOWNLOAD_URL + tar -xvf openjdk-22-jextract+6-47_linux-x64_bin.tar.gz + JEXTRACT_COMMAND="jextract-22/bin/jextract" + echo "jextract downloaded to `pwd`/jextract-22" +fi + # Use Jextract utility to generate panama bindings -jextract \ +$JEXTRACT_COMMAND \ --include-dir ${REPODIR}/cpp/build/_deps/dlpack-src/include/ \ --include-dir ${CUDA_HOME}/include \ --include-dir ${REPODIR}/cpp/include \ From 6dfef85c30ad79f6cd0ff4e761b9db688be1b8b7 Mon Sep 17 00:00:00 2001 From: Ishan Chattopadhyaya Date: Thu, 24 Apr 2025 23:47:33 +0530 Subject: [PATCH 23/26] Debug printing of the CUDA_HOME path, to aid troubleshooting in CI env --- java/panama-bindings/generate-bindings.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index 7e1bb72a4f..6791f6a0ef 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -18,6 +18,14 @@ then echo "jextract downloaded to `pwd`/jextract-22" fi +#Debug printing +echo "CUDA_HOME points to: $CUDA_HOME" +echo "Include dir in CUDA_HOME has:" +ls $CUDA_HOME/include +echo "JEXTRACT_COMMAND points to: $JEXTRACT_COMMAND" +echo "CURDIR is: $CURDIR" +echo "REPODIR is: $REPODIR" + # Use Jextract utility to generate panama bindings $JEXTRACT_COMMAND \ --include-dir ${REPODIR}/cpp/build/_deps/dlpack-src/include/ \ From 306229d29b0123bc7f6e72adca6e7d155047f528 Mon Sep 17 00:00:00 2001 From: Ishan Chattopadhyaya Date: Fri, 25 Apr 2025 00:02:20 +0530 Subject: [PATCH 24/26] Fallback to /usr/local/cuda in case we're unable to find a include dir in CUDA_HOME --- java/panama-bindings/generate-bindings.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index 6791f6a0ef..0e0a6f80fa 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -6,6 +6,20 @@ CURDIR=$(cd $(dirname $0); pwd) CUDA_HOME=$(which nvcc | cut -d/ -f-4) TARGET_PACKAGE="com.nvidia.cuvs.internal.panama" +# Try to verify that a include directory exists inside CUDA_HOME +if [ ! -d "$CUDA_HOME/include" ]; +then + echo "$CUDA_HOME/include does not exist." + if [ -d "/usr/local/cuda/include" ]; + then + echo "Setting CUDA_HOME to /usr/local/cuda" + CUDA_HOME=/usr/local/cuda + else + echo "Couldn't find a suitable CUDA include directory." + exit 1 + fi +fi + JEXTRACT_COMMAND="jextract" if [[ `command -v jextract` == "" ]]; @@ -18,9 +32,9 @@ then echo "jextract downloaded to `pwd`/jextract-22" fi -#Debug printing +# Debug printing echo "CUDA_HOME points to: $CUDA_HOME" -echo "Include dir in CUDA_HOME has:" +echo "include dir in CUDA_HOME has:" ls $CUDA_HOME/include echo "JEXTRACT_COMMAND points to: $JEXTRACT_COMMAND" echo "CURDIR is: $CURDIR" From 5bf89615e07c582716977b1dc5b15b7837d25de8 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Mon, 28 Apr 2025 18:00:36 +0530 Subject: [PATCH 25/26] build c wrapper before generating panama bindings --- java/build.sh | 9 +++--- java/panama-bindings/generate-bindings.sh | 34 +++++++++++------------ 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/java/build.sh b/java/build.sh index 022746d797..9657706ac3 100755 --- a/java/build.sh +++ b/java/build.sh @@ -3,9 +3,12 @@ GROUP_ID="com.nvidia.cuvs" SO_FILE_PATH="./internal" if [ -z "$CMAKE_PREFIX_PATH" ]; then - export CMAKE_PREFIX_PATH=`pwd`/../cpp/build + export CMAKE_PREFIX_PATH=`pwd`/../cpp/build fi +cd internal && cmake . && cmake --build . \ + && cd .. + # Generate Panama FFM API bindings and update (if any of them changed) /bin/bash panama-bindings/generate-bindings.sh @@ -17,9 +20,7 @@ then exit 1 fi -cd internal && cmake . && cmake --build . \ - && cd .. \ - && mvn install:install-file -DgroupId=$GROUP_ID -DartifactId=cuvs-java-internal -Dversion=$VERSION -Dpackaging=so -Dfile=$SO_FILE_PATH/libcuvs_java.so \ +mvn install:install-file -DgroupId=$GROUP_ID -DartifactId=cuvs-java-internal -Dversion=$VERSION -Dpackaging=so -Dfile=$SO_FILE_PATH/libcuvs_java.so \ && cd cuvs-java \ && mvn verify \ && mvn install:install-file -Dfile=./target/cuvs-java-$VERSION-jar-with-dependencies.jar -DgroupId=$GROUP_ID -DartifactId=cuvs-java -Dversion=$VERSION -Dpackaging=jar diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index 0e0a6f80fa..2d341ecca2 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -7,29 +7,29 @@ CUDA_HOME=$(which nvcc | cut -d/ -f-4) TARGET_PACKAGE="com.nvidia.cuvs.internal.panama" # Try to verify that a include directory exists inside CUDA_HOME -if [ ! -d "$CUDA_HOME/include" ]; +if [ ! -d "$CUDA_HOME/include" ]; then - echo "$CUDA_HOME/include does not exist." - if [ -d "/usr/local/cuda/include" ]; - then - echo "Setting CUDA_HOME to /usr/local/cuda" - CUDA_HOME=/usr/local/cuda - else - echo "Couldn't find a suitable CUDA include directory." - exit 1 - fi + echo "$CUDA_HOME/include does not exist." + if [ -d "/usr/local/cuda/include" ]; + then + echo "Setting CUDA_HOME to /usr/local/cuda" + CUDA_HOME=/usr/local/cuda + else + echo "Couldn't find a suitable CUDA include directory." + exit 1 + fi fi JEXTRACT_COMMAND="jextract" if [[ `command -v jextract` == "" ]]; then - JEXTRACT_DOWNLOAD_URL="https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz" - echo "jextract doesn't exist. Downloading it from $JEXTRACT_DOWNLOAD_URL."; - wget -c $JEXTRACT_DOWNLOAD_URL - tar -xvf openjdk-22-jextract+6-47_linux-x64_bin.tar.gz - JEXTRACT_COMMAND="jextract-22/bin/jextract" - echo "jextract downloaded to `pwd`/jextract-22" + JEXTRACT_DOWNLOAD_URL="https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz" + echo "jextract doesn't exist. Downloading it from $JEXTRACT_DOWNLOAD_URL."; + wget -c $JEXTRACT_DOWNLOAD_URL + tar -xvf openjdk-22-jextract+6-47_linux-x64_bin.tar.gz + JEXTRACT_COMMAND="jextract-22/bin/jextract" + echo "jextract downloaded to `pwd`/jextract-22" fi # Debug printing @@ -42,7 +42,7 @@ echo "REPODIR is: $REPODIR" # Use Jextract utility to generate panama bindings $JEXTRACT_COMMAND \ - --include-dir ${REPODIR}/cpp/build/_deps/dlpack-src/include/ \ + --include-dir ${REPODIR}/java/internal/_deps/dlpack-src/include/ \ --include-dir ${CUDA_HOME}/include \ --include-dir ${REPODIR}/cpp/include \ --output "${REPODIR}/java/cuvs-java/src/main/java22/" \ From 24f127ae7d065e31423b97bf2d8840c4ffcdf230 Mon Sep 17 00:00:00 2001 From: Vivek Narang Date: Thu, 1 May 2025 01:30:06 +0530 Subject: [PATCH 26/26] review updates --- java/.gitignore | 12 ------ java/build.sh | 25 ++++++------- .../java/com/nvidia/cuvs/BruteForceQuery.java | 2 +- java/panama-bindings/generate-bindings.sh | 37 +++++-------------- 4 files changed, 22 insertions(+), 54 deletions(-) diff --git a/java/.gitignore b/java/.gitignore index 19115ac15e..815e71455b 100644 --- a/java/.gitignore +++ b/java/.gitignore @@ -3,17 +3,5 @@ /cuvs-java/bin/ /cuvs-java/src/main/java22/com/nvidia/cuvs/internal/panama/ /cuvs-java/*.cag -# internal -/internal/.ninja_deps -/internal/.ninja_log -/internal/CMakeCache.txt -/internal/CMakeFiles/ -/internal/CPM_modules/ -/internal/_deps/ -/internal/build.ninja -/internal/cmake/ -/internal/cmake_install.cmake -/internal/cpm-package-lock.cmake -/internal/Makefile # examples /examples/target/ diff --git a/java/build.sh b/java/build.sh index 9657706ac3..84e44c71f9 100755 --- a/java/build.sh +++ b/java/build.sh @@ -1,25 +1,22 @@ +#!/bin/bash + +set -e -u -o pipefail + VERSION="25.06.0" # Note: The version is updated automatically when ci/release/update-version.sh is invoked GROUP_ID="com.nvidia.cuvs" -SO_FILE_PATH="./internal" +SO_FILE_PATH="./internal/build" -if [ -z "$CMAKE_PREFIX_PATH" ]; then - export CMAKE_PREFIX_PATH=`pwd`/../cpp/build +if [ -z "${CMAKE_PREFIX_PATH:=}" ]; then + export CMAKE_PREFIX_PATH="$(pwd)/../cpp/build" fi -cd internal && cmake . && cmake --build . \ - && cd .. +cmake -B ./internal/build -S ./internal +cmake --build ./internal/build # Generate Panama FFM API bindings and update (if any of them changed) -/bin/bash panama-bindings/generate-bindings.sh - -BINDINGS_GENERATION_RETURN_VALUE=$? -if [ $BINDINGS_GENERATION_RETURN_VALUE != 0 ] -then - echo "Bindings generation did not complete normally (returned value ${BINDINGS_GENERATION_RETURN_VALUE})" - echo "Forcing this build process to abort" - exit 1 -fi +./panama-bindings/generate-bindings.sh +# Build the java layer mvn install:install-file -DgroupId=$GROUP_ID -DartifactId=cuvs-java-internal -Dversion=$VERSION -Dpackaging=so -Dfile=$SO_FILE_PATH/libcuvs_java.so \ && cd cuvs-java \ && mvn verify \ diff --git a/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java b/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java index f99fca11a3..70fa662210 100644 --- a/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java +++ b/java/cuvs-java/src/main/java/com/nvidia/cuvs/BruteForceQuery.java @@ -40,7 +40,7 @@ public class BruteForceQuery { * @param queryVectors 2D float query vector array * @param mapping an instance of ID mapping * @param topK the top k results to return - * @param prefilters the prefilters data to use while searching the BRUTEFORCE + * @param prefilters the prefilters data to use while searching the BRUTEFORCE * index * @param numDocs Maximum of bits in each prefilter, representing number of documents in this index. * Used only when prefilter(s) is/are passed. diff --git a/java/panama-bindings/generate-bindings.sh b/java/panama-bindings/generate-bindings.sh index 2d341ecca2..3984d4a16c 100755 --- a/java/panama-bindings/generate-bindings.sh +++ b/java/panama-bindings/generate-bindings.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e -u -o pipefail + echo "Starting Panama FFM API bindings generation ..." REPODIR=$(cd $(dirname $0); cd ../../ ; pwd) CURDIR=$(cd $(dirname $0); pwd) @@ -20,44 +22,25 @@ then fi fi -JEXTRACT_COMMAND="jextract" - if [[ `command -v jextract` == "" ]]; then - JEXTRACT_DOWNLOAD_URL="https://download.java.net/java/early_access/jextract/22/6/openjdk-22-jextract+6-47_linux-x64_bin.tar.gz" + JEXTRACT_FILENAME="openjdk-22-jextract+6-47_linux-x64_bin.tar.gz" + JEXTRACT_DOWNLOAD_URL="https://download.java.net/java/early_access/jextract/22/6/${JEXTRACT_FILENAME}" echo "jextract doesn't exist. Downloading it from $JEXTRACT_DOWNLOAD_URL."; wget -c $JEXTRACT_DOWNLOAD_URL - tar -xvf openjdk-22-jextract+6-47_linux-x64_bin.tar.gz - JEXTRACT_COMMAND="jextract-22/bin/jextract" - echo "jextract downloaded to `pwd`/jextract-22" + tar -xvf ./"${JEXTRACT_FILENAME}" + export PATH="$(pwd)/jextract-22/bin/jextract:${PATH}" + echo "jextract downloaded to $(pwd)/jextract-22" fi -# Debug printing -echo "CUDA_HOME points to: $CUDA_HOME" -echo "include dir in CUDA_HOME has:" -ls $CUDA_HOME/include -echo "JEXTRACT_COMMAND points to: $JEXTRACT_COMMAND" -echo "CURDIR is: $CURDIR" -echo "REPODIR is: $REPODIR" - # Use Jextract utility to generate panama bindings -$JEXTRACT_COMMAND \ - --include-dir ${REPODIR}/java/internal/_deps/dlpack-src/include/ \ - --include-dir ${CUDA_HOME}/include \ +jextract \ + --include-dir ${REPODIR}/java/internal/build/_deps/dlpack-src/include/ \ + --include-dir ${CUDA_HOME}/targets/x86_64-linux/include \ --include-dir ${REPODIR}/cpp/include \ --output "${REPODIR}/java/cuvs-java/src/main/java22/" \ --target-package ${TARGET_PACKAGE} \ --header-class-name PanamaFFMAPI \ ${CURDIR}/headers.h -# Did Jextract complete normally? If not, stop and return -JEXTRACT_RETURN_VALUE=$? -if [ $JEXTRACT_RETURN_VALUE == 0 ] -then - echo "Jextract SUCCESS" -else - echo "Jextract encountered issues (returned value ${JEXTRACT_RETURN_VALUE})" - exit $JEXTRACT_RETURN_VALUE -fi - echo "Panama FFM API bindings generation done"