diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/about.json b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..007ee6ab7a21313f4f691143447ddd240dcc0a7e --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/about.json @@ -0,0 +1,165 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/r", + "https://repo.anaconda.com/pkgs/main" + ], + "conda_build_version": "25.1.2", + "conda_version": "25.1.1", + "description": "CUDA internal headers.\n", + "doc_url": "https://docs.nvidia.com/cuda/index.html", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "feedstock-name": "cuda-nvcc-impl", + "final": true, + "parent_recipe": { + "name": "cuda-nvcc-impl-split", + "path": "/home/task_175891970154079/cuda-nvcc-impl-feedstock/recipe", + "version": "12.8.93" + }, + "recipe-maintainers": [ + "conda-forge/cuda" + ] + }, + "home": "https://developer.nvidia.com/cuda-toolkit", + "identifiers": [], + "keywords": [], + "license": "LicenseRef-NVIDIA-End-User-License-Agreement", + "license_file": "LICENSE", + "license_url": "https://docs.nvidia.com/cuda/eula/index.html", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.9.9 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025a h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.6.4 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "liblief 0.12.3 h6a678d5_0", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xz 5.4.6 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxml2 2.13.5 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "tk 8.6.14 h39e8969_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.20.1 h143b758_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.45.3 h5eee18b_0", + "libcurl 8.11.1 hc9e6f67_0", + "python 3.12.9 h5148396_0", + "libmamba 2.0.5 haf1ee3a_1", + "menuinst 2.2.0 py312h06a4308_1", + "anaconda-anon-usage 0.5.0 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 24.1.0 py312h06a4308_0", + "brotli-python 1.0.9 py312h6a678d5_9", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 3.10.0 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.15.1 py312h06a4308_1", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.8 py312h5eee18b_0", + "setuptools 75.8.0 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.0 py312h06a4308_0", + "ruamel.yaml 0.18.6 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "urllib3 2.3.0 py312h06a4308_0", + "cryptography 43.0.3 py312h7825ff9_1", + "pydantic-core 2.27.1 py312h4aa5aa6_0", + "requests 2.32.3 py312h06a4308_1", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "conda-package-streaming 0.11.0 py312h06a4308_0", + "pydantic 2.10.3 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda 25.1.1 py312h06a4308_0", + "conda-anaconda-tos 0.1.2 py312h06a4308_0", + "conda-libmamba-solver 25.1.1 pyhd3eb1b0_0", + "libsodium 1.0.18 h7b6447c_0", + "openssl 3.0.17 h5eee18b_0", + "patch 2.8 hb25bd0a_0", + "patchelf 0.17.2 h6a678d5_0", + "yaml 0.2.5 h7b6447c_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 24.3.0 py312h06a4308_0", + "certifi 2025.8.3 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_0", + "filelock 3.17.0 py312h06a4308_0", + "jmespath 1.0.1 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "more-itertools 10.3.0 py312h06a4308_0", + "pkginfo 1.12.0 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_0", + "py-lief 0.12.3 py312h6a678d5_0", + "python-libarchive-c 5.1 pyhd3eb1b0_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.22.3 py312h4aa5aa6_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.2 py312h06a4308_0", + "xmltodict 0.14.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.30.2 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.13.5 py312h06a4308_0", + "botocore 1.37.10 py312h06a4308_0", + "jsonschema-specifications 2023.7.1 py312h06a4308_0", + "pynacl 1.5.0 py312h5eee18b_1", + "jsonschema 4.25.0 py312h06a4308_0", + "s3transfer 0.11.2 py312h06a4308_0", + "boto3 1.37.10 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.5.0 py312h06a4308_0", + "conda-build 25.1.2 py312h06a4308_0" + ], + "summary": "CUDA internal headers.", + "tags": [] +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/files b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/files new file mode 100644 index 0000000000000000000000000000000000000000..2d614cdaf74741d8ccc27b6c3b4701c971a8889c --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/files @@ -0,0 +1,25 @@ +targets/x86_64-linux/include/crt/common_functions.h +targets/x86_64-linux/include/crt/cudacc_ext.h +targets/x86_64-linux/include/crt/device_double_functions.h +targets/x86_64-linux/include/crt/device_double_functions.hpp +targets/x86_64-linux/include/crt/device_fp128_functions.h +targets/x86_64-linux/include/crt/device_functions.h +targets/x86_64-linux/include/crt/device_functions.hpp +targets/x86_64-linux/include/crt/func_macro.h +targets/x86_64-linux/include/crt/host_config.h +targets/x86_64-linux/include/crt/host_defines.h +targets/x86_64-linux/include/crt/host_runtime.h +targets/x86_64-linux/include/crt/math_functions.h +targets/x86_64-linux/include/crt/math_functions.hpp +targets/x86_64-linux/include/crt/mma.h +targets/x86_64-linux/include/crt/mma.hpp +targets/x86_64-linux/include/crt/nvfunctional +targets/x86_64-linux/include/crt/sm_100_rt.h +targets/x86_64-linux/include/crt/sm_100_rt.hpp +targets/x86_64-linux/include/crt/sm_70_rt.h +targets/x86_64-linux/include/crt/sm_70_rt.hpp +targets/x86_64-linux/include/crt/sm_80_rt.h +targets/x86_64-linux/include/crt/sm_80_rt.hpp +targets/x86_64-linux/include/crt/sm_90_rt.h +targets/x86_64-linux/include/crt/sm_90_rt.hpp +targets/x86_64-linux/include/crt/storage_class.h diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/git b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/hash_input.json b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..e1489271625fa4f5548417553f3725447d4df321 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/hash_input.json @@ -0,0 +1,4 @@ +{ + "channel_targets": "defaults", + "target_platform": "linux-64" +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/index.json b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..eb5f03fb59977312c9fe1be0e824cf3584b61e14 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/index.json @@ -0,0 +1,15 @@ +{ + "arch": null, + "build": "h06a4308_3", + "build_number": 3, + "depends": [ + "cuda-version >=12.8,<12.9.0a0" + ], + "license": "LicenseRef-NVIDIA-End-User-License-Agreement", + "name": "cuda-crt-dev_linux-64", + "noarch": "generic", + "platform": null, + "subdir": "noarch", + "timestamp": 1758920527917, + "version": "12.8.93" +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/licenses/LICENSE b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6622367aff6567f25c18f500137a36caf101ea50 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/licenses/LICENSE @@ -0,0 +1,1632 @@ +End User License Agreement +-------------------------- + +NVIDIA Software License Agreement and CUDA Supplement to +Software License Agreement. + +The CUDA Toolkit End User License Agreement applies to the +NVIDIA CUDA Toolkit, the NVIDIA CUDA Samples, the NVIDIA +Display Driver, NVIDIA Nsight tools (Visual Studio Edition), +and the associated documentation on CUDA APIs, programming +model and development tools. If you do not agree with the +terms and conditions of the license agreement, then do not +download or use the software. + +Last updated: January 12, 2024. + + +Preface +------- + +The Software License Agreement in Chapter 1 and the Supplement +in Chapter 2 contain license terms and conditions that govern +the use of NVIDIA toolkit. By accepting this agreement, you +agree to comply with all the terms and conditions applicable +to the product(s) included herein. + + +NVIDIA Driver + + +Description + +This package contains the operating system driver and +fundamental system software components for NVIDIA GPUs. + + +NVIDIA CUDA Toolkit + + +Description + +The NVIDIA CUDA Toolkit provides command-line and graphical +tools for building, debugging and optimizing the performance +of applications accelerated by NVIDIA GPUs, runtime and math +libraries, and documentation including programming guides, +user manuals, and API references. + + +Default Install Location of CUDA Toolkit + +Windows platform: + +%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v#.# + +Linux platform: + +/usr/local/cuda-#.# + +Mac platform: + +/Developer/NVIDIA/CUDA-#.# + + +NVIDIA CUDA Samples + + +Description + +CUDA Samples are now located in +https://github.com/nvidia/cuda-samples, which includes +instructions for obtaining, building, and running the samples. +They are no longer included in the CUDA toolkit. + + +NVIDIA Nsight Visual Studio Edition (Windows only) + + +Description + +NVIDIA Nsight Development Platform, Visual Studio Edition is a +development environment integrated into Microsoft Visual +Studio that provides tools for debugging, profiling, analyzing +and optimizing your GPU computing and graphics applications. + + +Default Install Location of Nsight Visual Studio Edition + +Windows platform: + +%ProgramFiles(x86)%\NVIDIA Corporation\Nsight Visual Studio Edition #.# + + +1. License Agreement for NVIDIA Software Development Kits +--------------------------------------------------------- + + +Important Notice—Read before downloading, installing, +copying or using the licensed software: +------------------------------------------------------- + +This license agreement, including exhibits attached +("Agreement”) is a legal agreement between you and NVIDIA +Corporation ("NVIDIA") and governs your use of a NVIDIA +software development kit (“SDK”). + +Each SDK has its own set of software and materials, but here +is a description of the types of items that may be included in +a SDK: source code, header files, APIs, data sets and assets +(examples include images, textures, models, scenes, videos, +native API input/output files), binary software, sample code, +libraries, utility programs, programming code and +documentation. + +This Agreement can be accepted only by an adult of legal age +of majority in the country in which the SDK is used. + +If you are entering into this Agreement on behalf of a company +or other legal entity, you represent that you have the legal +authority to bind the entity to this Agreement, in which case +“you” will mean the entity you represent. + +If you don’t have the required age or authority to accept +this Agreement, or if you don’t accept all the terms and +conditions of this Agreement, do not download, install or use +the SDK. + +You agree to use the SDK only for purposes that are permitted +by (a) this Agreement, and (b) any applicable law, regulation +or generally accepted practices or guidelines in the relevant +jurisdictions. + + +1.1. License + + +1.1.1. License Grant + +Subject to the terms of this Agreement, NVIDIA hereby grants +you a non-exclusive, non-transferable license, without the +right to sublicense (except as expressly provided in this +Agreement) to: + + 1. Install and use the SDK, + + 2. Modify and create derivative works of sample source code + delivered in the SDK, and + + 3. Distribute those portions of the SDK that are identified + in this Agreement as distributable, as incorporated in + object code format into a software application that meets + the distribution requirements indicated in this Agreement. + + +1.1.2. Distribution Requirements + +These are the distribution requirements for you to exercise +the distribution grant: + + 1. Your application must have material additional + functionality, beyond the included portions of the SDK. + + 2. The distributable portions of the SDK shall only be + accessed by your application. + + 3. The following notice shall be included in modifications + and derivative works of sample source code distributed: + “This software contains source code provided by NVIDIA + Corporation.” + + 4. Unless a developer tool is identified in this Agreement + as distributable, it is delivered for your internal use + only. + + 5. The terms under which you distribute your application + must be consistent with the terms of this Agreement, + including (without limitation) terms relating to the + license grant and license restrictions and protection of + NVIDIA’s intellectual property rights. Additionally, you + agree that you will protect the privacy, security and + legal rights of your application users. + + 6. You agree to notify NVIDIA in writing of any known or + suspected distribution or use of the SDK not in compliance + with the requirements of this Agreement, and to enforce + the terms of your agreements with respect to distributed + SDK. + + +1.1.3. Authorized Users + +You may allow employees and contractors of your entity or of +your subsidiary(ies) to access and use the SDK from your +secure network to perform work on your behalf. + +If you are an academic institution you may allow users +enrolled or employed by the academic institution to access and +use the SDK from your secure network. + +You are responsible for the compliance with the terms of this +Agreement by your authorized users. If you become aware that +your authorized users didn’t follow the terms of this +Agreement, you agree to take reasonable steps to resolve the +non-compliance and prevent new occurrences. + + +1.1.4. Pre-Release SDK + +The SDK versions identified as alpha, beta, preview or +otherwise as pre-release, may not be fully functional, may +contain errors or design flaws, and may have reduced or +different security, privacy, accessibility, availability, and +reliability standards relative to commercial versions of +NVIDIA software and materials. Use of a pre-release SDK may +result in unexpected results, loss of data, project delays or +other unpredictable damage or loss. + +You may use a pre-release SDK at your own risk, understanding +that pre-release SDKs are not intended for use in production +or business-critical systems. + +NVIDIA may choose not to make available a commercial version +of any pre-release SDK. NVIDIA may also choose to abandon +development and terminate the availability of a pre-release +SDK at any time without liability. + + +1.1.5. Updates + +NVIDIA may, at its option, make available patches, workarounds +or other updates to this SDK. Unless the updates are provided +with their separate governing terms, they are deemed part of +the SDK licensed to you as provided in this Agreement. You +agree that the form and content of the SDK that NVIDIA +provides may change without prior notice to you. While NVIDIA +generally maintains compatibility between versions, NVIDIA may +in some cases make changes that introduce incompatibilities in +future versions of the SDK. + + +1.1.6. Components Under Other Licenses + +The SDK may come bundled with, or otherwise include or be +distributed with, NVIDIA or third-party components with +separate legal notices or terms as may be described in +proprietary notices accompanying the SDK. If and to the extent +there is a conflict between the terms in this Agreement and +the license terms associated with the component, the license +terms associated with the components control only to the +extent necessary to resolve the conflict. + +Subject to the other terms of this Agreement, you may use the +SDK to develop and test applications released under Open +Source Initiative (OSI) approved open source software +licenses. + + +1.1.7. Reservation of Rights + +NVIDIA reserves all rights, title, and interest in and to the +SDK, not expressly granted to you under this Agreement. + + +1.2. Limitations + +The following license limitations apply to your use of the +SDK: + + 1. You may not reverse engineer, decompile or disassemble, + or remove copyright or other proprietary notices from any + portion of the SDK or copies of the SDK. + + 2. Except as expressly provided in this Agreement, you may + not copy, sell, rent, sublicense, transfer, distribute, + modify, or create derivative works of any portion of the + SDK. For clarity, you may not distribute or sublicense the + SDK as a stand-alone product. + + 3. Unless you have an agreement with NVIDIA for this + purpose, you may not indicate that an application created + with the SDK is sponsored or endorsed by NVIDIA. + + 4. You may not bypass, disable, or circumvent any + encryption, security, digital rights management or + authentication mechanism in the SDK. + + 5. You may not use the SDK in any manner that would cause it + to become subject to an open source software license. As + examples, licenses that require as a condition of use, + modification, and/or distribution that the SDK be: + + a. Disclosed or distributed in source code form; + + b. Licensed for the purpose of making derivative works; + or + + c. Redistributable at no charge. + + 6. You acknowledge that the SDK as delivered is not tested + or certified by NVIDIA for use in connection with the + design, construction, maintenance, and/or operation of any + system where the use or failure of such system could + result in a situation that threatens the safety of human + life or results in catastrophic damages (each, a "Critical + Application"). Examples of Critical Applications include + use in avionics, navigation, autonomous vehicle + applications, ai solutions for automotive products, + military, medical, life support or other life critical + applications. NVIDIA shall not be liable to you or any + third party, in whole or in part, for any claims or + damages arising from such uses. You are solely responsible + for ensuring that any product or service developed with + the SDK as a whole includes sufficient features to comply + with all applicable legal and regulatory standards and + requirements. + + 7. You agree to defend, indemnify and hold harmless NVIDIA + and its affiliates, and their respective employees, + contractors, agents, officers and directors, from and + against any and all claims, damages, obligations, losses, + liabilities, costs or debt, fines, restitutions and + expenses (including but not limited to attorney’s fees + and costs incident to establishing the right of + indemnification) arising out of or related to products or + services that use the SDK in or for Critical Applications, + and for use of the SDK outside of the scope of this + Agreement or not in compliance with its terms. + + 8. You may not reverse engineer, decompile or disassemble + any portion of the output generated using SDK elements for + the purpose of translating such output artifacts to target + a non-NVIDIA platform. + + +1.3. Ownership + + 1. NVIDIA or its licensors hold all rights, title and + interest in and to the SDK and its modifications and + derivative works, including their respective intellectual + property rights, subject to your rights under Section + 1.3.2. This SDK may include software and materials from + NVIDIA’s licensors, and these licensors are intended + third party beneficiaries that may enforce this Agreement + with respect to their intellectual property rights. + + 2. You hold all rights, title and interest in and to your + applications and your derivative works of the sample + source code delivered in the SDK, including their + respective intellectual property rights, subject to + NVIDIA’s rights under Section 1.3.1. + + 3. You may, but don’t have to, provide to NVIDIA + suggestions, feature requests or other feedback regarding + the SDK, including possible enhancements or modifications + to the SDK. For any feedback that you voluntarily provide, + you hereby grant NVIDIA and its affiliates a perpetual, + non-exclusive, worldwide, irrevocable license to use, + reproduce, modify, license, sublicense (through multiple + tiers of sublicensees), and distribute (through multiple + tiers of distributors) it without the payment of any + royalties or fees to you. NVIDIA will use feedback at its + choice. NVIDIA is constantly looking for ways to improve + its products, so you may send feedback to NVIDIA through + the developer portal at https://developer.nvidia.com. + + +1.4. No Warranties + +THE SDK IS PROVIDED BY NVIDIA “AS IS” AND “WITH ALL +FAULTS.” TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND +ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND +OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, +BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, OR THE +ABSENCE OF ANY DEFECTS THEREIN, WHETHER LATENT OR PATENT. NO +WARRANTY IS MADE ON THE BASIS OF TRADE USAGE, COURSE OF +DEALING OR COURSE OF TRADE. + + +1.5. Limitation of Liability + +TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS +AFFILIATES SHALL NOT BE LIABLE FOR ANY (I) SPECIAL, INCIDENTAL, +PUNITIVE OR CONSEQUENTIAL DAMAGES, OR (II) DAMAGES FOR (A) ANY +LOST PROFITS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, +OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF +OR IN CONNECTION WITH THIS AGREEMENT OR THE USE OR PERFORMANCE +OF THE SDK, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED +UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING +NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR +THEORY OF LIABILITY. IN NO EVENT WILL NVIDIA’S AND ITS AFFILIATES +TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS +AGREEMENT EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE +NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS +LIMIT. + +These exclusions and limitations of liability shall apply +regardless if NVIDIA or its affiliates have been advised of +the possibility of such damages, and regardless of whether a +remedy fails its essential purpose. These exclusions and +limitations of liability form an essential basis of the +bargain between the parties, and, absent any of these +exclusions or limitations of liability, the provisions of this +Agreement, including, without limitation, the economic terms, +would be substantially different. + + +1.6. Termination + + 1. This Agreement will continue to apply until terminated by + either you or NVIDIA as described below. + + 2. If you want to terminate this Agreement, you may do so by + stopping to use the SDK. + + 3. NVIDIA may, at any time, terminate this Agreement if: + + a. (i) you fail to comply with any term of this + Agreement and the non-compliance is not fixed within + thirty (30) days following notice from NVIDIA (or + immediately if you violate NVIDIA’s intellectual + property rights); + + b. (ii) you commence or participate in any legal + proceeding against NVIDIA with respect to the SDK; or + + c. (iii) NVIDIA decides to no longer provide the SDK in + a country or, in NVIDIA’s sole discretion, the + continued use of it is no longer commercially viable. + + 4. Upon any termination of this Agreement, you agree to + promptly discontinue use of the SDK and destroy all copies + in your possession or control. Your prior distributions in + accordance with this Agreement are not affected by the + termination of this Agreement. Upon written request, you + will certify in writing that you have complied with your + commitments under this section. Upon any termination of + this Agreement all provisions survive except for the + license grant provisions. + + +1.7. General + +If you wish to assign this Agreement or your rights and +obligations, including by merger, consolidation, dissolution +or operation of law, contact NVIDIA to ask for permission. Any +attempted assignment not approved by NVIDIA in writing shall +be void and of no effect. NVIDIA may assign, delegate or +transfer this Agreement and its rights and obligations, and if +to a non-affiliate you will be notified. + +You agree to cooperate with NVIDIA and provide reasonably +requested information to verify your compliance with this +Agreement. + +This Agreement will be governed in all respects by the laws of +the United States and of the State of Delaware, without regard to the +conflicts of laws principles. The United Nations Convention on +Contracts for the International Sale of Goods is specifically +disclaimed. You agree to all terms of this Agreement in the +English language. + +The state or federal courts residing in Santa Clara County, +California shall have exclusive jurisdiction over any dispute +or claim arising out of this Agreement. Notwithstanding this, +you agree that NVIDIA shall still be allowed to apply for +injunctive remedies or an equivalent type of urgent legal +relief in any jurisdiction. + +If any court of competent jurisdiction determines that any +provision of this Agreement is illegal, invalid or +unenforceable, such provision will be construed as limited to +the extent necessary to be consistent with and fully +enforceable under the law and the remaining provisions will +remain in full force and effect. Unless otherwise specified, +remedies are cumulative. + +Each party acknowledges and agrees that the other is an +independent contractor in the performance of this Agreement. + +The SDK has been developed entirely at private expense and is +“commercial items” consisting of “commercial computer +software” and “commercial computer software +documentation” provided with RESTRICTED RIGHTS. Use, +duplication or disclosure by the U.S. Government or a U.S. +Government subcontractor is subject to the restrictions in +this Agreement pursuant to DFARS 227.7202-3(a) or as set forth +in subparagraphs (c)(1) and (2) of the Commercial Computer +Software - Restricted Rights clause at FAR 52.227-19, as +applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas +Expressway, Santa Clara, CA 95051. + +The SDK is subject to United States export laws and +regulations. You agree that you will not ship, transfer or +export the SDK into any country, or use the SDK in any manner, +prohibited by the United States Bureau of Industry and +Security or economic sanctions regulations administered by the +U.S. Department of Treasury’s Office of Foreign Assets +Control (OFAC), or any applicable export laws, restrictions or +regulations. These laws include restrictions on destinations, +end users and end use. By accepting this Agreement, you +confirm that you are not located in a country currently +embargoed by the U.S. or otherwise prohibited from receiving +the SDK under U.S. law. + +Any notice delivered by NVIDIA to you under this Agreement +will be delivered via mail, email or fax. You agree that any +notices that NVIDIA sends you electronically will satisfy any +legal communication requirements. Please direct your legal +notices or other correspondence to NVIDIA Corporation, 2788 +San Tomas Expressway, Santa Clara, California 95051, United +States of America, Attention: Legal Department. + +This Agreement and any exhibits incorporated into this +Agreement constitute the entire agreement of the parties with +respect to the subject matter of this Agreement and supersede +all prior negotiations or documentation exchanged between the +parties relating to this SDK license. Any additional and/or +conflicting terms on documents issued by you are null, void, +and invalid. Any amendment or waiver under this Agreement +shall be in writing and signed by representatives of both +parties. + + +2. CUDA Toolkit Supplement to Software License Agreement for +NVIDIA Software Development Kits +------------------------------------------------------------ + +The terms in this supplement govern your use of the NVIDIA +CUDA Toolkit SDK under the terms of your license agreement +(“Agreement”) as modified by this supplement. Capitalized +terms used but not defined below have the meaning assigned to +them in the Agreement. + +This supplement is an exhibit to the Agreement and is +incorporated as an integral part of the Agreement. In the +event of conflict between the terms in this supplement and the +terms in the Agreement, the terms in this supplement govern. + + +2.1. License Scope + +The SDK is licensed for you to develop applications only for +use in systems with NVIDIA GPUs. + + +2.2. Distribution + +The portions of the SDK that are distributable under the +Agreement are listed in Attachment A. + + +2.3. Operating Systems + +Those portions of the SDK designed exclusively for use on the +Linux or FreeBSD operating systems, or other operating systems +derived from the source code to these operating systems, may +be copied and redistributed for use in accordance with this +Agreement, provided that the object code files are not +modified in any way (except for unzipping of compressed +files). + + +2.4. Audio and Video Encoders and Decoders + +You acknowledge and agree that it is your sole responsibility +to obtain any additional third-party licenses required to +make, have made, use, have used, sell, import, and offer for +sale your products or services that include or incorporate any +third-party software and content relating to audio and/or +video encoders and decoders from, including but not limited +to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A., +MPEG-LA, and Coding Technologies. NVIDIA does not grant to you +under this Agreement any necessary patent or other rights with +respect to any audio and/or video encoders and decoders. + + +2.5. Licensing + +If the distribution terms in this Agreement are not suitable +for your organization, or for any questions regarding this +Agreement, please contact NVIDIA at +nvidia-compute-license-questions@nvidia.com. + + +2.6. Attachment A + +The following CUDA Toolkit files may be distributed with +applications developed by you, including certain +variations of these files that have version number or +architecture specific information embedded in the file name - +as an example only, for release version 9.0 of the 64-bit +Windows software, the file cudart64_90.dll is redistributable. + +Component + +CUDA Runtime + +Windows + +cudart.dll, cudart_static.lib, cudadevrt.lib + +Mac OSX + +libcudart.dylib, libcudart_static.a, libcudadevrt.a + +Linux + +libcudart.so, libcudart_static.a, libcudadevrt.a + +Android + +libcudart.so, libcudart_static.a, libcudadevrt.a + +Component + +CUDA FFT Library + +Windows + +cufft.dll, cufftw.dll, cufft.lib, cufftw.lib + +Mac OSX + +libcufft.dylib, libcufft_static.a, libcufftw.dylib, +libcufftw_static.a + +Linux + +libcufft.so, libcufft_static.a, libcufftw.so, +libcufftw_static.a + +Android + +libcufft.so, libcufft_static.a, libcufftw.so, +libcufftw_static.a + +Component + +CUDA BLAS Library + +Windows + +cublas.dll, cublasLt.dll + +Mac OSX + +libcublas.dylib, libcublasLt.dylib, libcublas_static.a, +libcublasLt_static.a + +Linux + +libcublas.so, libcublasLt.so, libcublas_static.a, +libcublasLt_static.a + +Android + +libcublas.so, libcublasLt.so, libcublas_static.a, +libcublasLt_static.a + +Component + +NVIDIA "Drop-in" BLAS Library + +Windows + +nvblas.dll + +Mac OSX + +libnvblas.dylib + +Linux + +libnvblas.so + +Component + +CUDA Sparse Matrix Library + +Windows + +cusparse.dll, cusparse.lib + +Mac OSX + +libcusparse.dylib, libcusparse_static.a + +Linux + +libcusparse.so, libcusparse_static.a + +Android + +libcusparse.so, libcusparse_static.a + +Component + +CUDA Linear Solver Library + +Windows + +cusolver.dll, cusolver.lib + +Mac OSX + +libcusolver.dylib, libcusolver_static.a + +Linux + +libcusolver.so, libcusolver_static.a + +Android + +libcusolver.so, libcusolver_static.a + +Component + +CUDA Random Number Generation Library + +Windows + +curand.dll, curand.lib + +Mac OSX + +libcurand.dylib, libcurand_static.a + +Linux + +libcurand.so, libcurand_static.a + +Android + +libcurand.so, libcurand_static.a + +Component + +NVIDIA Performance Primitives Library + +Windows + +nppc.dll, nppc.lib, nppial.dll, nppial.lib, nppicc.dll, +nppicc.lib, nppicom.dll, nppicom.lib, nppidei.dll, +nppidei.lib, nppif.dll, nppif.lib, nppig.dll, nppig.lib, +nppim.dll, nppim.lib, nppist.dll, nppist.lib, nppisu.dll, +nppisu.lib, nppitc.dll, nppitc.lib, npps.dll, npps.lib + +Mac OSX + +libnppc.dylib, libnppc_static.a, libnppial.dylib, +libnppial_static.a, libnppicc.dylib, libnppicc_static.a, +libnppicom.dylib, libnppicom_static.a, libnppidei.dylib, +libnppidei_static.a, libnppif.dylib, libnppif_static.a, +libnppig.dylib, libnppig_static.a, libnppim.dylib, +libnppisu_static.a, libnppitc.dylib, libnppitc_static.a, +libnpps.dylib, libnpps_static.a + +Linux + +libnppc.so, libnppc_static.a, libnppial.so, +libnppial_static.a, libnppicc.so, libnppicc_static.a, +libnppicom.so, libnppicom_static.a, libnppidei.so, +libnppidei_static.a, libnppif.so, libnppif_static.a +libnppig.so, libnppig_static.a, libnppim.so, +libnppim_static.a, libnppist.so, libnppist_static.a, +libnppisu.so, libnppisu_static.a, libnppitc.so +libnppitc_static.a, libnpps.so, libnpps_static.a + +Android + +libnppc.so, libnppc_static.a, libnppial.so, +libnppial_static.a, libnppicc.so, libnppicc_static.a, +libnppicom.so, libnppicom_static.a, libnppidei.so, +libnppidei_static.a, libnppif.so, libnppif_static.a +libnppig.so, libnppig_static.a, libnppim.so, +libnppim_static.a, libnppist.so, libnppist_static.a, +libnppisu.so, libnppisu_static.a, libnppitc.so +libnppitc_static.a, libnpps.so, libnpps_static.a + +Component + +NVIDIA JPEG Library + +Windows + +nvjpeg.lib, nvjpeg.dll + +Linux + +libnvjpeg.so, libnvjpeg_static.a + +Component + +Internal common library required for statically linking to +cuBLAS, cuSPARSE, cuFFT, cuRAND, nvJPEG and NPP + +Mac OSX + +libculibos.a + +Linux + +libculibos.a + +Component + +NVIDIA Runtime Compilation Library and Header + +All + +nvrtc.h + +Windows + +nvrtc.dll, nvrtc-builtins.dll + +Mac OSX + +libnvrtc.dylib, libnvrtc-builtins.dylib + +Linux + +libnvrtc.so, libnvrtc-builtins.so, libnvrtc_static.a, libnvrtx-builtins_static.a + +Component + +NVIDIA Optimizing Compiler Library + +Windows + +nvvm.dll + +Mac OSX + +libnvvm.dylib + +Linux + +libnvvm.so + +Component + +NVIDIA JIT Linking Library + +Windows + +libnvJitLink.dll, libnvJitLink.lib + +Linux + +libnvJitLink.so, libnvJitLink_static.a + +Component + +NVIDIA Common Device Math Functions Library + +Windows + +libdevice.10.bc + +Mac OSX + +libdevice.10.bc + +Linux + +libdevice.10.bc + +Component + +CUDA Occupancy Calculation Header Library + +All + +cuda_occupancy.h + +Component + +CUDA Half Precision Headers + +All + +cuda_fp16.h, cuda_fp16.hpp + +Component + +CUDA Profiling Tools Interface (CUPTI) Library + +Windows + +cupti.dll + +Mac OSX + +libcupti.dylib + +Linux + +libcupti.so + +Component + +NVIDIA Tools Extension Library + +Windows + +nvToolsExt.dll, nvToolsExt.lib + +Mac OSX + +libnvToolsExt.dylib + +Linux + +libnvToolsExt.so + +Component + +NVIDIA CUDA Driver Libraries + +Linux + +libcuda.so, libnvidia-ptxjitcompiler.so, libnvptxcompiler_static.a + +Component + +NVIDIA CUDA File IO Libraries and Header + +All + +cufile.h + +Linux + +libcufile.so, libcufile_rdma.so, libcufile_static.a, +libcufile_rdma_static.a + +In addition to the rights above, for parties that are +developing software intended solely for use on Jetson +development kits or Jetson modules, and running Linux for +Tegra software, the following shall apply: + + * The SDK may be distributed in its entirety, as provided by + NVIDIA, and without separation of its components, for you + and/or your licensees to create software development kits + for use only on the Jetson platform and running Linux for + Tegra software. + + +2.7. Attachment B + + +Additional Licensing Obligations + +The following third party components included in the SOFTWARE +are licensed to Licensee pursuant to the following terms and +conditions: + + 1. Licensee's use of the GDB third party component is + subject to the terms and conditions of GNU GPL v3: + + This product includes copyrighted third-party software licensed + under the terms of the GNU General Public License v3 ("GPL v3"). + All third-party software packages are copyright by their respective + authors. GPL v3 terms and conditions are hereby incorporated into + the Agreement by this reference: http://www.gnu.org/licenses/gpl.txt + + Consistent with these licensing requirements, the software + listed below is provided under the terms of the specified + open source software licenses. To obtain source code for + software provided under licenses that require + redistribution of source code, including the GNU General + Public License (GPL) and GNU Lesser General Public License + (LGPL), contact oss-requests@nvidia.com. This offer is + valid for a period of three (3) years from the date of the + distribution of this product by NVIDIA CORPORATION. + + Component License + CUDA-GDB GPL v3 + + 2. Licensee represents and warrants that any and all third + party licensing and/or royalty payment obligations in + connection with Licensee's use of the H.264 video codecs + are solely the responsibility of Licensee. + + 3. Licensee's use of the Thrust library is subject to the + terms and conditions of the Apache License Version 2.0. + All third-party software packages are copyright by their + respective authors. Apache License Version 2.0 terms and + conditions are hereby incorporated into the Agreement by + this reference. + http://www.apache.org/licenses/LICENSE-2.0.html + + In addition, Licensee acknowledges the following notice: + Thrust includes source code from the Boost Iterator, + Tuple, System, and Random Number libraries. + + Boost Software License - Version 1.0 - August 17th, 2003 + . . . . + + Permission is hereby granted, free of charge, to any person or + organization obtaining a copy of the software and accompanying + documentation covered by this license (the "Software") to use, + reproduce, display, distribute, execute, and transmit the Software, + and to prepare derivative works of the Software, and to permit + third-parties to whom the Software is furnished to do so, all + subject to the following: + + The copyright notices in the Software and this entire statement, + including the above license grant, this restriction and the following + disclaimer, must be included in all copies of the Software, in whole + or in part, and all derivative works of the Software, unless such + copies or derivative works are solely in the form of machine-executable + object code generated by a source language processor. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND + NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR + OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + 4. Licensee's use of the LLVM third party component is + subject to the following terms and conditions: + + ====================================================== + LLVM Release License + ====================================================== + University of Illinois/NCSA + Open Source License + + Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign. + All rights reserved. + + Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal with the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at Urbana- + Champaign, nor the names of its contributors may be used to endorse or + promote products derived from this Software without specific prior + written permission. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS WITH THE SOFTWARE. + + 5. Licensee's use of the PCRE third party component is + subject to the following terms and conditions: + + ------------ + PCRE LICENCE + ------------ + PCRE is a library of functions to support regular expressions whose syntax + and semantics are as close as possible to those of the Perl 5 language. + Release 8 of PCRE is distributed under the terms of the "BSD" licence, as + specified below. The documentation for PCRE, supplied in the "doc" + directory, is distributed under the same terms as the software itself. The + basic library functions are written in C and are freestanding. Also + included in the distribution is a set of C++ wrapper functions, and a just- + in-time compiler that can be used to optimize pattern matching. These are + both optional features that can be omitted when the library is built. + + THE BASIC LIBRARY FUNCTIONS + --------------------------- + Written by: Philip Hazel + Email local part: ph10 + Email domain: cam.ac.uk + University of Cambridge Computing Service, + Cambridge, England. + Copyright (c) 1997-2012 University of Cambridge + All rights reserved. + + PCRE JUST-IN-TIME COMPILATION SUPPORT + ------------------------------------- + Written by: Zoltan Herczeg + Email local part: hzmester + Emain domain: freemail.hu + Copyright(c) 2010-2012 Zoltan Herczeg + All rights reserved. + + STACK-LESS JUST-IN-TIME COMPILER + -------------------------------- + Written by: Zoltan Herczeg + Email local part: hzmester + Emain domain: freemail.hu + Copyright(c) 2009-2012 Zoltan Herczeg + All rights reserved. + + THE C++ WRAPPER FUNCTIONS + ------------------------- + Contributed by: Google Inc. + Copyright (c) 2007-2012, Google Inc. + All rights reserved. + + THE "BSD" LICENCE + ----------------- + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the name of Google + Inc. nor the names of their contributors may be used to endorse or + promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + 6. Some of the cuBLAS library routines were written by or + derived from code written by Vasily Volkov and are subject + to the Modified Berkeley Software Distribution License as + follows: + + Copyright (c) 2007-2009, Regents of the University of California + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the University of California, Berkeley nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + 7. Some of the cuBLAS library routines were written by or + derived from code written by Davide Barbieri and are + subject to the Modified Berkeley Software Distribution + License as follows: + + Copyright (c) 2008-2009 Davide Barbieri @ University of Rome Tor Vergata. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + 8. Some of the cuBLAS library routines were derived from + code developed by the University of Tennessee and are + subject to the Modified Berkeley Software Distribution + License as follows: + + Copyright (c) 2010 The University of Tennessee. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer listed in this license in the documentation and/or + other materials provided with the distribution. + * Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 9. Some of the cuBLAS library routines were written by or + derived from code written by Jonathan Hogg and are subject + to the Modified Berkeley Software Distribution License as + follows: + + Copyright (c) 2012, The Science and Technology Facilities Council (STFC). + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the STFC nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE STFC BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 10. Some of the cuBLAS library routines were written by or + derived from code written by Ahmad M. Abdelfattah, David + Keyes, and Hatem Ltaief, and are subject to the Apache + License, Version 2.0, as follows: + + -- (C) Copyright 2013 King Abdullah University of Science and Technology + Authors: + Ahmad Abdelfattah (ahmad.ahmad@kaust.edu.sa) + David Keyes (david.keyes@kaust.edu.sa) + Hatem Ltaief (hatem.ltaief@kaust.edu.sa) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the King Abdullah University of Science and + Technology nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE + + 11. Some of the cuSPARSE library routines were written by or + derived from code written by Li-Wen Chang and are subject + to the NCSA Open Source License as follows: + + Copyright (c) 2012, University of Illinois. + + All rights reserved. + + Developed by: IMPACT Group, University of Illinois, http://impact.crhc.illinois.edu + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal with the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimers in the documentation and/or other materials provided + with the distribution. + * Neither the names of IMPACT Group, University of Illinois, nor + the names of its contributors may be used to endorse or promote + products derived from this Software without specific prior + written permission. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE + SOFTWARE. + + 12. Some of the cuRAND library routines were written by or + derived from code written by Mutsuo Saito and Makoto + Matsumoto and are subject to the following license: + + Copyright (c) 2009, 2010 Mutsuo Saito, Makoto Matsumoto and Hiroshima + University. All rights reserved. + + Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima + University and University of Tokyo. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the Hiroshima University nor the names of + its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 13. Some of the cuRAND library routines were derived from + code developed by D. E. Shaw Research and are subject to + the following license: + + Copyright 2010-2011, D. E. Shaw Research. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions, and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of D. E. Shaw Research nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 14. Some of the Math library routines were written by or + derived from code developed by Norbert Juffa and are + subject to the following license: + + Copyright (c) 2015-2017, Norbert Juffa + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 15. Licensee's use of the lz4 third party component is + subject to the following terms and conditions: + + Copyright (C) 2011-2013, Yann Collet. + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 16. The NPP library uses code from the Boost Math Toolkit, + and is subject to the following license: + + Boost Software License - Version 1.0 - August 17th, 2003 + . . . . + + Permission is hereby granted, free of charge, to any person or + organization obtaining a copy of the software and accompanying + documentation covered by this license (the "Software") to use, + reproduce, display, distribute, execute, and transmit the Software, + and to prepare derivative works of the Software, and to permit + third-parties to whom the Software is furnished to do so, all + subject to the following: + + The copyright notices in the Software and this entire statement, + including the above license grant, this restriction and the following + disclaimer, must be included in all copies of the Software, in whole + or in part, and all derivative works of the Software, unless such + copies or derivative works are solely in the form of machine-executable + object code generated by a source language processor. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND + NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR + OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + 17. Portions of the Nsight Eclipse Edition is subject to the + following license: + + The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content is provided + to you under the terms and conditions of the Eclipse Public License + Version 1.0 ("EPL"). A copy of the EPL is available at http:// + www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" + will mean the Content. + + If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may apply to your + use of any object code in the Content. Check the Redistributor's + license that was provided with the Content. If no such license exists, + contact the Redistributor. Unless otherwise indicated below, the terms + and conditions of the EPL still apply to any source code in the + Content and such source code may be obtained at http://www.eclipse.org. + + 18. Some of the cuBLAS library routines uses code from + OpenAI, which is subject to the following license: + + License URL + https://github.com/openai/openai-gemm/blob/master/LICENSE + + License Text + The MIT License + + Copyright (c) 2016 OpenAI (http://openai.com), 2016 Google Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + 19. Licensee's use of the Visual Studio Setup Configuration + Samples is subject to the following license: + + The MIT License (MIT) + Copyright (C) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + 20. Licensee's use of linmath.h header for CPU functions for + GL vector/matrix operations from lunarG is subject to the + Apache License Version 2.0. + + 21. The DX12-CUDA sample uses the d3dx12.h header, which is + subject to the MIT license. + + 22. Components of the driver and compiler used for binary management, including + nvFatBin, nvcc, and cuobjdump, use the Zstandard library which is subject to + the following license: + + BSD License + + For Zstandard software + + Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Facebook, nor Meta, nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGE. + +----------------- diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/link.json b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/link.json new file mode 100644 index 0000000000000000000000000000000000000000..f072e87f8bb5634b93a0459b8b7c6b15eef0c47c --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/link.json @@ -0,0 +1,6 @@ +{ + "noarch": { + "type": "generic" + }, + "package_metadata_version": 1 +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/paths.json b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..65b2d51593f787b05debb0dece98a9397b1afb78 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/paths.json @@ -0,0 +1,155 @@ +{ + "paths": [ + { + "_path": "targets/x86_64-linux/include/crt/common_functions.h", + "path_type": "hardlink", + "sha256": "f94e387f8c941a6c033f077b43fdc2cf989fd39c4718f4a5033cf9cccca52d24", + "size_in_bytes": 13559 + }, + { + "_path": "targets/x86_64-linux/include/crt/cudacc_ext.h", + "path_type": "hardlink", + "sha256": "296ea7d0898e64a4b456a5660475935ed1c8f35ea187cf187848148366987555", + "size_in_bytes": 3224 + }, + { + "_path": "targets/x86_64-linux/include/crt/device_double_functions.h", + "path_type": "hardlink", + "sha256": "035bc1de0d2ac273447dca53d5df518860dac6a3d75e062bf95c5eda8307cb16", + "size_in_bytes": 39938 + }, + { + "_path": "targets/x86_64-linux/include/crt/device_double_functions.hpp", + "path_type": "hardlink", + "sha256": "61821ba9885be5099ff1ce187dc0bf8f2b60e054707173e3bf74c54f085bdb81", + "size_in_bytes": 8568 + }, + { + "_path": "targets/x86_64-linux/include/crt/device_fp128_functions.h", + "path_type": "hardlink", + "sha256": "de208aadd98fa753488eb946478edd0993a057d5fa32675f9a3ba0ac5e8312db", + "size_in_bytes": 51047 + }, + { + "_path": "targets/x86_64-linux/include/crt/device_functions.h", + "path_type": "hardlink", + "sha256": "4f820db9104894b99ddc9100f07e81e571d500d195ea3f20c325138f987f175f", + "size_in_bytes": 137919 + }, + { + "_path": "targets/x86_64-linux/include/crt/device_functions.hpp", + "path_type": "hardlink", + "sha256": "3951e2a818dd6b2fda5059c3289c53788d150d923c640e8921d50a780291e290", + "size_in_bytes": 37991 + }, + { + "_path": "targets/x86_64-linux/include/crt/func_macro.h", + "path_type": "hardlink", + "sha256": "10ea4395a33dd7b6e1f5cc0188504f17af3d0c2301c398456abc4bc45b7e8bbe", + "size_in_bytes": 1755 + }, + { + "_path": "targets/x86_64-linux/include/crt/host_config.h", + "path_type": "hardlink", + "sha256": "d5e922df0e71b98d3480891d61b9927d93b64a823c8226566124d120bdae16cd", + "size_in_bytes": 12169 + }, + { + "_path": "targets/x86_64-linux/include/crt/host_defines.h", + "path_type": "hardlink", + "sha256": "7c353fd1c41db48bc474cd33645298d0e6e83003443201cb6e589f3da94f18b9", + "size_in_bytes": 10102 + }, + { + "_path": "targets/x86_64-linux/include/crt/host_runtime.h", + "path_type": "hardlink", + "sha256": "94ea66931159564129f1d70c0061194484ec87ed7da3d8f2dfd91d48d2dcdcd8", + "size_in_bytes": 10284 + }, + { + "_path": "targets/x86_64-linux/include/crt/math_functions.h", + "path_type": "hardlink", + "sha256": "2f2189d1752d862e96122f985484c89e16bd03a485a01e1f114514f738a2ed4f", + "size_in_bytes": 238284 + }, + { + "_path": "targets/x86_64-linux/include/crt/math_functions.hpp", + "path_type": "hardlink", + "sha256": "bbe0866ddd11d8565674a1bee9b766192a2bf4a4ffc279884a3eb794f40a0123", + "size_in_bytes": 100207 + }, + { + "_path": "targets/x86_64-linux/include/crt/mma.h", + "path_type": "hardlink", + "sha256": "068a1600b0d6013bd9ba925a2fbf8615045060ea2d35efc5cb5d48e4d1a1d850", + "size_in_bytes": 62695 + }, + { + "_path": "targets/x86_64-linux/include/crt/mma.hpp", + "path_type": "hardlink", + "sha256": "b29a342d7ef5b540a2a712b9d7b06cb23d2773e6477fca0c5b3bc7a18601ffa2", + "size_in_bytes": 66599 + }, + { + "_path": "targets/x86_64-linux/include/crt/nvfunctional", + "path_type": "hardlink", + "sha256": "143334cea58ee9b97d8e924acfd53c08c6e3b7a8932a1d7cb506a5c40bd1b1a8", + "size_in_bytes": 16900 + }, + { + "_path": "targets/x86_64-linux/include/crt/sm_100_rt.h", + "path_type": "hardlink", + "sha256": "ddc062094d7539c8c6629afce5e742375ab89b6cfdd45686841b6e3b48ace13a", + "size_in_bytes": 8987 + }, + { + "_path": "targets/x86_64-linux/include/crt/sm_100_rt.hpp", + "path_type": "hardlink", + "sha256": "bdb23608d098d3c74323bcd7c29e8135c7992a5d1c7971b596f7aae30f9535aa", + "size_in_bytes": 6855 + }, + { + "_path": "targets/x86_64-linux/include/crt/sm_70_rt.h", + "path_type": "hardlink", + "sha256": "29ff37d31ca603ece617b2ecba71472d23728614f952224ca1c8281c141e367b", + "size_in_bytes": 6837 + }, + { + "_path": "targets/x86_64-linux/include/crt/sm_70_rt.hpp", + "path_type": "hardlink", + "sha256": "ddafeb53e63431207886d043158e0f090fe35e25854deed64f567284cb8224e0", + "size_in_bytes": 7837 + }, + { + "_path": "targets/x86_64-linux/include/crt/sm_80_rt.h", + "path_type": "hardlink", + "sha256": "31d2475824732ccfff9c30dfd60a3ad6b0ec97dc9d396de88ba49905f8d4c9cf", + "size_in_bytes": 7743 + }, + { + "_path": "targets/x86_64-linux/include/crt/sm_80_rt.hpp", + "path_type": "hardlink", + "sha256": "a3eac9bbe8e97a109ec8004682ffbc758441ee82530b0b8d76f482ab455445d1", + "size_in_bytes": 6705 + }, + { + "_path": "targets/x86_64-linux/include/crt/sm_90_rt.h", + "path_type": "hardlink", + "sha256": "6a7e3b9b45c505a277a545fd325138fa792d3f58dbdde2545e14379ed66dcdcf", + "size_in_bytes": 11445 + }, + { + "_path": "targets/x86_64-linux/include/crt/sm_90_rt.hpp", + "path_type": "hardlink", + "sha256": "62ea95ca0195eab82d5adc7527d70fa4423705729004823e133ea86453f7c2b1", + "size_in_bytes": 9228 + }, + { + "_path": "targets/x86_64-linux/include/crt/storage_class.h", + "path_type": "hardlink", + "sha256": "77370e675ea92da37c7a3a87697c388876c127a7d75b17da53eb23d908d8cf38", + "size_in_bytes": 4791 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/conda_build_config.yaml b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c8adb0e92dc9d54ed132f3ff3257231824f7ef57 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/conda_build_config.yaml @@ -0,0 +1,33 @@ +c_compiler: gcc +c_compiler_version: 11.2.0 +c_stdlib: sysroot +c_stdlib_version: '2.28' +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: gxx +cxx_compiler_version: 11.2.0 +extend_keys: +- ignore_version +- pin_run_as_build +- ignore_build_only_deps +- extend_keys +fortran_compiler: gfortran +ignore_build_only_deps: +- python +- numpy +lua: '5' +numpy: '1.26' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.12' +r_base: '3.5' +target_platform: linux-64 +xz: '5' diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/meta.yaml b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b0e12c66c900b598289e25a759d38cfd9f9e5b6e --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/meta.yaml @@ -0,0 +1,39 @@ +# This file created by conda-build 25.1.2 +# ------------------------------------------------ + +package: + name: cuda-crt-dev_linux-64 + version: 12.8.93 +source: + patches: + - nvcc.profile.patch + sha256: 9961b3484b6b71314063709a4f9529654f96782ad39e72bf1e00f070db8210d3 + url: https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/linux-x86_64/cuda_nvcc-linux-x86_64-12.8.93-archive.tar.xz +build: + noarch: generic + number: 3 + string: h06a4308_3 +requirements: + host: + - cuda-version 12.8 h30beaf8_3 + run: + - cuda-version >=12.8,<12.9.0a0 +test: + commands: + - test -f $PREFIX/targets/x86_64-linux/include/crt/common_functions.h +about: + description: 'CUDA internal headers. + + ' + doc_url: https://docs.nvidia.com/cuda/index.html + home: https://developer.nvidia.com/cuda-toolkit + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_file: LICENSE + license_url: https://docs.nvidia.com/cuda/eula/index.html + summary: CUDA internal headers. +extra: + copy_test_source_files: true + feedstock-name: cuda-nvcc-impl + final: true + recipe-maintainers: + - conda-forge/cuda diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/CMakeLists.txt b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..9298c151b3070363195f7d5674f73c8d15a9f5bc --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/CMakeLists.txt @@ -0,0 +1,37 @@ +cmake_minimum_required(VERSION 3.20 FATAL_ERROR) + +project(verify_cuda_compiler LANGUAGES CUDA) + +if(NOT DEFINED CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES) + message(FATAL_ERROR "CUDA compiler detection failed, no recording of CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES") +endif() + +find_package(CUDAToolkit REQUIRED) +set(should_exist + CUDAToolkit_BIN_DIR + CUDAToolkit_INCLUDE_DIRS + CUDAToolkit_LIBRARY_DIR + CUDAToolkit_LIBRARY_ROOT + ) +foreach (cuda_loc_var IN LISTS should_exist) + foreach(entry IN LISTS ${cuda_loc_var}) + if(NOT EXISTS "${entry}") + message(FATAL_ERROR "${entry} from ${cuda_loc_var} should exist on disk") + endif() + endforeach() +endforeach() + + +set(cuda_libs cudart cuda_driver) +foreach (cuda_lib IN LISTS cuda_libs) + if(NOT CUDA_${cuda_lib}_LIBRARY) + message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found") + elseif(CUDA_${cuda_lib}_LIBRARY MATCHES [[\.\./]]) + message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY[\"${CUDA_${cuda_lib}_LIBRARY}\"] to not contain /..") + endif() + if(NOT TARGET CUDA::${cuda_lib}) + message(FATAL_ERROR "expected CUDAToolkit target CUDA::${cuda_lib} not found") + endif() +endforeach() + +add_executable(verify test.cu) diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/bld.bat b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..9a1db6ee9c6a05d07eef792bfab551ae1cbcdfd0 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/bld.bat @@ -0,0 +1,8 @@ +if not exist %PREFIX% mkdir %PREFIX% + +move lib\x64\* %LIBRARY_LIB% +move bin\* %LIBRARY_BIN% +move bin\crt %LIBRARY_BIN% +move include\* %LIBRARY_INC% +move include\crt %LIBRARY_INC% +move nvvm %PREFIX%\Library diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/build.sh b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..2904e1081a7ea04647c2e1af505ca1c99bc9c37f --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/build.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +# Install to conda style directories +[[ -d lib64 ]] && mv lib64 lib + +[[ ${target_platform} == "linux-64" ]] && targetsDir="targets/x86_64-linux" +[[ ${target_platform} == "linux-ppc64le" ]] && targetsDir="targets/ppc64le-linux" +# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html?highlight=tegra#cross-compilation +[[ ${target_platform} == "linux-aarch64" && ${arm_variant_type} == "sbsa" ]] && targetsDir="targets/sbsa-linux" +[[ ${target_platform} == "linux-aarch64" && ${arm_variant_type} == "tegra" ]] && targetsDir="targets/aarch64-linux" + +if [ -z "${targetsDir+x}" ]; then + echo "target_platform: ${target_platform} is unknown! targetsDir must be defined!" >&2 + exit 1 +fi + +mkdir -p ${PREFIX}/${targetsDir} + +for i in `ls`; do + [[ $i == "LICENSE" ]] && continue + [[ $i == "build_env_setup.sh" ]] && continue + [[ $i == "conda_build.sh" ]] && continue + [[ $i == "metadata_conda_debug.yaml" ]] && continue + if [[ $i == "bin" ]] || [[ $i == "lib" ]] || [[ $i == "include" ]] || [[ $i == "nvvm" ]]; then + # Headers and libraries are installed to targetsDir + mkdir -p ${PREFIX}/$i + if [[ $i == "bin" ]]; then + for j in `ls "${i}"`; do + [[ -f "bin/${j}" ]] || continue + + if grep -qx "${j}" ${RECIPE_DIR}/patchelf_exclude.txt; then + echo "Skipping bin/${j} as it is in the patchelf exclusion list." + continue + fi + + echo patchelf --force-rpath --set-rpath "\$ORIGIN/../lib:\$ORIGIN/../${targetsDir}/lib" "${i}/${j}" ... + patchelf --force-rpath --set-rpath "\$ORIGIN/../lib:\$ORIGIN/../${targetsDir}/lib" "${i}/${j}" + done + + mkdir -p ${PREFIX}/${targetsDir}/bin + cp -rv $i ${PREFIX} + ln -sv ${PREFIX}/bin/nvcc ${PREFIX}/${targetsDir}/bin/nvcc + elif [[ $i == "lib" ]]; then + cp -rv $i ${PREFIX}/${targetsDir} + for j in "$i"/*.a*; do + # Static libraries are symlinked in $PREFIX/lib + ln -sv ${PREFIX}/${targetsDir}/$j ${PREFIX}/$j + done + ln -sv ${PREFIX}/${targetsDir}/lib ${PREFIX}/${targetsDir}/lib64 + elif [[ $i == "include" ]]; then + cp -rv $i ${PREFIX}/${targetsDir} + elif [[ $i == "nvvm" ]]; then + for j in `find "${i}"`; do + if [[ "${j}" =~ /bin/.*$ ]]; then + # Adds the following paths relative to `$PREFIX` to the `RPATH`: `nvvm/lib64`, `lib`, `${targetsDir}/lib` + echo patchelf --force-rpath --set-rpath "\$ORIGIN/../lib64:\$ORIGIN/../../lib:\$ORIGIN/../../${targetsDir}/lib" "${j}" ... + patchelf --force-rpath --set-rpath "\$ORIGIN/../lib64:\$ORIGIN/../../lib:\$ORIGIN/../../${targetsDir}/lib" "${j}" + elif [[ "${j}" =~ /lib.*/.*\.so($|\.) && ! -L "${j}" ]]; then + echo patchelf --force-rpath --set-rpath "\$ORIGIN" "${j}" ... + patchelf --force-rpath --set-rpath "\$ORIGIN" "${j}" + fi + done + + cp -rv $i ${PREFIX} + ln -sv ${PREFIX}/nvvm ${PREFIX}/${targetsDir}/nvvm + fi + else + cp -rv $i ${PREFIX}/${targetsDir} + fi +done + +# Copy the [de]activate scripts to $PREFIX/etc/conda/[de]activate.d. +# This will allow them to be run on environment activation. +# Name this script starting with `~` so it is run after all other compiler activation scripts. +# At the point of running this, $CXX must be defined. +# for CHANGE in "activate" "deactivate" +# do +# mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d" +# cp "${RECIPE_DIR}/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/~cuda-nvcc_${CHANGE}.sh" +# done + +check-glibc ${PREFIX}/{bin,lib}*/* ${PREFIX}/${targetsDir}/{bin,lib}*/* ${PREFIX}/nvvm/{bin,lib}*/* diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/conda_build_config.yaml b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d95e0413baa14e681376bc6f2d86082d40b19259 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/conda_build_config.yaml @@ -0,0 +1,13 @@ +arm_variant_type: # [linux and aarch64] + - sbsa # [linux and aarch64] + # arm-variant * tegra requires glibc version which is currently not available. + # binary glibc 2.29.0 <= recipe glibc 2.28 $PREFIX/bin/nvcc + # The binary is not compatible with the recipe's glibc pinning. + # See https://docs.nvidia.com/cuda/cuda-installation-guide-linux/#system-requirements + # Enable this once glibc is available on the main channel. + #- tegra # [linux and aarch64] + +c_compiler: # [win] + - vs2019 # [win] +cxx_compiler: # [win] + - vs2019 # [win] diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/meta.yaml b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7525b109e88b9d4a2a95115802d7f436c3e2700f --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/meta.yaml @@ -0,0 +1,386 @@ +{% set name = "cuda-nvcc-impl" %} +{% set version = "12.8.93" %} +{% set cuda_version = "12.8" %} +{% set cuda_version_next_major = (cuda_version.split(".")[0]|int + 1)|string + ".0a0" %} +{% set gcc_min_constraint = ">=6" %} +{% set gcc_constraint = ">=6,<15.0a0" %} +{% set platform = "linux-x86_64" %} # [linux64] +{% set platform = "linux-sbsa" %} # [aarch64 and arm_variant_type == "sbsa"] +#{% set platform = "linux-aarch64" %} # [aarch64 and arm_variant_type == "tegra"] +{% set platform = "windows-x86_64" %} # [win] +{% set target_name = "x86_64-linux" %} # [linux64] +{% set target_name = "sbsa-linux" %} # [aarch64 and arm_variant_type == "sbsa"] +#{% set target_name = "aarch64-linux" %} # [aarch64 and arm_variant_type == "tegra"] +{% set target_name = "x64" %} # [win] +{% set extension = "tar.xz" %} # [not win] +{% set extension = "zip" %} # [win] +{% set exists = "which" %} # [not win] +{% set exists = "where" %} # [win] +{% set sha256 = "9961b3484b6b71314063709a4f9529654f96782ad39e72bf1e00f070db8210d3" %} # [linux64] +{% set sha256 = "dc0b713ce69fd921aa53ac68610717d126fc273a3c554b0465cf44d7e379f467" %} # [aarch64 and arm_variant_type == "sbsa"] +{% set sha256 = "9fdc70b4271ed9aad4d64cd7076a7d96ec36512d074b9995fe638de669197391" %} # [win] +#{% set sha256 = "2eb267e6ebbe17e5ebc593bae8b83fa927c3e53cbf43ef5c614eff6c94053d10" %} # [aarch64 and arm_variant_type == "tegra"] + +package: + name: cuda-nvcc-impl-split + version: {{ version }} + +source: + url: https://developer.download.nvidia.com/compute/cuda/redist/cuda_nvcc/{{ platform }}/cuda_nvcc-{{ platform }}-{{ version }}-archive.{{ extension }} + sha256: {{ sha256 }} + patches: + - nvcc.profile.patch # [linux] + - nvcc.profile.patch.win # [win] + +build: + number: 3 + binary_relocation: false + skip: true # [osx] + +requirements: + build: + - patchelf # [linux] + - cf-nvidia-tools 1.* # [linux] + +outputs: + - name: cuda-nvcc-tools + files: # [linux] + - bin/* # [linux] + build: + binary_relocation: false + requirements: + build: + - {{ compiler("c") }} + - {{ compiler("cxx") }} + - {{ stdlib("c") }} + host: + - {{ pin_subpackage("cuda-crt-tools", exact=True) }} + - {{ pin_subpackage("cuda-nvvm-tools", exact=True) }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + - cuda-version {{ cuda_version }} + run: + - {{ pin_compatible("cuda-version", max_pin="x.x") }} + - {{ pin_subpackage("cuda-crt-tools", exact=True) }} + - {{ pin_subpackage("cuda-nvvm-tools", exact=True) }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + run_constrained: + - gcc_impl_{{ target_platform }} {{ gcc_constraint }} # [linux] + test: + requires: + - patchelf # [linux] + files: + - patchelf_exclude.txt # [linux] + - test-rpath-nvcc.sh # [linux] + commands: + - test -f $PREFIX/bin/nvcc # [linux] + - test -f $PREFIX/bin/ptxas # [linux] + - bash test-rpath-nvcc.sh # [linux] + about: + home: https://developer.nvidia.com/cuda-toolkit + license_file: LICENSE + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_url: https://docs.nvidia.com/cuda/eula/index.html + summary: Architecture independent part of CUDA NVCC compiler. + description: | + Compiler for CUDA applications. + doc_url: https://docs.nvidia.com/cuda/index.html + + - name: cuda-nvcc-dev_{{ target_platform }} + build: + noarch: generic + missing_dso_whitelist: # [win] + - "*/api-ms-win-core-winrt-*.dll" # [win] + run_exports: + strong: + - cuda-version >={{ cuda_version }},<{{ cuda_version_next_major }} + files: + # targets/{{ target_name }}/bin/nvcc is only a symlink + - targets/{{ target_name }}/bin # [linux] + - targets/{{ target_name }}/include/*.h # [linux] + - targets/{{ target_name }}/lib # [linux] + - Library\bin\*.exe # [win] + - Library\bin\nvcc.profile # [win] + - Library\include\fatbinary_section.h # [win] + - Library\include\nvPTXCompiler.h # [win] + - Library\lib\nvptxcompiler_static.lib # [win] + requirements: + build: + - {{ stdlib("c") }} + host: + - {{ pin_subpackage("cuda-crt-dev_" + target_platform, exact=True) }} + - {{ pin_subpackage("cuda-nvcc-tools", exact=True) }} + - {{ pin_subpackage("cuda-nvvm-dev_" + target_platform, exact=True) }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + - cuda-version {{ cuda_version }} + # Use libgcc-ng instead of libgcc + - libgcc-ng {{ gcc_min_constraint }} # [linux] + run: + - {{ pin_compatible("cuda-version", max_pin="x.x") }} + - {{ pin_subpackage("cuda-crt-dev_" + target_platform, exact=True) }} + - {{ pin_subpackage("cuda-nvvm-dev_" + target_platform, exact=True) }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + # Use libgcc-ng instead of libgcc + - libgcc-ng {{ gcc_min_constraint }} # [linux] + run_constrained: + - gcc_impl_{{ target_platform }} {{ gcc_constraint }} # [linux] + test: + commands: + - test -L $PREFIX/targets/{{ target_name }}/bin/nvcc # [linux] + - test -f $PREFIX/targets/{{ target_name }}/lib/libnvptxcompiler_static.a # [linux] + - test -f $PREFIX/targets/{{ target_name }}/include/fatbinary_section.h # [linux] + - test -f $PREFIX/targets/{{ target_name }}/include/nvPTXCompiler.h # [linux] + - if not exist %LIBRARY_BIN%\nvcc.exe exit 1 # [win] + - if not exist %LIBRARY_BIN%\nvcc.profile exit 1 # [win] + - if not exist %LIBRARY_LIB%\nvptxcompiler_static.lib exit 1 # [win] + - if not exist %LIBRARY_INC%\nvPTXCompiler.h exit 1 # [win] + about: + home: https://developer.nvidia.com/cuda-toolkit + license_file: LICENSE + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_url: https://docs.nvidia.com/cuda/eula/index.html + summary: Target architecture dependent parts of CUDA NVCC compiler. + description: | + Compiler for CUDA applications. + doc_url: https://docs.nvidia.com/cuda/index.html + + - name: cuda-nvcc-impl + build: + # libnvvm.so gets corrupted by patchelf. No need to relocate as it is already relocatable + binary_relocation: false + run_exports: + strong: + - cuda-version >={{ cuda_version }},<{{ cuda_version_next_major }} + files: # [linux] + - lib/libnvptxcompiler_static.a # [linux] + requirements: + host: + - {{ pin_subpackage("cuda-nvvm-impl", exact=True) }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + - cuda-cudart-dev + - cuda-version {{ cuda_version }} + run: + - {{ pin_subpackage("cuda-nvcc-tools", exact=True) }} + - {{ pin_subpackage("cuda-nvcc-dev_" + target_platform, exact=True) }} + - {{ pin_subpackage("cuda-nvvm-impl", exact=True) }} + - {{ pin_compatible("cuda-version", max_pin="x.x") }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + - cuda-cudart-dev + run_constrained: + - gcc_impl_{{ target_platform }} {{ gcc_constraint }} # [linux] + test: + requires: + - {{ compiler("c") }} + - {{ compiler("cxx") }} + - {{ stdlib("c") }} + - cmake + - cuda-driver-dev # [linux] + - git # [linux] + - ninja + files: + - test.cu + - CMakeLists.txt + - run_nvcc_tests.sh # [linux] + - run_nvcc_tests.bat # [win] + commands: + # these symlinks are provided by the gxx and gcc packages on conda-forge + - ln -sf ${PREFIX}/bin/x86_64-conda-linux-gnu-g++ ${PREFIX}/bin/g++ # [linux and x86_64] + - ln -sf ${PREFIX}/bin/x86_64-conda-linux-gnu-gcc ${PREFIX}/bin/gcc # [linux and x86_64] + - ln -sf ${PREFIX}/bin/aarch64-conda-linux-gnu-g++ ${PREFIX}/bin/g++ # [linux and aarch64] + - ln -sf ${PREFIX}/bin/aarch64-conda-linux-gnu-gcc ${PREFIX}/bin/gcc # [linux and aarch64] + # cmake has trouble finding ar on linux-aarch64; so this needs to be added + # compared to conda-forge. NB conda-forge isn't building this for linux-aarch64 currently. + - if [ ! -f "${PREFIX}/bin/ar" ]; then ln -s "${AR}" "${PREFIX}/bin/ar"; fi # [linux and aarch64] + - test -L $PREFIX/lib/libnvptxcompiler_static.a # [linux] + - {{ exists }} nvcc + - ./run_nvcc_tests.sh # [linux] + - .\run_nvcc_tests.bat # [win] + about: + home: https://developer.nvidia.com/cuda-toolkit + license_file: LICENSE + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_url: https://docs.nvidia.com/cuda/eula/index.html + summary: Compiler for CUDA applications. + description: | + Compiler for CUDA applications. + doc_url: https://docs.nvidia.com/cuda/index.html + + - name: cuda-crt-tools + files: + - bin/crt # [linux] + - Library\bin\crt # [win] + requirements: + host: + - cuda-version {{ cuda_version }} + run: + - {{ pin_compatible("cuda-version", max_pin="x.x") }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + test: + commands: + - test -d $PREFIX/bin/crt # [linux] + - test -f $PREFIX/bin/crt/link.stub # [linux] + - if not exist %LIBRARY_BIN%\crt\link.stub exit 1 # [win] + about: + home: https://developer.nvidia.com/cuda-toolkit + license_file: LICENSE + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_url: https://docs.nvidia.com/cuda/eula/index.html + summary: CUDA internal tools. + description: | + CUDA internal tools. + doc_url: https://docs.nvidia.com/cuda/index.html + + - name: cuda-crt-dev_{{ target_platform }} + build: + noarch: generic + run_exports: + strong: + - cuda-version >={{ cuda_version }},<{{ cuda_version_next_major }} + files: + - targets/{{ target_name }}/include/crt # [linux] + - Library\include\crt # [win] + requirements: + host: + - cuda-version {{ cuda_version }} + run: + - {{ pin_compatible("cuda-version", max_pin="x.x") }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + test: + commands: + - test -f $PREFIX/targets/{{ target_name }}/include/crt/common_functions.h # [linux] + - if not exist %LIBRARY_INC%\crt\common_functions.h exit 1 # [win] + about: + home: https://developer.nvidia.com/cuda-toolkit + license_file: LICENSE + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_url: https://docs.nvidia.com/cuda/eula/index.html + summary: CUDA internal headers. + description: | + CUDA internal headers. + doc_url: https://docs.nvidia.com/cuda/index.html + + - name: cuda-nvvm-tools + files: + - nvvm/bin # [linux] + - nvvm/libdevice # [linux] + - Library\nvvm\bin # [win] + - Library\nvvm\libdevice # [win] + requirements: + build: + - {{ compiler("c") }} + - {{ compiler("cxx") }} + - {{ stdlib("c") }} + host: + - cuda-version {{ cuda_version }} + run: + - {{ pin_compatible("cuda-version", max_pin="x.x") }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + test: + requires: + - patchelf # [linux] + files: + - test-rpath-nvvm.sh # [linux] + commands: + - test -d $PREFIX/nvvm # [linux] + - test -f $PREFIX/nvvm/bin/cicc # [linux] + - bash test-rpath-nvvm.sh # [linux] + - if not exist %LIBRARY_PREFIX%\nvvm\bin\cicc.exe exit 1 # [win] + - if not exist %LIBRARY_PREFIX%\nvvm\libdevice exit 1 # [win] + about: + home: https://developer.nvidia.com/cuda-toolkit + license_file: LICENSE + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_url: https://docs.nvidia.com/cuda/eula/index.html + summary: Compiler for CUDA applications. + description: | + Compiler for CUDA applications. + doc_url: https://docs.nvidia.com/cuda/index.html + + - name: cuda-nvvm-dev_{{ target_platform }} + build: + noarch: generic + files: # [linux] + - targets/{{ target_name }}/nvvm # [linux] + requirements: + host: + - cuda-version {{ cuda_version }} + run: + - {{ pin_compatible("cuda-version", max_pin="x.x") }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + test: + commands: + - test -L $PREFIX/targets/{{ target_name }}/nvvm # [linux] + about: + home: https://developer.nvidia.com/cuda-toolkit + license_file: LICENSE + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_url: https://docs.nvidia.com/cuda/eula/index.html + summary: Compiler for CUDA applications. + description: | + Compiler for CUDA applications. + doc_url: https://docs.nvidia.com/cuda/index.html + + - name: cuda-nvvm-impl + build: + # libnvvm.so gets corrupted by patchelf. No need to relocate as it is already relocatable. + binary_relocation: false + # This is a workaround to ignore the overlinking error for problematic *.so files. + # The reason is that in the Amazon Linux 2-based Docker container, there's py-lief version 0.12.3. + # In the Rocky 8 container, there's 0.16.4, which seems to have this bug. + # See also: + # https://github.com/anaconda/docker-images/blob/main/anaconda-pkg-build/linux/rocky8/Dockerfile + # https://github.com/conda/conda-build/issues/5665 + # https://github.com/conda-forge/conda-build-feedstock/pull/251 + # https://github.com/conda-forge/lief-feedstock/pull/57#issuecomment-2770881269 + # This workaround should be removed when the conda-build fix is merged/py-lief pinned and the rocky 8 docker image rebuilt. + overlinking_ignore_patterns: # [linux and aarch64] + - "nvvm/lib64/libnvvm.so*" # [linux and aarch64] + files: + - nvvm/include # [linux] + - nvvm/lib64 # [linux] + - Library\nvvm\include # [win] + - Library\nvvm\lib # [win] + requirements: + build: + - {{ compiler("c") }} + - {{ compiler("cxx") }} + - {{ stdlib("c") }} + host: + - cuda-version {{ cuda_version }} + run: + - {{ pin_compatible("cuda-version", max_pin="x.x") }} + - arm-variant * {{ arm_variant_type }} # [aarch64] + test: + requires: + - patchelf # [linux] + files: + - test-rpath-nvvm.sh # [linux] + commands: + - test -d $PREFIX/nvvm/include # [linux] + - test -d $PREFIX/nvvm/lib64 # [linux] + - bash test-rpath-nvvm.sh # [linux] + - if not exist %LIBRARY_PREFIX%\nvvm\include exit 1 # [win] + - if not exist %LIBRARY_PREFIX%\nvvm\lib exit 1 # [win] + about: + home: https://developer.nvidia.com/cuda-toolkit + license_file: LICENSE + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_url: https://docs.nvidia.com/cuda/eula/index.html + summary: Compiler for CUDA applications. + description: | + Compiler for CUDA applications. + doc_url: https://docs.nvidia.com/cuda/index.html + +about: + home: https://developer.nvidia.com/cuda-toolkit + license_file: LICENSE + license: LicenseRef-NVIDIA-End-User-License-Agreement + license_url: https://docs.nvidia.com/cuda/eula/index.html + summary: Compiler for CUDA applications. + description: | + Compiler for CUDA applications. + doc_url: https://docs.nvidia.com/cuda/index.html + +extra: + feedstock-name: cuda-nvcc-impl + recipe-maintainers: + - conda-forge/cuda diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/nvcc.profile.patch b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/nvcc.profile.patch new file mode 100644 index 0000000000000000000000000000000000000000..4a9713ee43f519c94a8956c6f2ba2e13079205cb --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/nvcc.profile.patch @@ -0,0 +1,23 @@ +--- bin/nvcc.profile.bak 2024-03-12 15:52:23.511145665 +0000 ++++ bin/nvcc.profile 2024-03-12 16:27:28.806624738 +0000 +@@ -1,15 +1,15 @@ + +-TOP = $(_HERE_)/.. ++TOP = $(_HERE_)/../$(_TARGET_DIR_) + + CICC_PATH = $(TOP)/nvvm/bin + NVVMIR_LIBRARY_DIR = $(TOP)/nvvm/libdevice + + LD_LIBRARY_PATH += $(TOP)/lib: +-PATH += $(CICC_PATH):$(_HERE_): ++PATH += $(TOP)/bin:$(CICC_PATH):$(TOP)/../../bin:$(TOP)/../../$(_NVVM_BRANCH_)/bin: + +-INCLUDES += "-I$(TOP)/$(_TARGET_DIR_)/include" $(_SPACE_) ++INCLUDES += "-I$(TOP)/include" $(_SPACE_) + +-LIBRARIES =+ $(_SPACE_) "-L$(TOP)/$(_TARGET_DIR_)/lib$(_TARGET_SIZE_)/stubs" "-L$(TOP)/$(_TARGET_DIR_)/lib$(_TARGET_SIZE_)" ++LIBRARIES =+ $(_SPACE_) "-L$(TOP)/lib/stubs" "-L$(TOP)/lib" + + CUDAFE_FLAGS += + PTXAS_FLAGS += + diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/nvcc.profile.patch.win b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/nvcc.profile.patch.win new file mode 100644 index 0000000000000000000000000000000000000000..96ada0ba28d8ee0a3e10b37b1f9ca1fb4f6be7b0 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/nvcc.profile.patch.win @@ -0,0 +1,14 @@ +--- bin/nvcc.profile 2023-03-23 15:56:49.535384866 -0400 ++++ bin/nvcc.profile.new 2023-03-23 19:21:08.071151138 -0400 +@@ -5,9 +5,9 @@ + + PATH += $(TOP)/$(_NVVM_BRANCH_)/bin;$(_HERE_);$(TOP)/lib; + +-INCLUDES += "-I$(TOP)/include" $(_SPACE_) ++INCLUDES += "-I$(TOP)/include" $(_SPACE_) "-I$(TOP)/include/targets/$(_WIN_PLATFORM_)" $(_SPACE_) + +-LIBRARIES =+ $(_SPACE_) "/LIBPATH:$(TOP)/lib/$(_WIN_PLATFORM_)" ++LIBRARIES =+ $(_SPACE_) "/LIBPATH:$(TOP)/lib/$(_WIN_PLATFORM_)" $(_SPACE_) "/LIBPATH:$(TOP)/lib" + + CUDAFE_FLAGS += + PTXAS_FLAGS += diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/patchelf_exclude.txt b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/patchelf_exclude.txt new file mode 100644 index 0000000000000000000000000000000000000000..3075b28c97b65aaecf7b3a870e0fa29bfdf54f5b --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/patchelf_exclude.txt @@ -0,0 +1,4 @@ +link.stub +prelink.stub +nvcc.profile +patchelf diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/run_nvcc_tests.bat b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/run_nvcc_tests.bat new file mode 100644 index 0000000000000000000000000000000000000000..852f98821e74ed49eb40fc691a2aab917575936f --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/run_nvcc_tests.bat @@ -0,0 +1,45 @@ +@echo on + +nvcc --version +if errorlevel 1 exit 1 + +nvcc --verbose test.cu +if errorlevel 1 exit 1 + +cmake -S . -B ./build -G=Ninja && cmake --build ./build -v +if errorlevel 1 exit 1 + +REM Get CMake version for cloning the right branch +for /f "tokens=3" %%i in ('cmake --version ^| findstr version') do set CMAKE_VERSION=%%i + +REM Clone and build CMake's test suite +md cmake-tests +git clone -b v%CMAKE_VERSION% --depth 1 https://gitlab.kitware.com/cmake/cmake.git cmake-tests +if errorlevel 1 exit 1 + +cmake -S cmake-tests -B cmake-tests/build -DCMake_TEST_HOST_CMAKE=ON -DCMake_TEST_CUDA=nvcc -G "Ninja" +if errorlevel 1 exit 1 + +REM Change to the CMake test build directory and run CUDA tests +cd cmake-tests\build + +REM Test exclusion list: +REM Requires CUDA libraries not available in build environment +REM ProperDeviceLibraries (needs cublas) +REM *SharedRuntime* (needs curand) +REM +REM Requires execution on a machine with a CUDA GPU +REM ObjectLibrary, WithC, StubRPATH, ArchSpecial, GPUDebugFlag +REM SeparateCompilationPTX, WithDefs, CUBIN, Fatbin, OptixIR +REM CUDA_architectures, *Toolkit* +REM +REM Failing due to glibc symbol issues +REM Cuda.Complex +REM +REM Windows-specific issues (path length, resource compiler, command parsing) +REM CompileFeatures - Windows environment compatibility issues +REM NinjaMultiConfig - Windows resource compiler and manifest file issues +REM UnityBuild - Windows path length limitations (250 character limit) +REM RuntimeControls - Windows command parsing issues with complex paths +ctest -L CUDA --output-on-failure -E "(Architecture|CompileFlags|DeviceLTO|ProperDeviceLibraries|SharedRuntime|ObjectLibrary|WithC|StubRPATH|ArchSpecial|GPUDebugFlag|SeparateCompilationPTX|WithDefs|CUBIN|Fatbin|OptixIR|CUDA_architectures|Toolkit|Cuda.Complex|CompileFeatures|NinjaMultiConfig|UnityBuild|RuntimeControls)" +if errorlevel 1 exit 1 diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/run_nvcc_tests.sh b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/run_nvcc_tests.sh new file mode 100644 index 0000000000000000000000000000000000000000..cde7715a4242ebefd204db4515da75e054499d8e --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/run_nvcc_tests.sh @@ -0,0 +1,67 @@ +#!/bin/bash +set -e +set -x + +kernel_name="$(uname -s)" +if [[ "${kernel_name}" != "Linux" ]] +then + echo "Unknown OS. Expected Linux, but found ${kernel_name}" + exit 1 +fi + +processor_name="$(uname -m)" +case "${processor_name}" in + "x86_64") test_platform="linux-64" ;; + "aarch64") test_platform="linux-aarch64" ;; + "ppc64le") test_platform="linux-ppc64le" ;; + *) echo "Unknown architecture: ${processor_name}" && exit 1 ;; +esac + +if [[ "${test_platform}" != "${target_platform}" ]] +then + echo "Skipping NVCC testing as current platform is ${test_platform}, whereas; NVCC is built for ${target_platform}." + exit 0 +fi + +cmake_version=$(cmake --version | grep version | awk '{print $3}') + +nvcc --version + +nvcc --verbose test.cu + +cmake -S . -B ./build -G=Ninja && cmake --build ./build -v + +if [[ "${target_platform}" == "linux-ppc64le" ]] +then + echo "Skipping CMake tests on ${target_platform} due to known issues." + exit 0 +fi + +mkdir -p cmake-tests +git clone -b v${cmake_version} --depth 1 https://gitlab.kitware.com/cmake/cmake.git cmake-tests +cmake -S cmake-tests -B cmake-tests/build -DCMake_TEST_HOST_CMAKE=ON -DCMake_TEST_CUDA=nvcc -G "Ninja" +cd cmake-tests/build + +# Test exclusion list: +# Requires cublas +# Cuda.ProperDeviceLibraries +# +# Requires curand +# *SharedRuntime* +# +# Requires execution on a machine with a CUDA GPU +# Cuda.ObjectLibrary +# Cuda.WithC +# Cuda.StubRPATH +# CudaOnly.ArchSpecial +# CudaOnly.GPUDebugFlag +# CudaOnly.SeparateCompilationPTX +# CudaOnly.WithDefs +# CudaOnly.CUBIN +# CudaOnly.Fatbin +# CudaOnly.OptixIR +# RunCMake.CUDA_architectures +# *Toolkit* +# Failing due to undefined symbol: __libc_dl_error_tsd, version GLIBC_PRIVATE +# Cuda.Complex +CUDAHOSTCXX=$CXX ctest -L CUDA --output-on-failure -j $(nproc) -E "(ProperDeviceLibraries|SharedRuntime|ObjectLibrary|WithC|StubRPATH|ArchSpecial|GPUDebugFlag|SeparateCompilationPTX|WithDefs|CUBIN|Fatbin|OptixIR|CUDA_architectures|Toolkit|Cuda.Complex)" diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/test-rpath-nvcc.sh b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/test-rpath-nvcc.sh new file mode 100644 index 0000000000000000000000000000000000000000..a3de7e6b591acdb50946ea586a697c4b464350de --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/test-rpath-nvcc.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +[[ ${target_platform} == "linux-64" ]] && targetsDir="targets/x86_64-linux" +[[ ${target_platform} == "linux-ppc64le" ]] && targetsDir="targets/ppc64le-linux" +# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html?highlight=tegra#cross-compilation +[[ ${target_platform} == "linux-aarch64" && ${arm_variant_type} == "sbsa" ]] && targetsDir="targets/sbsa-linux" +[[ ${target_platform} == "linux-aarch64" && ${arm_variant_type} == "tegra" ]] && targetsDir="targets/aarch64-linux" + +if [ -z "${targetsDir+x}" ]; then + echo "target_platform: ${target_platform} is unknown! targetsDir must be defined!" >&2 + exit 1 +fi + +errors="" + +for item in `find ${PREFIX}/bin -type f`; do + filename=$(basename "${item}") + echo "Artifact to test: ${filename}" + + if grep -qx "${filename}" patchelf_exclude.txt; then + echo Skipping ${filename} as it is not subject to testing + continue + fi + + pkg_info=$(conda package -w "${item}") + echo "\$PKG_NAME: ${PKG_NAME}" + echo "\$pkg_info: ${pkg_info}" + + if [[ ! "$pkg_info" == *"$PKG_NAME"* ]]; then + echo "Not a match, skipping ${item}" + continue + fi + + echo "Match found, testing ${item}" + + rpath=$(patchelf --print-rpath "${item}") + echo "${item} rpath: ${rpath}" + + if [[ ${item} =~ /bin/ && $rpath != "\$ORIGIN/../lib:\$ORIGIN/../${targetsDir}/lib" ]]; then + errors+="${item}\n" + elif [[ $(objdump -x ${item} | grep "PATH") == *"RUNPATH"* ]]; then + errors+="${item}\n" + fi +done + +if [[ $errors ]]; then + echo "The following items were found with an unexpected RPATH:" + echo -e "${errors}" + exit 1 +fi diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/test-rpath-nvvm.sh b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/test-rpath-nvvm.sh new file mode 100644 index 0000000000000000000000000000000000000000..2779d0b0240e6c8d0b696543a23811dc258cb045 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/test-rpath-nvvm.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +[[ ${target_platform} == "linux-64" ]] && targetsDir="targets/x86_64-linux" +[[ ${target_platform} == "linux-ppc64le" ]] && targetsDir="targets/ppc64le-linux" +# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html?highlight=tegra#cross-compilation +[[ ${target_platform} == "linux-aarch64" && ${arm_variant_type} == "sbsa" ]] && targetsDir="targets/sbsa-linux" +[[ ${target_platform} == "linux-aarch64" && ${arm_variant_type} == "tegra" ]] && targetsDir="targets/aarch64-linux" + +if [ -z "${targetsDir+x}" ]; then + echo "target_platform: ${target_platform} is unknown! targetsDir must be defined!" >&2 + exit 1 +fi + +errors="" + +dirs=() +[[ -d ${PREFIX}/nvvm/bin ]] && dirs+=(${PREFIX}/nvvm/bin) +[[ -d ${PREFIX}/nvvm/lib64 ]] && dirs+=(${PREFIX}/nvvm/lib64) + +if [[ ${#dirs[@]} == 0 ]]; then + echo "There is nothing to test. Returning." + exit +fi + +for item in `find ${dirs[@]} -type f`; do + [[ -L $item ]] && continue + + echo "Artifact to test: ${item}" + filename=$(basename "${item}") + + pkg_info=$(conda package -w "${item}") + echo "\$PKG_NAME: ${PKG_NAME}" + echo "\$pkg_info: ${pkg_info}" + + if [[ ! "$pkg_info" == *"$PKG_NAME"* ]]; then + echo "Not a match, skipping ${item}" + continue + fi + + echo "Match found, testing ${item}" + + rpath=$(patchelf --print-rpath "${item}") + echo "${item} rpath: ${rpath}" + + if [[ ${item} =~ /nvvm/bin/ && $rpath != "\$ORIGIN/../lib64:\$ORIGIN/../../lib:\$ORIGIN/../../${targetsDir}/lib" ]]; then + errors+="${item}\n" + elif [[ ${item} =~ nvvm/lib64/ && $rpath != "\$ORIGIN" ]]; then + errors+="${item}\n" + elif [[ $(objdump -x ${item} | grep "PATH") == *"RUNPATH"* ]]; then + errors+="${item}\n" + fi +done + +if [[ $errors ]]; then + echo "The following items were found with an unexpected RPATH:" + echo -e "${errors}" + exit 1 +fi diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/test.cu b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/test.cu new file mode 100644 index 0000000000000000000000000000000000000000..33c14ce1d76c0abf607ca769d1c3f913b0a7e421 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/recipe/parent/test.cu @@ -0,0 +1,3 @@ +int main() { + return 0; +} diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/repodata_record.json b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..7b691482106b0df607d210d5f4fc3c94aa202f71 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/repodata_record.json @@ -0,0 +1,21 @@ +{ + "name": "cuda-crt-dev_linux-64", + "version": "12.8.93", + "build": "h06a4308_3", + "build_number": 3, + "channel": "https://repo.anaconda.com/pkgs/main/noarch", + "subdir": "noarch", + "fn": "cuda-crt-dev_linux-64-12.8.93-h06a4308_3.conda", + "md5": "6c7339b995d6050894acf9f68b5ae2fb", + "url": "https://repo.anaconda.com/pkgs/main/noarch/cuda-crt-dev_linux-64-12.8.93-h06a4308_3.conda", + "sha256": "9fe58ce5dc6acb9d3b76fba71eabe6dc15296d681733c6568ed71985b4496906", + "depends": [ + "cuda-version >=12.8,<12.9.0a0" + ], + "constrains": [], + "noarch": "generic", + "license": "LicenseRef-NVIDIA-End-User-License-Agreement", + "package_type": "noarch_generic", + "timestamp": 1758920527000, + "size": 92655 +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/test/run_test.bat b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/test/run_test.bat new file mode 100644 index 0000000000000000000000000000000000000000..0260ba72f74a5affaaa39843fc741ed4541b8bac --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/test/run_test.bat @@ -0,0 +1,7 @@ + + + + +test -f $PREFIX/targets/x86_64-linux/include/crt/common_functions.h +IF %ERRORLEVEL% NEQ 0 exit /B 1 +exit /B 0 diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/test/run_test.sh b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..ea533d2815a08bddabf6f3e225958aa2f9ccc74e --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/info/test/run_test.sh @@ -0,0 +1,8 @@ + + +set -ex + + + +test -f $PREFIX/targets/x86_64-linux/include/crt/common_functions.h +exit 0 diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/common_functions.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/common_functions.h new file mode 100644 index 0000000000000000000000000000000000000000..b7e70950fb51d0d58f8dd99239e6b36ba89c4779 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/common_functions.h @@ -0,0 +1,310 @@ +/* + * Copyright 1993-2021 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/common_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/common_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_COMMON_FUNCTIONS_H__ +#endif + +#if !defined(__COMMON_FUNCTIONS_H__) +#define __COMMON_FUNCTIONS_H__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#include "builtin_types.h" +#include "host_defines.h" + +#define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead." + +#ifndef __CUDA_API_VER_MAJOR__ +#define __CUDA_API_VER_MAJOR__ __CUDACC_VER_MAJOR__ +#endif /* __CUDA_API_VER_MAJOR__ */ + +#ifndef __CUDA_API_VER_MINOR__ +#define __CUDA_API_VER_MINOR__ __CUDACC_VER_MINOR__ +#endif /* __CUDA_API_VER_MINOR__ */ + +#if !defined(__CUDACC_RTC__) +#include +#include + +extern "C" +{ +#endif /* !__CUDACC_RTC__ */ +extern _CRTIMP __host__ __device__ __device_builtin__ __cudart_builtin__ clock_t __cdecl clock(void) +#if defined(__QNX__) +asm("clock32") +#endif +__THROW; +extern __host__ __device__ __device_builtin__ __cudart_builtin__ void* __cdecl memset(void*, int, size_t) __THROW; +extern __host__ __device__ __device_builtin__ __cudart_builtin__ void* __cdecl memcpy(void*, const void*, size_t) __THROW; +#if !defined(__CUDACC_RTC__) +} +#endif /* !__CUDACC_RTC__ */ + +#if defined(__CUDA_ARCH__) + +#if defined(__CUDACC_RTC__) +inline __host__ __device__ void* operator new(size_t, void *p) { return p; } +inline __host__ __device__ void* operator new[](size_t, void *p) { return p; } +inline __host__ __device__ void operator delete(void*, void*) { } +inline __host__ __device__ void operator delete[](void*, void*) { } +#else /* !__CUDACC_RTC__ */ +#ifndef __CUDA_INTERNAL_SKIP_CPP_HEADERS__ +#include +#endif + +#if defined (__GNUC__) + +#define STD \ + std:: + +#else /* __GNUC__ */ + +#define STD + +#endif /* __GNUC__ */ + +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new(STD size_t, void*) throw(); +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new[](STD size_t, void*) throw(); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*, void*) throw(); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*, void*) throw(); +# if __cplusplus >= 201402L || (defined(_MSC_VER) && _MSC_VER >= 1900) || defined(__CUDA_XLC_CPP14__) || defined(__CUDA_ICC_CPP14__) +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*, STD size_t) throw(); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*, STD size_t) throw(); +#endif /* __cplusplus >= 201402L || (defined(_MSC_VER) && _MSC_VER >= 1900) || defined(__CUDA_XLC_CPP14__) || defined(__CUDA_ICC_CPP14__) */ +#endif /* __CUDACC_RTC__ */ + +#if !defined(__CUDACC_RTC__) +#include +#include +#endif /* !__CUDACC_RTC__ */ + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +extern "C" +{ +extern +#if !defined(_MSC_VER) || _MSC_VER < 1900 +_CRTIMP +#endif + +#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ( (__GLIBC__ < 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3) ) ) +__host__ __device__ __device_builtin__ __cudart_builtin__ int __cdecl printf(const char*, ...) __THROW; +#else /* newer glibc */ +__host__ __device__ __device_builtin__ __cudart_builtin__ int __cdecl printf(const char*, ...); +#endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ( (__GLIBC__ < 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3) ) ) */ + + +extern _CRTIMP __host__ __device__ __cudart_builtin__ void* __cdecl malloc(size_t) __THROW; +extern _CRTIMP __host__ __device__ __cudart_builtin__ void __cdecl free(void*) __THROW; + +#if defined(_MSC_VER) +extern __host__ __device__ __cudart_builtin__ void* __cdecl _alloca(size_t); +#endif + +#if defined(__QNX__) +#undef alloca +#define alloca(__S) __builtin_alloca(__S) +#endif +} +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +#if !defined(__CUDACC_RTC__) +#include +#endif /* !__CUDACC_RTC__ */ + +extern "C" +{ +#if defined(__CUDACC_RTC__) +extern __host__ __device__ void __assertfail(const char * __assertion, + const char *__file, + unsigned int __line, + const char *__function, + size_t charsize); +#elif defined(__APPLE__) +#define __builtin_expect(exp,c) (exp) +extern __host__ __device__ __cudart_builtin__ void __assert_rtn( + const char *, const char *, int, const char *); +#elif defined(__ANDROID__) +extern __host__ __device__ __cudart_builtin__ void __assert2( + const char *, int, const char *, const char *); +#elif defined(__QNX__) +#if !defined(_LIBCPP_VERSION) +namespace std { +#endif +extern __host__ __device__ __cudart_builtin__ void __assert( + const char *, const char *, unsigned int, const char *); +#if !defined(_LIBCPP_VERSION) +} +#endif +#elif defined(__HORIZON__) +extern __host__ __device__ __cudart_builtin__ void __assert_fail( + const char *, const char *, int, const char *); +#elif defined(__GNUC__) +extern __host__ __device__ __cudart_builtin__ void __assert_fail( + const char *, const char *, unsigned int, const char *) + __THROW; +#elif defined(_WIN32) +extern __host__ __device__ __cudart_builtin__ _CRTIMP void __cdecl _wassert( + const wchar_t *, const wchar_t *, unsigned); +#endif +} + +#if defined(__CUDACC_RTC__) +#ifdef NDEBUG +#define assert(e) (static_cast(0)) +#else /* !NDEBUG */ +#define __ASSERT_STR_HELPER(x) #x +#define assert(e) ((e) ? static_cast(0)\ + : __assertfail(__ASSERT_STR_HELPER(e), __FILE__,\ + __LINE__, __PRETTY_FUNCTION__,\ + sizeof(char))) +#endif /* NDEBUG */ +__host__ __device__ void* operator new(size_t); +__host__ __device__ void* operator new[](size_t); +__host__ __device__ void operator delete(void*); +__host__ __device__ void operator delete[](void*); +# if __cplusplus >= 201402L +__host__ __device__ void operator delete(void*, size_t); +__host__ __device__ void operator delete[](void*, size_t); +#endif /* __cplusplus >= 201402L */ + +#if __cplusplus >= 201703L +namespace std { enum class align_val_t : size_t {}; } +__host__ __device__ void* __cdecl operator new(size_t sz, std::align_val_t) noexcept; +__host__ __device__ void* __cdecl operator new[](size_t sz, std::align_val_t) noexcept; +__host__ __device__ void __cdecl operator delete(void* ptr, std::align_val_t) noexcept; +__host__ __device__ void __cdecl operator delete[](void* ptr, std::align_val_t) noexcept; +__host__ __device__ void __cdecl operator delete(void* ptr, size_t, std::align_val_t) noexcept; +__host__ __device__ void __cdecl operator delete[](void* ptr, size_t, std::align_val_t) noexcept; +#endif /* __cplusplus >= 201703L */ + +#else /* !__CUDACC_RTC__ */ +#if defined (__GNUC__) + +#define __NV_GLIBCXX_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) + +#if (__cplusplus >= 201103L) && ((!(defined(__QNX__) && defined(_LIBCPP_VERSION))) || (defined(__QNX__) && __NV_GLIBCXX_VERSION >= 80300)) +#define THROWBADALLOC +#else +#if defined(__ANDROID__) && !defined(_LIBCPP_VERSION) && (defined(__BIONIC__) || __NV_GLIBCXX_VERSION < 40900) +#define THROWBADALLOC +#else +#define THROWBADALLOC throw(STD bad_alloc) +#endif +#endif +#define __DELETE_THROW throw() + +#undef __NV_GLIBCXX_VERSION + +#else /* __GNUC__ */ + +#define THROWBADALLOC throw(...) + +#endif /* __GNUC__ */ + +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new(STD size_t) THROWBADALLOC; +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new[](STD size_t) THROWBADALLOC; +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*) throw(); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*) throw(); +# if __cplusplus >= 201402L || (defined(_MSC_VER) && _MSC_VER >= 1900) || defined(__CUDA_XLC_CPP14__) || defined(__CUDA_ICC_CPP14__) +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*, STD size_t) throw(); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*, STD size_t) throw(); +#endif /* __cplusplus >= 201402L || (defined(_MSC_VER) && _MSC_VER >= 1900) || defined(__CUDA_XLC_CPP14__) || defined(__CUDA_ICC_CPP14__) */ + +#if __cpp_aligned_new +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new(STD size_t, std::align_val_t); +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new[](STD size_t, std::align_val_t); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*, std::align_val_t) noexcept; +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*, std::align_val_t) noexcept; +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*, STD size_t, std::align_val_t) noexcept; +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*, STD size_t, std::align_val_t) noexcept; +#endif /* __cpp_aligned_new */ + +#undef THROWBADALLOC +#undef STD +#endif /* __CUDACC_RTC__ */ + +#endif /* __CUDA_ARCH__ */ + +#endif /* __cplusplus && __CUDACC__ */ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__CUDACC_RTC__) && (__CUDA_ARCH__ >= 350) +#include "cuda_device_runtime_api.h" +#endif + +#include "math_functions.h" + +#endif /* !__COMMON_FUNCTIONS_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_COMMON_FUNCTIONS_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_COMMON_FUNCTIONS_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/cudacc_ext.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/cudacc_ext.h new file mode 100644 index 0000000000000000000000000000000000000000..8d244463e73f0f7569a4707002c8e059bca67c6d --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/cudacc_ext.h @@ -0,0 +1,64 @@ +/* + * Copyright 2021-2021 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/cudacc_ext.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/cudacc_ext.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_CUDACC_EXT_H__ +#endif + + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_CUDACC_EXT_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_CUDACC_EXT_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_double_functions.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_double_functions.h new file mode 100644 index 0000000000000000000000000000000000000000..7849c6c6e099e85a4676e7c9c38c05b5a5b02d26 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_double_functions.h @@ -0,0 +1,1192 @@ +/* + * Copyright 1993-2021 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/device_double_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/device_double_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_DOUBLE_FUNCTIONS_H__ +#endif + +#if !defined(__DEVICE_DOUBLE_FUNCTIONS_H__) +#define __DEVICE_DOUBLE_FUNCTIONS_H__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__cplusplus) && defined(__CUDACC__) + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__CUDACC_RTC__) +#define __DEVICE_DOUBLE_FUNCTIONS_DECL__ __device__ +#else +#define __DEVICE_DOUBLE_FUNCTIONS_DECL__ static __inline__ __device__ +#endif /* __CUDACC_RTC__ */ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +//NOTE: For NVRTC, these declarations have been moved into the compiler (to reduce compile time) +#define EXCLUDE_FROM_RTC + +extern "C" +{ +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Reinterpret bits in a double as a 64-bit signed integer. + * + * Reinterpret the bits in the double-precision floating-point value \p x + * as a signed 64-bit integer. + * \return Returns reinterpreted value. + */ +extern __device__ __device_builtin__ long long int __double_as_longlong(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Reinterpret bits in a 64-bit signed integer as a double. + * + * Reinterpret the bits in the 64-bit signed integer value \p x as + * a double-precision floating-point value. + * \return Returns reinterpreted value. + */ +extern __device__ __device_builtin__ double __longlong_as_double(long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Compute + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single operation in round-to-nearest-even mode. + * + * Computes the value of + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single ternary operation, rounding the + * result once in round-to-nearest-even mode. + * + * \return Returns the rounded value of + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single operation. + * - fmaf( + * \latexonly $\pm \infty$ \endlatexonly + * \xmlonly + * + * + * ± + * ∞ + * + * + * \endxmlonly + * , + * \latexonly $\pm 0$ \endlatexonly + * \xmlonly + * + * + * ± + * 0 + * + * + * \endxmlonly + * , \p z) returns NaN. + * - fmaf( + * \latexonly $\pm 0$ \endlatexonly + * \xmlonly + * + * + * ± + * 0 + * + * + * \endxmlonly + * , + * \latexonly $\pm \infty$ \endlatexonly + * \xmlonly + * + * + * ± + * ∞ + * + * + * \endxmlonly + * , \p z) returns NaN. + * - fmaf(\p x, \p y, + * \latexonly $-\infty$ \endlatexonly + * \xmlonly + * + * + * - + * ∞ + * + * + * \endxmlonly + * ) returns NaN if + * \latexonly $x \times y$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + * + * \endxmlonly + * is an exact + * \latexonly $+\infty$ \endlatexonly + * \xmlonly + * + * + * + + * ∞ + * + * + * \endxmlonly + * . + * - fmaf(\p x, \p y, + * \latexonly $+\infty$ \endlatexonly + * \xmlonly + * + * + * + + * ∞ + * + * + * \endxmlonly + * ) returns NaN if + * \latexonly $x \times y$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + * + * \endxmlonly + * is an exact + * \latexonly $-\infty$ \endlatexonly + * \xmlonly + * + * + * - + * ∞ + * + * + * \endxmlonly + * . + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ double __fma_rn(double x, double y, double z); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Compute + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single operation in round-towards-zero mode. + * + * Computes the value of + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single ternary operation, rounding the + * result once in round-towards-zero mode. + * + * \return Returns the rounded value of + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single operation. + * - fmaf( + * \latexonly $\pm \infty$ \endlatexonly + * \xmlonly + * + * + * ± + * ∞ + * + * + * \endxmlonly + * , + * \latexonly $\pm 0$ \endlatexonly + * \xmlonly + * + * + * ± + * 0 + * + * + * \endxmlonly + * , \p z) returns NaN. + * - fmaf( + * \latexonly $\pm 0$ \endlatexonly + * \xmlonly + * + * + * ± + * 0 + * + * + * \endxmlonly + * , + * \latexonly $\pm \infty$ \endlatexonly + * \xmlonly + * + * + * ± + * ∞ + * + * + * \endxmlonly + * , \p z) returns NaN. + * - fmaf(\p x, \p y, + * \latexonly $-\infty$ \endlatexonly + * \xmlonly + * + * + * - + * ∞ + * + * + * \endxmlonly + * ) returns NaN if + * \latexonly $x \times y$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + * + * \endxmlonly + * is an exact + * \latexonly $+\infty$ \endlatexonly + * \xmlonly + * + * + * + + * ∞ + * + * + * \endxmlonly + * . + * - fmaf(\p x, \p y, + * \latexonly $+\infty$ \endlatexonly + * \xmlonly + * + * + * + + * ∞ + * + * + * \endxmlonly + * ) returns NaN if + * \latexonly $x \times y$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + * + * \endxmlonly + * is an exact + * \latexonly $-\infty$ \endlatexonly + * \xmlonly + * + * + * - + * ∞ + * + * + * \endxmlonly + * . + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ double __fma_rz(double x, double y, double z); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Compute + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single operation in round-up mode. + * + * Computes the value of + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single ternary operation, rounding the + * result once in round-up (to positive infinity) mode. + * + * \return Returns the rounded value of + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single operation. + * - fmaf( + * \latexonly $\pm \infty$ \endlatexonly + * \xmlonly + * + * + * ± + * ∞ + * + * + * \endxmlonly + * , + * \latexonly $\pm 0$ \endlatexonly + * \xmlonly + * + * + * ± + * 0 + * + * + * \endxmlonly + * , \p z) returns NaN. + * - fmaf( + * \latexonly $\pm 0$ \endlatexonly + * \xmlonly + * + * + * ± + * 0 + * + * + * \endxmlonly + * , + * \latexonly $\pm \infty$ \endlatexonly + * \xmlonly + * + * + * ± + * ∞ + * + * + * \endxmlonly + * , \p z) returns NaN. + * - fmaf(\p x, \p y, + * \latexonly $-\infty$ \endlatexonly + * \xmlonly + * + * + * - + * ∞ + * + * + * \endxmlonly + * ) returns NaN if + * \latexonly $x \times y$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + * + * \endxmlonly + * is an exact + * \latexonly $+\infty$ \endlatexonly + * \xmlonly + * + * + * + + * ∞ + * + * + * \endxmlonly + * . + * - fmaf(\p x, \p y, + * \latexonly $+\infty$ \endlatexonly + * \xmlonly + * + * + * + + * ∞ + * + * + * \endxmlonly + * ) returns NaN if + * \latexonly $x \times y$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + * + * \endxmlonly + * is an exact + * \latexonly $-\infty$ \endlatexonly + * \xmlonly + * + * + * - + * ∞ + * + * + * \endxmlonly + * . + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ double __fma_ru(double x, double y, double z); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Compute + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single operation in round-down mode. + * + * Computes the value of + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single ternary operation, rounding the + * result once in round-down (to negative infinity) mode. + * + * \return Returns the rounded value of + * \latexonly $x \times y + z$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + + * z + * + * + * \endxmlonly + * as a single operation. + * - fmaf( + * \latexonly $\pm \infty$ \endlatexonly + * \xmlonly + * + * + * ± + * ∞ + * + * + * \endxmlonly + * , + * \latexonly $\pm 0$ \endlatexonly + * \xmlonly + * + * + * ± + * 0 + * + * + * \endxmlonly + * , \p z) returns NaN. + * - fmaf( + * \latexonly $\pm 0$ \endlatexonly + * \xmlonly + * + * + * ± + * 0 + * + * + * \endxmlonly + * , + * \latexonly $\pm \infty$ \endlatexonly + * \xmlonly + * + * + * ± + * ∞ + * + * + * \endxmlonly + * , \p z) returns NaN. + * - fmaf(\p x, \p y, + * \latexonly $-\infty$ \endlatexonly + * \xmlonly + * + * + * - + * ∞ + * + * + * \endxmlonly + * ) returns NaN if + * \latexonly $x \times y$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + * + * \endxmlonly + * is an exact + * \latexonly $+\infty$ \endlatexonly + * \xmlonly + * + * + * + + * ∞ + * + * + * \endxmlonly + * . + * - fmaf(\p x, \p y, + * \latexonly $+\infty$ \endlatexonly + * \xmlonly + * + * + * + + * ∞ + * + * + * \endxmlonly + * ) returns NaN if + * \latexonly $x \times y$ \endlatexonly + * \xmlonly + * + * + * x + * × + * y + * + * + * \endxmlonly + * is an exact + * \latexonly $-\infty$ \endlatexonly + * \xmlonly + * + * + * - + * ∞ + * + * + * \endxmlonly + * . + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ double __fma_rd(double x, double y, double z); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Add two floating-point values in round-to-nearest-even mode. + * + * Adds two floating-point values \p x and \p y in round-to-nearest-even mode. + * + * \return Returns \p x + \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dadd_rn(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Add two floating-point values in round-towards-zero mode. + * + * Adds two floating-point values \p x and \p y in round-towards-zero mode. + * + * \return Returns \p x + \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dadd_rz(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Add two floating-point values in round-up mode. + * + * Adds two floating-point values \p x and \p y in round-up (to positive infinity) mode. + * + * \return Returns \p x + \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dadd_ru(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Add two floating-point values in round-down mode. + * + * Adds two floating-point values \p x and \p y in round-down (to negative infinity) mode. + * + * \return Returns \p x + \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dadd_rd(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Subtract two floating-point values in round-to-nearest-even mode. + * + * Subtracts two floating-point values \p x and \p y in round-to-nearest-even mode. + * + * \return Returns \p x - \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dsub_rn(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Subtract two floating-point values in round-towards-zero mode. + * + * Subtracts two floating-point values \p x and \p y in round-towards-zero mode. + * + * \return Returns \p x - \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dsub_rz(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Subtract two floating-point values in round-up mode. + * + * Subtracts two floating-point values \p x and \p y in round-up (to positive infinity) mode. + * + * \return Returns \p x - \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dsub_ru(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Subtract two floating-point values in round-down mode. + * + * Subtracts two floating-point values \p x and \p y in round-down (to negative infinity) mode. + * + * \return Returns \p x - \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dsub_rd(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Multiply two floating-point values in round-to-nearest-even mode. + * + * Multiplies two floating-point values \p x and \p y in round-to-nearest-even mode. + * + * \return Returns \p x * \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dmul_rn(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Multiply two floating-point values in round-towards-zero mode. + * + * Multiplies two floating-point values \p x and \p y in round-towards-zero mode. + * + * \return Returns \p x * \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dmul_rz(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Multiply two floating-point values in round-up mode. + * + * Multiplies two floating-point values \p x and \p y in round-up (to positive infinity) mode. + * + * \return Returns \p x * \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dmul_ru(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_DOUBLE + * \brief Multiply two floating-point values in round-down mode. + * + * Multiplies two floating-point values \p x and \p y in round-down (to negative infinity) mode. + * + * \return Returns \p x * \p y. + * + * \note_accuracy_double + * \note_nofma + */ +extern __device__ __device_builtin__ double __dmul_rd(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a float in round-to-nearest-even mode. + * + * Convert the double-precision floating-point value \p x to a single-precision + * floating-point value in round-to-nearest-even mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ float __double2float_rn(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a float in round-towards-zero mode. + * + * Convert the double-precision floating-point value \p x to a single-precision + * floating-point value in round-towards-zero mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ float __double2float_rz(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a float in round-up mode. + * + * Convert the double-precision floating-point value \p x to a single-precision + * floating-point value in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ float __double2float_ru(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a float in round-down mode. + * + * Convert the double-precision floating-point value \p x to a single-precision + * floating-point value in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ float __double2float_rd(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a signed int in round-to-nearest-even mode. + * + * Convert the double-precision floating-point value \p x to a + * signed integer value in round-to-nearest-even mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ int __double2int_rn(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a signed int in round-up mode. + * + * Convert the double-precision floating-point value \p x to a + * signed integer value in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ int __double2int_ru(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a signed int in round-down mode. + * + * Convert the double-precision floating-point value \p x to a + * signed integer value in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ int __double2int_rd(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to an unsigned int in round-to-nearest-even mode. + * + * Convert the double-precision floating-point value \p x to an + * unsigned integer value in round-to-nearest-even mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ unsigned int __double2uint_rn(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to an unsigned int in round-up mode. + * + * Convert the double-precision floating-point value \p x to an + * unsigned integer value in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ unsigned int __double2uint_ru(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to an unsigned int in round-down mode. + * + * Convert the double-precision floating-point value \p x to an + * unsigned integer value in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ unsigned int __double2uint_rd(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a signed 64-bit int in round-to-nearest-even mode. + * + * Convert the double-precision floating-point value \p x to a + * signed 64-bit integer value in round-to-nearest-even mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ long long int __double2ll_rn(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a signed 64-bit int in round-up mode. + * + * Convert the double-precision floating-point value \p x to a + * signed 64-bit integer value in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ long long int __double2ll_ru(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a signed 64-bit int in round-down mode. + * + * Convert the double-precision floating-point value \p x to a + * signed 64-bit integer value in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ long long int __double2ll_rd(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to an unsigned 64-bit int in round-to-nearest-even mode. + * + * Convert the double-precision floating-point value \p x to an + * unsigned 64-bit integer value in round-to-nearest-even mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ unsigned long long int __double2ull_rn(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to an unsigned 64-bit int in round-up mode. + * + * Convert the double-precision floating-point value \p x to an + * unsigned 64-bit integer value in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ unsigned long long int __double2ull_ru(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to an unsigned 64-bit int in round-down mode. + * + * Convert the double-precision floating-point value \p x to an + * unsigned 64-bit integer value in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ unsigned long long int __double2ull_rd(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed int to a double. + * + * Convert the signed integer value \p x to a double-precision floating-point value. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ double __int2double_rn(int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned int to a double. + * + * Convert the unsigned integer value \p x to a double-precision floating-point value. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ double __uint2double_rn(unsigned int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed 64-bit int to a double in round-to-nearest-even mode. + * + * Convert the signed 64-bit integer value \p x to a double-precision floating-point + * value in round-to-nearest-even mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ double __ll2double_rn(long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed 64-bit int to a double in round-towards-zero mode. + * + * Convert the signed 64-bit integer value \p x to a double-precision floating-point + * value in round-towards-zero mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ double __ll2double_rz(long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed 64-bit int to a double in round-up mode. + * + * Convert the signed 64-bit integer value \p x to a double-precision floating-point + * value in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ double __ll2double_ru(long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed 64-bit int to a double in round-down mode. + * + * Convert the signed 64-bit integer value \p x to a double-precision floating-point + * value in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ double __ll2double_rd(long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned 64-bit int to a double in round-to-nearest-even mode. + * + * Convert the unsigned 64-bit integer value \p x to a double-precision floating-point + * value in round-to-nearest-even mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ double __ull2double_rn(unsigned long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned 64-bit int to a double in round-towards-zero mode. + * + * Convert the unsigned 64-bit integer value \p x to a double-precision floating-point + * value in round-towards-zero mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ double __ull2double_rz(unsigned long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned 64-bit int to a double in round-up mode. + * + * Convert the unsigned 64-bit integer value \p x to a double-precision floating-point + * value in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ double __ull2double_ru(unsigned long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned 64-bit int to a double in round-down mode. + * + * Convert the unsigned 64-bit integer value \p x to a double-precision floating-point + * value in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +extern __device__ __device_builtin__ double __ull2double_rd(unsigned long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Reinterpret high 32 bits in a double as a signed integer. + * + * Reinterpret the high 32 bits in the double-precision floating-point value \p x + * as a signed integer. + * \return Returns reinterpreted value. + */ +extern __device__ __device_builtin__ int __double2hiint(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Reinterpret low 32 bits in a double as a signed integer. + * + * Reinterpret the low 32 bits in the double-precision floating-point value \p x + * as a signed integer. + * \return Returns reinterpreted value. + */ +extern __device__ __device_builtin__ int __double2loint(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Reinterpret high and low 32-bit integer values as a double. + * + * Reinterpret the integer value of \p hi as the high 32 bits of a + * double-precision floating-point value and the integer value of \p lo + * as the low 32 bits of the same double-precision floating-point value. + * \return Returns reinterpreted value. + */ +extern __device__ __device_builtin__ double __hiloint2double(int hi, int lo); +} + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double fma(double a, double b, double c, enum cudaRoundMode mode); + +#undef EXCLUDE_FROM_RTC + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double dmul(double a, double b, enum cudaRoundMode mode = cudaRoundNearest); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double dadd(double a, double b, enum cudaRoundMode mode = cudaRoundNearest); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double dsub(double a, double b, enum cudaRoundMode mode = cudaRoundNearest); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ int double2int(double a, enum cudaRoundMode mode = cudaRoundZero); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ unsigned int double2uint(double a, enum cudaRoundMode mode = cudaRoundZero); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ long long int double2ll(double a, enum cudaRoundMode mode = cudaRoundZero); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ unsigned long long int double2ull(double a, enum cudaRoundMode mode = cudaRoundZero); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double ll2double(long long int a, enum cudaRoundMode mode = cudaRoundNearest); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double ull2double(unsigned long long int a, enum cudaRoundMode mode = cudaRoundNearest); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double int2double(int a, enum cudaRoundMode mode = cudaRoundNearest); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double uint2double(unsigned int a, enum cudaRoundMode mode = cudaRoundNearest); + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double float2double(float a, enum cudaRoundMode mode = cudaRoundNearest); + +#undef __DEVICE_DOUBLE_FUNCTIONS_DECL__ + + +#endif /* __cplusplus && __CUDACC__ */ + +#if !defined(__CUDACC_RTC__) +#include "device_double_functions.hpp" +#endif /* !__CUDACC_RTC__ */ + +#endif /* !__DEVICE_DOUBLE_FUNCTIONS_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_DOUBLE_FUNCTIONS_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_DOUBLE_FUNCTIONS_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_double_functions.hpp b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_double_functions.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f63063689d65c4a1dffb9a823ddaf6a5b353cba3 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_double_functions.hpp @@ -0,0 +1,197 @@ +/* + * Copyright 1993-2017 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/device_double_functions.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/device_double_functions.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_DOUBLE_FUNCTIONS_HPP__ +#endif + +#if !defined(__DEVICE_DOUBLE_FUNCTIONS_HPP__) +#define __DEVICE_DOUBLE_FUNCTIONS_HPP__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__cplusplus) && defined(__CUDACC__) + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__CUDACC_RTC__) +#define __DEVICE_DOUBLE_FUNCTIONS_DECL__ __device__ +#else +#define __DEVICE_DOUBLE_FUNCTIONS_DECL__ static __inline__ __device__ +#endif /* __CUDACC_RTC__ */ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double fma(double a, double b, double c, enum cudaRoundMode mode) +{ + return mode == cudaRoundZero ? __fma_rz(a, b, c) : + mode == cudaRoundPosInf ? __fma_ru(a, b, c) : + mode == cudaRoundMinInf ? __fma_rd(a, b, c) : + __fma_rn(a, b, c); +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double dmul(double a, double b, enum cudaRoundMode mode) +{ + return mode == cudaRoundZero ? __dmul_rz(a, b) : + mode == cudaRoundPosInf ? __dmul_ru(a, b) : + mode == cudaRoundMinInf ? __dmul_rd(a, b) : + __dmul_rn(a, b); +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double dadd(double a, double b, enum cudaRoundMode mode) +{ + return mode == cudaRoundZero ? __dadd_rz(a, b) : + mode == cudaRoundPosInf ? __dadd_ru(a, b) : + mode == cudaRoundMinInf ? __dadd_rd(a, b) : + __dadd_rn(a, b); +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double dsub(double a, double b, enum cudaRoundMode mode) +{ + return mode == cudaRoundZero ? __dsub_rz(a, b) : + mode == cudaRoundPosInf ? __dsub_ru(a, b) : + mode == cudaRoundMinInf ? __dsub_rd(a, b) : + __dsub_rn(a, b); +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ int double2int(double a, enum cudaRoundMode mode) +{ + return mode == cudaRoundNearest ? __double2int_rn(a) : + mode == cudaRoundPosInf ? __double2int_ru(a) : + mode == cudaRoundMinInf ? __double2int_rd(a) : + __double2int_rz(a); +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ unsigned int double2uint(double a, enum cudaRoundMode mode) +{ + return mode == cudaRoundNearest ? __double2uint_rn(a) : + mode == cudaRoundPosInf ? __double2uint_ru(a) : + mode == cudaRoundMinInf ? __double2uint_rd(a) : + __double2uint_rz(a); +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ long long int double2ll(double a, enum cudaRoundMode mode) +{ + return mode == cudaRoundNearest ? __double2ll_rn(a) : + mode == cudaRoundPosInf ? __double2ll_ru(a) : + mode == cudaRoundMinInf ? __double2ll_rd(a) : + __double2ll_rz(a); +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ unsigned long long int double2ull(double a, enum cudaRoundMode mode) +{ + return mode == cudaRoundNearest ? __double2ull_rn(a) : + mode == cudaRoundPosInf ? __double2ull_ru(a) : + mode == cudaRoundMinInf ? __double2ull_rd(a) : + __double2ull_rz(a); +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double ll2double(long long int a, enum cudaRoundMode mode) +{ + return mode == cudaRoundZero ? __ll2double_rz(a) : + mode == cudaRoundPosInf ? __ll2double_ru(a) : + mode == cudaRoundMinInf ? __ll2double_rd(a) : + __ll2double_rn(a); +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double ull2double(unsigned long long int a, enum cudaRoundMode mode) +{ + return mode == cudaRoundZero ? __ull2double_rz(a) : + mode == cudaRoundPosInf ? __ull2double_ru(a) : + mode == cudaRoundMinInf ? __ull2double_rd(a) : + __ull2double_rn(a); +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double int2double(int a, enum cudaRoundMode mode) +{ + return (double)a; +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double uint2double(unsigned int a, enum cudaRoundMode mode) +{ + return (double)a; +} + +__DEVICE_DOUBLE_FUNCTIONS_DECL__ double float2double(float a, enum cudaRoundMode mode) +{ + return (double)a; +} + +#undef __DEVICE_DOUBLE_FUNCTIONS_DECL__ + +#endif /* __cplusplus && __CUDACC__ */ + +#endif /* !__DEVICE_DOUBLE_FUNCTIONS_HPP__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_DOUBLE_FUNCTIONS_HPP__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_DOUBLE_FUNCTIONS_HPP__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_fp128_functions.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_fp128_functions.h new file mode 100644 index 0000000000000000000000000000000000000000..715220e121f790ab8ff2aeaed25620fe9759236f --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_fp128_functions.h @@ -0,0 +1,1217 @@ +/* + * Copyright 2024 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +// to easily switch off fp128 device functions if needed +#ifndef __NV_DISABLE_DEVICE_FP128_FUNCTIONS__ + +#if !defined(__DEVICE_FP128_FUNCTIONS_H__) +#define __DEVICE_FP128_FUNCTIONS_H__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__cplusplus) && defined(__CUDACC__) + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "device_types.h" + +#if !defined(__CUDA_ARCH__) && !defined(_NVHPC_CUDA) +#define __DEF_IF_HOST { } +#define __INLINE_IF_HOST__ __inline__ +#else /* !__CUDA_ARCH__ */ +#define __DEF_IF_HOST ; +#define __INLINE_IF_HOST__ +#endif /* __CUDA_ARCH__ */ + +#define __DEVICE_FP128_FUNCTIONS_DECL__ __device__ __cudart_builtin__ __INLINE_IF_HOST__ + +/******************************************************************************* +* * +* Support for __float128 on: * +* - NVRTC on Linux * +* - GCC version 4.1 or later on x86_64/amd64 * +* - Clang version 3.9 or later on x86_64/amd64 * +* - NVHPC version 21.1 or later on x86_64/amd64 * +* * +*******************************************************************************/ +#if defined(__CUDACC_RTC__) +#if !_WIN64 +#define __FLOAT128_CPP_SPELLING_ENABLED__ +#endif +#else /* !__CUDACC_RTC__ */ + +#if (defined __NVCOMPILER_MAJOR__) + #if (defined(__x86_64__) || defined(__amd64__)) && \ + ((__NVCOMPILER_MAJOR__ > 21) || \ + (__NVCOMPILER_MAJOR__ == 21 && __NVCOMPILER_MINOR__ >= 1)) + #define __FLOAT128_CPP_SPELLING_ENABLED__ + #endif +#elif defined(__clang__) + #if (defined(__x86_64__) || defined(__amd64__)) && \ + ((__clang_major__ > 3) || \ + (__clang_major__ == 3 && __clang_minor__ >= 9)) + #define __FLOAT128_CPP_SPELLING_ENABLED__ + #endif +#elif defined(__GNUC__) + // check gcc version if no other host compiler is used + #if (defined(__x86_64__) || defined(__amd64__)) && \ + ((__GNUC__ > 4) || \ + (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) + #define __FLOAT128_CPP_SPELLING_ENABLED__ + #endif +#endif /* (defined __NVCOMPILER_MAJOR__) */ + +#endif /* !__CUDACC_RTC__ */ + +/******************************************************************************* +* * +* Support for _Float128 on: * +* - GCC version 13.1 or later on x86_64/amd64/aarch64 * +* * +*******************************************************************************/ +#if defined(__GNUC__) && !defined(__clang__) && !defined(__NVCOMPILER_MAJOR__) + // check gcc version if no other host compiler is used + #if (defined(__x86_64__) || defined(__amd64__) || defined(__aarch64__)) && \ + ((__GNUC__ > 13) || \ + (__GNUC__ == 13 && __GNUC_MINOR__ >= 1)) + #define __FLOAT128_C_SPELLING_ENABLED__ + #endif +#endif /* defined(__GNUC__) && !defined(__clang__) && !defined(__NVCOMPILER_MAJOR__) */ + +/** + * \defgroup CUDA_MATH_QUAD FP128 Quad Precision Mathematical Functions + * This section describes quad precision mathematical functions. + * To use these functions, include the header file \p device_fp128_functions.h in your program. + * + * Functions declared here have \p __nv_fp128_ prefix to distinguish them + * from other global namespace symbols. + * + * Note that FP128 CUDA Math functions are only available to device programs + * on platforms where host compiler supports the basic quad precision datatype + * \p __float128 or \p _Float128. + * + * Every FP128 CUDA Math function name is overloaded to support either of these + * host-compiler-specific types, whenever the types are available. See for example: + * \code + * #ifdef __FLOAT128_CPP_SPELLING_ENABLED__ + * __float128 __nv_fp128_sqrt(__float128 x); + * #endif + * #ifdef __FLOAT128_C_SPELLING_ENABLED__ + * _Float128 __nv_fp128_sqrt(_Float128 x); + * #endif + * \endcode + * + * \note_fp128_target_arch + */ + +#ifdef __FLOAT128_CPP_SPELLING_ENABLED__ +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \sqrt{x} \end_cuda_math_formula, the square root of the input argument. + * + * \return + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula. + * - __nv_fp128_sqrt( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_sqrt( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_sqrt(\p x) returns NaN if \p x is less than 0. + * - __nv_fp128_sqrt(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_sqrt(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \sin{x} \end_cuda_math_formula, the sine of input argument (measured in radians). + * + * \return + * \cuda_math_formula \sin{x} \end_cuda_math_formula. + * - __nv_fp128_sin( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_sin( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - __nv_fp128_sin(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_sin(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \cos{x} \end_cuda_math_formula, the cosine of input argument (measured in radians). + * + * \return + * \cuda_math_formula \cos{x} \end_cuda_math_formula. + * - __nv_fp128_cos( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula 1 \end_cuda_math_formula. + * - __nv_fp128_cos( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - __nv_fp128_cos(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_cos(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \tan{x} \end_cuda_math_formula, the tangent of input argument (measured in radians). + * + * \return + * \cuda_math_formula \tan{x} \end_cuda_math_formula. + * - __nv_fp128_tan( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_tan( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - __nv_fp128_tan(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_tan(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \sin^{-1}{x} \end_cuda_math_formula, the arc sine of input argument. + * + * \return + * The principal value of the arc sine of the input argument \p x. + * Result will be in radians, in the interval [- + * \cuda_math_formula \pi/2 \end_cuda_math_formula + * , + + * \cuda_math_formula \pi/2 \end_cuda_math_formula + * ] for \p x inside [-1, +1]. + * - __nv_fp128_asin( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_asin(\p x) returns NaN for \p x outside [-1, +1]. + * - __nv_fp128_asin(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_asin(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \cos^{-1}{x} \end_cuda_math_formula, the arc cosine of input argument. + * + * \return + * The principal value of the arc cosine of the input argument \p x. + * Result will be in radians, in the interval [0, + * \cuda_math_formula \pi \end_cuda_math_formula + * ] for \p x inside [-1, +1]. + * - __nv_fp128_acos(1) returns +0. + * - __nv_fp128_acos(\p x) returns NaN for \p x outside [-1, +1]. + * - __nv_fp128_acos(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_acos(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \tan^{-1}{x} \end_cuda_math_formula, the arc tangent of input argument. + * + * \return + * The principal value of the arc tangent of the input argument \p x. + * Result will be in radians, in the interval [- + * \cuda_math_formula \pi/2 \end_cuda_math_formula + * , + + * \cuda_math_formula \pi/2 \end_cuda_math_formula + * ]. + * - __nv_fp128_atan( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_atan( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * /2. + * - __nv_fp128_atan(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_atan(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula e^x \end_cuda_math_formula, the base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument. + * + * \return + * - __nv_fp128_exp( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - __nv_fp128_exp( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0. + * - __nv_fp128_exp( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_exp(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_exp(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula 2^x \end_cuda_math_formula, the base 2 exponential of the input argument. + * + * \return + * - __nv_fp128_exp2( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - ex__nv_fp128_exp2p2f( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0. + * - __nv_fp128_exp2( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_exp2(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_exp2(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula 10^x \end_cuda_math_formula, the base 10 exponential of the input argument. + * + * \return + * - __nv_fp128_exp10( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - __nv_fp128_exp10( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0. + * - __nv_fp128_exp10( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_exp10(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_exp10(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate + * \cuda_math_formula e^x - 1 \end_cuda_math_formula, + * the base e exponential of the input argument, minus 1. + * + * \return + * - __nv_fp128_expm1( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_expm1( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns -1. + * - __nv_fp128_expm1( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_expm1(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_expm1(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \log_{e}{x} \end_cuda_math_formula, the base + * \cuda_math_formula e \end_cuda_math_formula + * logarithm of the input argument. + * + * \return + * - __nv_fp128_log( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - __nv_fp128_log(1) returns +0. + * - __nv_fp128_log(\p x) returns NaN for \p x < 0. + * - __nv_fp128_log( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_log(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_log(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \log_{2}{x} \end_cuda_math_formula, the base 2 logarithm of the input argument. + * + * \return + * - __nv_fp128_log2( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - __nv_fp128_log2(1) returns +0. + * - __nv_fp128_log2(\p x) returns NaN for \p x < 0. + * - __nv_fp128_log2( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_log2(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_log2(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \log_{10}{x} \end_cuda_math_formula, the base 10 logarithm of the input argument. + * + * \return + * - __nv_fp128_log10( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - __nv_fp128_log10(1) returns +0. + * - __nv_fp128_log10(\p x) returns NaN for \p x < 0. + * - __nv_fp128_log10( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_log10(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_log10(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate the value of + * \cuda_math_formula \log_{e}(1+x) \end_cuda_math_formula. + * + * \return + * - __nv_fp128_log1p( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_log1p(-1) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - __nv_fp128_log1p(\p x) returns NaN for \p x < -1. + * - __nv_fp128_log1p( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_log1p(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_log1p(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate the value of \cuda_math_formula x^{y} \end_cuda_math_formula, first argument to the power of second argument. + * + * \return + * - __nv_fp128_pow( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * for \p y an odd integer less than 0. + * - __nv_fp128_pow( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for \p y less than 0 and not an odd integer. + * - __nv_fp128_pow( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * for \p y an odd integer greater than 0. + * - __nv_fp128_pow( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns +0 for \p y > 0 and not an odd integer. + * - __nv_fp128_pow(-1, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns 1. + * - __nv_fp128_pow(+1, \p y) returns 1 for any \p y, even a NaN. + * - __nv_fp128_pow(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1 for any \p x, even a NaN. + * - __nv_fp128_pow(\p x, \p y) returns a NaN for finite \p x < 0 and finite non-integer \p y. + * - __nv_fp128_pow(\p x, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for + * \cuda_math_formula | x | < 1 \end_cuda_math_formula. + * - __nv_fp128_pow(\p x, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0 for + * \cuda_math_formula | x | > 1 \end_cuda_math_formula. + * - __nv_fp128_pow(\p x, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0 for + * \cuda_math_formula | x | < 1 \end_cuda_math_formula. + * - __nv_fp128_pow(\p x, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for + * \cuda_math_formula | x | > 1 \end_cuda_math_formula. + * - __nv_fp128_pow( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns -0 for \p y an odd integer less than 0. + * - __nv_fp128_pow( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns +0 for \p y < 0 and not an odd integer. + * - __nv_fp128_pow( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula -\infty \end_cuda_math_formula + * for \p y an odd integer greater than 0. + * - __nv_fp128_pow( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for \p y > 0 and not an odd integer. + * - __nv_fp128_pow( + * \cuda_math_formula +\infty \end_cuda_math_formula + * , \p y) returns +0 for \p y < 0. + * - __nv_fp128_pow( + * \cuda_math_formula +\infty \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for \p y > 0. + * - __nv_fp128_pow(\p x, \p y) returns NaN if either \p x or \p y or both are NaN and \p x \cuda_math_formula \neq \end_cuda_math_formula +1 and \p y \cuda_math_formula \neq\pm 0 \end_cuda_math_formula. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_pow(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \sinh{x} \end_cuda_math_formula, the hyperbolic sine of the input argument. + * + * Calculate \cuda_math_formula \sinh{x} \end_cuda_math_formula, the hyperbolic sine of the input argument \p x. + * + * \return + * - __nv_fp128_sinhinh( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_sinh( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - __nv_fp128_sinh(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_sinh(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \cosh{x} \end_cuda_math_formula, the hyperbolic cosine of the input argument. + * + * \return + * - __nv_fp128_cosh( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - __nv_fp128_cosh( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_cosh(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_cosh(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \tanh{x} \end_cuda_math_formula, the hyperbolic tangent of the input argument. + * + * \return + * - __nv_fp128_tanh( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_tanh( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 1 \end_cuda_math_formula. + * - __nv_fp128_tanh(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_tanh(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \sinh^{-1}{x} \end_cuda_math_formula, the inverse hyperbolic sine of the input argument. + * + * \return + * - __nv_fp128_asinh( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_asinh( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - __nv_fp128_asinh(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_asinh(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \cosh^{-1}{x} \end_cuda_math_formula, the nonnegative inverse hyperbolic cosine of the input argument. + * + * \return + * Result will be in the interval [0, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ]. + * - __nv_fp128_acosh(1) returns 0. + * - __nv_fp128_acosh(\p x) returns NaN for \p x in the interval [ + * \cuda_math_formula -\infty \end_cuda_math_formula + * , 1). + * - __nv_fp128_acosh( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_acosh(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_acosh(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \tanh^{-1}{x} \end_cuda_math_formula, the inverse hyperbolic tangent of the input argument. + * + * \return + * - __nv_fp128_atanh( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_atanh( + * \cuda_math_formula \pm 1 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - __nv_fp128_atanh(\p x) returns NaN for \p x outside interval [-1, 1]. + * - __nv_fp128_atanh(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_atanh(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Truncate input argument to the integral part. + * + * \return + * Rounded \p x to the nearest integer value in floating-point format, that does not exceed \p x in + * magnitude. + * - __nv_fp128_trunc( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_trunc( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - __nv_fp128_trunc(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_trunc(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \lfloor x \rfloor \end_cuda_math_formula, the largest integer less than or equal to \p x. + * + * \return + * \cuda_math_formula \lfloor x \rfloor \end_cuda_math_formula + * expressed as a floating-point number. + * - __nv_fp128_floor( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - __nv_fp128_floor( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_floor(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_floor(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \lceil x \rceil \end_cuda_math_formula, the smallest integer greater than or equal to \p x. + * + * \return + * \cuda_math_formula \lceil x \rceil \end_cuda_math_formula + * expressed as a floating-point number. + * - __nv_fp128_ceil( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - __nv_fp128_ceil( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_ceil(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_ceil(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Round to nearest integer value in floating-point format, + * with halfway cases rounded away from zero. + * + * \return + * - __nv_fp128_round( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_round( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - __nv_fp128_round(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_round(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Round to nearest integer value in floating-point format, + * with halfway cases rounded to the nearest even integer value. + * + * \return + * - __nv_fp128_rint( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_rint( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - __nv_fp128_rint(NaN) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_rint(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula |x| \end_cuda_math_formula, the absolute value of the input argument. + * + * \return + * - __nv_fp128_fabs( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_fabs( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns +0. + * - __nv_fp128_fabs(NaN) returns an unspecified NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_fabs(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Create value with the magnitude of the first agument \p x, and the sign of the second argument \p y. + * + * \return + * - copysign(\p NaN, \p y) returns a \p NaN with the sign of \p y. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_copysign(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Determine the maximum numeric value of the arguments. + * + * \return + * The maximum numeric value of the arguments \p x and \p y. Treats NaN + * arguments as missing data. + * - If both arguments are NaN, returns NaN. + * - If one argument is NaN, returns the numeric argument. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_fmax(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Determine the minimum numeric value of the arguments. + * + * \return + * The minimum numeric value of the arguments \p x and \p y. Treats NaN + * arguments as missing data. + * - If both arguments are NaN, returns NaN. + * - If one argument is NaN, returns the numeric argument. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_fmin(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Compute the positive difference between \p x and \p y. + * + * \return + * - __nv_fp128_fdim(\p x, \p y) returns \p x - \p y if \cuda_math_formula x > y \end_cuda_math_formula. + * - __nv_fp128_fdim(\p x, \p y) returns +0 if \cuda_math_formula x \leq y \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_fdim(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate the floating-point remainder of \p x / \p y. + * + * \return + * The floating-point remainder of the division operation \p x / \p y calculated + * by this function is exactly the value x - n*y, where \p n is \p x / \p y with its fractional part truncated. + * - The computed value will have the same sign as \p x, and its magnitude will be less than the magnitude of \p y. + * - __nv_fp128_fmod( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * if \p y is not zero. + * - __nv_fp128_fmod(\p x, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns \p x if \p x is finite. + * - __nv_fp128_fmod(\p x, \p y) returns NaN if \p x is + * \cuda_math_formula \pm\infty \end_cuda_math_formula + * or \p y is zero. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_fmod(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Compute the floating-point remainder function. + * + * \return + * The floating-point remainder \p r of dividing + * \p x by \p y for nonzero \p y is defined as + * \cuda_math_formula r = x - n y \end_cuda_math_formula. + * The value \p n is the integer value nearest + * \cuda_math_formula \frac{x}{y} \end_cuda_math_formula. + * In the halfway cases when + * \cuda_math_formula | n -\frac{x}{y} | = \frac{1}{2} \end_cuda_math_formula + * , the + * even \p n value is chosen. + * - __nv_fp128_remainder(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns NaN. + * - __nv_fp128_remainder( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p y) returns NaN. + * - __nv_fp128_remainder(\p x, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns \p x for finite \p x. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_remainder(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Extract mantissa and exponent of the floating-point input argument. + * + * Decompose the floating-point value \p x into a component \p m for the + * normalized fraction element and an integral term \p n for the exponent. + * The absolute value of \p m will be greater than or equal to 0.5 and + * less than 1.0 or it will be equal to 0; + * \cuda_math_formula x = m\cdot 2^n \end_cuda_math_formula. + * The integer exponent \p n will be stored in the location to which \p nptr points. + * + * \return + * The fractional component \p m. + * - __nv_fp128_frexp( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p nptr) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * and stores zero in the location pointed to by \p nptr. + * - __nv_fp128_frexp( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p nptr) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * and stores an unspecified value in the + * location to which \p nptr points. + * - __nv_fp128_frexp(NaN, \p y) returns a NaN and stores an unspecified value in the location to which \p nptr points. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_frexp(__float128 x, int* nptr) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Break down the input argument into fractional and integral parts. + * + * Break down the argument \p x into fractional and integral parts. The + * integral part is stored in floating-point format in the location to which \p iptr points. + * Fractional and integral parts are given the same sign as the argument \p x. + * + * \return + * - __nv_fp128_modf( + * \cuda_math_formula \pm x \end_cuda_math_formula + * , \p iptr) returns a result with the same sign as \p x. + * - __nv_fp128_modf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p iptr) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * and stores + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * in the object pointed to by \p iptr. + * - __nv_fp128_modf(NaN, \p iptr) stores a NaN in the object pointed to by \p iptr and returns a NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_modf(__float128 x, __float128* iptr) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate \cuda_math_formula \sqrt{x^2+y^2} \end_cuda_math_formula, the square root of the sum of squares of two arguments. + * + * \return + * The length of the hypotenuse of a right triangle whose two sides have lengths + * \cuda_math_formula |x| \end_cuda_math_formula and \cuda_math_formula |y| \end_cuda_math_formula without undue overflow or underflow. + * - __nv_fp128_hypot(\p x,\p y), __nv_fp128_hypot(\p y,\p x), and __nv_fp128_hypot(\p x, \p -y) are equivalent. + * - __nv_fp128_hypot(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) is equivalent to __nv_fp128_fabs(\p x). + * - __nv_fp128_hypot( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ,\p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula, + * even if \p y is a NaN. + * - __nv_fp128_hypot(NaN, \p y) returns NaN, when \p y is not \cuda_math_formula \pm\infty \end_cuda_math_formula. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_hypot(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Compute + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation using round-to-nearest-even rounding mode. + * + * \return + * The value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single ternary operation, rounded once using round-to-nearest, + * ties-to-even rounding mode. + * - __nv_fp128_fma( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p z) returns NaN. + * - __nv_fp128_fma( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p z) returns NaN. + * - __nv_fp128_fma(\p x, \p y, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __nv_fp128_fma(\p x, \p y, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - __nv_fp128_fma(\p x, \p y, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_fma(\p x, \p y, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_fma(\p x, \p y, \p z) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y + z \end_cuda_math_formula is exactly zero and \cuda_math_formula z \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_fma(__float128 x, __float128 y, __float128 c) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Calculate the value of + * \cuda_math_formula x\cdot 2^{exp} \end_cuda_math_formula. + * + * \return + * - __nv_fp128_ldexp( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p exp) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_ldexp(\p x, 0) returns \p x. + * - __nv_fp128_ldexp( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p exp) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - __nv_fp128_ldexp(NaN, \p exp) returns NaN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_ldexp(__float128 x, int exp) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Compute the unbiased integer exponent of the input argument. + * + * \return + * - If successful, returns the unbiased exponent of the argument. + * - __nv_fp128_ilogb( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns INT_MIN. + * - __nv_fp128_ilogb(NaN) returns INT_MIN. + * - __nv_fp128_ilogb( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns INT_MAX. + * - Note: above behavior does not take into account FP_ILOGB0 nor FP_ILOGBNAN. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ int __nv_fp128_ilogb(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Compute \cuda_math_formula x \cdot y \end_cuda_math_formula, the product of the two floating-point inputs using round-to-nearest-even rounding mode. + * + * \return Returns \p x * \p y. + * - sign of the product \p x * \p y is XOR of the signs of \p x and \p y when neither inputs nor result are NaN. + * - __nv_fp128_mul(\p x, \p y) is equivalent to __nv_fp128_mul(\p y, \p x). + * - __nv_fp128_mul(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for \p x \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - __nv_fp128_mul(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __nv_fp128_mul(\cuda_math_formula \pm 0 \end_cuda_math_formula, \p y) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for finite \p y. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_mul(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Compute \cuda_math_formula x + y \end_cuda_math_formula, the sum of the two floating-point inputs using round-to-nearest-even rounding mode. + * + * \return Returns \p x + \p y. + * - __nv_fp128_add(\p x, \p y) is equivalent to __nv_fp128_add(\p y, \p x). + * - __nv_fp128_add(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula for finite \p x. + * - __nv_fp128_add(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __nv_fp128_add(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \mp\infty \end_cuda_math_formula) returns NaN. + * - __nv_fp128_add(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_add(\p x, \p -x) returns \cuda_math_formula +0 \end_cuda_math_formula for finite \p x, including \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_add(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Compute \cuda_math_formula x - y \end_cuda_math_formula, the difference of the two floating-point inputs using round-to-nearest-even rounding mode. + * + * \return Returns \p x - \p y. + * - __nv_fp128_sub(\cuda_math_formula \pm\infty \end_cuda_math_formula, \p y) returns \cuda_math_formula \pm\infty \end_cuda_math_formula for finite \p y. + * - __nv_fp128_sub(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \mp\infty \end_cuda_math_formula for finite \p x. + * - __nv_fp128_sub(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __nv_fp128_sub(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \mp\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __nv_fp128_sub(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __nv_fp128_sub(\p x, \p x) returns \cuda_math_formula +0 \end_cuda_math_formula for finite \p x, including \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_sub(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Compute \cuda_math_formula \frac{x}{y} \end_cuda_math_formula, the quotient of the two floating-point inputs using round-to-nearest-even rounding mode. + * + * \return + * - sign of the quotient \p x / \p y is XOR of the signs of \p x and \p y when neither inputs nor result are NaN. + * - __nv_fp128_div(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns NaN. + * - __nv_fp128_div(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __nv_fp128_div(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for finite \p x. + * - __nv_fp128_div(\cuda_math_formula \pm\infty \end_cuda_math_formula, \p y) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for finite \p y. + * - __nv_fp128_div(\p x, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for \p x \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - __nv_fp128_div(\cuda_math_formula \pm 0 \end_cuda_math_formula, \p y) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for \p y \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_quad + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ __float128 __nv_fp128_div(__float128 x, __float128 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Determine whether the input argument is a NaN. + * + * \return + * A nonzero value if and only if \p x is a NaN value. + * + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ int __nv_fp128_isnan(__float128 x) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_QUAD + * \brief Determine whether the pair of inputs is unordered. + * + * \return + * - nonzero value if at least one of input values is a NaN. + * - zero otherwise + * + * \note_fp128_target_arch + */ +__DEVICE_FP128_FUNCTIONS_DECL__ int __nv_fp128_isunordered(__float128 x, __float128 y) __DEF_IF_HOST +#endif /* __FLOAT128_CPP_SPELLING_ENABLED__ */ + + +#ifdef __FLOAT128_C_SPELLING_ENABLED__ +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_sqrt(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_sin(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_cos(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_tan(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_asin(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_acos(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_atan(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_exp(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_exp2(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_exp10(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_expm1(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_log(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_log2(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_log10(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_log1p(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_pow(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_sinh(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_cosh(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_tanh(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_asinh(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_acosh(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_atanh(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_trunc(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_floor(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_ceil(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_round(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_rint(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_fabs(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_copysign(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_fmax(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_fmin(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_fdim(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_fmod(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_remainder(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_frexp(_Float128 x, int* nptr) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_modf(_Float128 x, _Float128* iptr) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_hypot(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_fma(_Float128 x, _Float128 y, _Float128 c) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_ldexp(_Float128 x, int exp) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ int __nv_fp128_ilogb(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_mul(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_add(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_sub(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ _Float128 __nv_fp128_div(_Float128 x, _Float128 y) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ int __nv_fp128_isnan(_Float128 x) __DEF_IF_HOST +__DEVICE_FP128_FUNCTIONS_DECL__ int __nv_fp128_isunordered(_Float128 x, _Float128 y) __DEF_IF_HOST +#endif /* __FLOAT_C_SPELLING_ENABLED */ + + +#undef __DEVICE_FP128_FUNCTIONS_DECL__ + +#endif /* __cplusplus && __CUDACC__ */ + +#endif /* !__DEVICE_FP128_FUNCTIONS_H__ */ + +#endif /* !__NV_DISABLE_DEVICE_FP128_FUNCTIONS__ */ diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_functions.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_functions.h new file mode 100644 index 0000000000000000000000000000000000000000..ae9de40d680c6e50c25b0c4a01c00679bd0c8fe4 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_functions.h @@ -0,0 +1,2993 @@ +/* + * Copyright 1993-2024 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/device_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/device_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_FUNCTIONS_H__ +#endif + +#if !defined(__DEVICE_FUNCTIONS_H__) +#define __DEVICE_FUNCTIONS_H__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if defined(__CUDACC_RTC__) +#define __DEVICE_FUNCTIONS_DECL__ __device__ __cudart_builtin__ +#define __DEVICE_FUNCTIONS_STATIC_DECL__ __device__ __cudart_builtin__ +#define __DEVICE_HOST_FUNCTIONS_STATIC_DECL__ __device__ __host__ __cudart_builtin__ +#else +#define __DEVICE_FUNCTIONS_DECL__ __device__ __cudart_builtin__ +#define __DEVICE_FUNCTIONS_STATIC_DECL__ static __inline__ __device__ __cudart_builtin__ +#define __DEVICE_HOST_FUNCTIONS_STATIC_DECL__ static __inline__ __device__ __host__ __cudart_builtin__ +#endif /* __CUDACC_RTC__ */ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + + +//NOTE: For NVRTC, these declarations have been moved into the compiler (to reduce compile time) +#define EXCLUDE_FROM_RTC + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +extern "C" +{ +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Calculate the most significant 32 bits of the product of the two 32-bit integers. + * + * Calculate the most significant 32 bits of the 64-bit product \p x * \p y, where \p x and \p y + * are 32-bit integers. + * + * \return Returns the most significant 32 bits of the product \p x * \p y. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __mulhi(int x, int y); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Calculate the most significant 32 bits of the product of the two 32-bit unsigned integers. + * + * Calculate the most significant 32 bits of the 64-bit product \p x * \p y, where \p x and \p y + * are 32-bit unsigned integers. + * + * \return Returns the most significant 32 bits of the product \p x * \p y. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __umulhi(unsigned int x, unsigned int y); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Calculate the most significant 64 bits of the product of the two 64-bit integers. + * + * Calculate the most significant 64 bits of the 128-bit product \p x * \p y, where \p x and \p y + * are 64-bit integers. + * + * \return Returns the most significant 64 bits of the product \p x * \p y. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int __mul64hi(long long int x, long long int y); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Calculate the most significant 64 bits of the product of the two 64 unsigned bit integers. + * + * Calculate the most significant 64 bits of the 128-bit product \p x * \p y, where \p x and \p y + * are 64-bit unsigned integers. + * + * \return Returns the most significant 64 bits of the product \p x * \p y. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned long long int __umul64hi(unsigned long long int x, unsigned long long int y); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Reinterpret bits in an integer as a float. + * + * Reinterpret the bits in the signed integer value \p x as a single-precision + * floating-point value. + * \return Returns reinterpreted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __int_as_float(int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Reinterpret bits in a float as a signed integer. + * + * Reinterpret the bits in the single-precision floating-point value \p x + * as a signed integer. + * \return Returns reinterpreted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __float_as_int(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Reinterpret bits in an unsigned integer as a float. + * + * Reinterpret the bits in the unsigned integer value \p x as a single-precision + * floating-point value. + * \return Returns reinterpreted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __uint_as_float(unsigned int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Reinterpret bits in a float as a unsigned integer. + * + * Reinterpret the bits in the single-precision floating-point value \p x + * as a unsigned integer. + * \return Returns reinterpreted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __float_as_uint(float x); +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ void __syncthreads(void); +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ void __prof_trigger(int); +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ void __threadfence(void); +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ void __threadfence_block(void); +__DEVICE_FUNCTIONS_DECL__ +#if defined(__GNUC__) || defined(__CUDACC_RTC__) +__attribute__((__noreturn__)) +#elif defined(_MSC_VER) +__declspec(noreturn) +#endif /* defined(__GNUC__) || defined(__CUDACC_RTC__) */ +__device_builtin__ void __trap(void); +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ void __brkpt(); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Clamp the input argument to [+0.0, 1.0]. + * + * Clamp the input argument \p x to be within the interval [+0.0, 1.0]. + * \return + * - __saturatef(\p x) returns +0 if \cuda_math_formula x \le 0 \end_cuda_math_formula. + * - __saturatef(\p x) returns 1 if \cuda_math_formula x \ge 1 \end_cuda_math_formula. + * - __saturatef(\p x) returns \p x if \cuda_math_formula 0 < x < 1 \end_cuda_math_formula. + * - __saturatef(NaN) returns +0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __saturatef(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Calculate + * \cuda_math_formula |x - y| + z \end_cuda_math_formula + * , the sum of absolute difference. + * + * Calculate + * \cuda_math_formula |x - y| + z \end_cuda_math_formula + * , the 32-bit sum of the third argument \p z plus and the absolute + * value of the difference between the first argument, \p x, and second + * argument, \p y. + * + * Inputs \p x and \p y are signed 32-bit integers, input \p z is + * a 32-bit unsigned integer. + * + * \return Returns + * \cuda_math_formula |x - y| + z \end_cuda_math_formula. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __sad(int x, int y, unsigned int z); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Calculate + * \cuda_math_formula |x - y| + z \end_cuda_math_formula + * , the sum of absolute difference. + * + * Calculate + * \cuda_math_formula |x - y| + z \end_cuda_math_formula + * , the 32-bit sum of the third argument \p z plus and the absolute + * value of the difference between the first argument, \p x, and second + * argument, \p y. + * + * Inputs \p x, \p y, and \p z are unsigned 32-bit integers. + * + * \return Returns + * \cuda_math_formula |x - y| + z \end_cuda_math_formula. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __usad(unsigned int x, unsigned int y, unsigned int z); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Calculate the least significant 32 bits of the product of the least significant 24 bits of two integers. + * + * Calculate the least significant 32 bits of the product of the least significant 24 bits of \p x and \p y. + * The high order 8 bits of \p x and \p y are ignored. + * + * \return Returns the least significant 32 bits of the product \p x * \p y. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __mul24(int x, int y); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Calculate the least significant 32 bits of the product of the least significant 24 bits of two unsigned integers. + * + * Calculate the least significant 32 bits of the product of the least significant 24 bits of \p x and \p y. + * The high order 8 bits of \p x and \p y are ignored. + * + * \return Returns the least significant 32 bits of the product \p x * \p y. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __umul24(unsigned int x, unsigned int y); +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Divide two floating-point values. + * + * Compute \p x divided by \p y. + * + * \return Returns \p x / \p y. + * - Follows the regular division operation behavior by default. + * - If \p -use_fast_math is specified and is not amended by + * an explicit \p -prec_div=true, uses ::__fdividef() for higher + * performance + * + * \note_accuracy_single + * \note_fastmath + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float fdividef(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate division of the input arguments. + * + * Calculate the fast approximate division of \p x by \p y. + * + * \return Returns \p x / \p y. + * - __fdividef( + * \cuda_math_formula \infty \end_cuda_math_formula + * , \p y) returns NaN for + * \cuda_math_formula 2^{126} < |y| < 2^{128} \end_cuda_math_formula. + * - __fdividef(\p x, \p y) returns 0 for + * \cuda_math_formula 2^{126} < |y| < 2^{128} \end_cuda_math_formula + * and finite + * \cuda_math_formula x \end_cuda_math_formula. + * \see __fdiv_rn() for further special case behavior specification. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fdividef(float x, float y); +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ double fdivide(double x, double y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate sine of the input argument. + * + * Calculate the fast approximate sine of the input argument \p x, measured in radians. + * + * \return Returns the approximate sine of \p x. + * + * \see sinf() for further special case behavior specification. + * \note_accuracy_single_intrinsic + * \note Output in the denormal range is flushed to sign preserving 0.0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ float __sinf(float x) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate cosine of the input argument. + * + * Calculate the fast approximate cosine of the input argument \p x, measured in radians. + * + * \return Returns the approximate cosine of \p x. + * + * \see cosf() for further special case behavior specification. + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ float __cosf(float x) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate tangent of the input argument. + * + * Calculate the fast approximate tangent of the input argument \p x, measured in radians. + * + * \return Returns the approximate tangent of \p x. + * + * \note_accuracy_single_intrinsic + * \note The result is computed as the fast divide of ::__sinf() + * by ::__cosf(). Denormal output is flushed to sign-preserving 0.0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ float __tanf(float x) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate hyperbolic tangent of the input argument. + * + * Calculate the fast approximate hyperbolic tangent of the input argument \p x, measured in radians. + * + * \return Returns the approximate hyperbolic tangent of \p x. + * + * \see tanhf() for further special case behavior specification. + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ float __tanhf(float x) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate of sine and cosine of the first input argument. + * + * Calculate the fast approximate of sine and cosine of the first input argument \p x (measured + * in radians). The results for sine and cosine are written into the second + * argument, \p sptr, and, respectively, third argument, \p cptr. + * + * \see __sinf() and __cosf(). + * \note_accuracy_single_intrinsic + * \note Denorm input/output is flushed to sign preserving 0.0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ void __sincosf(float x, float *sptr, float *cptr) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument. + * + * Calculate the fast approximate base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument \p x, + * \cuda_math_formula e^x \end_cuda_math_formula. + * + * \return Returns an approximation to + * \cuda_math_formula e^x \end_cuda_math_formula. + * \see expf() for further special case behavior specification. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ float __expf(float x) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate base 10 exponential of the input argument. + * + * Calculate the fast approximate base 10 exponential of the input argument \p x, + * \cuda_math_formula 10^x \end_cuda_math_formula. + * + * \return Returns an approximation to + * \cuda_math_formula 10^x \end_cuda_math_formula. + * \see exp10f() for further special case behavior specification. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ float __exp10f(float x) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate base 2 logarithm of the input argument. + * + * Calculate the fast approximate base 2 logarithm of the input argument \p x. + * + * \return Returns an approximation to + * \cuda_math_formula \log_2(x) \end_cuda_math_formula. + * \see log2f() for further special case behavior specification. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ float __log2f(float x) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate base 10 logarithm of the input argument. + * + * Calculate the fast approximate base 10 logarithm of the input argument \p x. + * + * \return Returns an approximation to + * \cuda_math_formula \log_{10}(x) \end_cuda_math_formula. + * \see log10f() for further special case behavior specification. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ float __log10f(float x) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate base + * \cuda_math_formula e \end_cuda_math_formula + * logarithm of the input argument. + * + * Calculate the fast approximate base + * \cuda_math_formula e \end_cuda_math_formula + * logarithm of the input argument \p x. + * + * \return Returns an approximation to + * \cuda_math_formula \log_e(x) \end_cuda_math_formula. + * \see logf() for further special case behavior specification. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ float __logf(float x) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Calculate the fast approximate of + * \cuda_math_formula x^y \end_cuda_math_formula. + * + * Calculate the fast approximate of \p x, the first input argument, + * raised to the power of \p y, the second input argument, + * \cuda_math_formula x^y \end_cuda_math_formula. + * + * \return Returns an approximation to + * \cuda_math_formula x^y \end_cuda_math_formula. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ float __powf(float x, float y) __THROW; +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to a signed integer in round-to-nearest-even mode. + * + * Convert the single-precision floating-point value \p x to a signed integer + * in round-to-nearest-even mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __float2int_rn(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to a signed integer in round-towards-zero mode. + * + * Convert the single-precision floating-point value \p x to a signed integer + * in round-towards-zero mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __float2int_rz(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to a signed integer in round-up mode. + * + * Convert the single-precision floating-point value \p x to a signed integer + * in round-up (to positive infinity) mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __float2int_ru(float); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to a signed integer in round-down mode. + * + * Convert the single-precision floating-point value \p x to a signed integer + * in round-down (to negative infinity) mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __float2int_rd(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to an unsigned integer in round-to-nearest-even mode. + * + * Convert the single-precision floating-point value \p x to an unsigned integer + * in round-to-nearest-even mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __float2uint_rn(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to an unsigned integer in round-towards-zero mode. + * + * Convert the single-precision floating-point value \p x to an unsigned integer + * in round-towards-zero mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __float2uint_rz(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to an unsigned integer in round-up mode. + * + * Convert the single-precision floating-point value \p x to an unsigned integer + * in round-up (to positive infinity) mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __float2uint_ru(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to an unsigned integer in round-down mode. + * + * Convert the single-precision floating-point value \p x to an unsigned integer + * in round-down (to negative infinity) mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __float2uint_rd(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed integer to a float in round-to-nearest-even mode. + * + * Convert the signed integer value \p x to a single-precision floating-point value + * in round-to-nearest-even mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __int2float_rn(int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed integer to a float in round-towards-zero mode. + * + * Convert the signed integer value \p x to a single-precision floating-point value + * in round-towards-zero mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __int2float_rz(int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed integer to a float in round-up mode. + * + * Convert the signed integer value \p x to a single-precision floating-point value + * in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __int2float_ru(int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed integer to a float in round-down mode. + * + * Convert the signed integer value \p x to a single-precision floating-point value + * in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __int2float_rd(int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned integer to a float in round-to-nearest-even mode. + * + * Convert the unsigned integer value \p x to a single-precision floating-point value + * in round-to-nearest-even mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __uint2float_rn(unsigned int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned integer to a float in round-towards-zero mode. + * + * Convert the unsigned integer value \p x to a single-precision floating-point value + * in round-towards-zero mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __uint2float_rz(unsigned int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned integer to a float in round-up mode. + * + * Convert the unsigned integer value \p x to a single-precision floating-point value + * in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __uint2float_ru(unsigned int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned integer to a float in round-down mode. + * + * Convert the unsigned integer value \p x to a single-precision floating-point value + * in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __uint2float_rd(unsigned int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to a signed 64-bit integer in round-to-nearest-even mode. + * + * Convert the single-precision floating-point value \p x to a signed 64-bit integer + * in round-to-nearest-even mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int __float2ll_rn(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to a signed 64-bit integer in round-towards-zero mode. + * + * Convert the single-precision floating-point value \p x to a signed 64-bit integer + * in round-towards-zero mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int __float2ll_rz(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to a signed 64-bit integer in round-up mode. + * + * Convert the single-precision floating-point value \p x to a signed 64-bit integer + * in round-up (to positive infinity) mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int __float2ll_ru(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to a signed 64-bit integer in round-down mode. + * + * Convert the single-precision floating-point value \p x to a signed 64-bit integer + * in round-down (to negative infinity) mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int __float2ll_rd(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to an unsigned 64-bit integer in round-to-nearest-even mode. + * + * Convert the single-precision floating-point value \p x to an unsigned 64-bit integer + * in round-to-nearest-even mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned long long int __float2ull_rn(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to an unsigned 64-bit integer in round-towards-zero mode. + * + * Convert the single-precision floating-point value \p x to an unsigned 64-bit integer + * in round-towards-zero mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned long long int __float2ull_rz(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to an unsigned 64-bit integer in round-up mode. + * + * Convert the single-precision floating-point value \p x to an unsigned 64-bit integer + * in round-up (to positive infinity) mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned long long int __float2ull_ru(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a float to an unsigned 64-bit integer in round-down mode. + * + * Convert the single-precision floating-point value \p x to an unsigned 64-bit integer + * in round-down (to negative infinity) mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned long long int __float2ull_rd(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed 64-bit integer to a float in round-to-nearest-even mode. + * + * Convert the signed 64-bit integer value \p x to a single-precision floating-point value + * in round-to-nearest-even mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __ll2float_rn(long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed integer to a float in round-towards-zero mode. + * + * Convert the signed integer value \p x to a single-precision floating-point value + * in round-towards-zero mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __ll2float_rz(long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed integer to a float in round-up mode. + * + * Convert the signed integer value \p x to a single-precision floating-point value + * in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __ll2float_ru(long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a signed integer to a float in round-down mode. + * + * Convert the signed integer value \p x to a single-precision floating-point value + * in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __ll2float_rd(long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned integer to a float in round-to-nearest-even mode. + * + * Convert the unsigned integer value \p x to a single-precision floating-point value + * in round-to-nearest-even mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __ull2float_rn(unsigned long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned integer to a float in round-towards-zero mode. + * + * Convert the unsigned integer value \p x to a single-precision floating-point value + * in round-towards-zero mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __ull2float_rz(unsigned long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned integer to a float in round-up mode. + * + * Convert the unsigned integer value \p x to a single-precision floating-point value + * in round-up (to positive infinity) mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __ull2float_ru(unsigned long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert an unsigned integer to a float in round-down mode. + * + * Convert the unsigned integer value \p x to a single-precision floating-point value + * in round-down (to negative infinity) mode. + * \return Returns converted value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __ull2float_rd(unsigned long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Add two floating-point values in round-to-nearest-even mode. + * + * Compute the sum of \p x and \p y in round-to-nearest-even rounding mode. + * + * \return Returns \p x + \p y. + * - __fadd_rn(\p x, \p y) is equivalent to __fadd_rn(\p y, \p x). + * - __fadd_rn(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula for finite \p x. + * - __fadd_rn(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __fadd_rn(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \mp\infty \end_cuda_math_formula) returns NaN. + * - __fadd_rn(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fadd_rn(\p x, \p -x) returns \cuda_math_formula +0 \end_cuda_math_formula for finite \p x, including \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fadd_rn(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Add two floating-point values in round-towards-zero mode. + * + * Compute the sum of \p x and \p y in round-towards-zero mode. + * + * \return Returns \p x + \p y. + * - __fadd_rz(\p x, \p y) is equivalent to __fadd_rz(\p y, \p x). + * - __fadd_rz(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula for finite \p x. + * - __fadd_rz(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __fadd_rz(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \mp\infty \end_cuda_math_formula) returns NaN. + * - __fadd_rz(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fadd_rz(\p x, \p -x) returns \cuda_math_formula +0 \end_cuda_math_formula for finite \p x, including \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fadd_rz(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Add two floating-point values in round-up mode. + * + * Compute the sum of \p x and \p y in round-up (to positive infinity) mode. + * + * \return Returns \p x + \p y. + * - __fadd_ru(\p x, \p y) is equivalent to __fadd_ru(\p y, \p x). + * - __fadd_ru(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula for finite \p x. + * - __fadd_ru(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __fadd_ru(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \mp\infty \end_cuda_math_formula) returns NaN. + * - __fadd_ru(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fadd_ru(\p x, \p -x) returns \cuda_math_formula +0 \end_cuda_math_formula for finite \p x, including \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fadd_ru(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Add two floating-point values in round-down mode. + * + * Compute the sum of \p x and \p y in round-down (to negative infinity) mode. + * + * \return Returns \p x + \p y. + * - __fadd_rd(\p x, \p y) is equivalent to __fadd_rd(\p y, \p x). + * - __fadd_rd(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula for finite \p x. + * - __fadd_rd(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __fadd_rd(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \mp\infty \end_cuda_math_formula) returns NaN. + * - __fadd_rd(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fadd_rd(\p x, \p -x) returns \cuda_math_formula -0 \end_cuda_math_formula for finite \p x, including \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fadd_rd(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Subtract two floating-point values in round-to-nearest-even mode. + * + * Compute the difference of \p x and \p y in round-to-nearest-even rounding mode. + * + * \return Returns \p x - \p y. + * - __fsub_rn(\cuda_math_formula \pm\infty \end_cuda_math_formula, \p y) returns \cuda_math_formula \pm\infty \end_cuda_math_formula for finite \p y. + * - __fsub_rn(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \mp\infty \end_cuda_math_formula for finite \p x. + * - __fsub_rn(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fsub_rn(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \mp\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __fsub_rn(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fsub_rn(\p x, \p x) returns \cuda_math_formula +0 \end_cuda_math_formula for finite \p x, including \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fsub_rn(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Subtract two floating-point values in round-towards-zero mode. + * + * Compute the difference of \p x and \p y in round-towards-zero mode. + * + * \return Returns \p x - \p y. + * - __fsub_rz(\cuda_math_formula \pm\infty \end_cuda_math_formula, \p y) returns \cuda_math_formula \pm\infty \end_cuda_math_formula for finite \p y. + * - __fsub_rz(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \mp\infty \end_cuda_math_formula for finite \p x. + * - __fsub_rz(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fsub_rz(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \mp\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __fsub_rz(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fsub_rz(\p x, \p x) returns \cuda_math_formula +0 \end_cuda_math_formula for finite \p x, including \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fsub_rz(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Subtract two floating-point values in round-up mode. + * + * Compute the difference of \p x and \p y in round-up (to positive infinity) mode. + * + * \return Returns \p x - \p y. + * - __fsub_ru(\cuda_math_formula \pm\infty \end_cuda_math_formula, \p y) returns \cuda_math_formula \pm\infty \end_cuda_math_formula for finite \p y. + * - __fsub_ru(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \mp\infty \end_cuda_math_formula for finite \p x. + * - __fsub_ru(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fsub_ru(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \mp\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __fsub_ru(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fsub_ru(\p x, \p x) returns \cuda_math_formula +0 \end_cuda_math_formula for finite \p x, including \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fsub_ru(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Subtract two floating-point values in round-down mode. + * + * Compute the difference of \p x and \p y in round-down (to negative infinity) mode. + * + * \return Returns \p x - \p y. + * - __fsub_rd(\cuda_math_formula \pm\infty \end_cuda_math_formula, \p y) returns \cuda_math_formula \pm\infty \end_cuda_math_formula for finite \p y. + * - __fsub_rd(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \mp\infty \end_cuda_math_formula for finite \p x. + * - __fsub_rd(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fsub_rd(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \mp\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __fsub_rd(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fsub_rd(\p x, \p x) returns \cuda_math_formula -0 \end_cuda_math_formula for finite \p x, including \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fsub_rd(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Multiply two floating-point values in round-to-nearest-even mode. + * + * Compute the product of \p x and \p y in round-to-nearest-even mode. + * + * \return Returns \p x * \p y. + * - sign of the product \p x * \p y is XOR of the signs of \p x and \p y when neither inputs nor result are NaN. + * - __fmul_rn(\p x, \p y) is equivalent to __fmul_rn(\p y, \p x). + * - __fmul_rn(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for \p x \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - __fmul_rn(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fmul_rn(\cuda_math_formula \pm 0 \end_cuda_math_formula, \p y) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for finite \p y. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fmul_rn(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Multiply two floating-point values in round-towards-zero mode. + * + * Compute the product of \p x and \p y in round-towards-zero mode. + * + * \return Returns \p x * \p y. + * - sign of the product \p x * \p y is XOR of the signs of \p x and \p y when neither inputs nor result are NaN. + * - __fmul_rz(\p x, \p y) is equivalent to __fmul_rz(\p y, \p x). + * - __fmul_rz(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for \p x \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - __fmul_rz(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fmul_rz(\cuda_math_formula \pm 0 \end_cuda_math_formula, \p y) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for finite \p y. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fmul_rz(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Multiply two floating-point values in round-up mode. + * + * Compute the product of \p x and \p y in round-up (to positive infinity) mode. + * + * \return Returns \p x * \p y. + * - sign of the product \p x * \p y is XOR of the signs of \p x and \p y when neither inputs nor result are NaN. + * - __fmul_ru(\p x, \p y) is equivalent to __fmul_ru(\p y, \p x). + * - __fmul_ru(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for \p x \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - __fmul_ru(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fmul_ru(\cuda_math_formula \pm 0 \end_cuda_math_formula, \p y) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for finite \p y. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fmul_ru(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Multiply two floating-point values in round-down mode. + * + * Compute the product of \p x and \p y in round-down (to negative infinity) mode. + * + * \return Returns \p x * \p y. + * - sign of the product \p x * \p y is XOR of the signs of \p x and \p y when neither inputs nor result are NaN. + * - __fmul_rd(\p x, \p y) is equivalent to __fmul_rd(\p y, \p x). + * - __fmul_rd(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for \p x \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - __fmul_rd(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fmul_rd(\cuda_math_formula \pm 0 \end_cuda_math_formula, \p y) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for finite \p y. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + * \note_nofma + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fmul_rd(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation, in round-to-nearest-even mode. + * + * Computes the value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single ternary operation, rounding the + * result once in round-to-nearest-even mode. + * + * \return Returns the rounded value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation. + * - __fmaf_rn( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p z) returns NaN. + * - __fmaf_rn( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p z) returns NaN. + * - __fmaf_rn(\p x, \p y, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __fmaf_rn(\p x, \p y, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - __fmaf_rn(\p x, \p y, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fmaf_rn(\p x, \p y, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fmaf_rn(\p x, \p y, \p z) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y + z \end_cuda_math_formula is exactly zero and \cuda_math_formula z \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fmaf_rn(float x, float y, float z); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation, in round-towards-zero mode. + * + * Computes the value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single ternary operation, rounding the + * result once in round-towards-zero mode. + * + * \return Returns the rounded value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation. + * - __fmaf_rz( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p z) returns NaN. + * - __fmaf_rz( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p z) returns NaN. + * - __fmaf_rz(\p x, \p y, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __fmaf_rz(\p x, \p y, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - __fmaf_rz(\p x, \p y, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fmaf_rz(\p x, \p y, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fmaf_rz(\p x, \p y, \p z) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y + z \end_cuda_math_formula is exactly zero and \cuda_math_formula z \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fmaf_rz(float x, float y, float z); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation, in round-up mode. + * + * Computes the value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single ternary operation, rounding the + * result once in round-up (to positive infinity) mode. + * + * \return Returns the rounded value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation. + * - __fmaf_ru( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p z) returns NaN. + * - __fmaf_ru( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p z) returns NaN. + * - __fmaf_ru(\p x, \p y, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __fmaf_ru(\p x, \p y, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - __fmaf_ru(\p x, \p y, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fmaf_ru(\p x, \p y, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fmaf_ru(\p x, \p y, \p z) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y + z \end_cuda_math_formula is exactly zero and \cuda_math_formula z \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fmaf_ru(float x, float y, float z); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation, in round-down mode. + * + * Computes the value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single ternary operation, rounding the + * result once in round-down (to negative infinity) mode. + * + * \return Returns the rounded value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation. + * - __fmaf_rd( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p z) returns NaN. + * - __fmaf_rd( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p z) returns NaN. + * - __fmaf_rd(\p x, \p y, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - __fmaf_rd(\p x, \p y, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - __fmaf_rd(\p x, \p y, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fmaf_rd(\p x, \p y, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula -0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fmaf_rd(\p x, \p y, \p z) returns \cuda_math_formula -0 \end_cuda_math_formula if \cuda_math_formula x \times y + z \end_cuda_math_formula is exactly zero and \cuda_math_formula z \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fmaf_rd(float x, float y, float z); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula \frac{1}{x} \end_cuda_math_formula + * in round-to-nearest-even mode. + * + * Compute the reciprocal of \p x in round-to-nearest-even mode. + * + * \return Returns + * \cuda_math_formula \frac{1}{x} \end_cuda_math_formula. + * - __frcp_rn(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __frcp_rn(\cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __frcp_rn(NaN) returns NaN. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __frcp_rn(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula \frac{1}{x} \end_cuda_math_formula + * in round-towards-zero mode. + * + * Compute the reciprocal of \p x in round-towards-zero mode. + * + * \return Returns + * \cuda_math_formula \frac{1}{x} \end_cuda_math_formula. + * - __frcp_rz(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __frcp_rz(\cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __frcp_rz(NaN) returns NaN. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __frcp_rz(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula \frac{1}{x} \end_cuda_math_formula + * in round-up mode. + * + * Compute the reciprocal of \p x in round-up (to positive infinity) mode. + * + * \return Returns + * \cuda_math_formula \frac{1}{x} \end_cuda_math_formula. + * - __frcp_ru(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __frcp_ru(\cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __frcp_ru(NaN) returns NaN. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __frcp_ru(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula \frac{1}{x} \end_cuda_math_formula + * in round-down mode. + * + * Compute the reciprocal of \p x in round-down (to negative infinity) mode. + * + * \return Returns + * \cuda_math_formula \frac{1}{x} \end_cuda_math_formula. + * - __frcp_rd(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __frcp_rd(\cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __frcp_rd(NaN) returns NaN. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __frcp_rd(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula + * in round-to-nearest-even mode. + * + * Compute the square root of \p x in round-to-nearest-even mode. + * + * \return Returns + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula. + * - __fsqrt_rn(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fsqrt_rn(\cuda_math_formula +\infty \end_cuda_math_formula) returns \cuda_math_formula +\infty \end_cuda_math_formula. + * - __fsqrt_rn(\p x) returns NaN for \p x < 0. + * - __fsqrt_rn(NaN) returns NaN. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fsqrt_rn(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula + * in round-towards-zero mode. + * + * Compute the square root of \p x in round-towards-zero mode. + * + * \return Returns + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula. + * - __fsqrt_rz(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fsqrt_rz(\cuda_math_formula +\infty \end_cuda_math_formula) returns \cuda_math_formula +\infty \end_cuda_math_formula. + * - __fsqrt_rz(\p x) returns NaN for \p x < 0. + * - __fsqrt_rz(NaN) returns NaN. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fsqrt_rz(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula + * in round-up mode. + * + * Compute the square root of \p x in round-up (to positive infinity) mode. + * + * \return Returns + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula. + * - __fsqrt_ru(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fsqrt_ru(\cuda_math_formula +\infty \end_cuda_math_formula) returns \cuda_math_formula +\infty \end_cuda_math_formula. + * - __fsqrt_ru(\p x) returns NaN for \p x < 0. + * - __fsqrt_ru(NaN) returns NaN. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fsqrt_ru(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula + * in round-down mode. + * + * Compute the square root of \p x in round-down (to negative infinity) mode. + * + * \return Returns + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula. + * - __fsqrt_rd(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - __fsqrt_rd(\cuda_math_formula +\infty \end_cuda_math_formula) returns \cuda_math_formula +\infty \end_cuda_math_formula. + * - __fsqrt_rd(\p x) returns NaN for \p x < 0. + * - __fsqrt_rd(NaN) returns NaN. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fsqrt_rd(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute + * \cuda_math_formula 1/\sqrt{x} \end_cuda_math_formula + * in round-to-nearest-even mode. + * + * Compute the reciprocal square root of \p x in round-to-nearest-even mode. + * + * \return Returns + * \cuda_math_formula 1/\sqrt{x} \end_cuda_math_formula. + * - __frsqrt_rn(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - __frsqrt_rn(\cuda_math_formula +\infty \end_cuda_math_formula) returns \cuda_math_formula +0 \end_cuda_math_formula. + * - __frsqrt_rn(\p x) returns NaN for \p x < 0. + * - __frsqrt_rn(NaN) returns NaN. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __frsqrt_rn(float x); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Divide two floating-point values in round-to-nearest-even mode. + * + * Divide two floating-point values \p x by \p y in round-to-nearest-even mode. + * + * \return Returns \p x / \p y. + * - sign of the quotient \p x / \p y is XOR of the signs of \p x and \p y when neither inputs nor result are NaN. + * - __fdiv_rn(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns NaN. + * - __fdiv_rn(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fdiv_rn(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for finite \p x. + * - __fdiv_rn(\cuda_math_formula \pm\infty \end_cuda_math_formula, \p y) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for finite \p y. + * - __fdiv_rn(\p x, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for \p x \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - __fdiv_rn(\cuda_math_formula \pm 0 \end_cuda_math_formula, \p y) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for \p y \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fdiv_rn(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Divide two floating-point values in round-towards-zero mode. + * + * Divide two floating-point values \p x by \p y in round-towards-zero mode. + * + * \return Returns \p x / \p y. + * - sign of the quotient \p x / \p y is XOR of the signs of \p x and \p y when neither inputs nor result are NaN. + * - __fdiv_rz(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns NaN. + * - __fdiv_rz(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fdiv_rz(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for finite \p x. + * - __fdiv_rz(\cuda_math_formula \pm\infty \end_cuda_math_formula, \p y) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for finite \p y. + * - __fdiv_rz(\p x, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for \p x \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - __fdiv_rz(\cuda_math_formula \pm 0 \end_cuda_math_formula, \p y) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for \p y \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fdiv_rz(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Divide two floating-point values in round-up mode. + * + * Divide two floating-point values \p x by \p y in round-up (to positive infinity) mode. + * + * \return Returns \p x / \p y. + * - sign of the quotient \p x / \p y is XOR of the signs of \p x and \p y when neither inputs nor result are NaN. + * - __fdiv_ru(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns NaN. + * - __fdiv_ru(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fdiv_ru(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for finite \p x. + * - __fdiv_ru(\cuda_math_formula \pm\infty \end_cuda_math_formula, \p y) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for finite \p y. + * - __fdiv_ru(\p x, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for \p x \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - __fdiv_ru(\cuda_math_formula \pm 0 \end_cuda_math_formula, \p y) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for \p y \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fdiv_ru(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Divide two floating-point values in round-down mode. + * + * Divide two floating-point values \p x by \p y in round-down (to negative infinity) mode. + * + * \return Returns \p x / \p y. + * - sign of the quotient \p x / \p y is XOR of the signs of \p x and \p y when neither inputs nor result are NaN. + * - __fdiv_rd(\cuda_math_formula \pm 0 \end_cuda_math_formula, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns NaN. + * - __fdiv_rd(\cuda_math_formula \pm\infty \end_cuda_math_formula, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns NaN. + * - __fdiv_rd(\p x, \cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for finite \p x. + * - __fdiv_rd(\cuda_math_formula \pm\infty \end_cuda_math_formula, \p y) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for finite \p y. + * - __fdiv_rd(\p x, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \infty \end_cuda_math_formula of appropriate sign for \p x \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - __fdiv_rd(\cuda_math_formula \pm 0 \end_cuda_math_formula, \p y) returns \cuda_math_formula 0 \end_cuda_math_formula of appropriate sign for \p y \cuda_math_formula \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single_intrinsic + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __fdiv_rd(float x, float y); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Return the number of consecutive high-order zero bits in a 32-bit integer. + * + * Count the number of consecutive leading zero bits, starting at the most significant bit (bit 31) of \p x. + * + * \return Returns a value between 0 and 32 inclusive representing the number of zero bits. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __clz(int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Find the position of the least significant bit set to 1 in a 32-bit integer. + * + * Find the position of the first (least significant) bit set to 1 in \p x, where the least significant + * bit position is 1. + * + * \return Returns a value between 0 and 32 inclusive representing the position of the first bit set. + * - __ffs(0) returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __ffs(int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Count the number of bits that are set to 1 in a 32-bit integer. + * + * Count the number of bits that are set to 1 in \p x. + * + * \return Returns a value between 0 and 32 inclusive representing the number of set bits. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __popc(unsigned int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Reverse the bit order of a 32-bit unsigned integer. + * + * Reverses the bit order of the 32-bit unsigned integer \p x. + * + * \return Returns the bit-reversed value of \p x. i.e. bit N of the return value corresponds to bit 31-N of \p x. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __brev(unsigned int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Count the number of consecutive high-order zero bits in a 64-bit integer. + * + * Count the number of consecutive leading zero bits, starting at the most significant bit (bit 63) of \p x. + * + * \return Returns a value between 0 and 64 inclusive representing the number of zero bits. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __clzll(long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Find the position of the least significant bit set to 1 in a 64-bit integer. + * + * Find the position of the first (least significant) bit set to 1 in \p x, where the least significant + * bit position is 1. + * + * \return Returns a value between 0 and 64 inclusive representing the position of the first bit set. + * - __ffsll(0) returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __ffsll(long long int x); + + +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Count the number of bits that are set to 1 in a 64-bit integer. + * + * Count the number of bits that are set to 1 in \p x. + * + * \return Returns a value between 0 and 64 inclusive representing the number of set bits. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __popcll(unsigned long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Reverse the bit order of a 64-bit unsigned integer. + * + * Reverses the bit order of the 64-bit unsigned integer \p x. + * + * \return Returns the bit-reversed value of \p x. i.e. bit N of the return value corresponds to bit 63-N of \p x. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned long long int __brevll(unsigned long long int x); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Return selected bytes from two 32-bit unsigned integers. + * + * \return Returns a 32-bit integer consisting of four bytes from eight input bytes provided in the two + * input integers \p x and \p y, as specified by a selector, \p s. + * + * Create 8-byte source + * - uint64_t \p tmp64 = ((uint64_t)\p y << 32) | \p x; + * + * Extract selector bits + * - \p selector0 = (\p s >> 0) & 0x7; + * - \p selector1 = (\p s >> 4) & 0x7; + * - \p selector2 = (\p s >> 8) & 0x7; + * - \p selector3 = (\p s >> 12) & 0x7; + * + * Return 4 selected bytes from 8-byte source: + * - \p res[07:00] = \p tmp64[\p selector0]; + * - \p res[15:08] = \p tmp64[\p selector1]; + * - \p res[23:16] = \p tmp64[\p selector2]; + * - \p res[31:24] = \p tmp64[\p selector3]; + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __byte_perm(unsigned int x, unsigned int y, unsigned int s); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Compute average of signed input arguments, avoiding overflow + * in the intermediate sum. + * + * Compute average of signed input arguments \p x and \p y + * as ( \p x + \p y ) >> 1, avoiding overflow in the intermediate sum. + * + * \return Returns a signed integer value representing the signed + * average value of the two inputs. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __hadd(int x, int y); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Compute rounded average of signed input arguments, avoiding + * overflow in the intermediate sum. + * + * Compute average of signed input arguments \p x and \p y + * as ( \p x + \p y + 1 ) >> 1, avoiding overflow in the intermediate + * sum. + * + * \return Returns a signed integer value representing the signed + * rounded average value of the two inputs. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __rhadd(int x, int y); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Compute average of unsigned input arguments, avoiding overflow + * in the intermediate sum. + * + * Compute average of unsigned input arguments \p x and \p y + * as ( \p x + \p y ) >> 1, avoiding overflow in the intermediate sum. + * + * \return Returns an unsigned integer value representing the unsigned + * average value of the two inputs. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __uhadd(unsigned int x, unsigned int y); +/** + * \ingroup CUDA_MATH_INTRINSIC_INT + * \brief Compute rounded average of unsigned input arguments, avoiding + * overflow in the intermediate sum. + * + * Compute average of unsigned input arguments \p x and \p y + * as ( \p x + \p y + 1 ) >> 1, avoiding overflow in the intermediate + * sum. + * + * \return Returns an unsigned integer value representing the unsigned + * rounded average value of the two inputs. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __urhadd(unsigned int x, unsigned int y); + +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a signed int in round-towards-zero mode. + * + * Convert the double-precision floating-point value \p x to a + * signed integer value in round-towards-zero mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __double2int_rz(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to an unsigned int in round-towards-zero mode. + * + * Convert the double-precision floating-point value \p x to an + * unsigned integer value in round-towards-zero mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __double2uint_rz(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to a signed 64-bit int in round-towards-zero mode. + * + * Convert the double-precision floating-point value \p x to a + * signed 64-bit integer value in round-towards-zero mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int __double2ll_rz(double x); +/** + * \ingroup CUDA_MATH_INTRINSIC_CAST + * \brief Convert a double to an unsigned 64-bit int in round-towards-zero mode. + * + * Convert the double-precision floating-point value \p x to an + * unsigned 64-bit integer value in round-towards-zero mode. + * \return Returns converted value. + * \note_fp_to_int_out_of_range_undefined + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned long long int __double2ull_rz(double x); +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __pm0(void); +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __pm1(void); +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __pm2(void); +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __pm3(void); + +/******************************************************************************* + * * + * FP16 SIMD functions * + * * + *******************************************************************************/ + + // #include "fp16.h" + + +/******************************************************************************* + * * + * SIMD functions * + * * + *******************************************************************************/ + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-halfword absolute value: |a|. + * + * Splits 4 bytes of argument into 2 parts, each consisting of 2 bytes, + * then computes absolute value for each of parts. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vabs2(unsigned int a); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-halfword absolute value with signed saturation: |a|. + * + * Splits 4 bytes of argument into 2 parts, each consisting of 2 bytes, + * then computes absolute value with signed saturation for each of parts. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vabsss2(unsigned int a); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword (un)signed addition, with wrap-around: a + b. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes, + * then performs unsigned addition on corresponding parts. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vadd2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword addition with signed saturation: a + b. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes, + * then performs addition with signed saturation on corresponding parts. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vaddss2 (unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword addition with unsigned saturation: a + b. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes, + * then performs addition with unsigned saturation on corresponding parts. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vaddus2 (unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed rounded average computation. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes, + * then computes signed rounded average of corresponding parts. Partial results are + * recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vavgs2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned rounded average computation. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes, + * then computes unsigned rounded average of corresponding parts. Partial results are + * recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vavgu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned average computation. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes, + * then computes unsigned average of corresponding parts. Partial results are + * recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vhaddu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword (un)signed comparison: a == b ? 0xffff : 0. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts result is ffff if they are equal, and 0000 otherwise. + * For example __vcmpeq2(0x1234aba5, 0x1234aba6) returns 0xffff0000. + * \return Returns 0xffff computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpeq2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed comparison: a >= b ? 0xffff : 0. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts result is ffff if 'a' part >= 'b' part, and 0000 otherwise. + * For example __vcmpges2(0x1234aba5, 0x1234aba6) returns 0xffff0000. + * \return Returns 0xffff if a >= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpges2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned comparison: a >= b ? 0xffff : 0. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts result is ffff if 'a' part >= 'b' part, and 0000 otherwise. + * For example __vcmpgeu2(0x1234aba5, 0x1234aba6) returns 0xffff0000. + * \return Returns 0xffff if a >= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpgeu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed comparison: a > b ? 0xffff : 0. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts result is ffff if 'a' part > 'b' part, and 0000 otherwise. + * For example __vcmpgts2(0x1234aba5, 0x1234aba6) returns 0x00000000. + * \return Returns 0xffff if a > b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpgts2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned comparison: a > b ? 0xffff : 0. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts result is ffff if 'a' part > 'b' part, and 0000 otherwise. + * For example __vcmpgtu2(0x1234aba5, 0x1234aba6) returns 0x00000000. + * \return Returns 0xffff if a > b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpgtu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed comparison: a <= b ? 0xffff : 0. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts result is ffff if 'a' part <= 'b' part, and 0000 otherwise. + * For example __vcmples2(0x1234aba5, 0x1234aba6) returns 0xffffffff. + * \return Returns 0xffff if a <= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmples2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned comparison: a <= b ? 0xffff : 0. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts result is ffff if 'a' part <= 'b' part, and 0000 otherwise. + * For example __vcmpleu2(0x1234aba5, 0x1234aba6) returns 0xffffffff. + * \return Returns 0xffff if a <= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpleu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed comparison: a < b ? 0xffff : 0. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts result is ffff if 'a' part < 'b' part, and 0000 otherwise. + * For example __vcmplts2(0x1234aba5, 0x1234aba6) returns 0x0000ffff. + * \return Returns 0xffff if a < b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmplts2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned comparison: a < b ? 0xffff : 0. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts result is ffff if 'a' part < 'b' part, and 0000 otherwise. + * For example __vcmpltu2(0x1234aba5, 0x1234aba6) returns 0x0000ffff. + * \return Returns 0xffff if a < b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpltu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword (un)signed comparison: a != b ? 0xffff : 0. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts result is ffff if 'a' part != 'b' part, and 0000 otherwise. + * For example __vcmplts2(0x1234aba5, 0x1234aba6) returns 0x0000ffff. + * \return Returns 0xffff if a != b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpne2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-halfword absolute difference of unsigned integer: |a - b|. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function computes absolute difference. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vabsdiffu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed maximum computation. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function computes signed maximum. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vmaxs2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned maximum computation. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function computes unsigned maximum. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vmaxu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed minimum computation. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function computes signed minimum. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vmins2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned minimum computation. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function computes unsigned minimum. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vminu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword (un)signed comparison: returns 1 if both parts compare equal. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs comparison 'a' part == 'b' part. + * If both equalities are satisfied, function returns 1. + * \return Returns 1 if a = b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vseteq2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed comparison: returns 1 if both parts compare greater than or equal. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs comparison 'a' part >= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a >= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetges2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned comparison: returns 1 if both parts compare greater than or equal. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs comparison 'a' part >= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a >= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetgeu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed comparison: returns 1 if both parts compare greater than. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs comparison 'a' part > 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a > b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetgts2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned comparison: returns 1 if both parts compare greater than. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs comparison 'a' part > 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a > b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetgtu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned comparison: returns 1 if both parts compare less than or equal. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs comparison 'a' part <= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a <= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetles2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed comparison: returns 1 if both parts compare less than or equal. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs comparison 'a' part <= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a <= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetleu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword signed comparison: returns 1 if both parts compare less than. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs comparison 'a' part <= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a < b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetlts2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword unsigned comparison: returns 1 if both parts compare less than. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs comparison 'a' part <= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a < b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetltu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword (un)signed comparison: returns 1 if both parts compare not equal. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs comparison 'a' part != 'b' part. + * If both conditions are satisfied, function returns 1. + * \return Returns 1 if a != b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetne2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-halfword sum of abs diff of unsigned. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function computes absolute differences and returns + * sum of those differences. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsadu2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword (un)signed subtraction, with wrap-around: a - b. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs subtraction. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsub2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword (un)signed subtraction, with signed saturation: a - b. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs subtraction with signed saturation. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsubss2 (unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword subtraction with unsigned saturation: a - b. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function performs subtraction with unsigned saturation. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsubus2 (unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-halfword negation. + * + * Splits 4 bytes of argument into 2 parts, each consisting of 2 bytes. + * For each part function computes negation. Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vneg2(unsigned int a); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-halfword negation with signed saturation. + * + * Splits 4 bytes of argument into 2 parts, each consisting of 2 bytes. + * For each part function computes negation. Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vnegss2(unsigned int a); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-halfword absolute difference of signed integer: |a - b|. + * + * Splits 4 bytes of each into 2 parts, each consisting of 2 bytes. + * For corresponding parts function computes absolute difference. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vabsdiffs2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword sum of absolute difference of signed. + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * For corresponding parts function computes absolute difference and sum it up. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsads2(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte absolute value: |a|. + * + * Splits argument by bytes. Computes absolute value of each byte. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vabs4(unsigned int a); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte absolute value with signed saturation: |a|. + * + * Splits 4 bytes of argument into 4 parts, each consisting of 1 byte, + * then computes absolute value with signed saturation for each of parts. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vabsss4(unsigned int a); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte (un)signed addition: a + b. + * + * Splits 'a' into 4 bytes, then performs unsigned addition on each of these + * bytes with the corresponding byte from 'b', ignoring overflow. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vadd4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte addition with signed saturation: a + b. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte, + * then performs addition with signed saturation on corresponding parts. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vaddss4 (unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte addition with unsigned saturation: a + b. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte, + * then performs addition with unsigned saturation on corresponding parts. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vaddus4 (unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte signed rounded average. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * then computes signed rounded average of corresponding parts. Partial results are + * recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vavgs4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte unsigned rounded average. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * then computes unsigned rounded average of corresponding parts. Partial results are + * recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vavgu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte unsigned average. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * then computes unsigned average of corresponding parts. Partial results are + * recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vhaddu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte (un)signed comparison: a == b ? 0xff : 0. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts result is ff if they are equal, and 00 otherwise. + * For example __vcmpeq4(0x1234aba5, 0x1234aba6) returns 0xffffff00. + * \return Returns 0xff if a = b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpeq4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte signed comparison: a >= b ? 0xff : 0. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts result is ff if 'a' part >= 'b' part, and 00 otherwise. + * For example __vcmpges4(0x1234aba5, 0x1234aba6) returns 0xffffff00. + * \return Returns 0xff if a >= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpges4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte unsigned comparison: a >= b ? 0xff : 0. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts result is ff if 'a' part >= 'b' part, and 00 otherwise. + * For example __vcmpgeu4(0x1234aba5, 0x1234aba6) returns 0xffffff00. + * \return Returns 0xff if a >= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpgeu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte signed comparison: a > b ? 0xff : 0. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts result is ff if 'a' part > 'b' part, and 00 otherwise. + * For example __vcmpgts4(0x1234aba5, 0x1234aba6) returns 0x00000000. + * \return Returns 0xff if a > b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpgts4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte unsigned comparison: a > b ? 0xff : 0. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts result is ff if 'a' part > 'b' part, and 00 otherwise. + * For example __vcmpgtu4(0x1234aba5, 0x1234aba6) returns 0x00000000. + * \return Returns 0xff if a > b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpgtu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte signed comparison: a <= b ? 0xff : 0. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts result is ff if 'a' part <= 'b' part, and 00 otherwise. + * For example __vcmples4(0x1234aba5, 0x1234aba6) returns 0xffffffff. + * \return Returns 0xff if a <= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmples4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte unsigned comparison: a <= b ? 0xff : 0. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts result is ff if 'a' part <= 'b' part, and 00 otherwise. + * For example __vcmpleu4(0x1234aba5, 0x1234aba6) returns 0xffffffff. + * \return Returns 0xff if a <= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpleu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte signed comparison: a < b ? 0xff : 0. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts result is ff if 'a' part < 'b' part, and 00 otherwise. + * For example __vcmplts4(0x1234aba5, 0x1234aba6) returns 0x000000ff. + * \return Returns 0xff if a < b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmplts4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte unsigned comparison: a < b ? 0xff : 0. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts result is ff if 'a' part < 'b' part, and 00 otherwise. + * For example __vcmpltu4(0x1234aba5, 0x1234aba6) returns 0x000000ff. + * \return Returns 0xff if a < b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpltu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte (un)signed comparison: a != b ? 0xff : 0. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts result is ff if 'a' part != 'b' part, and 00 otherwise. + * For example __vcmplts4(0x1234aba5, 0x1234aba6) returns 0x000000ff. + * \return Returns 0xff if a != b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vcmpne4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte absolute difference of unsigned integer: |a - b|. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function computes absolute difference. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vabsdiffu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte signed maximum. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function computes signed maximum. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vmaxs4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte unsigned maximum. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function computes unsigned maximum. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vmaxu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte signed minimum. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function computes signed minimum. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vmins4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte unsigned minimum. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function computes unsigned minimum. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vminu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte (un)signed comparison: returns 1 if all 4 pairs compare equal. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs comparison 'a' part == 'b' part. + * If both equalities are satisfied, function returns 1. + * \return Returns 1 if a = b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vseteq4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte signed comparison: returns 1 if all 4 pairs compare less than or equal. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs comparison 'a' part <= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a <= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetles4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte unsigned comparison: returns 1 if all 4 pairs compare less than or equal. + * + * Splits 4 bytes of each argument into 4 part, each consisting of 1 byte. + * For corresponding parts function performs comparison 'a' part <= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a <= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetleu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte signed comparison: returns 1 if all 4 pairs compare less than. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs comparison 'a' part <= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a < b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetlts4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte unsigned comparison: returns 1 if all 4 pairs compare less than. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs comparison 'a' part <= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a < b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetltu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte signed comparison: returns 1 if all 4 pairs compare greater than or equal. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs comparison 'a' part >= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a >= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetges4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte unsigned comparison: returns 1 if all 4 pairs compare greater than or equal. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs comparison 'a' part >= 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a >= b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetgeu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte signed comparison: returns 1 if all 4 pairs compare greater than. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs comparison 'a' part > 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a > b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetgts4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte unsigned comparison: returns 1 if all 4 pairs compare greater than. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs comparison 'a' part > 'b' part. + * If both inequalities are satisfied, function returns 1. + * \return Returns 1 if a > b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetgtu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte (un)signed comparison: returns 1 if all 4 pairs compare not equal. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs comparison 'a' part != 'b' part. + * If both conditions are satisfied, function returns 1. + * \return Returns 1 if a != b, else returns 0. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsetne4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte sum of abs difference of unsigned. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function computes absolute differences and returns + * sum of those differences. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsadu4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte subtraction: a - b. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs subtraction. Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsub4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte subtraction with signed saturation: a - b. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs subtraction with signed saturation. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsubss4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte subtraction with unsigned saturation: a - b. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function performs subtraction with unsigned saturation. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsubus4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte negation. + * + * Splits 4 bytes of argument into 4 parts, each consisting of 1 byte. + * For each part function computes negation. Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vneg4(unsigned int a); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-byte negation with signed saturation. + * + * Splits 4 bytes of argument into 4 parts, each consisting of 1 byte. + * For each part function computes negation. Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vnegss4(unsigned int a); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte absolute difference of signed integer: |a - b|. + * + * Splits 4 bytes of each into 4 parts, each consisting of 1 byte. + * For corresponding parts function computes absolute difference. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vabsdiffs4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes per-byte sum of abs difference of signed. + * + * Splits 4 bytes of each argument into 4 parts, each consisting of 1 byte. + * For corresponding parts function computes absolute difference and sum it up. + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int __vsads4(unsigned int a, unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(max(a, b), 0) + * + * Calculates the maximum of \p a and \p b of two signed ints, if this is less than \p 0 then \p 0 is returned. + * \return Returns computed value. + */ + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimax_s32_relu(const int a, const int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(max(a, b), 0) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs a max with relu ( = max(a_part, b_part, 0) ). Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimax_s16x2_relu(const unsigned int a, const unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(min(a, b), 0) + * + * Calculates the minimum of \p a and \p b of two signed ints, if this is less than \p 0 then \p 0 is returned. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimin_s32_relu(const int a, const int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(min(a, b), 0) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs a min with relu ( = max(min(a_part, b_part), 0) ). Partial results + * are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimin_s16x2_relu(const unsigned int a, const unsigned int b); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(max(a, b), c) + * + * Calculates the 3-way max of signed integers \p a, \p b and \p c. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimax3_s32(const int a, const int b, const int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(max(a, b), c) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs a 3-way max ( = max(max(a_part, b_part), c_part) ). + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimax3_s16x2(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(max(a, b), c) + * + * Calculates the 3-way max of unsigned integers \p a, \p b and \p c. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimax3_u32(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(max(a, b), c) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as unsigned shorts. + * For corresponding parts function performs a 3-way max ( = max(max(a_part, b_part), c_part) ). + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimax3_u16x2(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes min(min(a, b), c) + * + * Calculates the 3-way min of signed integers \p a, \p b and \p c. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimin3_s32(const int a, const int b, const int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword min(min(a, b), c) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs a 3-way min ( = min(min(a_part, b_part), c_part) ). + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimin3_s16x2(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes min(min(a, b), c) + * + * Calculates the 3-way min of unsigned integers \p a, \p b and \p c. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimin3_u32(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword min(min(a, b), c) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as unsigned shorts. + * For corresponding parts function performs a 3-way min ( = min(min(a_part, b_part), c_part) ). + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimin3_u16x2(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(max(max(a, b), c), 0) + * + * Calculates the maximum of three signed ints, if this is less than \p 0 then \p 0 is returned. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimax3_s32_relu(const int a, const int b, const int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(max(max(a, b), c), 0) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs a three-way max with relu ( = max(a_part, b_part, c_part, 0) ). + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimax3_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(min(min(a, b), c), 0) + * + * Calculates the minimum of three signed ints, if this is less than \p 0 then \p 0 is returned. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimin3_s32_relu(const int a, const int b, const int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(min(min(a, b), c), 0) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs a three-way min with relu ( = max(min(a_part, b_part, c_part), 0) ). + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimin3_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(a + b, c) + * + * Calculates the sum of signed integers \p a and \p b and takes the max with \p c. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __viaddmax_s32(const int a, const int b, const int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(a + b, c) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs an add and compare: max(a_part + b_part), c_part) + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmax_s16x2(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(a + b, c) + * + * Calculates the sum of unsigned integers \p a and \p b and takes the max with \p c. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmax_u32(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(a + b, c) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as unsigned shorts. + * For corresponding parts function performs an add and compare: max(a_part + b_part), c_part) + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmax_u16x2(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes min(a + b, c) + * + * Calculates the sum of signed integers \p a and \p b and takes the min with \p c. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __viaddmin_s32(const int a, const int b, const int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword min(a + b, c) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs an add and compare: min(a_part + b_part), c_part) + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmin_s16x2(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes min(a + b, c) + * + * Calculates the sum of unsigned integers \p a and \p b and takes the min with \p c. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmin_u32(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword min(a + b, c) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as unsigned shorts. + * For corresponding parts function performs an add and compare: min(a_part + b_part), c_part) + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmin_u16x2(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(max(a + b, c), 0) + * + * Calculates the sum of signed integers \p a and \p b and takes the max with \p c. + * If the result is less than \p 0 then \p 0 is returned. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __viaddmax_s32_relu(const int a, const int b, const int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(max(a + b, c), 0) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs an add, followed by a max with relu: max(max(a_part + b_part), c_part), 0) + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmax_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(min(a + b, c), 0) + * + * Calculates the sum of signed integers \p a and \p b and takes the min with \p c. + * If the result is less than \p 0 then \p 0 is returned. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __viaddmin_s32_relu(const int a, const int b, const int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(min(a + b, c), 0) + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs an add, followed by a min with relu: max(min(a_part + b_part), c_part), 0) + * Partial results are recombined and returned as unsigned int. + * \return Returns computed value. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmin_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(a, b), also sets the value pointed to by pred to (a >= b). + * + * Calculates the maximum of \p a and \p b of two signed ints. Also sets the value pointed to by \p pred to the value (a >= b). + * \return Returns computed values. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vibmax_s32(const int a, const int b, bool* const pred); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes max(a, b), also sets the value pointed to by pred to (a >= b). + * + * Calculates the maximum of \p a and \p b of two unsigned ints. Also sets the value pointed to by \p pred to the value (a >= b). + * \return Returns computed values. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmax_u32(const unsigned int a, const unsigned int b, bool* const pred); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes min(a, b), also sets the value pointed to by pred to (a <= b). + * + * Calculates the minimum of \p a and \p b of two signed ints. Also sets the value pointed to by \p pred to the value (a <= b). + * \return Returns computed values. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vibmin_s32(const int a, const int b, bool* const pred); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Computes min(a, b), also sets the value pointed to by pred to (a <= b). + * + * Calculates the minimum of \p a and \p b of two unsigned ints. Also sets the value pointed to by \p pred to the value (a <= b). + * \return Returns computed values. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmin_u32(const unsigned int a, const unsigned int b, bool* const pred); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(a, b), also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a >= b). + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs a maximum ( = max(a_part, b_part) ). + * Partial results are recombined and returned as unsigned int. + * Sets the value pointed to by \p pred_hi to the value (a_high_part >= b_high_part). + * Sets the value pointed to by \p pred_lo to the value (a_low_part >= b_low_part). + * \return Returns computed values. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmax_s16x2(const unsigned int a, const unsigned int b, bool* const pred_hi, bool* const pred_lo); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword max(a, b), also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a >= b). + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as unsigned shorts. + * For corresponding parts function performs a maximum ( = max(a_part, b_part) ). + * Partial results are recombined and returned as unsigned int. + * Sets the value pointed to by \p pred_hi to the value (a_high_part >= b_high_part). + * Sets the value pointed to by \p pred_lo to the value (a_low_part >= b_low_part). + * \return Returns computed values. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmax_u16x2(const unsigned int a, const unsigned int b, bool* const pred_hi, bool* const pred_lo); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword min(a, b), also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a <= b). + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as signed shorts. + * For corresponding parts function performs a maximum ( = max(a_part, b_part) ). + * Partial results are recombined and returned as unsigned int. + * Sets the value pointed to by \p pred_hi to the value (a_high_part <= b_high_part). + * Sets the value pointed to by \p pred_lo to the value (a_low_part <= b_low_part). + * \return Returns computed values. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmin_s16x2(const unsigned int a, const unsigned int b, bool* const pred_hi, bool* const pred_lo); + +/** + * \ingroup CUDA_MATH_INTRINSIC_SIMD + * \brief Performs per-halfword min(a, b), also sets the value pointed to by pred_hi and pred_lo to the per-halfword result of (a <= b). + * + * Splits 4 bytes of each argument into 2 parts, each consisting of 2 bytes. + * These 2 byte parts are interpreted as unsigned shorts. + * For corresponding parts function performs a maximum ( = max(a_part, b_part) ). + * Partial results are recombined and returned as unsigned int. + * Sets the value pointed to by \p pred_hi to the value (a_high_part <= b_high_part). + * Sets the value pointed to by \p pred_lo to the value (a_low_part <= b_low_part). + * \return Returns computed values. + */ +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmin_u16x2(const unsigned int a, const unsigned int b, bool* const pred_hi, bool* const pred_lo); + +/******************************************************************************* + * * + * END SIMD functions * + * * + *******************************************************************************/ +} //extern "c" +#undef EXCLUDE_FROM_RTC + +#undef __DEVICE_FUNCTIONS_DECL__ +#undef __DEVICE_FUNCTIONS_STATIC_DECL__ +#undef __DEVICE_HOST_FUNCTIONS_STATIC_DECL__ + +#endif /* __cplusplus && __CUDACC__ */ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if !defined(__CUDACC_RTC__) +#include "device_functions.hpp" +#endif /* !defined(__CUDACC_RTC__) */ + +#include "device_atomic_functions.h" +#include "device_double_functions.h" +#include "sm_20_atomic_functions.h" +#include "sm_32_atomic_functions.h" +#include "sm_35_atomic_functions.h" +#include "sm_60_atomic_functions.h" +#include "sm_20_intrinsics.h" +#include "sm_30_intrinsics.h" +#include "sm_32_intrinsics.h" +#include "sm_35_intrinsics.h" +#include "sm_61_intrinsics.h" +#include "sm_70_rt.h" +#include "sm_80_rt.h" +#include "sm_90_rt.h" +#include "sm_100_rt.h" +#ifndef __CUDACC_RTC_MINIMAL__ +#include "texture_indirect_functions.h" +#include "surface_indirect_functions.h" +#endif /* !__CUDACC_RTC_MINIMAL__ */ +#include "cudacc_ext.h" + +#ifdef __CUDACC__ +extern "C" __host__ __device__ unsigned CUDARTAPI __cudaPushCallConfiguration(dim3 gridDim, + dim3 blockDim, + size_t sharedMem = 0, + struct CUstream_st *stream = 0); + +#if !defined(__CUDACC_RTC__) &&!defined(__NV_LEGACY_LAUNCH) +extern "C" cudaError_t CUDARTAPI __cudaGetKernel(cudaKernel_t *, const void *); + +extern "C" cudaError_t CUDARTAPI __cudaLaunchKernel( + cudaKernel_t kernel, + dim3 gridDim, + dim3 blockDim, + void **args, + size_t sharedMem, + cudaStream_t stream +); + +extern "C" cudaError_t CUDARTAPI __cudaLaunchKernel_ptsz( + cudaKernel_t kernel, + dim3 gridDim, + dim3 blockDim, + void **args, + size_t sharedMem, + cudaStream_t stream +); + +//referenced from compiler generated kernel launch code +static inline cudaError_t __cudaLaunchKernel_helper( + cudaKernel_t kernel, + dim3 gridDim, + dim3 blockDim, + void **args, + size_t sharedMem, + cudaStream_t stream) +{ +#if defined(__CUDART_API_PER_THREAD_DEFAULT_STREAM) + return __cudaLaunchKernel_ptsz(kernel, gridDim, blockDim, args, sharedMem, + stream); +#else /* !__CUDART_API_PER_THREAD_DEFAULT_STREAM */ + return __cudaLaunchKernel(kernel, gridDim, blockDim, args, sharedMem, + stream); +#endif /* __CUDART_API_PER_THREAD_DEFAULT_STREAM */ +} +#endif /* !defined(__CUDACC_RTC__) && !defined(__NV_LEGACY_LAUNCH) */ + +enum { + __NV_ATOMIC_RELAXED, + __NV_ATOMIC_CONSUME, + __NV_ATOMIC_ACQUIRE, + __NV_ATOMIC_RELEASE, + __NV_ATOMIC_ACQ_REL, + __NV_ATOMIC_SEQ_CST +}; + +enum { + __NV_THREAD_SCOPE_THREAD, + __NV_THREAD_SCOPE_BLOCK, + __NV_THREAD_SCOPE_CLUSTER, + __NV_THREAD_SCOPE_DEVICE, + __NV_THREAD_SCOPE_SYSTEM +}; + +#endif /* __CUDACC__ */ + +#endif /* !__DEVICE_FUNCTIONS_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_FUNCTIONS_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_FUNCTIONS_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_functions.hpp b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_functions.hpp new file mode 100644 index 0000000000000000000000000000000000000000..429b2298a8fdd95338c132996b1d9dca74130193 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/device_functions.hpp @@ -0,0 +1,1163 @@ +/* + * Copyright 1993-2024 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/device_functions.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/device_functions.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_FUNCTIONS_HPP__ +#endif + +#if !defined(__DEVICE_FUNCTIONS_HPP__) +#define __DEVICE_FUNCTIONS_HPP__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if defined(__CUDACC_RTC__) +#define __DEVICE_FUNCTIONS_DECL__ __device__ +#define __DEVICE_FUNCTIONS_STATIC_DECL__ __device__ +#define __DEVICE_HOST_FUNCTIONS_STATIC_DECL__ __device__ __host__ __cudart_builtin__ +#else +#define __DEVICE_FUNCTIONS_DECL__ __device__ +#define __DEVICE_FUNCTIONS_STATIC_DECL__ static __inline__ __device__ +#define __DEVICE_HOST_FUNCTIONS_STATIC_DECL__ static __inline__ __device__ __host__ __cudart_builtin__ +#endif /* __CUDACC_RTC__ */ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +#undef __DEVICE_FUNCTIONS_DECL__ +#undef __DEVICE_FUNCTIONS_STATIC_DECL__ + +#endif /* __cplusplus && __CUDACC__ */ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#ifdef __CUDACC__ +# if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 900) +#define __CUDA_AND_AT_LEAST_SM_90__ +#endif /* defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 900) */ +# if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 700) +#define __CUDA_AND_AT_LEAST_SM_70__ +#endif /* defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 700) */ +# if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 750) +#define __CUDA_AND_AT_LEAST_SM_75__ +#endif /* defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 750) */ +#endif /* __CUDACC__ */ + +/* C++ header for std::memcpy (used for type punning in host-side implementations). + * When compiling as a CUDA source file memcpy is provided implicitly. + * !defined(__CUDACC__) implies !defined(__CUDACC_RTC__). + */ +#if defined(__cplusplus) && !defined(__CUDACC__) +#include +#endif /* defined(__cplusplus) && !defined(__CUDACC__) */ + +static __host__ __device__ short __internal_cast_u2s(unsigned short x) +{ + short res; +#if defined(__CUDACC__) + (void)memcpy(&res, &x, sizeof(x)); +#else + (void)std::memcpy(&res, &x, sizeof(x)); +#endif + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimax_s32_relu(const int a, const int b){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm("{max.s32.relu %0, %1, %2;}" : "=r"(res) : "r"(a), "r"(b)); + return res; +#else + // Host and older architecture code + int ans = max(a, b); + + return (ans > 0) ? ans : 0; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimax_s16x2_relu(const unsigned int a, const unsigned int b){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm("{max.s16x2.relu %0, %1, %2;}" : "=r"(res) : "r"(a), "r"(b)); +#elif defined(__CUDA_ARCH__) + res = __vmaxs2(__vmaxs2(a, b), 0U); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + //cast to signed: + short aS_lo = __internal_cast_u2s(aU_lo); + short aS_hi = __internal_cast_u2s(aU_hi); + + short bS_lo = __internal_cast_u2s(bU_lo); + short bS_hi = __internal_cast_u2s(bU_hi); + + // Get answer + int ansI_lo = max(aS_lo, bS_lo); + int ansI_hi = max(aS_hi, bS_hi); + + // relu + if(ansI_lo < 0){ ansI_lo = 0; } + if(ansI_hi < 0){ ansI_hi = 0; } + + // Cast back to unsigned: + unsigned ansU_lo = (unsigned)ansI_lo; + unsigned ansU_hi = (unsigned)ansI_hi; + + // Put answer back together: + res = ansU_lo | (ansU_hi << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimin_s32_relu(const int a, const int b){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm("{min.s32.relu %0, %1, %2;}" : "=r"(res) : "r"(a), "r"(b)); + return res; +#else + // Host and older architecture code + int ans = min(a, b); + + return (ans > 0) ? ans : 0; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimin_s16x2_relu(const unsigned int a, const unsigned int b){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm("{min.s16x2.relu %0, %1, %2;}" : "=r"(res) : "r"(a), "r"(b)); +#elif defined(__CUDA_ARCH__) + res = __vmaxs2(__vmins2(a, b), 0U); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + //cast to signed: + short aS_lo = __internal_cast_u2s(aU_lo); + short aS_hi = __internal_cast_u2s(aU_hi); + + short bS_lo = __internal_cast_u2s(bU_lo); + short bS_hi = __internal_cast_u2s(bU_hi); + + // Get answer + int ansI_lo = min(aS_lo, bS_lo); + int ansI_hi = min(aS_hi, bS_hi); + + // relu + if(ansI_lo < 0){ ansI_lo = 0; } + if(ansI_hi < 0){ ansI_hi = 0; } + + // Cast back to unsigned: + unsigned ansU_lo = (unsigned)ansI_lo; + unsigned ansU_hi = (unsigned)ansI_hi; + + // Put answer back together: + res = ansU_lo | (ansU_hi << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimax3_s32(const int a, const int b, const int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm ("{.reg .s32 t1; \n\t" + "max.s32 t1, %1, %2; \n\t" + "max.s32 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + return max(max(a, b), c); +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimax3_s16x2(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + // Future asm code (naming/syntax may change): + asm ("{.reg .b32 t1; \n\t" + "max.s16x2 t1, %1, %2; \n\t" + "max.s16x2 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_AND_AT_LEAST_SM_70__) + res = __vmaxs2(__vmaxs2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + //cast to signed: + short aS_lo = __internal_cast_u2s(aU_lo); + short aS_hi = __internal_cast_u2s(aU_hi); + + short bS_lo = __internal_cast_u2s(bU_lo); + short bS_hi = __internal_cast_u2s(bU_hi); + + short cS_lo = __internal_cast_u2s(cU_lo); + short cS_hi = __internal_cast_u2s(cU_hi); + + // Get answer + unsigned int ansU_lo = (unsigned int)max(max(aS_lo, bS_lo), cS_lo); + unsigned int ansU_hi = (unsigned int)max(max(aS_hi, bS_hi), cS_hi); + + // Put answer back together: + res = (ansU_lo & 0x0000FFFFU) | (ansU_hi << 16); +#endif + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimax3_u32(const unsigned int a, const unsigned int b, const unsigned int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ +int res; + asm ("{.reg .u32 t1; \n\t" + "max.u32 t1, %1, %2; \n\t" + "max.u32 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + return max(max(a, b), c); +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimax3_u16x2(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "max.u16x2 t1, %1, %2; \n\t" + "max.u16x2 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_ARCH__) + res = __vmaxu2(__vmaxu2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + // Get answer + unsigned short ansU_lo = (unsigned short)max(max(aU_lo, bU_lo), cU_lo); + unsigned short ansU_hi = (unsigned short)max(max(aU_hi, bU_hi), cU_hi); + + // Put answer back together: + res = ((unsigned int) ansU_lo) | (((unsigned int) ansU_hi) << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimin3_s32(const int a, const int b, const int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm ("{.reg .s32 t1; \n\t" + "min.s32 t1, %1, %2; \n\t" + "min.s32 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + return min(min(a, b), c); +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimin3_s16x2(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "min.s16x2 t1, %1, %2; \n\t" + "min.s16x2 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_AND_AT_LEAST_SM_70__) + res = __vmins2(__vmins2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + //cast to signed: + short aS_lo = __internal_cast_u2s(aU_lo); + short aS_hi = __internal_cast_u2s(aU_hi); + + short bS_lo = __internal_cast_u2s(bU_lo); + short bS_hi = __internal_cast_u2s(bU_hi); + + short cS_lo = __internal_cast_u2s(cU_lo); + short cS_hi = __internal_cast_u2s(cU_hi); + + // Get answer + unsigned int ansU_lo = (unsigned int)min(min(aS_lo, bS_lo), cS_lo); + unsigned int ansU_hi = (unsigned int)min(min(aS_hi, bS_hi), cS_hi); + + // Put answer back together: + res = (ansU_lo & 0x0000FFFFU) | (ansU_hi << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimin3_u32(const unsigned int a, const unsigned int b, const unsigned int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm ("{.reg .u32 t1; \n\t" + "min.u32 t1, %1, %2; \n\t" + "min.u32 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + return min(min(a, b), c); +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimin3_u16x2(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "min.u16x2 t1, %1, %2; \n\t" + "min.u16x2 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_ARCH__) + res = __vminu2(__vminu2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + // Get answer + unsigned short ansU_lo = (unsigned short)min(min(aU_lo, bU_lo), cU_lo); + unsigned short ansU_hi = (unsigned short)min(min(aU_hi, bU_hi), cU_hi); + + // Put answer back together: + res = ((unsigned int) ansU_lo) | (((unsigned int) ansU_hi) << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimax3_s32_relu(const int a, const int b, const int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm ("{.reg .s32 t1; \n\t" + "max.s32.relu t1, %1, %2; \n\t" + "max.s32.relu %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + int ans = max(max(a, b), c); + + return (ans > 0) ? ans : 0; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimax3_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "max.s16x2.relu t1, %1, %2; \n\t" + "max.s16x2.relu %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_AND_AT_LEAST_SM_75__) + res = __vimax_s16x2_relu(__vmaxs2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + //cast to signed: + short aS_lo = __internal_cast_u2s(aU_lo); + short aS_hi = __internal_cast_u2s(aU_hi); + + short bS_lo = __internal_cast_u2s(bU_lo); + short bS_hi = __internal_cast_u2s(bU_hi); + + short cS_lo = __internal_cast_u2s(cU_lo); + short cS_hi = __internal_cast_u2s(cU_hi); + + // Get answer + unsigned ansU_lo = (unsigned)max(0, max(max(aS_lo, bS_lo), cS_lo)); + unsigned ansU_hi = (unsigned)max(0, max(max(aS_hi, bS_hi), cS_hi)); + + // Put answer back together: + res = ansU_lo | (ansU_hi << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vimin3_s32_relu(const int a, const int b, const int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm ("{.reg .s32 t1; \n\t" + "min.s32.relu t1, %1, %2; \n\t" + "min.s32.relu %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + int ans = min(min(a, b), c); + + return (ans > 0) ? ans : 0; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vimin3_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "min.s16x2.relu t1, %1, %2; \n\t" + "min.s16x2.relu %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_AND_AT_LEAST_SM_75__) + res = __vimin_s16x2_relu(__vmins2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + //cast to signed: + short aS_lo = __internal_cast_u2s(aU_lo); + short aS_hi = __internal_cast_u2s(aU_hi); + + short bS_lo = __internal_cast_u2s(bU_lo); + short bS_hi = __internal_cast_u2s(bU_hi); + + short cS_lo = __internal_cast_u2s(cU_lo); + short cS_hi = __internal_cast_u2s(cU_hi); + + // Get answer + unsigned ansU_lo = (unsigned)max(0, min(min(aS_lo, bS_lo), cS_lo)); + unsigned ansU_hi = (unsigned)max(0, min(min(aS_hi, bS_hi), cS_hi)); + + // Put answer back together: + res = ansU_lo | (ansU_hi << 16); + +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __viaddmax_s32(const int a, const int b, const int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm ("{.reg .s32 t1; \n\t" + "add.s32 t1, %1, %2; \n\t" + "max.s32 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + return max(a + b, c); +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmax_s16x2(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "add.s16x2 t1, %1, %2; \n\t" + "max.s16x2 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_ARCH__) + res = __vmaxs2(__vadd2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + aU_lo += bU_lo; + aU_hi += bU_hi; + + //cast to signed: + short sS_lo = __internal_cast_u2s(aU_lo); + short sS_hi = __internal_cast_u2s(aU_hi); + + short cS_lo = __internal_cast_u2s(cU_lo); + short cS_hi = __internal_cast_u2s(cU_hi); + + // Get answer + unsigned ansU_lo = (unsigned)max(sS_lo, cS_lo); + unsigned ansU_hi = (unsigned)max(sS_hi, cS_hi); + + // Put answer back together: + res = (ansU_lo & 0x0000FFFFU) | (ansU_hi << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmax_u32(const unsigned int a, const unsigned int b, const unsigned int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + unsigned int res; + asm ("{.reg .u32 t1; \n\t" + "add.u32 t1, %1, %2; \n\t" + "max.u32 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + return max(a + b, c); +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmax_u16x2(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "add.u16x2 t1, %1, %2; \n\t" + "max.u16x2 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_ARCH__) + res = __vmaxu2(__vadd2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + // Get answer + unsigned short ansU_lo = (unsigned short)max((unsigned short)(aU_lo + bU_lo), cU_lo); + unsigned short ansU_hi = (unsigned short)max((unsigned short)(aU_hi + bU_hi), cU_hi); + + // Put answer back together: + res = ((unsigned int) ansU_lo) | (((unsigned int) ansU_hi) << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __viaddmin_s32(const int a, const int b, const int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm ("{.reg .s32 t1; \n\t" + "add.s32 t1, %1, %2; \n\t" + "min.s32 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + return min(a + b, c); +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmin_s16x2(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "add.s16x2 t1, %1, %2; \n\t" + "min.s16x2 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_ARCH__) + res = __vmins2(__vadd2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + aU_lo += bU_lo; + aU_hi += bU_hi; + + //cast to signed: + short sS_lo = __internal_cast_u2s(aU_lo); + short sS_hi = __internal_cast_u2s(aU_hi); + + short cS_lo = __internal_cast_u2s(cU_lo); + short cS_hi = __internal_cast_u2s(cU_hi); + + // Get answer + unsigned ansU_lo = (unsigned)min(sS_lo, cS_lo); + unsigned ansU_hi = (unsigned)min(sS_hi, cS_hi); + + // Put answer back together: + res = (ansU_lo & 0x0000FFFFU) | (ansU_hi << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmin_u32(const unsigned int a, const unsigned int b, const unsigned int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + unsigned int res; + asm ("{.reg .u32 t1; \n\t" + "add.u32 t1, %1, %2; \n\t" + "min.u32 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + return min(a + b, c); +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmin_u16x2(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "add.u16x2 t1, %1, %2; \n\t" + "min.u16x2 %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_ARCH__) + res = __vminu2(__vadd2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + // Get answer + unsigned short ansU_lo = (unsigned short)min((unsigned short)(aU_lo + bU_lo), cU_lo); + unsigned short ansU_hi = (unsigned short)min((unsigned short)(aU_hi + bU_hi), cU_hi); + + // Put answer back together: + res = ((unsigned int) ansU_lo) | (((unsigned int) ansU_hi) << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __viaddmax_s32_relu(const int a, const int b, const int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm ("{.reg .s32 t1; \n\t" + "add.s32 t1, %1, %2; \n\t" + "max.s32.relu %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + int ans = max(a + b, c); + + return (ans > 0) ? ans : 0; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmax_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "add.s16x2 t1, %1, %2; \n\t" + "max.s16x2.relu %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_ARCH__) + res = __vimax_s16x2_relu(__vadd2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + aU_lo += bU_lo; + aU_hi += bU_hi; + + //cast to signed: + short sS_lo = __internal_cast_u2s(aU_lo); + short sS_hi = __internal_cast_u2s(aU_hi); + + short cS_lo = __internal_cast_u2s(cU_lo); + short cS_hi = __internal_cast_u2s(cU_hi); + + // Get answer + unsigned ansU_lo = (unsigned)max(0, max(sS_lo, cS_lo)); + unsigned ansU_hi = (unsigned)max(0, max(sS_hi, cS_hi)); + + // Put answer back together: + res = ansU_lo | (ansU_hi << 16); +#endif + + return res; +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __viaddmin_s32_relu(const int a, const int b, const int c){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int res; + asm ("{.reg .s32 t1; \n\t" + "add.s32 t1, %1, %2; \n\t" + "min.s32.relu %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); + return res; +#else + // Host and older architecture code + int ans = min(a + b, c); + + return (ans > 0) ? ans : 0; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __viaddmin_s16x2_relu(const unsigned int a, const unsigned int b, const unsigned int c){ + unsigned int res; +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + asm ("{.reg .b32 t1; \n\t" + "add.s16x2 t1, %1, %2; \n\t" + "min.s16x2.relu %0, t1, %3;}\n\t" + : "=r"(res) : "r"(a), "r"(b), "r"(c)); +#elif defined(__CUDA_ARCH__) + res = __vimin_s16x2_relu(__vadd2(a, b), c); +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + unsigned short cU_lo = (unsigned short)(c & 0xFFFFU); + unsigned short cU_hi = (unsigned short)(c >> 16); + + aU_lo += bU_lo; + aU_hi += bU_hi; + + //cast to signed: + short sS_lo = __internal_cast_u2s(aU_lo); + short sS_hi = __internal_cast_u2s(aU_hi); + + short cS_lo = __internal_cast_u2s(cU_lo); + short cS_hi = __internal_cast_u2s(cU_hi); + + // Get answer + unsigned ansU_lo = (unsigned)max(0, min(sS_lo, cS_lo)); + unsigned ansU_hi = (unsigned)max(0, min(sS_hi, cS_hi)); + + // Put answer back together: + res = ansU_lo | (ansU_hi << 16); +#endif + + return res; +} + +// vimax vimin with predicate +// *pred gets set to '(a >= b)' +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vibmax_s32(const int a, const int b, bool* const pred){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int val; + unsigned int predicate_local; + asm ("{ .reg .pred __$temp1;\n\t" + " setp.ge.s32 __$temp1, %2, %3;\n\t" + " selp.s32 %0, %2, %3, __$temp1;\n\t" + " selp.s32 %1, 1, 0, __$temp1;}\n\t" + : "=r"(val), "=r"(predicate_local) : "r"(a), "r"(b)); + + *pred = (bool)predicate_local; + return val; +#else + // Host and older architecture code + int ans = max(a, b); + + *pred = (a >= b); + return ans; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmax_u32(const unsigned int a, const unsigned int b, bool* const pred){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + unsigned int val; + unsigned int predicate_local; + asm ("{ .reg .pred __$temp1;\n\t" + " setp.ge.u32 __$temp1, %2, %3;\n\t" + " selp.u32 %0, %2, %3, __$temp1;\n\t" + " selp.u32 %1, 1, 0, __$temp1;}\n\t" + : "=r"(val), "=r"(predicate_local) : "r"(a), "r"(b)); + + *pred = (bool)predicate_local; + return val; +#else + // Host and older architecture code + unsigned int ans = max(a, b); + + *pred = (a >= b); + return ans; +#endif +} + +// *pred gets set to '(a <= b)' +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ int __vibmin_s32(const int a, const int b, bool* const pred){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + int val; + unsigned int predicate_local; + asm ("{ .reg .pred __$temp1;\n\t" + " setp.le.s32 __$temp1, %2, %3;\n\t" + " selp.s32 %0, %2, %3, __$temp1;\n\t" + " selp.s32 %1, 1, 0, __$temp1;}\n\t" + : "=r"(val), "=r"(predicate_local) : "r"(a), "r"(b)); + + *pred = (bool)predicate_local; + return val; +#else + // Host and older architecture code + int ans = min(a, b); + + *pred = (a <= b); + return ans; +#endif +} + +// *pred gets set to '(a <= b)' +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmin_u32(const unsigned int a, const unsigned int b, bool* const pred){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + unsigned int val; + unsigned int predicate_local; + asm ("{ .reg .pred __$temp1;\n\t" + " setp.le.u32 __$temp1, %2, %3;\n\t" + " selp.u32 %0, %2, %3, __$temp1;\n\t" + " selp.u32 %1, 1, 0, __$temp1;}\n\t" + : "=r"(val), "=r"(predicate_local) : "r"(a), "r"(b)); + + *pred = (bool)predicate_local; + return val; +#else + // Host and older architecture code + unsigned int ans = min(a, b); + + *pred = (a <= b); + return ans; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmax_s16x2(const unsigned int a, const unsigned int b, bool* const pred_hi, bool* const pred_lo){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + unsigned int val; + unsigned int predicate_local_hi; + unsigned int predicate_local_lo; + asm ("{.reg .pred pu, pv; \n\t" + ".reg .s16 rs0, rs1, rs2, rs3; \n\t" + "max.s16x2 %0, %3, %4; \n\t" + "mov.b32 {rs0, rs1}, %0; \n\t" + "mov.b32 {rs2, rs3}, %3; \n\t" + "setp.eq.s16 pv, rs0, rs2; \n\t" + "setp.eq.s16 pu, rs1, rs3; \n\t" + "selp.b32 %1, 1, 0, pu; \n\t" + "selp.b32 %2, 1, 0, pv;} \n\t" + : "=r"(val), "=r"(predicate_local_hi),"=r"(predicate_local_lo) : "r"(a), "r"(b)); + + *pred_hi = (bool)predicate_local_hi; + *pred_lo = (bool)predicate_local_lo; + return val; +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + //cast to signed: + short aS_lo = __internal_cast_u2s(aU_lo); + short aS_hi = __internal_cast_u2s(aU_hi); + + short bS_lo = __internal_cast_u2s(bU_lo); + short bS_hi = __internal_cast_u2s(bU_hi); + + // Get answer + unsigned int ansU_lo = (unsigned int)max(aS_lo, bS_lo); + unsigned int ansU_hi = (unsigned int)max(aS_hi, bS_hi); + + *pred_hi = (aS_hi >= bS_hi); + *pred_lo = (aS_lo >= bS_lo); + + // Put answer back together: + unsigned int ans = (ansU_lo & 0x0000FFFFU) | (ansU_hi << 16); + + return ans; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmax_u16x2(const unsigned int a, const unsigned int b, bool* const pred_hi, bool* const pred_lo){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + unsigned int val; + unsigned int predicate_local_hi; + unsigned int predicate_local_lo; + asm ("{.reg .pred pu, pv; \n\t" + ".reg .u16 rs0, rs1, rs2, rs3; \n\t" + "max.u16x2 %0, %3, %4; \n\t" + "mov.b32 {rs0, rs1}, %0; \n\t" + "mov.b32 {rs2, rs3}, %3; \n\t" + "setp.eq.u16 pv, rs0, rs2; \n\t" + "setp.eq.u16 pu, rs1, rs3; \n\t" + "selp.b32 %1, 1, 0, pu; \n\t" + "selp.b32 %2, 1, 0, pv;} \n\t" + : "=r"(val), "=r"(predicate_local_hi),"=r"(predicate_local_lo) : "r"(a), "r"(b)); + + *pred_hi = (bool)predicate_local_hi; + *pred_lo = (bool)predicate_local_lo; + return val; +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + // Get answer + unsigned short ansU_lo = (unsigned short)max(aU_lo, bU_lo); + unsigned short ansU_hi = (unsigned short)max(aU_hi, bU_hi); + + *pred_hi = (aU_hi >= bU_hi); + *pred_lo = (aU_lo >= bU_lo); + + // Put answer back together: + unsigned int ans = ((unsigned int) ansU_lo) | (((unsigned int) ansU_hi) << 16); + + return ans; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmin_s16x2(const unsigned int a, const unsigned int b, bool* const pred_hi, bool* const pred_lo){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + unsigned int val; + unsigned int predicate_local_hi; + unsigned int predicate_local_lo; + asm ("{.reg .pred pu, pv; \n\t" + ".reg .u16 rs0, rs1, rs2, rs3; \n\t" + "min.s16x2 %0, %3, %4; \n\t" + "mov.b32 {rs0, rs1}, %0; \n\t" + "mov.b32 {rs2, rs3}, %3; \n\t" + "setp.eq.s16 pv, rs0, rs2; \n\t" + "setp.eq.s16 pu, rs1, rs3; \n\t" + "selp.b32 %1, 1, 0, pu; \n\t" + "selp.b32 %2, 1, 0, pv;} \n\t" + : "=r"(val), "=r"(predicate_local_hi),"=r"(predicate_local_lo) : "r"(a), "r"(b)); + + *pred_hi = (bool)predicate_local_hi; + *pred_lo = (bool)predicate_local_lo; + return val; +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + //cast to signed: + short aS_lo = __internal_cast_u2s(aU_lo); + short aS_hi = __internal_cast_u2s(aU_hi); + + short bS_lo = __internal_cast_u2s(bU_lo); + short bS_hi = __internal_cast_u2s(bU_hi); + + // Get answer + unsigned int ansU_lo = (unsigned int)min(aS_lo, bS_lo); + unsigned int ansU_hi = (unsigned int)min(aS_hi, bS_hi); + + *pred_hi = (aS_hi <= bS_hi); + *pred_lo = (aS_lo <= bS_lo); + + // Put answer back together: + unsigned int ans = (ansU_lo & 0x0000FFFFU) | (ansU_hi << 16); + + return ans; +#endif +} + +__DEVICE_HOST_FUNCTIONS_STATIC_DECL__ unsigned int __vibmin_u16x2(const unsigned int a, const unsigned int b, bool* const pred_hi, bool* const pred_lo){ +#ifdef __CUDA_AND_AT_LEAST_SM_90__ + unsigned int val; + unsigned int predicate_local_hi; + unsigned int predicate_local_lo; + asm ("{.reg .pred pu, pv; \n\t" + ".reg .u16 rs0, rs1, rs2, rs3; \n\t" + "min.u16x2 %0, %3, %4; \n\t" + "mov.b32 {rs0, rs1}, %0; \n\t" + "mov.b32 {rs2, rs3}, %3; \n\t" + "setp.eq.u16 pv, rs0, rs2; \n\t" + "setp.eq.u16 pu, rs1, rs3; \n\t" + "selp.b32 %1, 1, 0, pu; \n\t" + "selp.b32 %2, 1, 0, pv;} \n\t" + : "=r"(val), "=r"(predicate_local_hi),"=r"(predicate_local_lo) : "r"(a), "r"(b)); + + *pred_hi = (bool)predicate_local_hi; + *pred_lo = (bool)predicate_local_lo; + return val; +#else + // Host and older architecture code + // Separate our high and low bit: + unsigned short aU_lo = (unsigned short)(a & 0xFFFFU); + unsigned short aU_hi = (unsigned short)(a >> 16); + + unsigned short bU_lo = (unsigned short)(b & 0xFFFFU); + unsigned short bU_hi = (unsigned short)(b >> 16); + + // Get answer + unsigned short ansU_lo = (unsigned short)min(aU_lo, bU_lo); + unsigned short ansU_hi = (unsigned short)min(aU_hi, bU_hi); + + *pred_hi = (aU_hi <= bU_hi); + *pred_lo = (aU_lo <= bU_lo); + + // Put answer back together: + unsigned int ans = ((unsigned int) ansU_lo) | (((unsigned int) ansU_hi) << 16); + + return ans; +#endif +} + +#ifdef __CUDA_AND_AT_LEAST_SM_90__ +#undef __CUDA_AND_AT_LEAST_SM_90__ +#endif + +#undef __DEVICE_HOST_FUNCTIONS_STATIC_DECL__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#endif /* !__DEVICE_FUNCTIONS_HPP__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_FUNCTIONS_HPP__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_DEVICE_FUNCTIONS_HPP__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/func_macro.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/func_macro.h new file mode 100644 index 0000000000000000000000000000000000000000..633554a01aaabd1bca5ae278c276710f323d5d7b --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/func_macro.h @@ -0,0 +1,57 @@ +/* + * NVIDIA_COPYRIGHT_BEGIN + * + * Copyright (c) 2008-2018, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + * + * NVIDIA_COPYRIGHT_END + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/func_macro.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/func_macro.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_FUNC_MACRO_H__ +#endif + +#if !defined(__FUNC_MACRO_H__) +#define __FUNC_MACRO_H__ + +#if !defined(__CUDA_INTERNAL_COMPILATION__) + +#error -- incorrect inclusion of a cudart header file + +#endif /* !__CUDA_INTERNAL_COMPILATION__ */ + +#if defined(__GNUC__) + +#define __func__(decl) \ + inline decl + +#define __device_func__(decl) \ + static __attribute__((__unused__)) decl + +#elif defined(_WIN32) + +#define __func__(decl) \ + static inline decl + +#define __device_func__(decl) \ + static decl + +#endif /* __GNUC__ */ + +#endif /* __FUNC_MACRO_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_FUNC_MACRO_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_FUNC_MACRO_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/host_config.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/host_config.h new file mode 100644 index 0000000000000000000000000000000000000000..820b81c2945d8dcc241329673a558090a4922e52 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/host_config.h @@ -0,0 +1,310 @@ +/* + * Copyright 1993-2024 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/host_config.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/host_config.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_CONFIG_H__ +#endif + +#if !defined(__HOST_CONFIG_H__) +#define __HOST_CONFIG_H__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__CUDACC__) + +#if defined(__CUDACC_RTC__) + +#define _CRTIMP +#define __THROW + +#else /* __CUDACC_RTC__ */ + +/* check for host compilers that are compatible with nvcc */ +#if !defined(__GNUC__) && !defined(_WIN32) + +#error --- !!! UNSUPPORTED COMPILER !!! --- + +#endif /* !__GNUC__ && !_WIN32 */ + +/* check invalid configurations */ +#if defined(__PGIC__) +#if !defined(__GNUC__) || !defined(__LP64__) || !defined(__linux__) +#error -- unsupported pgc++ configuration! pgc++ is supported only on Linux x86_64! +#endif /* !defined(__GNUC__) || !defined(__LP64__) || !defined(__linux__) */ +#endif /* defined(__PGIC__) */ + +#if defined(__powerpc__) +#if !defined(__powerpc64__) || !defined(__LITTLE_ENDIAN__) +#error -- unsupported PPC platform! Only 64-bit little endian PPC is supported! +#endif /* !__powerpc64__ || !__LITTLE_ENDIAN__ */ +#endif /* __powerpc__ */ + +#if defined(__APPLE__) && defined(__MACH__) && !defined(__clang__) +#error -- clang and clang++ are the only supported host compilers on Mac OS X! +#endif /* __APPLE__ && __MACH__ && !__clang__ */ + + +/* check host compiler version */ +#if !__NV_NO_HOST_COMPILER_CHECK + +#if defined(__ICC) + +#if (__ICC != 1500 && __ICC != 1600 && __ICC != 1700 && __ICC != 1800 && !(__ICC >= 1900 && __ICC <= 2021)) || !defined(__GNUC__) || !defined(__LP64__) + +#error -- unsupported ICC configuration! Only ICC 15.0, ICC 16.0, ICC 17.0, ICC 18.0, ICC 19.x and 20.x on Linux x86_64 are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. + +#endif /* (__ICC != 1500 && __ICC != 1600 && __ICC != 1700 && __ICC != 1800 && __ICC != 1900) || !__GNUC__ || !__LP64__ */ + +#endif /* __ICC */ + +#if defined(__GRCO_CLANG_COMPILER__) +#if (__GRCO_CLANG_COMPILER__ == 1) && ((__clang_major__ < 16) || (__clang_major__ > 19)) +#error -- unsupported Grace clang version! The version must be 16.x to 19.x. The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. +#endif /* (__GRCO_CLANG_COMPILER__ == 1) && ((__clang_major__ < 16) || (__clang_major__ > 19)) */ + +#endif /* __GRCO_CLANG_COMPILER__ */ + +#if defined(__INTEL_CLANG_COMPILER) +#error -- unsupported Intel ICX compiler! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. +#endif /* __INTEL_CLANG_COMPILER */ + +#if defined(__powerpc__) + +#if defined(__ibmxl_vrm__) && !(__ibmxl_vrm__ >= 0x0d010000 && __ibmxl_vrm__ < 0x0d020000) && \ + !(__ibmxl_vrm__ >= 0x10010000 && __ibmxl_vrm__ < 0x10020000) + +#error -- unsupported xlC version! only xlC 13.1 and 16.1 are supported. The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. + +#endif /* __ibmxl_vrm__ && !(__ibmxl_vrm__ >= 0x0d010000 && __ibmxl_vrm__ < 0x0d020000) && + !(__ibmxl_vrm__ >= 0x10010000 && __ibmxl_vrm__ < 0x10020000) */ + +#endif /* __powerpc__ */ + +#if defined(__GNUC__) + +#if __GNUC__ > 14 + +#error -- unsupported GNU version! gcc versions later than 14 are not supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. + +#endif /* __GNUC__ > 14 */ + + +#if defined(__HORIZON__) +#if (__clang_major__ >= 20) || (__clang_major__ < 3) || ((__clang_major__ == 3) && (__clang_minor__ < 3)) +#error -- unsupported HOS clang version! The version must be must be less than 20 and greater than 3.2 . The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. +#endif /* (__clang_major__ >= 20) || (__clang_major__ < 3) || ((__clang_major__ == 3) && (__clang_minor__ < 3)) */ +#endif /* __HORIZON__ */ + +#if defined(__clang__) && !defined(__ibmxl_vrm__) && !defined(__ICC) && !defined(__HORIZON__) && !defined(__APPLE__) && !defined(__GRCO_CLANG_COMPILER__) + +#if (__clang_major__ >= 20) || (__clang_major__ < 3) || ((__clang_major__ == 3) && (__clang_minor__ < 3)) +#error -- unsupported clang version! clang version must be less than 20 and greater than 3.2 . The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. + +#endif /* (__clang_major__ >= 20) || (__clang_major__ < 3) || ((__clang_major__ == 3) && (__clang_minor__ < 3)) */ + +#endif /* defined(__clang__) && !defined(__ibmxl_vrm__) && !defined(__ICC) && !defined(__HORIZON__) && !defined(__APPLE__) && !defined(__GRCO_CLANG_COMPILER__) */ + + +#endif /* __GNUC__ */ + +#if defined(_WIN32) + +#if _MSC_VER < 1910 || _MSC_VER >= 1950 + +#error -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2022 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk. + +#elif _MSC_VER >= 1910 && _MSC_VER < 1910 + +#pragma message("support for this version of Microsoft Visual Studio has been deprecated! Only the versions between 2017 and 2022 (inclusive) are supported!") + +#endif /* (_MSC_VER < 1910 || _MSC_VER >= 1950) || (_MSC_VER >= 1910 && _MSC_VER < 1910) */ + +#endif /* _WIN32 */ +#endif /* !__NV_NO_HOST_COMPILER_CHECK */ + + +/* configure host compiler */ +#if defined(__APPLE__) + +#define _CRTIMP +#define _ACRTIMP +#define __THROW + +#if defined(__BLOCKS__) /* nvcc does not support closures */ + +#undef __BLOCKS__ + +#endif /* __BLOCKS__ */ + +#elif defined(__ANDROID__) + +#define _CRTIMP +#define _ACRTIMP +#define __THROW + +#elif defined(__QNX__) + +#define _CRTIMP +#define _ACRTIMP +#define __THROW + +#elif defined(__HORIZON__) + +#define _CRTIMP +#define _ACRTIMP +#define __THROW + +#elif defined(__GNUC__) + +#define _CRTIMP +#define _ACRTIMP + +#include /* for __THROW */ + +#elif defined(_WIN32) + +#if _MSC_VER >= 1500 + +#undef _USE_DECLSPECS_FOR_SAL +#define _USE_DECLSPECS_FOR_SAL \ + 1 + +#endif /* _MSC_VER >= 1500 */ + +#if !defined(_CRT_NONSTDC_NO_WARNINGS) + +#define _CRT_NONSTDC_NO_WARNINGS /* to suppress warnings */ + +#endif /* !_CRT_NONSTDC_NO_WARNINGS */ + +#if !defined(_CRT_SECURE_NO_WARNINGS) + +#define _CRT_SECURE_NO_WARNINGS /* to suppress warnings */ + +#endif /* !_CRT_SECURE_NO_WARNINGS */ + +#if !defined(NOMINMAX) + +#define NOMINMAX /* min and max are part of cuda runtime */ + +#endif /* !NOMINMAX */ + +#include /* for _CRTIMP */ +#if _MSC_VER >= 1900 +#include /* for _ACRTIMP */ +#endif /* _MSC_VER >= 1900 */ + +#define __THROW + +#endif /* __APPLE__ */ + +#endif /* __CUDACC_RTC__ */ + + +#if defined(__cplusplus) && defined(__CUDA_ARCH__) && (defined(__PGIC__) || defined(__CUDACC_RTC__) || (defined(_WIN32) && defined(_MSC_VER))) + +#if __CUDACC_RTC__ +typedef char *va_list; +#else /* !__CUDACC_RTC__ */ +#include +#endif /* __CUDACC_RTC__ */ + + +#undef va_start +#undef va_end +#undef va_arg + +#ifdef __PGIC__ + +#undef __builtin_va_end + +#define va_start(v,l) __builtin_alt_va_start(v,l) +#define va_end(v) __builtin_va_end(v) +#define va_arg(v,l) __builtin_alt_va_arg(v,l) + +#if (__cplusplus >= 201103L) +#undef va_copy +#define va_copy(d,s) __builtin_va_copy(d,s) +#endif + +#else /* !__PGIC__ */ + + +#define va_start(ap, x) (__cu_va_start(&ap, x)) +#define va_end(ap) (__cu_va_end(&ap)) +#define va_arg(ap, t) (*((t *)__cu_va_arg(&ap, (t *)0))) + +#if (_MSC_VER >= 1800) || (defined(__CUDACC_RTC__) && (__cplusplus >= 201103L)) +#undef va_copy +#define va_copy(apd, aps) (__cu_va_copy(&(apd), &(aps))) +#endif /* (_MSC_VER >= 1800) || (defined(__CUDACC_RTC__) && (__cplusplus >= 201103L)) */ +#endif /* __PGIC__ */ + +#endif /* defined(__cplusplus) && (defined(__CUDACC_RTC__) || (defined(_WIN32) && defined(_MSC_VER))) */ + + + +#endif /* __CUDACC__ */ + +#endif /* !__HOST_CONFIG_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_CONFIG_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_CONFIG_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/host_defines.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/host_defines.h new file mode 100644 index 0000000000000000000000000000000000000000..b58cb3cc1086bdc6e0376f042c86b2755ef2ff00 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/host_defines.h @@ -0,0 +1,283 @@ +/* + * Copyright 1993-2023 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/host_defines.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/host_defines.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_DEFINES_H__ +#endif + +#if !defined(__HOST_DEFINES_H__) +#define __HOST_DEFINES_H__ + +#if defined(__CUDACC__) && !defined(__CUDACC_RTC__) && !defined(__CUDADEVRT_INTERNAL__) && !defined(_ALLOW_UNSUPPORTED_LIBCPP) +#include +#if ((defined(_MSC_VER ) && (defined(_M_X64) || defined(_M_AMD64))) ||\ + (defined(__x86_64__) || defined(__amd64__))) && defined(_LIBCPP_VERSION) && !(defined(__HORIZON__) || defined(__ANDROID__) || defined(__QNX__)) +#error "libc++ is not supported on x86 system" +#endif +#endif + +/* CUDA JIT mode (__CUDACC_RTC__) also uses GNU style attributes */ +#if defined(__GNUC__) || (defined(__PGIC__) && defined(__linux__)) || defined(__CUDA_LIBDEVICE__) || defined(__CUDACC_RTC__) + +#if defined(__CUDACC_RTC__) +#define __volatile__ volatile +#endif /* __CUDACC_RTC__ */ + +#define __no_return__ \ + __attribute__((noreturn)) + +#if defined(__CUDACC__) || defined(__CUDA_ARCH__) || defined(__CUDA_LIBDEVICE__) +/* gcc allows users to define attributes with underscores, + e.g., __attribute__((__noinline__)). + Consider a non-CUDA source file (e.g. .cpp) that has the + above attribute specification, and includes this header file. In that case, + defining __noinline__ as below would cause a gcc compilation error. + Hence, only define __noinline__ when the code is being processed + by a CUDA compiler component. +*/ +#define __noinline__ \ + __attribute__((noinline)) +#endif /* __CUDACC__ || __CUDA_ARCH__ || __CUDA_LIBDEVICE__ */ + +#undef __forceinline__ +#define __forceinline__ \ + __inline__ __attribute__((always_inline)) +#define __inline_hint__ \ + __attribute__((nv_inline_hint)) +#define __align__(n) \ + __attribute__((aligned(n))) +#define __maxnreg__(a) \ + __attribute__((maxnreg(a))) +#define __thread__ \ + __thread +#define __import__ +#define __export__ +#define __cdecl +#define __annotate__(a) \ + __attribute__((a)) +#define __location__(a) \ + __annotate__(a) +#define CUDARTAPI +#define CUDARTAPI_CDECL + +#elif defined(_MSC_VER) + +#if _MSC_VER >= 1400 + +#define __restrict__ \ + __restrict + +#else /* _MSC_VER >= 1400 */ + +#define __restrict__ + +#endif /* _MSC_VER >= 1400 */ + +#define __inline__ \ + __inline +#define __no_return__ \ + __declspec(noreturn) +#define __noinline__ \ + __declspec(noinline) +#define __forceinline__ \ + __forceinline +#define __inline_hint__ \ + __declspec(nv_inline_hint) +#define __align__(n) \ + __declspec(align(n)) +#define __maxnreg__(n) \ + __declspec(maxnreg(n)) +#define __thread__ \ + __declspec(thread) +#define __import__ \ + __declspec(dllimport) +#define __export__ \ + __declspec(dllexport) +#define __annotate__(a) \ + __declspec(a) +#define __location__(a) \ + __annotate__(__##a##__) +#define CUDARTAPI \ + __stdcall +#define CUDARTAPI_CDECL \ + __cdecl + +#else /* __GNUC__ || __CUDA_LIBDEVICE__ || __CUDACC_RTC__ */ + +#define __inline__ + +#if !defined(__align__) + +#error --- !!! UNKNOWN COMPILER: please provide a CUDA compatible definition for '__align__' !!! --- + +#endif /* !__align__ */ + +#if !defined(CUDARTAPI) + +#error --- !!! UNKNOWN COMPILER: please provide a CUDA compatible definition for 'CUDARTAPI' !!! --- + +#endif /* !CUDARTAPI */ + +#endif /* __GNUC__ || __CUDA_LIBDEVICE__ || __CUDACC_RTC__ */ + +#if (defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3 && !defined(__clang__)))) || \ + (defined(_MSC_VER) && _MSC_VER < 1900) || \ + (!defined(__GNUC__) && !defined(_MSC_VER)) + +#define __specialization_static \ + static + +#else /* (__GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3 && !__clang__))) || + (_MSC_VER && _MSC_VER < 1900) || + (!__GNUC__ && !_MSC_VER) */ + +#define __specialization_static + +#endif /* (__GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3 && !__clang__))) || + (_MSC_VER && _MSC_VER < 1900) || + (!__GNUC__ && !_MSC_VER) */ + +#if !defined(__CUDACC__) && !defined(__CUDA_LIBDEVICE__) + +#undef __annotate__ +#define __annotate__(a) + +#else /* !__CUDACC__ && !__CUDA_LIBDEVICE__ */ + +#define __launch_bounds__(...) \ + __annotate__(launch_bounds(__VA_ARGS__)) + +#endif /* !__CUDACC__ && !__CUDA_LIBDEVICE__ */ + +#if defined(__CUDACC__) || defined(__CUDA_LIBDEVICE__) || \ + defined(__GNUC__) || defined(_WIN64) + +#define __builtin_align__(a) \ + __align__(a) + +#else /* __CUDACC__ || __CUDA_LIBDEVICE__ || __GNUC__ || _WIN64 */ + +#define __builtin_align__(a) + +#endif /* __CUDACC__ || __CUDA_LIBDEVICE__ || __GNUC__ || _WIN64 */ + +#if defined(__CUDACC__) || !defined(__grid_constant__) +#define __grid_constant__ \ + __location__(grid_constant) +#endif /* defined(__CUDACC__) || !defined(__grid_constant__) */ + +#if defined(__CUDACC__) || !defined(__host__) +#define __host__ \ + __location__(host) +#endif /* defined(__CUDACC__) || !defined(__host__) */ +#if defined(__CUDACC__) || !defined(__device__) +#define __device__ \ + __location__(device) +#endif /* defined(__CUDACC__) || !defined(__device__) */ +#if defined(__CUDACC__) || !defined(__global__) +#define __global__ \ + __location__(global) +#endif /* defined(__CUDACC__) || !defined(__global__) */ +#if defined(__CUDACC__) || !defined(__shared__) +#define __shared__ \ + __location__(shared) +#endif /* defined(__CUDACC__) || !defined(__shared__) */ +#if defined(__CUDACC__) || !defined(__constant__) +#define __constant__ \ + __location__(constant) +#endif /* defined(__CUDACC__) || !defined(__constant__) */ +#if defined(__CUDACC__) || !defined(__managed__) +#define __managed__ \ + __location__(managed) +#endif /* defined(__CUDACC__) || !defined(__managed__) */ +#if defined(__CUDACC__) || !defined(__nv_pure__) +#define __nv_pure__ \ + __location__(nv_pure) +#endif /* defined(__CUDACC__) || !defined(__nv_pure__) */ +#if !defined(__CUDACC__) +#define __device_builtin__ +#define __device_builtin_texture_type__ +#define __device_builtin_surface_type__ +#define __cudart_builtin__ +#else /* defined(__CUDACC__) */ +#define __device_builtin__ \ + __location__(device_builtin) +#define __device_builtin_texture_type__ \ + __location__(device_builtin_texture_type) +#define __device_builtin_surface_type__ \ + __location__(device_builtin_surface_type) +#define __cudart_builtin__ \ + __location__(cudart_builtin) +#endif /* !defined(__CUDACC__) */ + +#if defined(__CUDACC__) || !defined(__cluster_dims__) +#if defined(_MSC_VER) +#define __cluster_dims__(...) \ + __declspec(__cluster_dims__(__VA_ARGS__)) + +#else /* !defined(_MSC_VER) */ +#define __cluster_dims__(...) \ + __attribute__((cluster_dims(__VA_ARGS__))) +#endif /* defined(_MSC_VER) */ +#endif /* defined(__CUDACC__) || !defined(__cluster_dims__) */ + +#define __CUDA_ARCH_HAS_FEATURE__(_FEAT) __CUDA_ARCH_FEAT_##_FEAT + +#endif /* !__HOST_DEFINES_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_DEFINES_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_DEFINES_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/host_runtime.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/host_runtime.h new file mode 100644 index 0000000000000000000000000000000000000000..22e3a1bea875ddb2a15075f6e0ecb10b7ce1a6a7 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/host_runtime.h @@ -0,0 +1,306 @@ +/* + * NVIDIA_COPYRIGHT_BEGIN + * + * Copyright (c) 2008-2023, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + * + * NVIDIA_COPYRIGHT_END + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/device_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/device_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_RUNTIME_H__ +#endif + +#if !defined(__CUDA_INTERNAL_COMPILATION__) + +#define __CUDA_INTERNAL_COMPILATION__ +#define __text__ +#define __surf__ +#define __name__shadow_var(c, cpp) \ + #c +#define __name__text_var(c, cpp) \ + #cpp +#define __host__shadow_var(c, cpp) \ + cpp +#define __text_var(c, cpp) \ + cpp +#define __device_fun(fun) \ + #fun +#define __device_var(var) \ + #var +#define __device__text_var(c, cpp) \ + #c +#define __device__shadow_var(c, cpp) \ + #c + +#if defined(_WIN32) && !defined(_WIN64) + +#define __pad__(f) \ + f + +#else /* _WIN32 && !_WIN64 */ + +#define __pad__(f) + +#endif /* _WIN32 && !_WIN64 */ + +#include "builtin_types.h" +#include "storage_class.h" + +#else /* !__CUDA_INTERNAL_COMPILATION__ */ + +template +static inline T *__cudaAddressOf(T &val) +{ + return (T *)((void *)(&(const_cast(reinterpret_cast(val))))); +} + +#define __cudaRegisterBinary(X) \ + __cudaFatCubinHandle = __cudaRegisterFatBinary((void*)&__fatDeviceText); \ + { void (*callback_fp)(void **) = (void (*)(void **))(X); (*callback_fp)(__cudaFatCubinHandle); __cudaRegisterFatBinaryEnd(__cudaFatCubinHandle); }\ + atexit(__cudaUnregisterBinaryUtil) + +#define __cudaRegisterVariable(handle, var, ext, size, constant, global) \ + __cudaRegisterVar(handle, (char*)&__host##var, (char*)__device##var, __name##var, ext, size, constant, global) +#define __cudaRegisterManagedVariable(handle, var, ext, size, constant, global) \ + __cudaRegisterManagedVar(handle, (void **)&__host##var, (char*)__device##var, __name##var, ext, size, constant, global) + +#define __cudaRegisterGlobalTexture(handle, tex, dim, norm, ext) \ + __cudaRegisterTexture(handle, (const struct textureReference*)&tex, (const void**)(void*)__device##tex, __name##tex, dim, norm, ext) +#define __cudaRegisterGlobalSurface(handle, surf, dim, ext) \ + __cudaRegisterSurface(handle, (const struct surfaceReference*)&surf, (const void**)(void*)__device##surf, __name##surf, dim, ext) +#define __cudaRegisterEntry(handle, funptr, fun, thread_limit) \ + __cudaRegisterFunction(handle, (const char*)funptr, (char*)__device_fun(fun), #fun, -1, (uint3*)0, (uint3*)0, (dim3*)0, (dim3*)0, (int*)0) + +extern "C" cudaError_t CUDARTAPI __cudaPopCallConfiguration( + dim3 *gridDim, + dim3 *blockDim, + size_t *sharedMem, + void *stream +); + +#define __cudaLaunchPrologue(size) \ + void * __args_arr[size]; \ + int __args_idx = 0 + +#define __cudaSetupArg(arg, offset) \ + __args_arr[__args_idx] = (void *)__cudaAddressOf(arg); ++__args_idx + +#define __cudaSetupArgSimple(arg, offset) \ + __args_arr[__args_idx] = (void *)(char *)&arg; ++__args_idx + +#if defined(__GNUC__) +#define __NV_ATTR_UNUSED_FOR_LAUNCH __attribute__((unused)) +#else /* !__GNUC__ */ +#define __NV_ATTR_UNUSED_FOR_LAUNCH +#endif /* __GNUC__ */ + +#ifdef __NV_LEGACY_LAUNCH +/* the use of __args_idx in the expression below avoids host compiler warning about it being an + unused variable when the launch has no arguments */ +#define __cudaLaunch(fun) \ + { volatile static char *__f __NV_ATTR_UNUSED_FOR_LAUNCH; __f = fun; \ + dim3 __gridDim, __blockDim;\ + size_t __sharedMem; \ + cudaStream_t __stream; \ + if (__cudaPopCallConfiguration(&__gridDim, &__blockDim, &__sharedMem, &__stream) != cudaSuccess) \ + return; \ + if (__args_idx == 0) {\ + (void)cudaLaunchKernel(fun, __gridDim, __blockDim, &__args_arr[__args_idx], __sharedMem, __stream);\ + } else { \ + (void)cudaLaunchKernel(fun, __gridDim, __blockDim, &__args_arr[0], __sharedMem, __stream);\ + }\ + } +#else /* !__NV_LEGACY_LAUNCH */ +#define __cudaLaunch(fun) \ + { volatile static char *__f __NV_ATTR_UNUSED_FOR_LAUNCH; __f = fun; \ + static cudaKernel_t __handle = 0; \ + volatile static bool __tmp __NV_ATTR_UNUSED_FOR_LAUNCH = (__cudaGetKernel(&__handle, (const void *)fun) == cudaSuccess); \ + dim3 __gridDim, __blockDim;\ + size_t __sharedMem; \ + cudaStream_t __stream; \ + if (__cudaPopCallConfiguration(&__gridDim, &__blockDim, &__sharedMem, &__stream) != cudaSuccess) \ + return; \ + if (__args_idx == 0) {\ + (void)__cudaLaunchKernel_helper(__handle, __gridDim, __blockDim, &__args_arr[__args_idx], __sharedMem, __stream);\ + } else { \ + (void)__cudaLaunchKernel_helper(__handle, __gridDim, __blockDim, &__args_arr[0], __sharedMem, __stream);\ + }\ + } +#endif /* __NV_LEGACY_LAUNCH */ + +#if defined(__GNUC__) +#define __nv_dummy_param_ref(param) \ + { volatile static void **__ref __attribute__((unused)); __ref = (volatile void **)param; } +#else /* __GNUC__ */ +#define __nv_dummy_param_ref(param) \ + { volatile static void **__ref; __ref = (volatile void **)param; } +#endif /* __GNUC__ */ + +static void ____nv_dummy_param_ref(void *param) __nv_dummy_param_ref(param) + +#define __REGISTERFUNCNAME_CORE(X) __cudaRegisterLinkedBinary##X +#define __REGISTERFUNCNAME(X) __REGISTERFUNCNAME_CORE(X) + +extern "C" { +void __REGISTERFUNCNAME( __NV_MODULE_ID ) ( void (*)(void **), void *, void *, void (*)(void *)); +} + +#define __TO_STRING_CORE(X) #X +#define __TO_STRING(X) __TO_STRING_CORE(X) + +extern "C" { +#if defined(_WIN32) +#pragma data_seg("__nv_module_id") + static const __declspec(allocate("__nv_module_id")) unsigned char __module_id_str[] = __TO_STRING(__NV_MODULE_ID); +#pragma data_seg() +#elif defined(__APPLE__) + static const unsigned char __module_id_str[] __attribute__((section ("__NV_CUDA,__nv_module_id"))) = __TO_STRING(__NV_MODULE_ID); +#else + static const unsigned char __module_id_str[] __attribute__((section ("__nv_module_id"))) = __TO_STRING(__NV_MODULE_ID); +#endif + +#undef __FATIDNAME_CORE +#undef __FATIDNAME +#define __FATIDNAME_CORE(X) __fatbinwrap##X +#define __FATIDNAME(X) __FATIDNAME_CORE(X) + +#define ____cudaRegisterLinkedBinary(X) \ +{ __REGISTERFUNCNAME(__NV_MODULE_ID) (( void (*)(void **))(X), (void *)&__FATIDNAME(__NV_MODULE_ID), (void *)&__module_id_str, (void (*)(void *))&____nv_dummy_param_ref); } + +} + +extern "C" { +extern void** CUDARTAPI __cudaRegisterFatBinary( + void *fatCubin +); + +extern void CUDARTAPI __cudaRegisterFatBinaryEnd( + void **fatCubinHandle +); + +extern void CUDARTAPI __cudaUnregisterFatBinary( + void **fatCubinHandle +); + +extern void CUDARTAPI __cudaRegisterVar( + void **fatCubinHandle, + char *hostVar, + char *deviceAddress, + const char *deviceName, + int ext, + size_t size, + int constant, + int global +); + +extern void CUDARTAPI __cudaRegisterManagedVar( + void **fatCubinHandle, + void **hostVarPtrAddress, + char *deviceAddress, + const char *deviceName, + int ext, + size_t size, + int constant, + int global +); + +extern char CUDARTAPI __cudaInitModule( + void **fatCubinHandle +); + +extern void CUDARTAPI __cudaRegisterTexture( + void **fatCubinHandle, + const struct textureReference *hostVar, + const void **deviceAddress, + const char *deviceName, + int dim, + int norm, + int ext +); + +extern void CUDARTAPI __cudaRegisterSurface( + void **fatCubinHandle, + const struct surfaceReference *hostVar, + const void **deviceAddress, + const char *deviceName, + int dim, + int ext +); + +extern void CUDARTAPI __cudaRegisterFunction( + void **fatCubinHandle, + const char *hostFun, + char *deviceFun, + const char *deviceName, + int thread_limit, + uint3 *tid, + uint3 *bid, + dim3 *bDim, + dim3 *gDim, + int *wSize +); + +#if defined(__APPLE__) +extern "C" int atexit(void (*)(void)); + +#elif defined(__GNUC__) && !defined(__ANDROID__) && !defined(__HORIZON__) +extern int atexit(void(*)(void)) throw(); + +#elif defined(__HORIZON__) + +// __TEMP_WAR__ 200132570 HOS : Disable atexit call until it works +#define atexit(p) + +#else /* __GNUC__ && !__ANDROID__ */ +extern int __cdecl atexit(void(__cdecl *)(void)); +#endif + +} + +static void **__cudaFatCubinHandle; + +static void __cdecl __cudaUnregisterBinaryUtil(void) +{ + ____nv_dummy_param_ref((void *)&__cudaFatCubinHandle); + __cudaUnregisterFatBinary(__cudaFatCubinHandle); +} + +static char __nv_init_managed_rt_with_module(void **handle) +{ + return __cudaInitModule(handle); +} + +#include "common_functions.h" + +#pragma pack() + +#if defined(_WIN32) + +#pragma warning(disable: 4099) + +#if !defined(_WIN64) + +#pragma warning(disable: 4408) + +#endif /* !_WIN64 */ + +#endif /* _WIN32 */ + +#endif /* !__CUDA_INTERNAL_COMPILATION__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_RUNTIME_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_HOST_RUNTIME_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/math_functions.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/math_functions.h new file mode 100644 index 0000000000000000000000000000000000000000..d8201f97efb3aed940f62360d90899a5171eeb0d --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/math_functions.h @@ -0,0 +1,6257 @@ +/* + * Copyright 1993-2024 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/math_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/math_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_MATH_FUNCTIONS_H__ +#endif + +#if !defined(__MATH_FUNCTIONS_H__) +#define __MATH_FUNCTIONS_H__ + +#if defined(__QNX__) && (__GNUC__ >= 5) && defined(__CUDACC__) +#if __has_include(<__config>) +#include <__config> +#endif +#endif + +/** + * \defgroup CUDA_MATH Mathematical Functions + * + * CUDA mathematical functions are always available in device code. + * + * Host implementations of the common mathematical functions are mapped + * in a platform-specific way to standard math library functions, provided + * by the host compiler and respective host libm where available. + * Some functions, not available with the host compilers, are implemented + * in crt/math_functions.hpp header file. + * For example, see ::erfinv(). Other, less common functions, + * like ::rhypot(), ::cyl_bessel_i0() are only available in device code. + * + * CUDA Math device functions are no-throw for well-formed CUDA programs. + * + * Note that many floating-point and integer functions names are + * overloaded for different argument types. For example, the ::log() + * function has the following prototypes: + * \code + * double log(double x); + * float log(float x); + * float logf(float x); + * \endcode + * + * Note also that due to implementation constraints, certain math functions + * from std:: namespace may be callable in device code even via explicitly + * qualified std:: names. However, such use is discouraged, since this + * capability is unsupported, unverified, undocumented, not portable, and + * may change without notice. + */ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__cplusplus) && defined(__CUDACC__) + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "host_defines.h" + +//NOTE: For NVRTC, these declarations have been moved into the compiler (to reduce compile time) +#define EXCLUDE_FROM_RTC + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +extern "C" +{ + +/** + * @{ + */ + +/* Define math function DOXYGEN toplevel groups, functions will + be added to these groups later. +*/ +/** + * \defgroup CUDA_MATH_SINGLE Single Precision Mathematical Functions + * This section describes single precision mathematical functions. + * To use these functions, you do not need to include any additional + * header file in your program. + */ + +/** + * \defgroup CUDA_MATH_DOUBLE Double Precision Mathematical Functions + * This section describes double precision mathematical functions. + * To use these functions, you do not need to include any additional + * header file in your program. + */ + +/** + * \defgroup CUDA_MATH_INT Integer Mathematical Functions + * This section describes integer mathematical functions. + * To use these functions, you do not need to include any additional + * header file in your program. + */ + +/** + * \defgroup CUDA_MATH_INTRINSIC_SINGLE Single Precision Intrinsics + * This section describes single precision intrinsic functions that are + * only supported in device code. + * To use these functions, you do not need to include any additional + * header file in your program. + */ + +/** + * \defgroup CUDA_MATH_INTRINSIC_DOUBLE Double Precision Intrinsics + * This section describes double precision intrinsic functions that are + * only supported in device code. + * To use these functions, you do not need to include any additional + * header file in your program. + */ + +/** + * \defgroup CUDA_MATH_INTRINSIC_INT Integer Intrinsics + * This section describes integer intrinsic functions. All of these + * functions are supported in device code. For some of the functions, + * host-specific implementations are also provided. For example, + * see `::__nv_bswap16()`. + * To use these functions, you do not need to include any additional + * header file in your program. + */ + +/** + * \defgroup CUDA_MATH_INTRINSIC_CAST Type Casting Intrinsics + * This section describes type casting intrinsic functions that are + * only supported in device code. + * To use these functions, you do not need to include any additional + * header file in your program. + */ + +/** + * + * \defgroup CUDA_MATH_INTRINSIC_SIMD SIMD Intrinsics + * This section describes SIMD intrinsic functions that are + * only supported in device code. + * To use these functions, you do not need to include any additional + * header file in your program. + */ + + +/** + * @} + */ +#define __DEVICE_FUNCTIONS_DECL__ __host__ __device__ +#if !defined(_MSC_VER) +#define __CUDA_MATH_CRTIMP +#else +#if _MSC_VER < 1900 +#define __CUDA_MATH_CRTIMP _CRTIMP +#else +#define __CUDA_MATH_CRTIMP _ACRTIMP +#endif +#endif + +#if defined(__ANDROID__) && (__ANDROID_API__ <= 20) && !defined(__aarch64__) +static __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ int abs(int); +static __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ long int labs(long int); +static __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ long long int llabs(long long int); +#else /* __ANDROID__ */ +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the absolute value of the input \p int argument. + * + * Calculate the absolute value of the input argument \p a. + * + * \return + * Returns the absolute value of the input argument. + * - abs(\p INT_MIN) is \p Undefined + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ int __cdecl abs(int a) __THROW; +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the absolute value of the input \p long \p int argument. + * + * Calculate the absolute value of the input argument \p a. + * + * \return + * Returns the absolute value of the input argument. + * - labs(\p LONG_MIN) is \p Undefined + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ long int __cdecl labs(long int a) __THROW; +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the absolute value of the input \p long \p long \p int argument. + * + * Calculate the absolute value of the input argument \p a. + * + * \return + * Returns the absolute value of the input argument. + * - llabs(\p LLONG_MIN) is \p Undefined + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __cudart_builtin__ long long int llabs(long long int a) __THROW; +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} +#endif +#endif /* __ANDROID__ */ + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +/* put all math functions in std */ +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the absolute value of the input argument. + * + * Calculate the absolute value of the input argument \p x. + * + * \return + * Returns the absolute value of the input argument. + * - fabs( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - fabs( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns +0. + * - fabs(NaN) returns an unspecified NaN. + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl fabs(double x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the absolute value of its argument + * + * Calculate the absolute value of the input argument \p x. + * + * \return + * Returns the absolute value of its argument. + * - fabsf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - fabsf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns +0. + * - fabsf(NaN) returns an unspecified NaN. + * + * \note_accuracy_single + */ +#if defined(_WIN32) && defined(_M_ARM64) +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl fabsf(float x) __THROW; +#else +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float fabsf(float x) __THROW; +#endif +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int min(const int a, const int b); +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p unsigned \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int umin(const unsigned int a, const unsigned int b); +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p long \p long \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int llmin(const long long int a, const long long int b); +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p unsigned \p long \p long \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned long long int ullmin(const unsigned long long int a, const unsigned long long int b); + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Determine the minimum numeric value of the arguments. + * + * Determines the minimum numeric value of the arguments \p x and \p y. Treats NaN + * arguments as missing data. If one argument is a NaN and the other is legitimate numeric + * value, the numeric value is chosen. + * + * \return + * Returns the minimum numeric value of the arguments \p x and \p y. + * - If both arguments are NaN, returns NaN. + * - If one argument is NaN, returns the numeric argument. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float fminf(float x, float y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl fminf(float x, float y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Determine the minimum numeric value of the arguments. + * + * Determines the minimum numeric value of the arguments \p x and \p y. Treats NaN + * arguments as missing data. If one argument is a NaN and the other is legitimate numeric + * value, the numeric value is chosen. + * + * \return + * Returns the minimum numeric value of the arguments \p x and \p y. + * - If both arguments are NaN, returns NaN. + * - If one argument is NaN, returns the numeric argument. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double fmin(double x, double y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl fmin(double x, double y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int max(const int a, const int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p unsigned \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned int umax(const unsigned int a, const unsigned int b); +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p long \p long \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int llmax(const long long int a, const long long int b); +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p unsigned \p long \p long \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ unsigned long long int ullmax(const unsigned long long int a, const unsigned long long int b); + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Determine the maximum numeric value of the arguments. + * + * Determines the maximum numeric value of the arguments \p x and \p y. Treats NaN + * arguments as missing data. If one argument is a NaN and the other is legitimate numeric + * value, the numeric value is chosen. + * + * \return + * Returns the maximum numeric values of the arguments \p x and \p y. + * - If both arguments are NaN, returns NaN. + * - If one argument is NaN, returns the numeric argument. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float fmaxf(float x, float y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl fmaxf(float x, float y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Determine the maximum numeric value of the arguments. + * + * Determines the maximum numeric value of the arguments \p x and \p y. Treats NaN + * arguments as missing data. If one argument is a NaN and the other is legitimate numeric + * value, the numeric value is chosen. + * + * \return + * Returns the maximum numeric values of the arguments \p x and \p y. + * - If both arguments are NaN, returns NaN. + * - If one argument is NaN, returns the numeric argument. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double fmax(double, double) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl fmax(double, double); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the sine of the input argument. + * + * Calculate the sine of the input argument \p x (measured in radians). + * + * \return + * - sin( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - sin( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - sin(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl sin(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the cosine of the input argument. + * + * Calculate the cosine of the input argument \p x (measured in radians). + * + * \return + * - cos( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - cos( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - cos(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl cos(double x) __THROW; +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the sine and cosine of the first input argument. + * + * Calculate the sine and cosine of the first input argument \p x (measured + * in radians). The results for sine and cosine are written into the + * second argument, \p sptr, and, respectively, third argument, \p cptr. + * + * \see ::sin() and ::cos(). + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ void sincos(double x, double *sptr, double *cptr) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the sine and cosine of the first input argument. + * + * Calculate the sine and cosine of the first input argument \p x (measured + * in radians). The results for sine and cosine are written into the second + * argument, \p sptr, and, respectively, third argument, \p cptr. + * + * \see ::sinf() and ::cosf(). + * \note_accuracy_single + * \note_fastmath + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ void sincosf(float x, float *sptr, float *cptr) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the tangent of the input argument. + * + * Calculate the tangent of the input argument \p x (measured in radians). + * + * \return + * - tan( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - tan( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - tan(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl tan(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the square root of the input argument. + * + * Calculate the nonnegative square root of \p x, + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula. + * + * \return + * Returns + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula. + * - sqrt( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - sqrt( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - sqrt(\p x) returns NaN if \p x is less than 0. + * - sqrt(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl sqrt(double x) __THROW; +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the reciprocal of the square root of the input argument. + * + * Calculate the reciprocal of the nonnegative square root of \p x, + * \cuda_math_formula 1/\sqrt{x} \end_cuda_math_formula. + * + * \return + * Returns + * \cuda_math_formula 1/\sqrt{x} \end_cuda_math_formula. + * - rsqrt( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - rsqrt( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - rsqrt(\p x) returns NaN if \p x is less than 0. + * - rsqrt(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rsqrt(double x); + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the reciprocal of the square root of the input argument. + * + * Calculate the reciprocal of the nonnegative square root of \p x, + * \cuda_math_formula 1/\sqrt{x} \end_cuda_math_formula. + * + * \return + * Returns + * \cuda_math_formula 1/\sqrt{x} \end_cuda_math_formula. + * - rsqrtf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - rsqrtf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - rsqrtf(\p x) returns NaN if \p x is less than 0. + * - rsqrtf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rsqrtf(float x); + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the base 2 logarithm of the input argument. + * + * Calculate the base 2 logarithm of the input argument \p x. + * + * \return + * - log2( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - log2(1) returns +0. + * - log2(\p x) returns NaN for \p x < 0. + * - log2( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - log2(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double log2(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl log2(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the base 2 exponential of the input argument. + * + * Calculate + * \cuda_math_formula 2^x \end_cuda_math_formula +, + * the base 2 exponential of the input argument \p x. + * + * \return + * - exp2( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - exp2( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0. + * - exp2( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - exp2(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double exp2(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl exp2(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the base 2 exponential of the input argument. + * + * Calculate + * \cuda_math_formula 2^x \end_cuda_math_formula +, + * the base 2 exponential of the input argument \p x. + * + * \return + * - exp2f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - exp2f( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0. + * - exp2f( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - exp2f(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float exp2f(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl exp2f(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the base 10 exponential of the input argument. + * + * Calculate + * \cuda_math_formula 10^x \end_cuda_math_formula +, + * the base 10 exponential of the input argument \p x. + * + * \return + * - exp10( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - exp10( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0. + * - exp10( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - exp10(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double exp10(double x) __THROW; + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the base 10 exponential of the input argument. + * + * Calculate + * \cuda_math_formula 10^x \end_cuda_math_formula +, + * the base 10 exponential of the input argument \p x. + * + * \return + * - exp10f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - exp10f( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0. + * - exp10f( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - exp10f(NaN) returns NaN. + * + * \note_accuracy_single + * \note_fastmath + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float exp10f(float x) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument, minus 1. + * + * Calculate + * \cuda_math_formula e^x \end_cuda_math_formula + * -1, the base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument \p x, minus 1. + * + * \return + * - expm1( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - expm1( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns -1. + * - expm1( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - expm1(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double expm1(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl expm1(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument, minus 1. + * + * Calculate + * \cuda_math_formula e^x \end_cuda_math_formula + * -1, the base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument \p x, minus 1. + * + * \return + * - expm1f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - expm1f( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns -1. + * - expm1f( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - expm1f(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float expm1f(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl expm1f(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the base 2 logarithm of the input argument. + * + * Calculate the base 2 logarithm of the input argument \p x. + * + * \return + * - log2f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - log2f(1) returns +0. + * - log2f(\p x) returns NaN for \p x < 0. + * - log2f( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - log2f(NaN) returns NaN. + * + * \note_accuracy_single + * \note_fastmath + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float log2f(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl log2f(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the base 10 logarithm of the input argument. + * + * Calculate the base 10 logarithm of the input argument \p x. + * + * \return + * - log10( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - log10(1) returns +0. + * - log10(\p x) returns NaN for \p x < 0. + * - log10( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - log10(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl log10(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the base + * \cuda_math_formula e \end_cuda_math_formula + * logarithm of the input argument. + * + * Calculate the base + * \cuda_math_formula e \end_cuda_math_formula + * logarithm of the input argument \p x. + * + * \return + * - log( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - log(1) returns +0. + * - log(\p x) returns NaN for \p x < 0. + * - log( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - log(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl log(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of + * \cuda_math_formula \log_{e}(1+x) \end_cuda_math_formula. + * + * Calculate the value of + * \cuda_math_formula \log_{e}(1+x) \end_cuda_math_formula + * of the input argument \p x. + * + * \return + * - log1p( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - log1p(-1) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - log1p(\p x) returns NaN for \p x < -1. + * - log1p( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - log1p(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double log1p(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl log1p(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of + * \cuda_math_formula \log_{e}(1+x) \end_cuda_math_formula. + * + * Calculate the value of + * \cuda_math_formula \log_{e}(1+x) \end_cuda_math_formula + * of the input argument \p x. + * + * \return + * - log1pf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - log1pf(-1) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - log1pf(\p x) returns NaN for \p x < -1. + * - log1pf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - log1pf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float log1pf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl log1pf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the largest integer less than or equal to \p x. + * + * Calculates the largest integer value which is less than or equal to \p x. + * + * \return + * Returns + * \cuda_math_formula \lfloor x \rfloor \end_cuda_math_formula + * expressed as a floating-point number. + * - floor( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - floor( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - floor(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl floor(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument. + * + * Calculate + * \cuda_math_formula e^x \end_cuda_math_formula +, + * the base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument \p x. + * + * \return + * - exp( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - exp( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0. + * - exp( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - exp(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl exp(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the hyperbolic cosine of the input argument. + * + * Calculate the hyperbolic cosine of the input argument \p x. + * + * \return + * - cosh( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - cosh( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - cosh(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl cosh(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the hyperbolic sine of the input argument. + * + * Calculate the hyperbolic sine of the input argument \p x. + * + * \return + * - sinh( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - sinh( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - sinh(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl sinh(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the hyperbolic tangent of the input argument. + * + * Calculate the hyperbolic tangent of the input argument \p x. + * + * \return + * - tanh( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - tanh( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 1 \end_cuda_math_formula. + * - tanh(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl tanh(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the nonnegative inverse hyperbolic cosine of the input argument. + * + * Calculate the nonnegative inverse hyperbolic cosine of the input argument \p x. + * + * \return + * Result will be in the interval [0, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ]. + * - acosh(1) returns 0. + * - acosh(\p x) returns NaN for \p x in the interval [ + * \cuda_math_formula -\infty \end_cuda_math_formula + * , 1). + * - acosh( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - acosh(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double acosh(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl acosh(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the nonnegative inverse hyperbolic cosine of the input argument. + * + * Calculate the nonnegative inverse hyperbolic cosine of the input argument \p x. + * + * \return + * Result will be in the interval [0, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ]. + * - acoshf(1) returns 0. + * - acoshf(\p x) returns NaN for \p x in the interval [ + * \cuda_math_formula -\infty \end_cuda_math_formula + * , 1). + * - acoshf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - acoshf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float acoshf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl acoshf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the inverse hyperbolic sine of the input argument. + * + * Calculate the inverse hyperbolic sine of the input argument \p x. + * + * \return + * - asinh( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - asinh( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - asinh(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double asinh(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl asinh(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the inverse hyperbolic sine of the input argument. + * + * Calculate the inverse hyperbolic sine of the input argument \p x. + * + * \return + * - asinhf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - asinhf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - asinhf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float asinhf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl asinhf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the inverse hyperbolic tangent of the input argument. + * + * Calculate the inverse hyperbolic tangent of the input argument \p x. + * + * \return + * - atanh( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - atanh( + * \cuda_math_formula \pm 1 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - atanh(\p x) returns NaN for \p x outside interval [-1, 1]. + * - atanh(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double atanh(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl atanh(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the inverse hyperbolic tangent of the input argument. + * + * Calculate the inverse hyperbolic tangent of the input argument \p x. + * + * \return + * - atanhf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - atanhf( + * \cuda_math_formula \pm 1 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - atanhf(\p x) returns NaN for \p x outside interval [-1, 1]. + * - atanhf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float atanhf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl atanhf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of + * \cuda_math_formula x\cdot 2^{exp} \end_cuda_math_formula. + * + * Calculate the value of + * \cuda_math_formula x\cdot 2^{exp} \end_cuda_math_formula + * of the input arguments \p x and \p exp. + * + * \return + * - ldexp(\p x, \p exp) is equivalent to scalbn(\p x, \p exp). + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl ldexp(double x, int exp) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of + * \cuda_math_formula x\cdot 2^{exp} \end_cuda_math_formula. + * + * Calculate the value of + * \cuda_math_formula x\cdot 2^{exp} \end_cuda_math_formula + * of the input arguments \p x and \p exp. + * + * \return + * - ldexpf(\p x, \p exp) is equivalent to scalbnf(\p x, \p exp). + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float ldexpf(float x, int exp) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the floating-point representation of the exponent of the input argument. + * + * Calculate the floating-point representation of the exponent of the input argument \p x. + * + * \return + * - logb( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - logb( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - logb(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double logb(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl logb(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the floating-point representation of the exponent of the input argument. + * + * Calculate the floating-point representation of the exponent of the input argument \p x. + * + * \return + * - logbf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - logbf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - logbf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float logbf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl logbf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Compute the unbiased integer exponent of the argument. + * + * Calculates the unbiased integer exponent of the input argument \p x. + * + * \return + * - If successful, returns the unbiased exponent of the argument. + * - ilogb( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns INT_MIN. + * - ilogb(NaN) returns INT_MIN. + * - ilogb( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns INT_MAX. + * - Note: above behavior does not take into account FP_ILOGB0 nor FP_ILOGBNAN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int ilogb(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP int __cdecl ilogb(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Compute the unbiased integer exponent of the argument. + * + * Calculates the unbiased integer exponent of the input argument \p x. + * + * \return + * - If successful, returns the unbiased exponent of the argument. + * - ilogbf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns INT_MIN. + * - ilogbf(NaN) returns INT_MIN. + * - ilogbf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns INT_MAX. + * - Note: above behavior does not take into account FP_ILOGB0 nor FP_ILOGBNAN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int ilogbf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP int __cdecl ilogbf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Scale floating-point input by integer power of two. + * + * Scale \p x by + * \cuda_math_formula 2^n \end_cuda_math_formula + * by efficient manipulation of the floating-point + * exponent. + * + * \return + * Returns \p x * + * \cuda_math_formula 2^n \end_cuda_math_formula. + * - scalbn( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p n) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - scalbn(\p x, 0) returns \p x. + * - scalbn( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p n) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - scalbn(NaN, \p n) returns NaN. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double scalbn(double x, int n) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl scalbn(double x, int n); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Scale floating-point input by integer power of two. + * + * Scale \p x by + * \cuda_math_formula 2^n \end_cuda_math_formula + * by efficient manipulation of the floating-point + * exponent. + * + * \return + * Returns \p x * + * \cuda_math_formula 2^n \end_cuda_math_formula. + * - scalbnf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p n) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - scalbnf(\p x, 0) returns \p x. + * - scalbnf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p n) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - scalbnf(NaN, \p n) returns NaN. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float scalbnf(float x, int n) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl scalbnf(float x, int n); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Scale floating-point input by integer power of two. + * + * Scale \p x by + * \cuda_math_formula 2^n \end_cuda_math_formula + * by efficient manipulation of the floating-point + * exponent. + * + * \return + * Returns \p x * + * \cuda_math_formula 2^n \end_cuda_math_formula. + * - scalbln( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p n) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - scalbln(\p x, 0) returns \p x. + * - scalbln( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p n) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - scalbln(NaN, \p n) returns NaN. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double scalbln(double x, long int n) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl scalbln(double x, long int n); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Scale floating-point input by integer power of two. + * + * Scale \p x by + * \cuda_math_formula 2^n \end_cuda_math_formula + * by efficient manipulation of the floating-point + * exponent. + * + * \return + * Returns \p x * + * \cuda_math_formula 2^n \end_cuda_math_formula. + * - scalblnf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p n) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - scalblnf(\p x, 0) returns \p x. + * - scalblnf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p n) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - scalblnf(NaN, \p n) returns NaN. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float scalblnf(float x, long int n) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl scalblnf(float x, long int n); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Extract mantissa and exponent of a floating-point value + * + * Decompose the floating-point value \p x into a component \p m for the + * normalized fraction element and another term \p n for the exponent. + * The absolute value of \p m will be greater than or equal to 0.5 and + * less than 1.0 or it will be equal to 0; + * \cuda_math_formula x = m\cdot 2^n \end_cuda_math_formula. + * The integer exponent \p n will be stored in the location to which \p nptr points. + * + * \return + * Returns the fractional component \p m. + * - frexp( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p nptr) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * and stores zero in the location pointed to by \p nptr. + * - frexp( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p nptr) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * and stores an unspecified value in the + * location to which \p nptr points. + * - frexp(NaN, \p y) returns a NaN and stores an unspecified value in the location to which \p nptr points. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl frexp(double x, int *nptr) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Extract mantissa and exponent of a floating-point value + * + * Decomposes the floating-point value \p x into a component \p m for the + * normalized fraction element and another term \p n for the exponent. + * The absolute value of \p m will be greater than or equal to 0.5 and + * less than 1.0 or it will be equal to 0; + * \cuda_math_formula x = m\cdot 2^n \end_cuda_math_formula. + * The integer exponent \p n will be stored in the location to which \p nptr points. + * + * \return + * Returns the fractional component \p m. + * - frexpf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p nptr) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * and stores zero in the location pointed to by \p nptr. + * - frexpf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p nptr) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * and stores an unspecified value in the + * location to which \p nptr points. + * - frexpf(NaN, \p y) returns a NaN and stores an unspecified value in the location to which \p nptr points. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float frexpf(float x, int *nptr) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Round to nearest integer value in floating-point. + * + * Round \p x to the nearest integer value in floating-point format, + * with halfway cases rounded away from zero. + * + * \return + * Returns rounded integer value. + * - round( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - round( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - round(NaN) returns NaN. + * + * \note_slow_round See ::rint(). + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double round(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl round(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Round to nearest integer value in floating-point. + * + * Round \p x to the nearest integer value in floating-point format, + * with halfway cases rounded away from zero. + * + * \return + * Returns rounded integer value. + * - roundf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - roundf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - roundf(NaN) returns NaN. + * + * \note_slow_round See ::rintf(). + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float roundf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl roundf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Round to nearest integer value. + * + * Round \p x to the nearest integer value, with halfway cases rounded + * away from zero. If the result is outside the range of the return type, + * the behavior is undefined. + * + * \return + * Returns rounded integer value. + * + * \note_slow_round See ::lrint(). + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ long int lround(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP long int __cdecl lround(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Round to nearest integer value. + * + * Round \p x to the nearest integer value, with halfway cases rounded + * away from zero. If the result is outside the range of the return type, + * the behavior is undefined. + * + * \return + * Returns rounded integer value. + * + * \note_slow_round See ::lrintf(). + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ long int lroundf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP long int __cdecl lroundf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Round to nearest integer value. + * + * Round \p x to the nearest integer value, with halfway cases rounded + * away from zero. If the result is outside the range of the return type, + * the behavior is undefined. + * + * \return + * Returns rounded integer value. + * + * \note_slow_round See ::llrint(). + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int llround(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP long long int __cdecl llround(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Round to nearest integer value. + * + * Round \p x to the nearest integer value, with halfway cases rounded + * away from zero. If the result is outside the range of the return type, + * the behavior is undefined. + * + * \return + * Returns rounded integer value. + * + * \note_slow_round See ::llrintf(). + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int llroundf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP long long int __cdecl llroundf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Round to nearest integer value in floating-point. + * + * Round \p x to the nearest integer value in floating-point format, + * with halfway cases rounded to the nearest even integer value. + * + * \return + * Returns rounded integer value. + * - rint( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - rint( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - rint(NaN) returns NaN. + */ +#if defined(__CUDA_ARCH__) || defined(__DOXYGEN_ONLY__) +/* + * We don't generate the declaration of rint for host compilation. + * This is acaully a workaround to compile the boost header file when + * Clang 3.8 is used as the host compiler. The boost header file has + * the following example code: + * namespace NS { extern "C" { double rint(double); } + * } + * + * After preprocessing, we get something like below: + * + * extern "C" { double rint(double x) throw(); } + * # 30 "/usr/include/math.h" 3 + * extern "C" { double rint(double x) throw(); } + * namespace NS { extern "C" { double rint(double); } } + * + * Although GCC accepts this output, Clang 3.8 doesn't. + * Furthermore, we cannot change the boost header file by adding "throw()" + * to rint's declaration there. So, as a workaround, we just don't generate + * our re-declaration for the host compilation. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rint(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl rint(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#endif /* __CUDA_ARCH__ || __DOXYGEN_ONLY__ */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Round input to nearest integer value in floating-point. + * + * Round \p x to the nearest integer value in floating-point format, + * with halfway cases rounded to the nearest even integer value. + * + * \return + * Returns rounded integer value. + * - rintf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - rintf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - rintf(NaN) returns NaN. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rintf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl rintf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Round input to nearest integer value. + * + * Round \p x to the nearest integer value, + * with halfway cases rounded to the nearest even integer value. + * If the result is outside the range of the return type, + * the behavior is undefined. + * + * \return + * Returns rounded integer value. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ long int lrint(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP long int __cdecl lrint(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Round input to nearest integer value. + * + * Round \p x to the nearest integer value, + * with halfway cases rounded to the nearest even integer value. + * If the result is outside the range of the return type, + * the behavior is undefined. + * + * \return + * Returns rounded integer value. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ long int lrintf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP long int __cdecl lrintf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Round input to nearest integer value. + * + * Round \p x to the nearest integer value, + * with halfway cases rounded to the nearest even integer value. + * If the result is outside the range of the return type, + * the behavior is undefined. + * + * \return + * Returns rounded integer value. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int llrint(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP long long int __cdecl llrint(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Round input to nearest integer value. + * + * Round \p x to the nearest integer value, + * with halfway cases rounded to the nearest even integer value. + * If the result is outside the range of the return type, + * the behavior is undefined. + * + * \return + * Returns rounded integer value. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ long long int llrintf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP long long int __cdecl llrintf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Round the input argument to the nearest integer. + * + * Round argument \p x to an integer value in double precision floating-point format. Uses round to nearest rounding, with ties rounding to even. + * + * \return + * - nearbyint( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - nearbyint( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - nearbyint(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double nearbyint(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl nearbyint(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Round the input argument to the nearest integer. + * + * Round argument \p x to an integer value in single precision floating-point format. Uses round to nearest rounding, with ties rounding to even. + * + * \return + * - nearbyintf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - nearbyintf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - nearbyintf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float nearbyintf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl nearbyintf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate ceiling of the input argument. + * + * Compute the smallest integer value not less than \p x. + * + * \return + * Returns + * \cuda_math_formula \lceil x \rceil \end_cuda_math_formula + expressed as a floating-point number. + * - ceil( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - ceil( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - ceil(NaN) returns NaN. + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl ceil(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Truncate input argument to the integral part. + * + * Round \p x to the nearest integer value that does not exceed \p x in + * magnitude. + * + * \return + * Returns truncated integer value. + * - trunc( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - trunc( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - trunc(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double trunc(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl trunc(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Truncate input argument to the integral part. + * + * Round \p x to the nearest integer value that does not exceed \p x in + * magnitude. + * + * \return + * Returns truncated integer value. + * - truncf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - truncf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - truncf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float truncf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl truncf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Compute the positive difference between \p x and \p y. + * + * Compute the positive difference between \p x and \p y. The positive + * difference is \p x - \p y when \p x > \p y and +0 otherwise. + * + * \return + * Returns the positive difference between \p x and \p y. + * - fdim(\p x, \p y) returns \p x - \p y if \p x > \p y. + * - fdim(\p x, \p y) returns +0 if \p x + * \cuda_math_formula \leq \end_cuda_math_formula + \p y. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double fdim(double x, double y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl fdim(double x, double y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Compute the positive difference between \p x and \p y. + * + * Compute the positive difference between \p x and \p y. The positive + * difference is \p x - \p y when \p x > \p y and +0 otherwise. + * + * \return + * Returns the positive difference between \p x and \p y. + * - fdimf(\p x, \p y) returns \p x - \p y if \p x > \p y. + * - fdimf(\p x, \p y) returns +0 if \p x + * \cuda_math_formula \leq \end_cuda_math_formula + \p y. + * - If either argument is NaN, NaN is returned. + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float fdimf(float x, float y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl fdimf(float x, float y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the arc tangent of the ratio of first and second input arguments. + * + * Calculate the principal value of the arc tangent of the ratio of first + * and second input arguments \p y / \p x. The quadrant of the result is + * determined by the signs of inputs \p y and \p x. + * + * \return + * Result will be in radians, in the interval [- + * \cuda_math_formula \pi \end_cuda_math_formula + * , + + * \cuda_math_formula \pi \end_cuda_math_formula + * ]. + * - atan2( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , -0) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula. + * - atan2( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , +0) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - atan2( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p x) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * for \p x < 0. + * - atan2( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p x) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * for \p x > 0. + * - atan2(\p y, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\pi \end_cuda_math_formula + * /2 for \p y < 0. + * - atan2(\p y, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pi \end_cuda_math_formula + * /2 for \p y > 0. + * - atan2( + * \cuda_math_formula \pm y \end_cuda_math_formula + * , + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * for finite \p y > 0. + * - atan2( + * \cuda_math_formula \pm y \end_cuda_math_formula + * , + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * for finite \p y > 0. + * - atan2( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p x) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * /2 for finite \p x. + * - atan2( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 3\pi \end_cuda_math_formula + * /4. + * - atan2( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * /4. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl atan2(double y, double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the arc tangent of the input argument. + * + * Calculate the principal value of the arc tangent of the input argument \p x. + * + * \return + * Result will be in radians, in the interval [- + * \cuda_math_formula \pi \end_cuda_math_formula + * /2, + + * \cuda_math_formula \pi \end_cuda_math_formula + * /2]. + * - atan( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - atan( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * /2. + * - atan(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl atan(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the arc cosine of the input argument. + * + * Calculate the principal value of the arc cosine of the input argument \p x. + * + * \return + * Result will be in radians, in the interval [0, + * \cuda_math_formula \pi \end_cuda_math_formula + * ] for \p x inside [-1, +1]. + * - acos(1) returns +0. + * - acos(\p x) returns NaN for \p x outside [-1, +1]. + * - acos(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl acos(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the arc sine of the input argument. + * + * Calculate the principal value of the arc sine of the input argument \p x. + * + * \return + * Result will be in radians, in the interval [- + * \cuda_math_formula \pi \end_cuda_math_formula + * /2, + + * \cuda_math_formula \pi \end_cuda_math_formula + * /2] for \p x inside [-1, +1]. + * - asin( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - asin(\p x) returns NaN for \p x outside [-1, +1]. + * - asin(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl asin(double x) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the square root of the sum of squares of two arguments. + * + * Calculate the length of the hypotenuse of a right triangle whose two sides have lengths + * \p x and \p y without undue overflow or underflow. + * + * \return Returns the length of the hypotenuse + * \cuda_math_formula \sqrt{x^2+y^2} \end_cuda_math_formula. + * - hypot(\p x,\p y), hypot(\p y,\p x), and hypot(\p x, \p -y) are equivalent. + * - hypot(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) is equivalent to fabs(\p x). + * - hypot( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ,\p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula +, + * even if \p y is a NaN. + * - hypot(NaN, \p y) returns NaN, when \p y is not \cuda_math_formula \pm\infty \end_cuda_math_formula. + * + * \note_accuracy_double + */ +#if defined(_WIN32) +#if defined(_MSC_VER) && _MSC_VER < 1900 +static __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __CRTDECL hypot(double x, double y); +#else +extern _ACRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl hypot(double x, double y); +#endif +#else /* _WIN32 */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double hypot(double x, double y) __THROW; +#endif /* _WIN32 */ + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate one over the square root of the sum of squares of two arguments. + * + * Calculate one over the length of the hypotenuse of a right triangle whose two sides have + * lengths \p x and \p y without undue overflow or underflow. + * + * \return Returns one over the length of the hypotenuse + * \cuda_math_formula \frac{1}{\sqrt{x^2+y^2}} \end_cuda_math_formula. + * - rhypot(\p x,\p y), rhypot(\p y,\p x), and rhypot(\p x, \p -y) are equivalent. + * - rhypot( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ,\p y) returns +0, + * even if \p y is a NaN. + * - rhypot(\cuda_math_formula \pm 0, \pm 0 \end_cuda_math_formula) returns \cuda_math_formula +\infty \end_cuda_math_formula. + * - rhypot(NaN, \p y) returns NaN, when \p y is not \cuda_math_formula \pm\infty \end_cuda_math_formula. + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ double rhypot(double x, double y) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the square root of the sum of squares of two arguments. + * + * Calculates the length of the hypotenuse of a right triangle whose two sides have lengths + * \p x and \p y without undue overflow or underflow. + * + * \return Returns the length of the hypotenuse + * \cuda_math_formula \sqrt{x^2+y^2} \end_cuda_math_formula. + * - hypotf(\p x,\p y), hypotf(\p y,\p x), and hypotf(\p x, \p -y) are equivalent. + * - hypotf(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) is equivalent to fabsf(\p x). + * - hypotf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ,\p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula +, + * even if \p y is a NaN. + * - hypotf(NaN, \p y) returns NaN, when \p y is not \cuda_math_formula \pm\infty \end_cuda_math_formula. + * + * \note_accuracy_single + */ +#if defined(_WIN32) +static __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __CRTDECL hypotf(float x, float y); +#else /* _WIN32 */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float hypotf(float x, float y) __THROW; +#endif /* _WIN32 */ + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate one over the square root of the sum of squares of two arguments. + * + * Calculates one over the length of the hypotenuse of a right triangle whose two sides have + * lengths \p x and \p y without undue overflow or underflow. + * + * \return Returns one over the length of the hypotenuse + * \cuda_math_formula \frac{1}{\sqrt{x^2+y^2}} \end_cuda_math_formula. + * - rhypotf(\p x,\p y), rhypotf(\p y,\p x), and rhypotf(\p x, \p -y) are equivalent. + * - rhypotf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ,\p y) returns +0, + * even if \p y is a NaN. + * - rhypotf(\cuda_math_formula \pm 0, \pm 0 \end_cuda_math_formula) returns \cuda_math_formula +\infty \end_cuda_math_formula. + * - rhypotf(NaN, \p y) returns NaN, when \p y is not \cuda_math_formula \pm\infty \end_cuda_math_formula. + * + * \note_accuracy_single + */ +extern __device__ __device_builtin__ float rhypotf(float x, float y) __THROW; + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the square root of the sum of squares of three coordinates of the argument. + * + * Calculate the length of three dimensional vector in Euclidean space without undue overflow or underflow. + * + * \return Returns the length of 3D vector + * \cuda_math_formula \sqrt{a^2+b^2+c^2} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +\infty \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns +0, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl norm3d(double a, double b, double c) __THROW; + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate one over the square root of the sum of squares of three coordinates. + * + * Calculate one over the length of three dimensional vector in Euclidean space without undue overflow or underflow. + * + * \return Returns one over the length of the 3D vector + * \cuda_math_formula \frac{1}{\sqrt{a^2+b^2+c^2}} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +0 \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns \cuda_math_formula +\infty \end_cuda_math_formula, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ double rnorm3d(double a, double b, double c) __THROW; + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the square root of the sum of squares of four coordinates of the argument. + * + * Calculate the length of four dimensional vector in Euclidean space without undue overflow or underflow. + * + * \return Returns the length of 4D vector + * \cuda_math_formula \sqrt{a^2+b^2+c^2+d^2} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +\infty \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns +0, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl norm4d(double a, double b, double c, double d) __THROW; + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate one over the square root of the sum of squares of four coordinates. + * + * Calculate one over the length of four dimensional vector in Euclidean space without undue overflow or underflow. + * + * \return Returns one over the length of the 3D vector + * \cuda_math_formula \frac{1}{\sqrt{a^2+b^2+c^2+d^2}} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +0 \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns \cuda_math_formula +\infty \end_cuda_math_formula, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ double rnorm4d(double a, double b, double c, double d) __THROW; + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the square root of the sum of squares of any number of coordinates. + * + * Calculate the length of a vector p, dimension of which is passed as an argument \p without undue overflow or underflow. + * + * \return Returns the length of the dim-D vector + * \cuda_math_formula \sqrt{\sum_{i=0}^{dim-1} p_i^2} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +\infty \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns +0, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_double + */ +__device__ __device_builtin__ double norm(int dim, double const * p) __THROW; + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the reciprocal of square root of the sum of squares of any number of coordinates. + * + * Calculates one over the length of vector \p p, dimension of which is passed as an argument, in Euclidean space without undue overflow or underflow. + * + * \return Returns one over the length of the vector + * \cuda_math_formula \frac{1}{\sqrt{\sum_{i=0}^{dim-1} p_i^2}} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +0 \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns \cuda_math_formula +\infty \end_cuda_math_formula, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ double rnorm(int dim, double const * p) __THROW; + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the reciprocal of square root of the sum of squares of any number of coordinates. + * + * Calculates one over the length of vector \p p, dimension of which is passed as an argument, in Euclidean space without undue overflow or underflow. + * + * \return Returns one over the length of the vector + * \cuda_math_formula \frac{1}{\sqrt{\sum_{i=0}^{dim-1} p_i^2}} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +0 \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns \cuda_math_formula +\infty \end_cuda_math_formula, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_single + */ + +extern __device__ __device_builtin__ float rnormf(int dim, float const * p) __THROW; + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the square root of the sum of squares of any number of coordinates. + * + * Calculates the length of a vector \p p, dimension of which is passed as an argument without undue overflow or underflow. + * + * \return Returns the length of the dim-D vector + * \cuda_math_formula \sqrt{\sum_{i=0}^{dim-1} p_i^2} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +\infty \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns +0, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_single + */ +__device__ __device_builtin__ float normf(int dim, float const * p) __THROW; + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the square root of the sum of squares of three coordinates of the argument. + * + * Calculates the length of three dimensional vector in Euclidean space without undue overflow or underflow. + * + * \return Returns the length of the 3D vector + * \cuda_math_formula \sqrt{a^2+b^2+c^2} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +\infty \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns +0, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_single + */ + +extern __device__ __device_builtin__ float norm3df(float a, float b, float c) __THROW; + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate one over the square root of the sum of squares of three coordinates. + * + * Calculates one over the length of three dimension vector in Euclidean space without undue overflow or underflow. + * + * \return Returns one over the length of the 3D vector + * \cuda_math_formula \frac{1}{\sqrt{a^2+b^2+c^2}} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +0 \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns \cuda_math_formula +\infty \end_cuda_math_formula, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_single + */ +extern __device__ __device_builtin__ float rnorm3df(float a, float b, float c) __THROW; + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the square root of the sum of squares of four coordinates of the argument. + * + * Calculates the length of four dimensional vector in Euclidean space without undue overflow or underflow. + * + * \return Returns the length of the 4D vector + * \cuda_math_formula \sqrt{a^2+b^2+c^2+d^2} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +\infty \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns +0, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_single + */ +extern __device__ __device_builtin__ float norm4df(float a, float b, float c, float d) __THROW; + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate one over the square root of the sum of squares of four coordinates. + * + * Calculates one over the length of four dimension vector in Euclidean space without undue overflow or underflow. + * + * \return Returns one over the length of the 3D vector + * \cuda_math_formula \frac{1}{\sqrt{a^2+b^2+c^2+d^2}} \end_cuda_math_formula. + * - In the presence of an exactly infinite coordinate + * \cuda_math_formula +0 \end_cuda_math_formula + * is returned, even if there are NaNs. + * - returns \cuda_math_formula +\infty \end_cuda_math_formula, when all coordinates are \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - returns NaN, when at least one of the coordinates is NaN and none are infinite. + * + * \note_accuracy_single + */ +extern __device__ __device_builtin__ float rnorm4df(float a, float b, float c, float d) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the cube root of the input argument. + * + * Calculate the cube root of \p x, + * \cuda_math_formula x^{1/3} \end_cuda_math_formula. + * + * \return + * Returns + * \cuda_math_formula x^{1/3} \end_cuda_math_formula. + * - cbrt( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - cbrt( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - cbrt(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cbrt(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl cbrt(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the cube root of the input argument. + * + * Calculate the cube root of \p x, + * \cuda_math_formula x^{1/3} \end_cuda_math_formula. + * + * \return + * Returns + * \cuda_math_formula x^{1/3} \end_cuda_math_formula. + * - cbrtf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - cbrtf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - cbrtf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cbrtf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl cbrtf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate reciprocal cube root function. + * + * Calculate reciprocal cube root function of \p x. + * + * \return + * - rcbrt( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - rcbrt( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - rcbrt(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double rcbrt(double x); + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate reciprocal cube root function. + * + * Calculate reciprocal cube root function of \p x. + * + * \return + * - rcbrtf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - rcbrtf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - rcbrtf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float rcbrtf(float x); +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the sine of the input argument + * \cuda_math_formula \times \pi \end_cuda_math_formula. + * + * Calculate the sine of \p x + * \cuda_math_formula \times \pi \end_cuda_math_formula + * (measured in radians), + * where \p x is the input argument. + * + * \return + * - sinpi( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - sinpi( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - sinpi(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double sinpi(double x); +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the sine of the input argument + * \cuda_math_formula \times \pi \end_cuda_math_formula. + * + * Calculate the sine of \p x + * \cuda_math_formula \times \pi \end_cuda_math_formula + * (measured in radians), + * where \p x is the input argument. + * + * \return + * - sinpif( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - sinpif( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - sinpif(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinpif(float x); +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the cosine of the input argument + * \cuda_math_formula \times \pi \end_cuda_math_formula. + * + * Calculate the cosine of \p x + * \cuda_math_formula \times \pi \end_cuda_math_formula + * (measured in radians), + * where \p x is the input argument. + * + * \return + * - cospi( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - cospi( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - cospi(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double cospi(double x); +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the cosine of the input argument + * \cuda_math_formula \times \pi \end_cuda_math_formula. + * + * Calculate the cosine of \p x + * \cuda_math_formula \times \pi \end_cuda_math_formula + * (measured in radians), + * where \p x is the input argument. + * + * \return + * - cospif( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - cospif( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - cospif(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cospif(float x); +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the sine and cosine of the first input argument + * \cuda_math_formula \times \pi \end_cuda_math_formula. + * + * Calculate the sine and cosine of the first input argument, \p x (measured in radians), + * \cuda_math_formula \times \pi \end_cuda_math_formula. The results for sine and cosine are written into the + * second argument, \p sptr, and, respectively, third argument, \p cptr. + * + * \see ::sinpi() and ::cospi(). + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ void sincospi(double x, double *sptr, double *cptr); +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the sine and cosine of the first input argument + * \cuda_math_formula \times \pi \end_cuda_math_formula. + * + * Calculate the sine and cosine of the first input argument, \p x (measured in radians), + * \cuda_math_formula \times \pi \end_cuda_math_formula. The results for sine and cosine are written into the + * second argument, \p sptr, and, respectively, third argument, \p cptr. + * + * \see ::sinpif() and ::cospif(). + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ void sincospif(float x, float *sptr, float *cptr); + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of first argument to the power of second argument. + * + * Calculate the value of \p x to the power of \p y. + * + * \return + * - pow( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * for \p y an odd integer less than 0. + * - pow( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for \p y less than 0 and not an odd integer. + * - pow( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * for \p y an odd integer greater than 0. + * - pow( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns +0 for \p y > 0 and not an odd integer. + * - pow(-1, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns 1. + * - pow(+1, \p y) returns 1 for any \p y, even a NaN. + * - pow(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1 for any \p x, even a NaN. + * - pow(\p x, \p y) returns a NaN for finite \p x < 0 and finite non-integer \p y. + * - pow(\p x, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for + * \cuda_math_formula | x | < 1 \end_cuda_math_formula. + * - pow(\p x, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0 for + * \cuda_math_formula | x | > 1 \end_cuda_math_formula. + * - pow(\p x, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0 for + * \cuda_math_formula | x | < 1 \end_cuda_math_formula. + * - pow(\p x, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for + * \cuda_math_formula | x | > 1 \end_cuda_math_formula. + * - pow( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns -0 for \p y an odd integer less than 0. + * - pow( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns +0 for \p y < 0 and not an odd integer. + * - pow( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula -\infty \end_cuda_math_formula + * for \p y an odd integer greater than 0. + * - pow( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for \p y > 0 and not an odd integer. + * - pow( + * \cuda_math_formula +\infty \end_cuda_math_formula + * , \p y) returns +0 for \p y < 0. + * - pow( + * \cuda_math_formula +\infty \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for \p y > 0. + * - pow(\p x, \p y) returns NaN if either \p x or \p y or both are NaN and \p x \cuda_math_formula \neq \end_cuda_math_formula +1 and \p y \cuda_math_formula \neq\pm 0 \end_cuda_math_formula. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl pow(double x, double y) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Break down the input argument into fractional and integral parts. + * + * Break down the argument \p x into fractional and integral parts. The + * integral part is stored in the argument \p iptr. + * Fractional and integral parts are given the same sign as the argument \p x. + * + * \return + * - modf( + * \cuda_math_formula \pm x \end_cuda_math_formula + * , \p iptr) returns a result with the same sign as \p x. + * - modf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p iptr) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * and stores + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * in the object pointed to by \p iptr. + * - modf(NaN, \p iptr) stores a NaN in the object pointed to by \p iptr and returns a NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl modf(double x, double *iptr) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the double-precision floating-point remainder of \p x / \p y. + * + * Calculate the double-precision floating-point remainder of \p x / \p y. + * The floating-point remainder of the division operation \p x / \p y calculated + * by this function is exactly the value x - n*y, where \p n is \p x / \p y with its fractional part truncated. + * The computed value will have the same sign as \p x, and its magnitude will be less than the magnitude of \p y. + * + * \return + * - Returns the floating-point remainder of \p x / \p y. + * - fmod( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * if \p y is not zero. + * - fmod(\p x, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns \p x if \p x is finite. + * - fmod(\p x, \p y) returns NaN if \p x is + * \cuda_math_formula \pm\infty \end_cuda_math_formula + * or \p y is zero. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double __cdecl fmod(double x, double y) __THROW; +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Compute double-precision floating-point remainder. + * + * Compute double-precision floating-point remainder \p r of dividing + * \p x by \p y for nonzero \p y. Thus + * \cuda_math_formula r = x - n y \end_cuda_math_formula. + * The value \p n is the integer value nearest + * \cuda_math_formula \frac{x}{y} \end_cuda_math_formula. + * In the case when + * \cuda_math_formula | n -\frac{x}{y} | = \frac{1}{2} \end_cuda_math_formula + * , the + * even \p n value is chosen. + * + * \return + * - remainder(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns NaN. + * - remainder( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p y) returns NaN. + * - remainder(\p x, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns \p x for finite \p x. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double remainder(double x, double y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl remainder(double x, double y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Compute single-precision floating-point remainder. + * + * Compute single-precision floating-point remainder \p r of dividing + * \p x by \p y for nonzero \p y. Thus + * \cuda_math_formula r = x - n y \end_cuda_math_formula. + * The value \p n is the integer value nearest + * \cuda_math_formula \frac{x}{y} \end_cuda_math_formula. + * In the case when + * \cuda_math_formula | n -\frac{x}{y} | = \frac{1}{2} \end_cuda_math_formula + * , the + * even \p n value is chosen. + * + * \return + * - remainderf(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns NaN. + * - remainderf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p y) returns NaN. + * - remainderf(\p x, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns \p x for finite \p x. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float remainderf(float x, float y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl remainderf(float x, float y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Compute double-precision floating-point remainder and part of quotient. + * + * Compute a double-precision floating-point remainder in the same way as the + * ::remainder() function. Argument \p quo returns part of quotient upon + * division of \p x by \p y. Value \p quo has the same sign as + * \cuda_math_formula \frac{x}{y} \end_cuda_math_formula + * and may not be the exact quotient but agrees with the exact quotient + * in the low order 3 bits. + * + * \return + * Returns the remainder. + * - remquo(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p quo) returns NaN + * and stores an unspecified value in the + * location to which \p quo points. + * - remquo( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p y, \p quo) returns NaN + * and stores an unspecified value in the + * location to which \p quo points. + * - remquo(\p x, \p y, \p quo) returns NaN + * and stores an unspecified value in the + * location to which \p quo points if either of \p x or \p y is NaN. + * - remquo(\p x, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p quo) returns \p x and stores zero + * in the location to which \p quo points for finite \p x. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double remquo(double x, double y, int *quo) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl remquo(double x, double y, int *quo); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Compute single-precision floating-point remainder and part of quotient. + * + * Compute a single-precision floating-point remainder in the same way as the + * ::remainderf() function. Argument \p quo returns part of quotient upon + * division of \p x by \p y. Value \p quo has the same sign as + * \cuda_math_formula \frac{x}{y} \end_cuda_math_formula + * and may not be the exact quotient but agrees with the exact quotient + * in the low order 3 bits. + * + * \return + * Returns the remainder. + * - remquof(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p quo) returns NaN + * and stores an unspecified value in the + * location to which \p quo points. + * - remquof( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p y, \p quo) returns NaN + * and stores an unspecified value in the + * location to which \p quo points. + * - remquof(\p x, \p y, \p quo) returns NaN + * and stores an unspecified value in the + * location to which \p quo points if either of \p x or \p y is NaN. + * - remquof(\p x, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p quo) returns \p x and stores zero + * in the location to which \p quo points for finite \p x. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float remquof(float x, float y, int *quo) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl remquof(float x, float y, int *quo); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of the Bessel function of the first kind of order 0 for the input argument. + * + * Calculate the value of the Bessel function of the first kind of order 0 for + * the input argument \p x, + * \cuda_math_formula J_0(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the first kind of order 0. + * - j0( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns +0. + * - j0(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl j0(double x) __THROW; +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of the Bessel function of the first kind of order 0 for the input argument. + * + * Calculate the value of the Bessel function of the first kind of order 0 for + * the input argument \p x, + * \cuda_math_formula J_0(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the first kind of order 0. + * - j0f( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns +0. + * - j0f(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float j0f(float x) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of the Bessel function of the first kind of order 1 for the input argument. + * + * Calculate the value of the Bessel function of the first kind of order 1 for + * the input argument \p x, + * \cuda_math_formula J_1(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the first kind of order 1. + * - j1( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - j1( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - j1(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl j1(double x) __THROW; +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of the Bessel function of the first kind of order 1 for the input argument. + * + * Calculate the value of the Bessel function of the first kind of order 1 for + * the input argument \p x, + * \cuda_math_formula J_1(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the first kind of order 1. + * - j1f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - j1f( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - j1f(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float j1f(float x) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of the Bessel function of the first kind of order n for the input argument. + * + * Calculate the value of the Bessel function of the first kind of order \p n for + * the input argument \p x, + * \cuda_math_formula J_n(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the first kind of order \p n. + * - jn(\p n, NaN) returns NaN. + * - jn(\p n, \p x) returns NaN for \p n < 0. + * - jn(\p n, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl jn(int n, double x) __THROW; +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of the Bessel function of the first kind of order n for the input argument. + * + * Calculate the value of the Bessel function of the first kind of order \p n for + * the input argument \p x, + * \cuda_math_formula J_n(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the first kind of order \p n. + * - jnf(\p n, NaN) returns NaN. + * - jnf(\p n, \p x) returns NaN for \p n < 0. + * - jnf(\p n, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float jnf(int n, float x) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of the Bessel function of the second kind of order 0 for the input argument. + * + * Calculate the value of the Bessel function of the second kind of order 0 for + * the input argument \p x, + * \cuda_math_formula Y_0(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the second kind of order 0. + * - y0( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - y0(\p x) returns NaN for \p x < 0. + * - y0( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - y0(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl y0(double x) __THROW; +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of the Bessel function of the second kind of order 0 for the input argument. + * + * Calculate the value of the Bessel function of the second kind of order 0 for + * the input argument \p x, + * \cuda_math_formula Y_0(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the second kind of order 0. + * - y0f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - y0f(\p x) returns NaN for \p x < 0. + * - y0f( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - y0f(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float y0f(float x) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of the Bessel function of the second kind of order 1 for the input argument. + * + * Calculate the value of the Bessel function of the second kind of order 1 for + * the input argument \p x, + * \cuda_math_formula Y_1(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the second kind of order 1. + * - y1( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - y1(\p x) returns NaN for \p x < 0. + * - y1( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - y1(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl y1(double x) __THROW; +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of the Bessel function of the second kind of order 1 for the input argument. + * + * Calculate the value of the Bessel function of the second kind of order 1 for + * the input argument \p x, + * \cuda_math_formula Y_1(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the second kind of order 1. + * - y1f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - y1f(\p x) returns NaN for \p x < 0. + * - y1f( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - y1f(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float y1f(float x) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of the Bessel function of the second kind of order n for the input argument. + * + * Calculate the value of the Bessel function of the second kind of order \p n for + * the input argument \p x, + * \cuda_math_formula Y_n(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the second kind of order \p n. + * - yn(\p n, \p x) returns NaN for \p n < 0. + * - yn(\p n, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + *) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - yn(\p n, \p x) returns NaN for \p x < 0. + * - yn(\p n, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - yn(\p n, NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl yn(int n, double x) __THROW; +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of the Bessel function of the second kind of order n for the input argument. + * + * Calculate the value of the Bessel function of the second kind of order \p n for + * the input argument \p x, + * \cuda_math_formula Y_n(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the Bessel function of the second kind of order \p n. + * - ynf(\p n, \p x) returns NaN for \p n < 0. + * - ynf(\p n, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - ynf(\p n, \p x) returns NaN for \p x < 0. + * - ynf(\p n, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - ynf(\p n, NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float ynf(int n, float x) __THROW; + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of the regular modified cylindrical Bessel function of order 0 for the input argument. + * + * Calculate the value of the regular modified cylindrical Bessel function of order 0 for + * the input argument \p x, + * \cuda_math_formula I_0(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the regular modified cylindrical Bessel function of order 0. + * - cyl_bessel_i0(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns +1. + * - cyl_bessel_i0(\cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula +\infty \end_cuda_math_formula. + * - cyl_bessel_i0(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl cyl_bessel_i0(double x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of the regular modified cylindrical Bessel function of order 0 for the input argument. + * + * Calculate the value of the regular modified cylindrical Bessel function of order 0 for + * the input argument \p x, + * \cuda_math_formula I_0(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the regular modified cylindrical Bessel function of order 0. + * - cyl_bessel_i0f(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns +1. + * - cyl_bessel_i0f(\cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula +\infty \end_cuda_math_formula. + * - cyl_bessel_i0f(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __device__ __device_builtin__ float cyl_bessel_i0f(float x) __THROW; + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the value of the regular modified cylindrical Bessel function of order 1 for the input argument. + * + * Calculate the value of the regular modified cylindrical Bessel function of order 1 for + * the input argument \p x, + * \cuda_math_formula I_1(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the regular modified cylindrical Bessel function of order 1. + * - cyl_bessel_i1(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - cyl_bessel_i1(\cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - cyl_bessel_i1(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __device__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl cyl_bessel_i1(double x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of the regular modified cylindrical Bessel function of order 1 for the input argument. + * + * Calculate the value of the regular modified cylindrical Bessel function of order 1 for + * the input argument \p x, + * \cuda_math_formula I_1(x) \end_cuda_math_formula. + * + * \return + * Returns the value of the regular modified cylindrical Bessel function of order 1. + * - cyl_bessel_i1f(\cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - cyl_bessel_i1f(\cuda_math_formula \pm\infty \end_cuda_math_formula) returns \cuda_math_formula \pm\infty \end_cuda_math_formula. + * - cyl_bessel_i1f(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __device__ __device_builtin__ float cyl_bessel_i1f(float x) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the error function of the input argument. + * + * Calculate the value of the error function for the input argument \p x, + * \cuda_math_formula \frac{2}{\sqrt \pi} \int_0^x e^{-t^2} dt \end_cuda_math_formula. + * + * \return + * - erf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - erf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 1 \end_cuda_math_formula. + * - erf(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double erf(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl erf(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the error function of the input argument. + * + * Calculate the value of the error function for the input argument \p x, + * \cuda_math_formula \frac{2}{\sqrt \pi} \int_0^x e^{-t^2} dt \end_cuda_math_formula. + * + * \return + * - erff( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - erff( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 1 \end_cuda_math_formula. + * - erff(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float erff(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl erff(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the inverse error function of the input argument. + * + * Calculate the inverse error function + * \cuda_math_formula \operatorname{erf}^{-1} \end_cuda_math_formula + * (\p x), of the input argument \p x in the interval [-1, 1]. + * + * \return + * - erfinv( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - erfinv(1) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - erfinv(-1) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - erfinv(\p x) returns NaN for \p x outside [-1, +1]. + * - erfinv(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double erfinv(double x); +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the inverse error function of the input argument. + * + * Calculate the inverse error function + * \cuda_math_formula \operatorname{erf}^{-1} \end_cuda_math_formula + * (\p x), of the input argument \p x in the interval [-1, 1]. + * + * \return + * - erfinvf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - erfinvf(1) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - erfinvf(-1) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - erfinvf(\p x) returns NaN for \p x outside [-1, +1]. + * - erfinvf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float erfinvf(float x); + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the complementary error function of the input argument. + * + * Calculate the complementary error function of the input argument \p x, + * 1 - erf(\p x). + * + * \return + * - erfc( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns 2. + * - erfc( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - erfc(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double erfc(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl erfc(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the complementary error function of the input argument. + * + * Calculate the complementary error function of the input argument \p x, + * 1 - erf(\p x). + * + * \return + * - erfcf( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns 2. + * - erfcf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - erfcf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float erfcf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl erfcf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the natural logarithm of the absolute value of the gamma function of the input argument. + * + * Calculate the natural logarithm of the absolute value of the gamma function of the input argument \p x, namely the value of + * \cuda_math_formula \log_{e}\left|\Gamma(x)\right| \end_cuda_math_formula + * + * \return + * - lgamma(1) returns +0. + * - lgamma(2) returns +0. + * - lgamma(\p x) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * if \p x + * \cuda_math_formula \leq \end_cuda_math_formula + 0 and \p x is an integer. + * - lgamma( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - lgamma( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - lgamma(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double lgamma(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl lgamma(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the inverse complementary error function of the input argument. + * + * Calculate the inverse complementary error function + * \cuda_math_formula \operatorname{erfc}^{-1} \end_cuda_math_formula + * (\p x), of the input argument \p x in the interval [0, 2]. + * + * \return + * - erfcinv( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - erfcinv(2) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - erfcinv(\p x) returns NaN for \p x outside [0, 2]. + * - erfcinv(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double erfcinv(double x); +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the inverse complementary error function of the input argument. + * + * Calculate the inverse complementary error function + * \cuda_math_formula \operatorname{erfc}^{-1} \end_cuda_math_formula + * (\p x), of the input argument \p x in the interval [0, 2]. + * + * \return + * - erfcinvf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - erfcinvf(2) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - erfcinvf(\p x) returns NaN for \p x outside [0, 2]. + * - erfcinvf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float erfcinvf(float x); +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the inverse of the standard normal cumulative distribution function. + * + * Calculate the inverse of the standard normal cumulative distribution function for input argument \p x, + * \cuda_math_formula \Phi^{-1}(x) \end_cuda_math_formula. The function is defined for input values in the interval + * \cuda_math_formula (0, 1) \end_cuda_math_formula. + * + * \return + * - normcdfinv( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - normcdfinv(1) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - normcdfinv(\p x) returns NaN + * if \p x is not in the interval [0,1]. + * - normcdfinv(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double normcdfinv(double x); +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the inverse of the standard normal cumulative distribution function. + * + * Calculate the inverse of the standard normal cumulative distribution function for input argument \p x, + * \cuda_math_formula \Phi^{-1}(x) \end_cuda_math_formula. The function is defined for input values in the interval + * \cuda_math_formula (0, 1) \end_cuda_math_formula. + * + * \return + * - normcdfinvf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - normcdfinvf(1) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - normcdfinvf(\p x) returns NaN + * if \p x is not in the interval [0,1]. + * - normcdfinvf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float normcdfinvf(float x); +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the standard normal cumulative distribution function. + * + * Calculate the cumulative distribution function of the standard normal distribution for input argument \p x, + * \cuda_math_formula \Phi(x) \end_cuda_math_formula. + * + * \return + * - normcdf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns 1. + * - normcdf( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0. + * - normcdf(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double normcdf(double x); +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the standard normal cumulative distribution function. + * + * Calculate the cumulative distribution function of the standard normal distribution for input argument \p x, + * \cuda_math_formula \Phi(x) \end_cuda_math_formula. + * + * \return + * - normcdff( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns 1. + * - normcdff( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0 + * - normcdff(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float normcdff(float x); +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the scaled complementary error function of the input argument. + * + * Calculate the scaled complementary error function of the input argument \p x, + * \cuda_math_formula e^{x^2}\cdot \operatorname{erfc}(x) \end_cuda_math_formula. + * + * \return + * - erfcx( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - erfcx( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - erfcx(NaN) returns NaN. + * + * \note_accuracy_double + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double erfcx(double x); +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the scaled complementary error function of the input argument. + * + * Calculate the scaled complementary error function of the input argument \p x, + * \cuda_math_formula e^{x^2}\cdot \operatorname{erfc}(x) \end_cuda_math_formula. + * + * \return + * - erfcxf( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - erfcxf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0. + * - erfcxf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float erfcxf(float x); + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the natural logarithm of the absolute value of the gamma function of the input argument. + * + * Calculate the natural logarithm of the absolute value of the gamma function of the input argument \p x, namely the value of + * \cuda_math_formula \log_{e}\left|\Gamma(x)\right| \end_cuda_math_formula + * + * \return + * - lgammaf(1) returns +0. + * - lgammaf(2) returns +0. + * - lgammaf(\p x) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * if \p x + * \cuda_math_formula \leq \end_cuda_math_formula + * 0 and \p x is an integer. + * - lgammaf( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - lgammaf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - lgammaf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float lgammaf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl lgammaf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the gamma function of the input argument. + * + * Calculate the gamma function of the input argument \p x, namely the value of + * \cuda_math_formula \Gamma(x) \end_cuda_math_formula. + * + * \return + * - tgamma( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - tgamma(\p x) returns NaN if \p x < 0 and \p x is an integer. + * - tgamma( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns NaN. + * - tgamma( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - tgamma(NaN) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double tgamma(double x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl tgamma(double x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the gamma function of the input argument. + * + * Calculate the gamma function of the input argument \p x, namely the value of + * \cuda_math_formula \Gamma(x) \end_cuda_math_formula. + * + * \return + * - tgammaf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - tgammaf(\p x) returns NaN if \p x < 0 and \p x is an integer. + * - tgammaf( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns NaN. + * - tgammaf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - tgammaf(NaN) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float tgammaf(float x) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl tgammaf(float x); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** \ingroup CUDA_MATH_DOUBLE + * \brief Create value with given magnitude, copying sign of second value. + * + * Create a floating-point value with the magnitude \p x and the sign of \p y. + * + * \return + * - a value with the magnitude of \p x and the sign of \p y. + * - copysign(\p NaN, \p y) returns a \p NaN with the sign of \p y. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double copysign(double x, double y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl copysign(double x, double y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** \ingroup CUDA_MATH_SINGLE + * \brief Create value with given magnitude, copying sign of second value. + * + * Create a floating-point value with the magnitude \p x and the sign of \p y. + * + * \return + * - a value with the magnitude of \p x and the sign of \p y. + * - copysignf(\p NaN, \p y) returns a \p NaN with the sign of \p y. + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float copysignf(float x, float y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl copysignf(float x, float y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Return next representable double-precision floating-point value after argument \p x in the direction of \p y. + * + * Calculate the next representable double-precision floating-point value + * following \p x in the direction of \p y. For example, if \p y is greater than \p x, ::nextafter() + * returns the smallest representable number greater than \p x + * + * \return + * - nextafter(\p x, \p y) = \p y if \p x equals \p y. + * - nextafter(\p x, \p y) = \p NaN if either \p x or \p y are \p NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double nextafter(double x, double y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl nextafter(double x, double y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Return next representable single-precision floating-point value after argument \p x in the direction of \p y. + * + * Calculate the next representable single-precision floating-point value + * following \p x in the direction of \p y. For example, if \p y is greater than \p x, ::nextafterf() + * returns the smallest representable number greater than \p x + * + * \return + * - nextafterf(\p x, \p y) = \p y if \p x equals \p y. + * - nextafterf(\p x, \p y) = \p NaN if either \p x or \p y are \p NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float nextafterf(float x, float y) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl nextafterf(float x, float y); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Returns "Not a Number" value. + * + * Return a representation of a quiet NaN. Argument \p tagp selects one of the possible representations. + * + * \return + * - nan(\p tagp) returns NaN. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double nan(const char *tagp) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl nan(const char *tagp); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Returns "Not a Number" value + * + * Return a representation of a quiet NaN. Argument \p tagp selects one of the possible representations. + * + * \return + * - nanf(\p tagp) returns NaN. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float nanf(const char *tagp) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl nanf(const char *tagp); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* namespace std */ +#endif +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isinff(float) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isnanf(float) __THROW; + + +#if defined(__APPLE__) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isfinited(double) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isfinitef(float) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __signbitd(double) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isnand(double) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isinfd(double) __THROW; +#else /* __APPLE__ */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __finite(double) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __finitef(float) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __signbit(double) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isnan(double) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isinf(double) __THROW; +#endif /* __APPLE__ */ + +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __signbitf(float) __THROW; + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Compute + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation. + * + * Compute the value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single ternary operation. After computing the value + * to infinite precision, the value is rounded once using round-to-nearest, + * ties-to-even rounding mode. + * + * \return + * Returns the rounded value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation. + * - fma( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p z) returns NaN. + * - fma( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p z) returns NaN. + * - fma(\p x, \p y, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - fma(\p x, \p y, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - fma(\p x, \p y, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - fma(\p x, \p y, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - fma(\p x, \p y, \p z) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y + z \end_cuda_math_formula is exactly zero and \cuda_math_formula z \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_double + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ double fma(double x, double y, double z) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP double __cdecl fma(double x, double y, double z); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Compute + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation. + * + * Compute the value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single ternary operation. After computing the value + * to infinite precision, the value is rounded once using round-to-nearest, + * ties-to-even rounding mode. + * + * \return + * Returns the rounded value of + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * as a single operation. + * - fmaf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p z) returns NaN. + * - fmaf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p z) returns NaN. + * - fmaf(\p x, \p y, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - fmaf(\p x, \p y, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns NaN if + * \cuda_math_formula x \times y \end_cuda_math_formula + * is an exact + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - fmaf(\p x, \p y, \cuda_math_formula \pm 0 \end_cuda_math_formula) returns \cuda_math_formula \pm 0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - fmaf(\p x, \p y, \cuda_math_formula \mp 0 \end_cuda_math_formula) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y \end_cuda_math_formula is exact \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - fmaf(\p x, \p y, \p z) returns \cuda_math_formula +0 \end_cuda_math_formula if \cuda_math_formula x \times y + z \end_cuda_math_formula is exactly zero and \cuda_math_formula z \neq 0 \end_cuda_math_formula. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single + */ +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float fmaf(float x, float y, float z) __THROW; +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ __CUDA_MATH_CRTIMP float __cdecl fmaf(float x, float y, float z); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + + +/* these are here to avoid warnings on the call graph. + long double is not supported on the device */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __signbitl(long double) __THROW; +#if defined(__APPLE__) +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isfinite(long double) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isinf(long double) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isnan(long double) __THROW; +#else /* __APPLE__ */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __finitel(long double) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isinfl(long double) __THROW; +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int __isnanl(long double) __THROW; +#endif /* __APPLE__ */ + +#if defined(_WIN32) && ( defined(_M_AMD64) || defined(_M_ARM64) ) +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl acosf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl asinf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl atanf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl atan2f(float, float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl cosf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl sinf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl tanf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl coshf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl sinhf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl tanhf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl expf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl logf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl log10f(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl modff(float, float*) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl powf(float, float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl sqrtf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl ceilf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl floorf(float) __THROW; +extern __CUDA_MATH_CRTIMP __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float __cdecl fmodf(float, float) __THROW; +#else /* _WIN32 && (_M_AMD64 || _M_ARM64) */ + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the arc cosine of the input argument. + * + * Calculate the principal value of the arc cosine of the input argument \p x. + * + * \return + * Result will be in radians, in the interval [0, + * \cuda_math_formula \pi \end_cuda_math_formula + * ] for \p x inside [-1, +1]. + * - acosf(1) returns +0. + * - acosf(\p x) returns NaN for \p x outside [-1, +1]. + * - acosf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float acosf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the arc sine of the input argument. + * + * Calculate the principal value of the arc sine of the input argument \p x. + * + * \return + * Result will be in radians, in the interval [- + * \cuda_math_formula \pi/2 \end_cuda_math_formula + * , + + * \cuda_math_formula \pi/2 \end_cuda_math_formula + * ] for \p x inside [-1, +1]. + * - asinf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - asinf(\p x) returns NaN for \p x outside [-1, +1]. + * - asinf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float asinf(float x) __THROW; + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the arc tangent of the input argument. + * + * Calculate the principal value of the arc tangent of the input argument \p x. + * + * \return + * Result will be in radians, in the interval [- + * \cuda_math_formula \pi/2 \end_cuda_math_formula + * , + + * \cuda_math_formula \pi/2 \end_cuda_math_formula + * ]. + * - atanf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - atanf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * /2. + * - atanf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float atanf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the arc tangent of the ratio of first and second input arguments. + * + * Calculate the principal value of the arc tangent of the ratio of first + * and second input arguments \p y / \p x. The quadrant of the result is + * determined by the signs of inputs \p y and \p x. + * + * \return + * Result will be in radians, in the interval [- + * \cuda_math_formula \pi \end_cuda_math_formula + * , + + * \cuda_math_formula \pi \end_cuda_math_formula + * ]. + * - atan2f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , -0) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula. + * - atan2f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , +0) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - atan2f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p x) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * for \p x < 0. + * - atan2f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p x) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * for \p x > 0. + * - atan2f(\p y, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\pi \end_cuda_math_formula + * /2 for \p y < 0. + * - atan2f(\p y, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pi \end_cuda_math_formula + * /2 for \p y > 0. + * - atan2f( + * \cuda_math_formula \pm y \end_cuda_math_formula + * , + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * for finite \p y > 0. + * - atan2f( + * \cuda_math_formula \pm y \end_cuda_math_formula + * , + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * for finite \p y > 0. + * - atan2f( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p x) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * /2 for finite \p x. + * - atan2f( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 3\pi \end_cuda_math_formula + * /4. + * - atan2f( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \pi \end_cuda_math_formula + * /4. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float atan2f(float y, float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the cosine of the input argument. + * + * Calculate the cosine of the input argument \p x (measured in radians). + * + * \return + * - cosf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - cosf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - cosf(NaN) returns NaN. + * + * \note_accuracy_single + * \note_fastmath + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float cosf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the sine of the input argument. + * + * Calculate the sine of the input argument \p x (measured in radians). + * + * \return + * - sinf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - sinf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - sinf(NaN) returns NaN. + * + * \note_accuracy_single + * \note_fastmath + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the tangent of the input argument. + * + * Calculate the tangent of the input argument \p x (measured in radians). + * + * \return + * - tanf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - tanf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns NaN. + * - tanf(NaN) returns NaN. + * + * \note_accuracy_single + * \note_fastmath + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float tanf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the hyperbolic cosine of the input argument. + * + * Calculate the hyperbolic cosine of the input argument \p x. + * + * \return + * - coshf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - coshf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - coshf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float coshf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the hyperbolic sine of the input argument. + * + * Calculate the hyperbolic sine of the input argument \p x. + * + * \return + * - sinhf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - sinhf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - sinhf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sinhf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the hyperbolic tangent of the input argument. + * + * Calculate the hyperbolic tangent of the input argument \p x. + * + * \return + * - tanhf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - tanhf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 1 \end_cuda_math_formula. + * - tanhf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float tanhf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the natural logarithm of the input argument. + * + * Calculate the natural logarithm of the input argument \p x. + * + * \return + * - logf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - logf(1) returns +0. + * - logf(\p x) returns NaN for \p x < 0. + * - logf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - logf(NaN) returns NaN. + * + * \note_accuracy_single + * \note_fastmath + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float logf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument. + * + * Calculate + * \cuda_math_formula e^x \end_cuda_math_formula +, + * the base + * \cuda_math_formula e \end_cuda_math_formula + * exponential of the input argument \p x. + * + * \return + * - expf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1. + * - expf( + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0. + * - expf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - expf(NaN) returns NaN. + * + * \note_accuracy_single + * \note_fastmath + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float expf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the base 10 logarithm of the input argument. + * + * Calculate the base 10 logarithm of the input argument \p x. + * + * \return + * - log10f( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula -\infty \end_cuda_math_formula. + * - log10f(1) returns +0. + * - log10f(\p x) returns NaN for \p x < 0. + * - log10f( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - log10f(NaN) returns NaN. + * + * \note_accuracy_single + * \note_fastmath + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float log10f(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Break down the input argument into fractional and integral parts. + * + * Break down the argument \p x into fractional and integral parts. The integral part is stored in the argument \p iptr. + * Fractional and integral parts are given the same sign as the argument \p x. + * + * \return + * - modff( + * \cuda_math_formula \pm x \end_cuda_math_formula + * , \p iptr) returns a result with the same sign as \p x. + * - modff( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * , \p iptr) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * and stores + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * in the object pointed to by \p iptr. + * - modff(NaN, \p iptr) stores a NaN in the object pointed to by \p iptr and returns a NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float modff(float x, float *iptr) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the value of first argument to the power of second argument. + * + * Calculate the value of \p x to the power of \p y. + * + * \return + * - powf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * for \p y an odd integer less than 0. + * - powf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for \p y less than 0 and not an odd integer. + * - powf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * for \p y an odd integer greater than 0. + * - powf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns +0 for \p y > 0 and not an odd integer. + * - powf(-1, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns 1. + * - powf(+1, \p y) returns 1 for any \p y, even a NaN. + * - powf(\p x, + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns 1 for any \p x, even a NaN. + * - powf(\p x, \p y) returns a NaN for finite \p x < 0 and finite non-integer \p y. + * - powf(\p x, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for + * \cuda_math_formula | x | < 1 \end_cuda_math_formula. + * - powf(\p x, + * \cuda_math_formula -\infty \end_cuda_math_formula + * ) returns +0 for + * \cuda_math_formula | x | > 1 \end_cuda_math_formula. + * - powf(\p x, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns +0 for + * \cuda_math_formula | x | < 1 \end_cuda_math_formula. + * - powf(\p x, + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for + * \cuda_math_formula | x | > 1 \end_cuda_math_formula. + * - powf( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns -0 for \p y an odd integer less than 0. + * - powf( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns +0 for \p y < 0 and not an odd integer. + * - powf( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula -\infty \end_cuda_math_formula + * for \p y an odd integer greater than 0. + * - powf( + * \cuda_math_formula -\infty \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for \p y > 0 and not an odd integer. + * - powf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * , \p y) returns +0 for \p y < 0. + * - powf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula +\infty \end_cuda_math_formula + * for \p y > 0. + * - powf(\p x, \p y) returns NaN if either \p x or \p y or both are NaN and \p x \cuda_math_formula \neq \end_cuda_math_formula +1 and \p y \cuda_math_formula \neq\pm 0 \end_cuda_math_formula. + * + * \note_accuracy_single + * \note_fastmath + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float powf(float x, float y) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the square root of the input argument. + * + * Calculate the nonnegative square root of \p x, + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula. + * + * \return + * Returns + * \cuda_math_formula \sqrt{x} \end_cuda_math_formula. + * - sqrtf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - sqrtf( + * \cuda_math_formula +\infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula +\infty \end_cuda_math_formula. + * - sqrtf(\p x) returns NaN if \p x is less than 0. + * - sqrtf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float sqrtf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate ceiling of the input argument. + * + * Compute the smallest integer value not less than \p x. + * + * \return + * Returns + * \cuda_math_formula \lceil x \rceil \end_cuda_math_formula + * expressed as a floating-point number. + * - ceilf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - ceilf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - ceilf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float ceilf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the largest integer less than or equal to \p x. + * + * Calculate the largest integer value which is less than or equal to \p x. + * + * \return + * Returns + * \cuda_math_formula \lfloor x \rfloor \end_cuda_math_formula + * expressed as a floating-point number. + * - floorf( + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm \infty \end_cuda_math_formula. + * - floorf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * ) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula. + * - floorf(NaN) returns NaN. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float floorf(float x) __THROW; +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the floating-point remainder of \p x / \p y. + * + * Calculate the floating-point remainder of \p x / \p y. + * The floating-point remainder of the division operation \p x / \p y calculated + * by this function is exactly the value x - n*y, where \p n is \p x / \p y with its fractional part truncated. + * The computed value will have the same sign as \p x, and its magnitude will be less than the magnitude of \p y. + * \return + * - Returns the floating-point remainder of \p x / \p y. + * - fmodf( + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * , \p y) returns + * \cuda_math_formula \pm 0 \end_cuda_math_formula + * if \p y is not zero. + * - fmodf(\p x, + * \cuda_math_formula \pm \infty \end_cuda_math_formula + * ) returns \p x if \p x is finite. + * - fmodf(\p x, \p y) returns NaN if \p x is + * \cuda_math_formula \pm\infty \end_cuda_math_formula + * or \p y is zero. + * - If either argument is NaN, NaN is returned. + * + * \note_accuracy_single + */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float fmodf(float x, float y) __THROW; +#if defined(__QNX__) +/* redeclare some builtins that QNX uses */ +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float _FLog(float, int); +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float _FCosh(float, float); +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float _FSinh(float, float); +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ float _FSinx(float, unsigned int, int); +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int _FDsign(float); +extern __DEVICE_FUNCTIONS_DECL__ __device_builtin__ int _Dsign(double); +#endif +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif +#endif /* _WIN32 && (_M_AMD64 || _M_ARM64) */ + +} + +#if !defined(__CUDACC_RTC__) +#include +#include + +#ifndef __CUDA_INTERNAL_SKIP_CPP_HEADERS__ +#include +#include +#endif /* __CUDA_INTERNAL_SKIP_CPP_HEADERS__ */ +#endif /* __CUDACC_RTC__ */ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__CUDACC_RTC__) + +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int signbit(float x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int signbit(double x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int signbit(long double x); + +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isfinite(float x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isfinite(double x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isfinite(long double x); + +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(float x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(double x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(long double x); + +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(float x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(double x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(long double x); + +#elif defined(__GNUC__) + +#undef signbit +#undef isfinite +#undef isnan +#undef isinf + +#if defined(__APPLE__) + +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int signbit(float x); +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int signbit(double x); +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int signbit(long double x); + +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isfinite(float x); +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isfinite(double x); +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isfinite(long double x); + +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(double x) throw(); +#if !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 7000 +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(float x); +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(long double x); +#else /* !(!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 7000) */ +template +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool __libcpp_isnan(T) _NOEXCEPT; +inline _LIBCPP_INLINE_VISIBILITY __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool isnan(float x) _NOEXCEPT; +inline _LIBCPP_INLINE_VISIBILITY __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool isnan(long double x) _NOEXCEPT; +#endif /* !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 7000 */ + +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(double x) throw(); +#if !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 7000 +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(float x); +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(long double x); +#else /* !(!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 7000) */ +template +__cudart_builtin__ __DEVICE_FUNCTIONS_DECL__ bool __libcpp_isinf(T) _NOEXCEPT; +inline _LIBCPP_INLINE_VISIBILITY __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool isinf(float x) _NOEXCEPT; +inline _LIBCPP_INLINE_VISIBILITY __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool isinf(long double x) _NOEXCEPT; +#endif /* !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 7000 */ + +#else /* __APPLE__ */ + +#if ((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L) +#if !defined(_NVHPC_CUDA) +namespace std { +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool signbit(float x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool signbit(double x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool signbit(long double x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool isfinite(float x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool isfinite(double x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool isfinite(long double x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool isnan(float x); +/* GCC 6.1 uses ::isnan(double x) for isnan(double x) if the condition is true */ +#if _GLIBCXX_HAVE_OBSOLETE_ISNAN && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(double x) throw(); +#else /* !(_GLIBCXX_HAVE_OBSOLETE_ISNAN && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC) */ +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool isnan(double x); +#endif /* _GLIBCXX_HAVE_OBSOLETE_ISNAN && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC */ +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool isnan(long double x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool isinf(float x); +/* GCC 6.1 uses ::isinf(double x) for isinf(double x) if the condition is true. */ +#if _GLIBCXX_HAVE_OBSOLETE_ISINF && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(double x) throw(); +#else /* !(_GLIBCXX_HAVE_OBSOLETE_ISINF && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC) */ +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool isinf(double x); +#endif /* _GLIBCXX_HAVE_OBSOLETE_ISINF && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC */ +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ constexpr bool isinf(long double x); +} +#endif + +#else /* !(((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L)) */ + +#if defined(__QNX__) +#if (__QNX__) && !defined(_LIBCPP_VERSION) +/* QNX defines functions in std, need to declare them here */ +namespace std { +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool signbit(float x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool signbit(double x); +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool signbit(long double x); +} +#else +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool signbit(const float x); +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool signbit(const double x); +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool signbit(const long double x); +#endif +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isfinite(const float a); +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isfinite(const double a); +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isfinite(const long double a); +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isnan(const float a); +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isnan(const double a); +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isnan(const long double a); +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isinf(const float a); +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isinf(const double a); +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isinf(const long double a); +#else /* ! __QNX__ */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int signbit(const float x); +#if defined(__ICC) +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int signbit(const double x) throw(); +#else /* !__ICC */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int signbit(const double x); +#endif /* __ICC */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int signbit(const long double x); + +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isfinite(const float x); +#if defined(__ICC) +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isfinite(const double x) throw(); +#else /* !__ICC */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isfinite(const double x); +#endif /* __ICC */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isfinite(const long double x); + +#if (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000 +template +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool __libcpp_isnan(T) _NOEXCEPT; +inline _LIBCPP_INLINE_VISIBILITY __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool isnan(float x) _NOEXCEPT; +#else /* !((defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000) */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(float x); +#endif /* (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000 */ +#if defined(__ANDROID__) || defined(__HORIZON__) +#if !defined(_LIBCPP_VERSION) +__forceinline__ +#endif /* !defined(_LIBCPP_VERSION) */ +#if _LIBCPP_VERSION >= 7000 +#ifdef _LIBCPP_PREFERRED_OVERLOAD +_LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool isnan(double x) _NOEXCEPT; +#endif /* _LIBCPP_PREFERRED_OVERLOAD */ +#else /* _LIBCPP_VERSION < 7000 */ +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(double x); +#endif /* _LIBCPP_VERSION >= 7000 */ +#else /* !(__ANDROID__ || __HORIZON__) */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(double x) throw(); +#endif /* __ANDROID__ */ +#if (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000 +inline _LIBCPP_INLINE_VISIBILITY __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool isnan(long double x) _NOEXCEPT; +#else /* !( (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000) */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isnan(long double x); +#endif /* (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000 */ + +#if (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000 +static __inline__ __cudart_builtin__ __DEVICE_FUNCTIONS_DECL__ unsigned __FLOAT_BITS(float __f); +static __inline__ __cudart_builtin__ __DEVICE_FUNCTIONS_DECL__ unsigned long long __DOUBLE_BITS(double __f); +template +__cudart_builtin__ __DEVICE_FUNCTIONS_DECL__ bool __libcpp_isinf(T) _NOEXCEPT; +inline _LIBCPP_INLINE_VISIBILITY __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool isinf(float x) _NOEXCEPT; +#else /* !( (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000) */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(float x); +#endif /* (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000 */ + +#if defined(__ANDROID__) || defined(__HORIZON__) +#if !defined(_LIBCPP_VERSION) +__forceinline__ +#endif /* !defined(_LIBCPP_VERSION) */ +#if _LIBCPP_VERSION >= 7000 +#ifdef _LIBCPP_PREFERRED_OVERLOAD +_LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool isinf(double x) _NOEXCEPT; +#endif /* _LIBCPP_PREFERRED_OVERLOAD */ +#else /* _LIBCPP_VERSION < 7000 */ +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(double x); +#endif /* _LIBCPP_VERSION >= 7000 */ +#else /* ! (__ANDROID__ || __HORIZON__) */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(double x) throw(); +#endif /* __ANDROID__ || __HORIZON__ */ +#if (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000 +inline _LIBCPP_INLINE_VISIBILITY __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool isinf(long double x) _NOEXCEPT; +#else /* !( (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000) */ +__forceinline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ int isinf(long double x); +#endif /* (defined(__ANDROID__) || defined(__HORIZON__)) && _LIBCPP_VERSION >= 8000 */ +#endif /* __QNX__ */ + +#endif /* ((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L) */ +#endif /* __APPLE__ */ + +#if !defined(_LIBCPP_VERSION) +#if defined(__clang__) +#if __has_include() +#define __NV_GLIBCXX_VERSION 40800 +#endif /* __has_include() */ +#endif /* __clang__ */ + +#if !defined(__NV_GLIBCXX_VERSION) +#define __NV_GLIBCXX_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#endif /* !__NV_GLIBCXX_VERSION */ +#endif /* !defined(_LIBCPP_VERSION) */ + +#if !defined(__HORIZON__) || !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 3800 +#if defined(__arm__) && !defined(_STLPORT_VERSION) && !_GLIBCXX_USE_C99 +#if !defined(__ANDROID__) || (defined(__NV_GLIBCXX_VERSION) && __NV_GLIBCXX_VERSION < 40800) + +#if defined(__QNX__) +/* QNX defines functions in std, need to declare them here */ +namespace std { +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ long long int abs (long long int a); +} +#elif defined(__HORIZON__) +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif +_LIBCPP_BEGIN_NAMESPACE_STD +__DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ long long int abs (long long int a) throw(); +_LIBCPP_END_NAMESPACE_STD +#else +static __inline__ __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ long long int abs(long long int a); +#endif /* __QNX__ || __HORIZON__*/ + +#endif /* !__ANDROID__ || (defined(__NV_GLIBCXX_VERSION) && __NV_GLIBCXX_VERSION < 40800) */ +#endif /* __arm__ && !_STLPORT_VERSION && !_GLIBCXX_USE_C99 */ +#endif /* !defined(__HORIZON__) || !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 3800 */ + +#if defined(__NV_GLIBCXX_VERSION) && __NV_GLIBCXX_VERSION < 40800 && !defined(__ibmxl__) + +#if !defined(_STLPORT_VERSION) +namespace __gnu_cxx +{ +#endif /* !_STLPORT_VERSION */ + +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ long long int abs(long long int a); + +#if !defined(_STLPORT_VERSION) +} +#endif /* !_STLPORT_VERSION */ + +#endif /* defined(__NV_GLIBCXX_VERSION) && __NV_GLIBCXX_VERSION < 40800 && !__ibmxl__ */ + +namespace std +{ + template extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ T __pow_helper(T, int); + template extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ T __cmath_power(T, unsigned int); +} + +using std::abs; +using std::fabs; +using std::ceil; +using std::floor; +using std::sqrt; +#if !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 3800 +using std::pow; +#endif /* !defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 3800 */ +using std::log; +using std::log10; +using std::fmod; +using std::modf; +using std::exp; +using std::frexp; +using std::ldexp; +using std::asin; +using std::sin; +using std::sinh; +using std::acos; +using std::cos; +using std::cosh; +using std::atan; +using std::atan2; +using std::tan; +using std::tanh; + +#elif defined(_WIN32) + +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ __CUDA_MATH_CRTIMP double __cdecl _hypot(double x, double y); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ __CUDA_MATH_CRTIMP float __cdecl _hypotf(float x, float y); + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __DEVICE_FUNCTIONS_DECL__ int signbit(long double a); +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#if _MSC_VER >= 1900 +#define __SIGNBIT_THROW throw() +#else +#define __SIGNBIT_THROW +#endif +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ bool signbit(long double) __SIGNBIT_THROW; +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ __device_builtin__ __CUDA_MATH_CRTIMP int _ldsign(long double); +#undef __SIGNBIT_THROW +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +#define __RETURN_TYPE int +/** + * \ingroup CUDA_MATH_DOUBLE + * + * \brief Return the sign bit of the input. + * + * Determine whether the floating-point value \p a is negative. + * + * \return + * Reports the sign bit of all values including infinities, zeros, and NaNs. + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. Returns + * true if and only if \p a is negative. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns a + * nonzero value if and only if \p a is negative. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE signbit(double a); +#undef __RETURN_TYPE +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#define __RETURN_TYPE bool +#if _MSC_VER >= 1900 +#define __SIGNBIT_THROW throw() +#else +#define __SIGNBIT_THROW +#endif +/** + * \ingroup CUDA_MATH_DOUBLE + * + * \brief Return the sign bit of the input. + * + * Determine whether the floating-point value \p a is negative. + * + * \return + * Reports the sign bit of all values including infinities, zeros, and NaNs. + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. Returns + * true if and only if \p a is negative. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns a + * nonzero value if and only if \p a is negative. + */ +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ __RETURN_TYPE signbit(double) __SIGNBIT_THROW; +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ __device_builtin__ __CUDA_MATH_CRTIMP int _dsign(double); +#undef __RETURN_TYPE +#undef __SIGNBIT_THROW +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +#define __RETURN_TYPE int +/** + * \ingroup CUDA_MATH_SINGLE + * + * \brief Return the sign bit of the input. + * + * Determine whether the floating-point value \p a is negative. + * + * \return + * Reports the sign bit of all values including infinities, zeros, and NaNs. + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. Returns + * true if and only if \p a is negative. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns a nonzero value + * if and only if \p a is negative. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE signbit(float a); +#undef __RETURN_TYPE +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#define __RETURN_TYPE bool +#if _MSC_VER >= 1900 +#define __SIGNBIT_THROW throw() +#else +#define __SIGNBIT_THROW +#endif +/** + * \ingroup CUDA_MATH_SINGLE + * + * \brief Return the sign bit of the input. + * + * Determine whether the floating-point value \p a is negative. + * + * \return + * Reports the sign bit of all values including infinities, zeros, and NaNs. + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. Returns + * true if and only if \p a is negative. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns a nonzero value + * if and only if \p a is negative. + */ +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ __RETURN_TYPE signbit(float) __SIGNBIT_THROW; +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ __device_builtin__ __CUDA_MATH_CRTIMP int _fdsign(float); +#undef __RETURN_TYPE +#undef __SIGNBIT_THROW +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __DEVICE_FUNCTIONS_DECL__ int isinf(long double a); +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isinf(long double a); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +#define __RETURN_TYPE int +/** + * \ingroup CUDA_MATH_DOUBLE + * + * \brief Determine whether argument is infinite. + * + * Determine whether the floating-point value \p a is an infinite value + * (positive or negative). + * \return + * - With Visual Studio 2013 host compiler: Returns true if and only + * if \p a is an infinite value. + * - With other host compilers: Returns a nonzero value if and only + * if \p a is an infinite value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isinf(double a); +#undef __RETURN_TYPE +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#define __RETURN_TYPE bool +/** + * \ingroup CUDA_MATH_DOUBLE + * + * \brief Determine whether argument is infinite. + * + * Determine whether the floating-point value \p a is an infinite value + * (positive or negative). + * \return + * - With Visual Studio 2013 host compiler: Returns true if and only + * if \p a is an infinite value. + * - With other host compilers: Returns a nonzero value if and only + * if \p a is an infinite value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isinf(double a); +#undef __RETURN_TYPE +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +#define __RETURN_TYPE int +/** + * \ingroup CUDA_MATH_SINGLE + * + * \brief Determine whether argument is infinite. + * + * Determine whether the floating-point value \p a is an infinite value + * (positive or negative). + * + * \return + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. Returns + * true if and only if \p a is an infinite value. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns a nonzero + * value if and only if \p a is an infinite value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isinf(float a); +#undef __RETURN_TYPE +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#define __RETURN_TYPE bool +/** + * \ingroup CUDA_MATH_SINGLE + * + * \brief Determine whether argument is infinite. + * + * Determine whether the floating-point value \p a is an infinite value + * (positive or negative). + * + * \return + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. Returns + * true if and only if \p a is an infinite value. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns a nonzero + * value if and only if \p a is an infinite value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isinf(float a); +#undef __RETURN_TYPE +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __DEVICE_FUNCTIONS_DECL__ int isnan(long double a); +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isnan(long double a); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +#define __RETURN_TYPE int +/** + * \ingroup CUDA_MATH_DOUBLE + * + * \brief Determine whether argument is a NaN. + * + * Determine whether the floating-point value \p a is a NaN. + * \return + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. + * Returns true if and only if \p a is a NaN value. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns a + * nonzero value if and only if \p a is a NaN value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isnan(double a); +#undef __RETURN_TYPE +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#define __RETURN_TYPE bool +/** + * \ingroup CUDA_MATH_DOUBLE + * + * \brief Determine whether argument is a NaN. + * + * Determine whether the floating-point value \p a is a NaN. + * \return + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. + * Returns true if and only if \p a is a NaN value. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns a + * nonzero value if and only if \p a is a NaN value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isnan(double a); +#undef __RETURN_TYPE +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +#define __RETURN_TYPE int +/** + * \ingroup CUDA_MATH_SINGLE + * + * + * \brief Determine whether argument is a NaN. + * + * Determine whether the floating-point value \p a is a NaN. + * \return + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. + * Returns true if and only if \p a is a NaN value. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns a + * nonzero value if and only if \p a is a NaN value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isnan(float a); +#undef __RETURN_TYPE +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#define __RETURN_TYPE bool +/** + * \ingroup CUDA_MATH_SINGLE + * + * + * \brief Determine whether argument is a NaN. + * + * Determine whether the floating-point value \p a is a NaN. + * \return + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. + * Returns true if and only if \p a is a NaN value. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns a + * nonzero value if and only if \p a is a NaN value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isnan(float a); +#undef __RETURN_TYPE +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __DEVICE_FUNCTIONS_DECL__ int isfinite(long double a); +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ bool isfinite(long double a); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +#define __RETURN_TYPE int +/** + * \ingroup CUDA_MATH_DOUBLE + * + * \brief Determine whether argument is finite. + * + * Determine whether the floating-point value \p a is a finite value + * (zero, subnormal, or normal and not infinity or NaN). + * + * \return + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. Returns + * true if and only if \p a is a finite value. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns + * a nonzero value if and only if \p a is a finite value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isfinite(double a); +#undef __RETURN_TYPE +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#define __RETURN_TYPE bool +/** + * \ingroup CUDA_MATH_DOUBLE + * + * \brief Determine whether argument is finite. + * + * Determine whether the floating-point value \p a is a finite value + * (zero, subnormal, or normal and not infinity or NaN). + * + * \return + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. Returns + * true if and only if \p a is a finite value. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns + * a nonzero value if and only if \p a is a finite value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isfinite(double a); +#undef __RETURN_TYPE +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +#define __RETURN_TYPE int +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Determine whether argument is finite. + * + * Determine whether the floating-point value \p a is a finite value + * (zero, subnormal, or normal and not infinity or NaN). + * + * \return + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. Returns + * true if and only if \p a is a finite value. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns + * a nonzero value if and only if \p a is a finite value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isfinite(float a); +#undef __RETURN_TYPE +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +#define __RETURN_TYPE bool +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Determine whether argument is finite. + * + * Determine whether the floating-point value \p a is a finite value + * (zero, subnormal, or normal and not infinity or NaN). + * + * \return + * - With Visual Studio 2013 host compiler: __RETURN_TYPE is 'bool'. Returns + * true if and only if \p a is a finite value. + * - With other host compilers: __RETURN_TYPE is 'int'. Returns + * a nonzero value if and only if \p a is a finite value. + */ +static __inline__ __DEVICE_FUNCTIONS_DECL__ __RETURN_TYPE isfinite(float a); +#undef __RETURN_TYPE +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +template extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ T _Pow_int(T, int); +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the absolute value of the input \p long \p long \p int argument. + * + * Calculate the absolute value of the input argument \p a. + * + * \return + * Returns the absolute value of the input argument. + * - abs(\p LLONG_MIN) is \p Undefined + */ +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ long long int abs(long long int a); +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +template extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ T _Pow_int(T, int) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ long long int abs(long long int) throw(); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#endif /* __CUDACC_RTC__ */ + +#if __cplusplus >= 201103L +#define __NV_NOEXCEPT noexcept +#else /* !__cplusplus >= 201103L */ +#define __NV_NOEXCEPT throw() +#endif /* __cplusplus >= 201103L */ + +#if defined(_LIBCPP_VERSION) && defined(_LIBCPP_BEGIN_NAMESPACE_STD) && !defined(_STLPORT_VERSION) +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wc++11-extensions" +#endif /* __clang__ */ +#if _LIBCPP_VERSION < 3800 +_LIBCPP_BEGIN_NAMESPACE_STD +#endif /* _LIBCPP_VERSION < 3800 */ +#elif defined(__GNUC__) && !defined(_STLPORT_VERSION) +namespace std { +#endif /* defined(_LIBCPP_VERSION) && defined(_LIBCPP_BEGIN_NAMESPACE_STD) && !defined(_STLPORT_VERSION) || + __GNUC__ && !_STLPORT_VERSION */ + +#if defined(__CUDACC_RTC__) || defined(__GNUC__) + +#if defined(__CUDACC_RTC__) || \ + (defined(__NV_GLIBCXX_VERSION) && __NV_GLIBCXX_VERSION >= 40800) || \ + defined(__ibmxl__) +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ long long int abs(long long int); +#endif /* __CUDACC__RTC__ || + (defined(__NV_GLIBCXX_VERSION) && __NV_GLIBCXX_VERSION >= 40800) || + __ibmxl__ */ + +#endif /* __CUDACC_RTC__ || __GNUC__ */ + +#if defined(__CUDACC_RTC__) || \ + (!defined(_MSC_VER) || _MSC_VER < 1800) && \ + (!defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)) +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the absolute value of the input \p long \p int argument. + * + * Calculate the absolute value of the input argument \p a. + * + * \return + * Returns the absolute value of the input argument. + * - abs(\p LONG_MIN) is \p Undefined + */ +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ long int __cdecl abs(long int a); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl abs(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ double __cdecl abs(double); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl fabs(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl ceil(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl floor(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl sqrt(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl pow(float, float); + +#if !defined(__QNX__) + +#if defined(__GNUC__) && __cplusplus >= 201103L && !defined(_LIBCPP_VERSION) +template +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ +typename __gnu_cxx::__promote_2<_Tp, _Up>::__type pow(_Tp, _Up); +#else /* !(defined(__GNUC__) && __cplusplus >= 201103L && !defined(_LIBCPP_VERSION)) */ +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl pow(float, int); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ double __cdecl pow(double, int); +#endif /* defined(__GNUC__) && __cplusplus >= 201103L && !defined(_LIBCPP_VERSION) */ + +#endif /* !defined(__QNX__) */ + +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl log(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl log10(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl fmod(float, float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl modf(float, float*); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl exp(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl frexp(float, int*); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl ldexp(float, int); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl asin(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl sin(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl sinh(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl acos(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl cos(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl cosh(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl atan(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl atan2(float, float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl tan(float); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl tanh(float); +#else /* __CUDACC_RTC__ || + (!defined(_MSC_VER) || _MSC_VER < 1800) && + (!defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)) */ +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ long int __cdecl abs(long int) throw(); +#if defined(_LIBCPP_VERSION) +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ long long int __cdecl abs(long long int) throw(); +#endif /* defined(_LIBCPP_VERSION) */ +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl abs(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ double __cdecl abs(double) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl fabs(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl ceil(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl floor(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl sqrt(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl pow(float, float) throw(); +#if defined(_LIBCPP_VERSION) +#if (defined (__ANDROID__) || defined(__HORIZON__)) && (_LIBCPP_VERSION >= 9000) +template +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ +#if _LIBCPP_VERSION >= 14000 +typename std::__enable_if_t +#else /* _LIBCPP_VERSION < 14000 */ +typename std::_EnableIf +#endif /* _LIBCPP_VERSION >= 14000 */ +< + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> +>::type pow(_A1 __lcpp_x, _A2 __lcpp_y) __NV_NOEXCEPT; +#elif (defined(__APPLE__) && __clang_major__ >= 7) || _LIBCPP_VERSION >= 3800 || defined(__QNX__) +template +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ +#if defined(__QNX__) && (_LIBCPP_VERSION >= 160000) +typename std::__enable_if_t < +#elif _LIBCPP_VERSION >= 13000 +typename std::enable_if < +#else /* #defined(__QNX__) && (_LIBCPP_VERSION >= 160000) */ +typename std::__lazy_enable_if < +#endif /* _LIBCPP_VERSION >= 160000 */ + std::is_arithmetic<_Tp>::value && std::is_arithmetic<_Up>::value, + std::__promote<_Tp, _Up> +>::type pow(_Tp __x, _Up __y) __NV_NOEXCEPT; +#else /* !((__APPLE__ && __clang_major__ >= 7) || _LIBCPP_VERSION >= 3800) */ +template +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ +typename enable_if < + std::is_arithmetic<_Tp>::value && std::is_arithmetic<_Up>::value, + typename std::__promote<_Tp, _Up>::type +>::type pow(_Tp __x, _Up __y) __NV_NOEXCEPT; +#endif /* (__APPLE__ && __clang_major__ >= 7) || _LIBCPP_VERSION >= 3800 */ +#else /* !defined(_LIBCPP_VERSION) */ +#if !(defined(__GNUC__) && __cplusplus >= 201103L) +#if (defined(_MSC_VER) && (_MSC_VER >= 1928)) && !(defined __CUDA_INTERNAL_SKIP_CPP_HEADERS__) +template && ::std:: is_arithmetic_v<_Ty2>, int> > [[nodiscard]] __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ ::std:: _Common_float_type_t<_Ty1, _Ty2> __cdecl pow(_Ty1 _Left, _Ty2 _Right) noexcept; +#else +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl pow(float, int) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ double __cdecl pow(double, int) throw(); +#endif /* (defined(_MSC_VER) && (_MSC_VER >= 1928)) && !(defined __CUDA_INTERNAL_SKIP_CPP_HEADERS__) */ +#endif /* !(defined(__GNUC__) && __cplusplus >= 201103L) */ +#endif /* defined(_LIBCPP_VERSION) */ +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl log(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl log10(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl fmod(float, float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl modf(float, float*) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl exp(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl frexp(float, int*) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl ldexp(float, int) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl asin(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl sin(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl sinh(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl acos(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl cos(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl cosh(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl atan(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl atan2(float, float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl tan(float) throw(); +extern __DEVICE_FUNCTIONS_DECL__ __cudart_builtin__ float __cdecl tanh(float) throw(); +#endif /* __CUDACC_RTC__ || + (!defined(_MSC_VER) || _MSC_VER < 1800) && + (!defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)) */ + +#if defined(_LIBCPP_VERSION) && defined(_LIBCPP_END_NAMESPACE_STD) && !defined(_STLPORT_VERSION) +#if _LIBCPP_VERSION < 3800 +_LIBCPP_END_NAMESPACE_STD +#endif /* _LIBCPP_VERSION < 3800 */ +#if defined(__clang__) +#pragma clang diagnostic pop +#endif /* __clang__ */ +#elif defined(__GNUC__) && !defined(_STLPORT_VERSION) +} +#endif /* defined(_LIBCPP_VERSION) && defined(_LIBCPP_BEGIN_NAMESPACE_STD) && !defined(_STLPORT_VERSION) || + __GNUC__ && !_STLPORT_VERSION */ + +#undef __DEVICE_FUNCTIONS_DECL__ +#undef __NV_NOEXCEPT + +#if defined(__CUDACC_RTC__) +#define __MATH_FUNCTIONS_DECL__ __host__ __device__ +#define __MATH_FUNCTIONS_DEVICE_DECL__ __device__ +#else /* __CUDACC_RTC__ */ +#define __MATH_FUNCTIONS_DECL__ static inline __host__ __device__ __cudart_builtin__ +#define __MATH_FUNCTIONS_DEVICE_DECL__ static inline __device__ __cudart_builtin__ +#endif /* __CUDACC_RTC__ */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +#if defined(__QNX__) || (defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 3800) +#if defined(__QNX__) && (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 8000) +#if defined(_LIBCPP_VERSION) +#define __NV_NOEXCEPT _NOEXCEPT +_LIBCPP_BEGIN_NAMESPACE_STD +#else +#define __NV_NOEXCEPT +namespace std { +__host__ __device__ __cudart_builtin__ int ilogbf(float a); +#endif +#else /* !(defined(__QNX__) && (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 8000)) */ +#define __NV_NOEXCEPT _NOEXCEPT +#endif /* defined(__QNX__) && (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 8000) */ +__host__ __device__ __cudart_builtin__ float logb(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ int ilogb(float a) __NV_NOEXCEPT; + +__host__ __device__ __cudart_builtin__ float scalbn(float a, int b) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float scalbln(float a, long int b) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float exp2(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float expm1(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float log2(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float log1p(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float acosh(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float asinh(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float atanh(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float hypot(float a, float b) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float cbrt(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float erf(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float erfc(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float lgamma(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float tgamma(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float copysign(float a, float b) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float nextafter(float a, float b) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float remainder(float a, float b) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float remquo(float a, float b, int *quo) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float round(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ long int lround(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ long long int llround(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float trunc(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float rint(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ long int lrint(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ long long int llrint(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float nearbyint(float a) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float fdim(float a, float b) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float fma(float a, float b, float c) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float fmax(float a, float b) __NV_NOEXCEPT; +__host__ __device__ __cudart_builtin__ float fmin(float a, float b) __NV_NOEXCEPT; +#if defined(__QNX__) && (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 8000) +#if defined(_LIBCPP_VERSION) +_LIBCPP_END_NAMESPACE_STD +using _VSTD::logb; +using _VSTD::ilogb; +using _VSTD::scalbn; +using _VSTD::scalbln; +using _VSTD::exp2; +using _VSTD::expm1; +using _VSTD::log2; +using _VSTD::log1p; +using _VSTD::acosh; +using _VSTD::asinh; +using _VSTD::atanh; +using _VSTD::hypot; +using _VSTD::cbrt; +using _VSTD::erf; +using _VSTD::erfc; +using _VSTD::lgamma; +using _VSTD::tgamma; +using _VSTD::copysign; +using _VSTD::nextafter; +using _VSTD::remainder; +using _VSTD::remquo; +using _VSTD::round; +using _VSTD::lround; +using _VSTD::llround; +using _VSTD::trunc; +using _VSTD::rint; +using _VSTD::lrint; +using _VSTD::llrint; +using _VSTD::nearbyint; +using _VSTD::fdim; +using _VSTD::fma; +using _VSTD::fmax; +using _VSTD::fmin; +#else +} +#endif +#endif /* defined(__QNX__) && (!defined(_LIBCPP_VERSION) || _LIBCPP_VERSION < 8000) */ +#undef __NV_NOEXCEPT +#else /* !(defined(__QNX__ ) || (defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 3800)) */ +#if ((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L) +namespace std { +__host__ __device__ __cudart_builtin__ constexpr float logb(float a); +__host__ __device__ __cudart_builtin__ constexpr int ilogb(float a); +__host__ __device__ __cudart_builtin__ constexpr float scalbn(float a, int b); +__host__ __device__ __cudart_builtin__ constexpr float scalbln(float a, long int b); +__host__ __device__ __cudart_builtin__ constexpr float exp2(float a); +__host__ __device__ __cudart_builtin__ constexpr float expm1(float a); +__host__ __device__ __cudart_builtin__ constexpr float log2(float a); +__host__ __device__ __cudart_builtin__ constexpr float log1p(float a); +__host__ __device__ __cudart_builtin__ constexpr float acosh(float a); +__host__ __device__ __cudart_builtin__ constexpr float asinh(float a); +__host__ __device__ __cudart_builtin__ constexpr float atanh(float a); +__host__ __device__ __cudart_builtin__ constexpr float hypot(float a, float b); +__host__ __device__ __cudart_builtin__ constexpr float cbrt(float a); +__host__ __device__ __cudart_builtin__ constexpr float erf(float a); +__host__ __device__ __cudart_builtin__ constexpr float erfc(float a); +__host__ __device__ __cudart_builtin__ constexpr float lgamma(float a); +__host__ __device__ __cudart_builtin__ constexpr float tgamma(float a); +__host__ __device__ __cudart_builtin__ constexpr float copysign(float a, float b); +__host__ __device__ __cudart_builtin__ constexpr float nextafter(float a, float b); +__host__ __device__ __cudart_builtin__ constexpr float remainder(float a, float b); +__host__ __device__ __cudart_builtin__ float remquo(float a, float b, int *quo); +__host__ __device__ __cudart_builtin__ constexpr float round(float a); +__host__ __device__ __cudart_builtin__ constexpr long int lround(float a); +__host__ __device__ __cudart_builtin__ constexpr long long int llround(float a); +__host__ __device__ __cudart_builtin__ constexpr float trunc(float a); +__host__ __device__ __cudart_builtin__ constexpr float rint(float a); +__host__ __device__ __cudart_builtin__ constexpr long int lrint(float a); +__host__ __device__ __cudart_builtin__ constexpr long long int llrint(float a); +__host__ __device__ __cudart_builtin__ constexpr float nearbyint(float a); +__host__ __device__ __cudart_builtin__ constexpr float fdim(float a, float b); +__host__ __device__ __cudart_builtin__ constexpr float fma(float a, float b, float c); +__host__ __device__ __cudart_builtin__ constexpr float fmax(float a, float b); +__host__ __device__ __cudart_builtin__ constexpr float fmin(float a, float b); +} +#else /* !(((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L)) */ +__MATH_FUNCTIONS_DECL__ float logb(float a); + +__MATH_FUNCTIONS_DECL__ int ilogb(float a); + +__MATH_FUNCTIONS_DECL__ float scalbn(float a, int b); + +__MATH_FUNCTIONS_DECL__ float scalbln(float a, long int b); + +__MATH_FUNCTIONS_DECL__ float exp2(float a); + +__MATH_FUNCTIONS_DECL__ float expm1(float a); + +__MATH_FUNCTIONS_DECL__ float log2(float a); + +__MATH_FUNCTIONS_DECL__ float log1p(float a); + +__MATH_FUNCTIONS_DECL__ float acosh(float a); + +__MATH_FUNCTIONS_DECL__ float asinh(float a); + +__MATH_FUNCTIONS_DECL__ float atanh(float a); + +__MATH_FUNCTIONS_DECL__ float hypot(float a, float b); + +__MATH_FUNCTIONS_DECL__ float cbrt(float a); + +__MATH_FUNCTIONS_DECL__ float erf(float a); + +__MATH_FUNCTIONS_DECL__ float erfc(float a); + +__MATH_FUNCTIONS_DECL__ float lgamma(float a); + +__MATH_FUNCTIONS_DECL__ float tgamma(float a); + +__MATH_FUNCTIONS_DECL__ float copysign(float a, float b); + +__MATH_FUNCTIONS_DECL__ float nextafter(float a, float b); + +__MATH_FUNCTIONS_DECL__ float remainder(float a, float b); + +__MATH_FUNCTIONS_DECL__ float remquo(float a, float b, int *quo); + +__MATH_FUNCTIONS_DECL__ float round(float a); + +__MATH_FUNCTIONS_DECL__ long int lround(float a); + +__MATH_FUNCTIONS_DECL__ long long int llround(float a); + +__MATH_FUNCTIONS_DECL__ float trunc(float a); + +__MATH_FUNCTIONS_DECL__ float rint(float a); + +__MATH_FUNCTIONS_DECL__ long int lrint(float a); + +__MATH_FUNCTIONS_DECL__ long long int llrint(float a); + +__MATH_FUNCTIONS_DECL__ float nearbyint(float a); + +__MATH_FUNCTIONS_DECL__ float fdim(float a, float b); + +__MATH_FUNCTIONS_DECL__ float fma(float a, float b, float c); + +__MATH_FUNCTIONS_DECL__ float fmax(float a, float b); + +__MATH_FUNCTIONS_DECL__ float fmin(float a, float b); +#endif /* ((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L) */ +#endif /* defined(__QNX__) || (defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 3800) */ +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +extern __host__ __device__ __cudart_builtin__ float __cdecl logb(float) throw(); +extern __host__ __device__ __cudart_builtin__ int __cdecl ilogb(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl scalbn(float, float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl scalbln(float, long int) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl exp2(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl expm1(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl log2(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl log1p(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl acosh(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl asinh(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl atanh(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl hypot(float, float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl cbrt(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl erf(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl erfc(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl lgamma(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl tgamma(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl copysign(float, float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl nextafter(float, float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl remainder(float, float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl remquo(float, float, int *) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl round(float) throw(); +extern __host__ __device__ __cudart_builtin__ long int __cdecl lround(float) throw(); +extern __host__ __device__ __cudart_builtin__ long long int __cdecl llround(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl trunc(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl rint(float) throw(); +extern __host__ __device__ __cudart_builtin__ long int __cdecl lrint(float) throw(); +extern __host__ __device__ __cudart_builtin__ long long int __cdecl llrint(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl nearbyint(float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl fdim(float, float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl fma(float, float, float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl fmax(float, float) throw(); +extern __host__ __device__ __cudart_builtin__ float __cdecl fmin(float, float) throw(); +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +__MATH_FUNCTIONS_DECL__ float exp10(const float a); + +__MATH_FUNCTIONS_DECL__ float rsqrt(const float a); + +__MATH_FUNCTIONS_DECL__ float rcbrt(const float a); + +__MATH_FUNCTIONS_DECL__ float sinpi(const float a); + +__MATH_FUNCTIONS_DECL__ float cospi(const float a); + +__MATH_FUNCTIONS_DECL__ void sincospi(const float a, float *const sptr, float *const cptr); + +__MATH_FUNCTIONS_DECL__ void sincos(const float a, float *const sptr, float *const cptr); + +__MATH_FUNCTIONS_DECL__ float j0(const float a); + +__MATH_FUNCTIONS_DECL__ float j1(const float a); + +__MATH_FUNCTIONS_DECL__ float jn(const int n, const float a); + +__MATH_FUNCTIONS_DECL__ float y0(const float a); + +__MATH_FUNCTIONS_DECL__ float y1(const float a); + +__MATH_FUNCTIONS_DECL__ float yn(const int n, const float a); + +__MATH_FUNCTIONS_DEVICE_DECL__ float cyl_bessel_i0(const float a); + +__MATH_FUNCTIONS_DEVICE_DECL__ float cyl_bessel_i1(const float a); + +__MATH_FUNCTIONS_DECL__ float erfinv(const float a); + +__MATH_FUNCTIONS_DECL__ float erfcinv(const float a); + +__MATH_FUNCTIONS_DECL__ float normcdfinv(const float a); + +__MATH_FUNCTIONS_DECL__ float normcdf(const float a); + +__MATH_FUNCTIONS_DECL__ float erfcx(const float a); + +__MATH_FUNCTIONS_DECL__ double copysign(const double a, const float b); + +__MATH_FUNCTIONS_DECL__ double copysign(const float a, const double b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p unsigned \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + */ +__MATH_FUNCTIONS_DECL__ unsigned int min(const unsigned int a, const unsigned int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p int and \p unsigned \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned int min(const int a, const unsigned int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p unsigned \p int and \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned int min(const unsigned int a, const int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p long \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + */ +__MATH_FUNCTIONS_DECL__ long int min(const long int a, const long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p unsigned \p long \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + */ +__MATH_FUNCTIONS_DECL__ unsigned long int min(const unsigned long int a, const unsigned long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p long \p int and \p unsigned \p long \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned long int min(const long int a, const unsigned long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p unsigned \p long \p int and \p long \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned long int min(const unsigned long int a, const long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p long \p long \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + */ +__MATH_FUNCTIONS_DECL__ long long int min(const long long int a, const long long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p unsigned \p long \p long \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + */ +__MATH_FUNCTIONS_DECL__ unsigned long long int min(const unsigned long long int a, const unsigned long long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p long \p long \p int and \p unsigned \p long \p long \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned long long int min(const long long int a, const unsigned long long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the minimum value of the input \p unsigned \p long \p long \p int and \p long \p long \p int arguments. + * + * Calculate the minimum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned long long int min(const unsigned long long int a, const long long int b); + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the minimum value of the input \p float arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + * Behavior is equivalent to ::fminf() function. + * + * Note, this is different from \p std:: specification + */ +__MATH_FUNCTIONS_DECL__ float min(const float a, const float b); + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the minimum value of the input \p float arguments. + * + * Calculate the minimum value of the arguments \p a and \p b. + * Behavior is equivalent to ::fmin() function. + * + * Note, this is different from \p std:: specification + */ +__MATH_FUNCTIONS_DECL__ double min(const double a, const double b); + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the minimum value of the input \p float and \p double arguments. + * + * Convert \p float argument \p a to \p double, followed by ::fmin(). + * + * Note, this is different from \p std:: specification + */ +__MATH_FUNCTIONS_DECL__ double min(const float a, const double b); + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the minimum value of the input \p double and \p float arguments. + * + * Convert \p float argument \p b to \p double, followed by ::fmin(). + * + * Note, this is different from \p std:: specification + */ +__MATH_FUNCTIONS_DECL__ double min(const double a, const float b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p unsigned \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + */ +__MATH_FUNCTIONS_DECL__ unsigned int max(const unsigned int a, const unsigned int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p int and \p unsigned \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned int max(const int a, const unsigned int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p unsigned \p int and \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned int max(const unsigned int a, const int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p long \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + */ +__MATH_FUNCTIONS_DECL__ long int max(const long int a, const long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p unsigned \p long \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + */ +__MATH_FUNCTIONS_DECL__ unsigned long int max(const unsigned long int a, const unsigned long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p long \p int and \p unsigned \p long \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned long int max(const long int a, const unsigned long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p unsigned \p long \p int and \p long \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned long int max(const unsigned long int a, const long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p long \p long \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + */ +__MATH_FUNCTIONS_DECL__ long long int max(const long long int a, const long long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p unsigned \p long \p long \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + */ +__MATH_FUNCTIONS_DECL__ unsigned long long int max(const unsigned long long int a, const unsigned long long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p long \p long \p int and \p unsigned \p long \p long \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned long long int max(const long long int a, const unsigned long long int b); + +/** + * \ingroup CUDA_MATH_INT + * \brief Calculate the maximum value of the input \p unsigned \p long \p long \p int and \p long \p long \p int arguments. + * + * Calculate the maximum value of the arguments \p a and \p b, perform integer promotion first. + */ +__MATH_FUNCTIONS_DECL__ unsigned long long int max(const unsigned long long int a, const long long int b); + +/** + * \ingroup CUDA_MATH_SINGLE + * \brief Calculate the maximum value of the input \p float arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + * Behavior is equivalent to ::fmaxf() function. + * + * Note, this is different from \p std:: specification + */ +__MATH_FUNCTIONS_DECL__ float max(const float a, const float b); + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the maximum value of the input \p float arguments. + * + * Calculate the maximum value of the arguments \p a and \p b. + * Behavior is equivalent to ::fmax() function. + * + * Note, this is different from \p std:: specification + */ +__MATH_FUNCTIONS_DECL__ double max(const double a, const double b); + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the maximum value of the input \p float and \p double arguments. + * + * Convert \p float argument \p a to \p double, followed by ::fmax(). + * + * Note, this is different from \p std:: specification + */ +__MATH_FUNCTIONS_DECL__ double max(const float a, const double b); + +/** + * \ingroup CUDA_MATH_DOUBLE + * \brief Calculate the maximum value of the input \p double and \p float arguments. + * + * Convert \p float argument \p b to \p double, followed by ::fmax(). + * + * Note, this is different from \p std:: specification + */ +__MATH_FUNCTIONS_DECL__ double max(const double a, const float b); + +#undef __MATH_FUNCTIONS_DECL__ +#undef __MATH_FUNCTIONS_DEVICE_DECL__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ +#undef EXCLUDE_FROM_RTC + +extern "C"{ +inline __device__ void *__nv_aligned_device_malloc(size_t size, size_t align) +{ + __device__ void *__nv_aligned_device_malloc_impl(size_t, size_t); + return __nv_aligned_device_malloc_impl(size, align); +} +} + +#endif /* __cplusplus && __CUDACC__ */ + +#define EXCLUDE_FROM_RTC + +#if !defined(__CUDACC__) + +/******************************************************************************* +* * +* ONLY FOR HOST CODE! NOT FOR DEVICE EXECUTION * +* * +*******************************************************************************/ + +#include + +#if defined(_WIN32) +#pragma warning (push) +#pragma warning (disable : 4211) + +#endif /* _WIN32 */ + +__func__(double rsqrt(double a)); + +__func__(double rcbrt(double a)); + +__func__(double sinpi(double a)); + +__func__(double cospi(double a)); + +__func__(void sincospi(double a, double *sptr, double *cptr)); + +__func__(double erfinv(double a)); + +__func__(double erfcinv(double a)); + +__func__(double normcdfinv(double a)); + +__func__(double normcdf(double a)); + +__func__(double erfcx(double a)); + +__func__(float rsqrtf(float a)); + +__func__(float rcbrtf(float a)); + +__func__(float sinpif(float a)); + +__func__(float cospif(float a)); + +__func__(void sincospif(float a, float *sptr, float *cptr)); + +__func__(float erfinvf(float a)); + +__func__(float erfcinvf(float a)); + +__func__(float normcdfinvf(float a)); + +__func__(float normcdff(float a)); + +__func__(float erfcxf(float a)); + +__func__(int min(int a, int b)); + +__func__(unsigned int umin(unsigned int a, unsigned int b)); + +__func__(long long int llmin(long long int a, long long int b)); + +__func__(unsigned long long int ullmin(unsigned long long int a, unsigned long long int b)); + +__func__(int max(int a, int b)); + +__func__(unsigned int umax(unsigned int a, unsigned int b)); + +__func__(long long int llmax(long long int a, long long int b)); + +__func__(unsigned long long int ullmax(unsigned long long int a, unsigned long long int b)); + +#if defined(_WIN32) || defined(__APPLE__) || defined (__ANDROID__) + +__func__(int __isnan(double a)); + +#endif /* _WIN32 || __APPLE__ || __ANDROID__ */ + +#if defined(_WIN32) || defined(__APPLE__) || defined (__QNX__) + +__func__(void sincos(double a, double *sptr, double *cptr)); + +#endif /* _WIN32 || __APPLE__ || __QNX__ */ + +#if defined(_WIN32) || defined(__APPLE__) + +__func__(double exp10(double a)); + +__func__(float exp10f(float a)); + +__func__(void sincosf(float a, float *sptr, float *cptr)); + +__func__(int __isinf(double a)); + +#endif /* _WIN32 || __APPLE__ */ + +#if (defined(_WIN32) && (!defined(_MSC_VER) || _MSC_VER < 1800)) || defined (__ANDROID__) + +__func__(double log2(double a)); + +#endif /* (_WIN32 && (!defined(_MSC_VER) || _MSC_VER < 1800)) || __ANDROID__ */ + +#if defined(_WIN32) + +__func__(int __signbit(double a)); + +__func__(int __finite(double a)); + +__func__(int __signbitl(long double a)); + +__func__(int __signbitf(float a)); + +__func__(int __finitel(long double a)); + +__func__(int __finitef(float a)); + +__func__(int __isinfl(long double a)); + +__func__(int __isinff(float a)); + +__func__(int __isnanl(long double a)); + +__func__(int __isnanf(float a)); + +#endif /* _WIN32 */ + +#if defined(_WIN32) && (!defined(_MSC_VER) || _MSC_VER < 1800) + +__func__(double copysign(double a, double b)); + +__func__(double fmax(double a, double b)); + +__func__(double fmin(double a, double b)); + +__func__(double trunc(double a)); + +__func__(double round(double a)); + +__func__(long int lround(double a)); + +__func__(long long int llround(double a)); + +__func__(double rint(double a)); + +__func__(double nearbyint(double a)); + +__func__(long int lrint(double a)); + +__func__(long long int llrint(double a)); + +__func__(double fdim(double a, double b)); + +__func__(double scalbn(double a, int b)); + +__func__(double scalbln(double a, long int b)); + +__func__(double exp2(double a)); + +__func__(double log1p(double a)); + +__func__(double expm1(double a)); + +__func__(double cbrt(double a)); + +__func__(double acosh(double a)); + +__func__(double asinh(double a)); + +__func__(double atanh(double a)); + +__func__(int ilogb(double a)); + +__func__(double logb(double a)); + +__func__(double remquo(double a, double b, int *quo)); + +__func__(double remainder(double a, double b)); + +__func__(double fma (double a, double b, double c)); + +__func__(double nextafter(double a, double b)); + +__func__(double erf(double a)); + +__func__(double erfc(double a)); + +__func__(double lgamma(double a)); + +__func__(unsigned long long int __internal_host_nan_kernel(const char *s)); + +__func__(double nan(const char *tagp)); + +__func__(double __host_tgamma_kernel(double a)); + +__func__(double __host_stirling_poly(double a)); + +__func__(double __host_tgamma_stirling(double a)); + +__func__(double tgamma(double a)); + +__func__(float fmaxf(float a, float b)); + +__func__(float fminf(float a, float b)); + +__func__(float roundf(float a)); + +__func__(long int lroundf(float a)); + +__func__(long long int llroundf(float a)); + +__func__(float truncf(float a)); + +__func__(float rintf(float a)); + +__func__(float nearbyintf(float a)); + +__func__(long int lrintf(float a)); + +__func__(long long int llrintf(float a)); + +__func__(float logbf(float a)); + +__func__(float scalblnf(float a, long int b)); + +__func__(float log2f(float a)); + +__func__(float exp2f(float a)); + +__func__(float acoshf(float a)); + +__func__(float asinhf(float a)); + +__func__(float atanhf(float a)); + +__func__(float cbrtf(float a)); + +__func__(float expm1f(float a)); + +__func__(float fdimf(float a, float b)); + +__func__(float log1pf(float a)); + +__func__(float scalbnf(float a, int b)); + +__func__(float fmaf(float a, float b, float c)); + +__func__(int ilogbf(float a)); + +__func__(float erff(float a)); + +__func__(float erfcf(float a)); + +__func__(float lgammaf(float a)); + +__func__(float tgammaf(float a)); + +__func__(float remquof(float a, float b, int *quo)); + +__func__(float remainderf(float a, float b)); + +__func__(float copysignf(float a, float b)); + +__func__(float nextafterf(float a, float b)); + +__func__(float nanf(const char *tagp)); + +#endif /* _WIN32 && (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if defined(_WIN32) +#pragma warning (pop) +#endif /* _WIN32 */ + +#endif /* !__CUDACC__ */ + +#undef EXCLUDE_FROM_RTC + +#if !defined(__CUDACC_RTC__) + +#include "math_functions.hpp" + +#endif /* !__CUDACC_RTC__ */ + +#endif /* !__MATH_FUNCTIONS_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_MATH_FUNCTIONS_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_MATH_FUNCTIONS_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/math_functions.hpp b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/math_functions.hpp new file mode 100644 index 0000000000000000000000000000000000000000..cc09b915ea07f8ef376f5c3640f963a09e86dbfd --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/math_functions.hpp @@ -0,0 +1,3398 @@ +/* + * Copyright 1993-2023 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/math_functions.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/math_functions.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_MATH_FUNCTIONS_HPP__ +#endif + +#if !defined(__MATH_FUNCTIONS_HPP__) +#define __MATH_FUNCTIONS_HPP__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__cplusplus) && defined(__CUDACC__) + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "host_defines.h" + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__CUDACC_RTC__) + +__host__ __device__ __cudart_builtin__ int signbit(const float x) { return __signbitf(x); } +__host__ __device__ __cudart_builtin__ int signbit(const double x) { return __signbit(x); } +__host__ __device__ __cudart_builtin__ int signbit(const long double x) { return __signbitl(static_cast(x));} + +__host__ __device__ __cudart_builtin__ int isfinite(const float x) { return __finitef(x); } +__host__ __device__ __cudart_builtin__ int isfinite(const double x) { return __finite(x); } +__host__ __device__ __cudart_builtin__ int isfinite(const long double x) { return __finitel(static_cast(x)); } + +__host__ __device__ __cudart_builtin__ int isnan(const float x) { return __isnanf(x); } +__host__ __device__ __cudart_builtin__ int isnan(const double x) { return __isnan(x); } +__host__ __device__ __cudart_builtin__ int isnan(const long double x) { return __isnanl(static_cast(x)); } + +__host__ __device__ __cudart_builtin__ int isinf(const float x) { return __isinff(x); } +__host__ __device__ __cudart_builtin__ int isinf(const double x) { return __isinf(x); } +__host__ __device__ __cudart_builtin__ int isinf(const long double x) { return __isinfl(static_cast(x)); } + +__host__ __device__ __cudart_builtin__ long long int abs(const long long int a) { return llabs(a); } + +__host__ __device__ __cudart_builtin__ long int abs(const long int in) { return llabs(in); } +__host__ __device__ __cudart_builtin__ float abs(const float in) { return fabsf(in); } +__host__ __device__ __cudart_builtin__ double abs(const double in) { return fabs(in); } +__host__ __device__ __cudart_builtin__ float fabs(const float in) { return fabsf(in); } +__host__ __device__ __cudart_builtin__ float ceil(const float in) { return ceilf(in); } +__host__ __device__ __cudart_builtin__ float floor(const float in) { return floorf(in); } +__host__ __device__ __cudart_builtin__ float sqrt(const float in) { return sqrtf(in); } +__host__ __device__ __cudart_builtin__ float pow(const float a, const float b) { return powf(a, b); } +extern "C" __device__ float powif(float, int); +__host__ __device__ __cudart_builtin__ float pow(const float a, const int b) { return powif(a, b); } +extern "C" __device__ double powi(double, int); +__host__ __device__ __cudart_builtin__ double pow(const double a, const int b) { return powi(a, b); } +__host__ __device__ __cudart_builtin__ float log(const float in) { return logf(in); } +__host__ __device__ __cudart_builtin__ float log10(const float in) { return log10f(in); } +__host__ __device__ __cudart_builtin__ float fmod(const float a, const float b) { return fmodf(a, b); } +__host__ __device__ __cudart_builtin__ float modf(const float a, float*b) { return modff(a, b); } +__host__ __device__ __cudart_builtin__ float exp(const float in) { return expf(in); } +__host__ __device__ __cudart_builtin__ float frexp(const float a, int*b) { return frexpf(a, b); } +__host__ __device__ __cudart_builtin__ float ldexp(const float a, int b) { return ldexpf(a, b); } +__host__ __device__ __cudart_builtin__ float asin(const float in) { return asinf(in); } +__host__ __device__ __cudart_builtin__ float sin(const float in) { return sinf(in); } +__host__ __device__ __cudart_builtin__ float sinh(const float in) { return sinhf(in); } +__host__ __device__ __cudart_builtin__ float acos(const float in) { return acosf(in); } +__host__ __device__ __cudart_builtin__ float cos(const float in) { return cosf(in); } +__host__ __device__ __cudart_builtin__ float cosh(const float in) { return coshf(in); } +__host__ __device__ __cudart_builtin__ float atan(const float in) { return atanf(in); } +__host__ __device__ __cudart_builtin__ float atan2(const float a, const float b) { return atan2f(a, b); } +__host__ __device__ __cudart_builtin__ float tan(const float in) { return tanf(in); } +__host__ __device__ __cudart_builtin__ float tanh(const float in) { return tanhf(in); } + +#elif defined(__GNUC__) + +#undef signbit +#undef isfinite +#undef isnan +#undef isinf + +#if defined(_LIBCPP_VERSION) +extern "C" __device__ float powif(float, int); +extern "C" __device__ double powi(double, int); +#endif /* _LIBCPP_VERSION */ + +#if defined(__APPLE__) +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const float x) { return __signbitf(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const double x) { return __signbitd(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const long double x) { return __signbitl(x);} + +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const float x) { return __isfinitef(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const double x) { return __isfinited(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const long double x) { return __isfinite(x); } + +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const double x) throw() { return __isnand(x); } +#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 7000 +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const float x) { return __isnanf(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const long double x) { return __isnan(x); } +#endif /* defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 7000 */ + +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const double x) throw() { return __isinfd(x); } +#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 7000 +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const float x) { return __isinff(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const long double x) { return __isinf(x); } +#endif /* defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 7000 */ +#else /* __APPLE__ */ + +#if ((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L) +#if defined(__CUDA_ARCH__) +#define __NV_BUILTIN_FUNC_DECL__ __forceinline__ __host__ __device__ __cudart_builtin__ +#if _GLIBCXX_HAVE_OBSOLETE_ISNAN && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC +__NV_BUILTIN_FUNC_DECL__ int isnan(const double a) throw() { return __isnan(a); } +__NV_BUILTIN_FUNC_DECL__ int isinf(const double x) throw() { return __isinf(x); } +#endif /* _GLIBCXX_HAVE_OBSOLETE_ISNAN && !_GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC */ +#undef __NV_BUILTIN_FUNC_DECL__ +#endif /* __CUDA_ARCH */ +#else /* !(((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L)) */ + +#if defined(__QNX__) +#if defined(__QNX__) && defined(_LIBCPP_VERSION) +static __inline__ __host__ __device__ __cudart_builtin__ bool signbit(const float x) +{ +#if defined(__CUDA_ARCH__) + return (__signbitf(x) != 0); +#else /* !__CUDA_ARCH__ */ + return signbit(x); +#endif /* __CUDA_ARCH__ */ +} +static __inline__ __host__ __device__ __cudart_builtin__ bool signbit(const double x) +{ +#if defined(__CUDA_ARCH__) + return (__signbit(x) != 0); +#else /* !__CUDA_ARCH__ */ + return signbit(x); +#endif /* __CUDA_ARCH__ */ +} +static __inline__ __host__ __device__ __cudart_builtin__ bool signbit(const long double x) +{ +#if defined(__CUDA_ARCH__) + return (__signbitl(x) != 0); +#else /* !__CUDA_ARCH__ */ + return signbit(x); +#endif /* __CUDA_ARCH__ */ +} +#endif /* (__QNX__ && _LIBCPP_VERSION) */ + +static __inline__ __host__ __device__ __cudart_builtin__ bool isfinite(const long double a) +{ +#if defined(__CUDA_ARCH__) + return (__finitel(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isfinite(a); +#endif /* defined(__CUDA_ARCH__) */ +} +static __inline__ __host__ __device__ __cudart_builtin__ bool isfinite(const double a) +{ +#if defined(__CUDA_ARCH__) + return (__finite(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isfinite(a); +#endif /* defined(__CUDA_ARCH__) */ +} +static __inline__ __host__ __device__ __cudart_builtin__ bool isfinite(const float a) +{ +#if defined(__CUDA_ARCH__) + return (__finitef(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isfinite(a); +#endif /* defined(__CUDA_ARCH__) */ +} + +static __inline__ __host__ __device__ __cudart_builtin__ bool isnan(const long double a) +{ +#if defined(__CUDA_ARCH__) + return (__isnanl(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isnan(a); +#endif /* defined(__CUDA_ARCH__) */ +} +static __inline__ __host__ __device__ __cudart_builtin__ bool isnan(const double a) +{ +#if defined(__CUDA_ARCH__) + return (__isnan(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isnan(a); +#endif /* defined(__CUDA_ARCH__) */ +} +static __inline__ __host__ __device__ __cudart_builtin__ bool isnan(const float a) +{ +#if defined(__CUDA_ARCH__) + return (__isnanf(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isnan(a); +#endif /* defined(__CUDA_ARCH__) */ +} + +static __inline__ __host__ __device__ __cudart_builtin__ bool isinf(const long double a) +{ +#if defined(__CUDA_ARCH__) + return (__isinfl(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isinf(a); +#endif /* defined(__CUDA_ARCH__) */ +} +static __inline__ __host__ __device__ __cudart_builtin__ bool isinf(const double a) +{ +#if defined(__CUDA_ARCH__) + return (__isinf(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isinf(a); +#endif /* defined(__CUDA_ARCH__) */ +} +static __inline__ __host__ __device__ __cudart_builtin__ bool isinf(const float a) +{ +#if defined(__CUDA_ARCH__) + return (__isinff(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isinf(a); +#endif /* defined(__CUDA_ARCH__) */ +} + +#elif ( (defined(__ANDROID__) || defined(__HORIZON__)) && defined(_LIBCPP_VERSION)) +#if defined(__CUDA_ARCH__) +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const float x) { return __signbitf(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const double x) { return __signbit(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const long double x) { return __signbitl(x);} + +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const float x) { return __finitef(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const double x) { return __finite(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const long double x) { return __finitel(x); } + +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const double x) { return __isnan(x); } +#if _LIBCPP_VERSION < 8000 +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const float x) { return __isnanf(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const long double x) { return __isnanl(x); } +#endif /* _LIBCPP_VERSION < 8000 */ + +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const double x) { return __isinf(x); } +#if _LIBCPP_VERSION < 8000 +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const float x) { return __isinff(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const long double x) { return __isinfl(x); } +#endif /* _LIBCPP_VERSION < 8000 */ +#else /* !defined(__CUDA_ARCH__) */ +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const float x) { return signbit(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const double x) { return signbit(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const long double x) { return signbit(x);} + +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const float x) { return isfinite(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const double x) { return isfinite(x); } +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const long double x) { return isfinite(x); } + +#if _LIBCPP_VERSION < 8000 +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const float x) { return isnan(x); } +/* int isnan(double) provided by math.h */ +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const long double x) { return isnan(x); } + +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const float x) { return isinf(x); } +/* int isinf(double) provided by math.h */ +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const long double x) { return isinf(x); } +#endif /* _LIBCPP_VERSION < 8000 */ + +#endif /* defined(__CUDA_ARCH__) */ + +#else /* !__QNX__ */ +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const float x) { return __signbitf(x); } +#if defined(__ICC) +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const double x) throw() { return __signbit(x); } +#else /* !__ICC */ +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const double x) { return __signbit(x); } +#endif /* __ICC */ +__forceinline__ __host__ __device__ __cudart_builtin__ int signbit(const long double x) { return __signbitl(x);} + +#if defined(__ANDROID__) +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const float x) { +#if defined(__CUDA_ARCH__) + return __finitef(x); +#else /* !__CUDA_ARCH__ */ + return __isfinitef(x); +#endif /* __CUDA_ARCH__ */ +} +#else /* !__ANDROID__ */ +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const float x) { return __finitef(x); } +#endif /* __ANDROID__ */ + +#if defined(__ANDROID__) +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const double x) +{ +#ifdef __CUDA_ARCH__ + return __finite(x); +#else /* !__CUDA_ARCH__ */ + return __isfinite(x); +#endif /* __CUDA_ARCH__ */ +} +#elif defined(__ICC) +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const double x) throw() { return __finite(x); } +#else +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const double x) { return __finite(x); } +#endif /* __ANDROID__ */ + +#if defined(__ANDROID__) +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const long double x) +{ +#ifdef __CUDA_ARCH__ + return __finitel(x); +#else /* !__CUDA_ARCH__ */ + return __isfinitel(x); +#endif /* __CUDA_ARCH__ */ +} +#else /* !__ANDROID__ */ +__forceinline__ __host__ __device__ __cudart_builtin__ int isfinite(const long double x) { return __finitel(x); } +#endif /* __ANDROID__ */ + +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const float x) { return __isnanf(x); } +#if defined(__ANDROID__) +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const double x) { return __isnan(x); } +#else /* !__ANDROID__ */ +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const double x) throw() { return __isnan(x); } +#endif /* __ANDROID__ */ +__forceinline__ __host__ __device__ __cudart_builtin__ int isnan(const long double x) { return __isnanl(x); } + +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const float x) { return __isinff(x); } +#if defined(__ANDROID__) +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const double x) { return __isinf(x); } +#else /* !__ANDROID__ */ +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const double x) throw() { return __isinf(x); } +#endif /* __ANDROID__ */ +__forceinline__ __host__ __device__ __cudart_builtin__ int isinf(const long double x) { return __isinfl(x); } +#endif /* __QNX__ || __HORIZON__ */ + +#endif /* ((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L) */ +#endif /* __APPLE__ */ + +#if defined(__arm__) && !defined(_STLPORT_VERSION) && !_GLIBCXX_USE_C99 +#if !defined(__ANDROID__) || (!defined(_LIBCPP_VERSION) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))) + +#if !defined(__QNX__) && !defined(__HORIZON__) +static __inline__ __host__ __device__ __cudart_builtin__ long long int abs(const long long int a) +{ + return llabs(a); +} +#endif /* !__QNX__ && !__HORIZON__*/ + +#endif /* !defined(__ANDROID__) || (!defined(_LIBCPP_VERSION) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8))) */ +#endif /* __arm__ && !_STLPORT_VERSION && !_GLIBCXX_USE_C99 */ + +#elif defined(_WIN32) + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __host__ __device__ __cudart_builtin__ int signbit(const long double a) +{ + return __signbitl(a); +} + +static __inline__ __host__ __device__ __cudart_builtin__ int signbit(const double a) +{ + return __signbit(a); +} + +static __inline__ __host__ __device__ __cudart_builtin__ int signbit(const float a) +{ + return __signbitf(a); +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __host__ __device__ __cudart_builtin__ int isinf(const long double a) +{ + return __isinfl(a); +} +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __host__ __device__ __cudart_builtin__ bool isinf(const long double a) +{ +#if defined(__CUDA_ARCH__) + return (__isinfl(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isinf(a); +#endif /* defined(__CUDA_ARCH__) */ +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __host__ __device__ __cudart_builtin__ int isinf(const double a) +{ + return __isinf(a); +} +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __host__ __device__ __cudart_builtin__ bool isinf(const double a) +{ +#if defined(__CUDA_ARCH__) + return (__isinf(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isinf(a); +#endif /* defined(__CUDA_ARCH__) */ +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __host__ __device__ __cudart_builtin__ int isinf(const float a) +{ + return __isinff(a); +} +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __host__ __device__ bool isinf(const float a) +{ +#if defined(__CUDA_ARCH__) + return (__isinff(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isinf(a); +#endif /* defined(__CUDA_ARCH__) */ +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __host__ __device__ __cudart_builtin__ int isnan(const long double a) +{ + return __isnanl(a); +} +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __host__ __device__ __cudart_builtin__ bool isnan(const long double a) +{ +#if defined(__CUDA_ARCH__) + return (__isnanl(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isnan(a); +#endif /* defined(__CUDA_ARCH__) */ +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __host__ __device__ __cudart_builtin__ int isnan(const double a) +{ + return __isnan(a); +} +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __host__ __device__ __cudart_builtin__ bool isnan(const double a) +{ +#if defined(__CUDA_ARCH__) + return (__isnan(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isnan(a); +#endif /* defined(__CUDA_ARCH__) */ +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __host__ __device__ __cudart_builtin__ int isnan(const float a) +{ + return __isnanf(a); +} +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __host__ __device__ __cudart_builtin__ bool isnan(const float a) +{ +#if defined(__CUDA_ARCH__) + return (__isnanf(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isnan(a); +#endif /* defined(__CUDA_ARCH__) */ +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __host__ __device__ __cudart_builtin__ int isfinite(const long double a) +{ + return __finitel(a); +} +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __host__ __device__ __cudart_builtin__ bool isfinite(const long double a) +{ +#if defined(__CUDA_ARCH__) + return (__finitel(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isfinite(a); +#endif /* defined(__CUDA_ARCH__) */ +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __host__ __device__ __cudart_builtin__ int isfinite(const double a) +{ + return __finite(a); +} +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __host__ __device__ __cudart_builtin__ bool isfinite(const double a) +{ +#if defined(__CUDA_ARCH__) + return (__finite(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isfinite(a); +#endif /* defined(__CUDA_ARCH__) */ +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +static __inline__ __host__ __device__ __cudart_builtin__ int isfinite(const float a) +{ + return __finitef(a); +} +#else /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ +static __inline__ __host__ __device__ __cudart_builtin__ bool isfinite(const float a) +{ +#if defined(__CUDA_ARCH__) + return (__finitef(a) != 0); +#else /* defined(__CUDA_ARCH__) */ + return isfinite(a); +#endif /* defined(__CUDA_ARCH__) */ +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#endif /* __CUDACC_RTC__ */ + +#if defined(__CUDACC_RTC__) +#define __MATH_FUNCTIONS_DECL__ __host__ __device__ +#define __MATH_FUNCTIONS_DEVICE_DECL__ __device__ +#else /* __CUDACC_RTC__ */ +#define __MATH_FUNCTIONS_DECL__ static inline __host__ __device__ +#define __MATH_FUNCTIONS_DEVICE_DECL__ static inline __device__ +#endif /* __CUDACC_RTC__ */ + +#if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) || _MSC_VER < 1800) +#if defined(__QNX__) && defined(_LIBCPP_VERSION) +_LIBCPP_BEGIN_NAMESPACE_STD +#endif /* __QNX__ && _LIBCPP_VERSION */ +#if !defined(__QNX__) && !(defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 3800) +#if !(((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L)) +__MATH_FUNCTIONS_DECL__ float logb(const float a) +{ + return logbf(a); +} + +__MATH_FUNCTIONS_DECL__ int ilogb(const float a) +{ + return ilogbf(a); +} + +__MATH_FUNCTIONS_DECL__ float scalbn(const float a, const int b) +{ + return scalbnf(a, b); +} + +__MATH_FUNCTIONS_DECL__ float scalbln(const float a, const long int b) +{ + return scalblnf(a, b); +} + +__MATH_FUNCTIONS_DECL__ float exp2(const float a) +{ + return exp2f(a); +} + +__MATH_FUNCTIONS_DECL__ float expm1(const float a) +{ + return expm1f(a); +} + +__MATH_FUNCTIONS_DECL__ float log2(const float a) +{ + return log2f(a); +} + +__MATH_FUNCTIONS_DECL__ float log1p(const float a) +{ + return log1pf(a); +} + +__MATH_FUNCTIONS_DECL__ float acosh(const float a) +{ + return acoshf(a); +} + +__MATH_FUNCTIONS_DECL__ float asinh(const float a) +{ + return asinhf(a); +} + +__MATH_FUNCTIONS_DECL__ float atanh(const float a) +{ + return atanhf(a); +} + +__MATH_FUNCTIONS_DECL__ float hypot(const float a, const float b) +{ + return hypotf(a, b); +} + +__MATH_FUNCTIONS_DECL__ float cbrt(const float a) +{ + return cbrtf(a); +} + +__MATH_FUNCTIONS_DECL__ float erf(const float a) +{ + return erff(a); +} + +__MATH_FUNCTIONS_DECL__ float erfc(const float a) +{ + return erfcf(a); +} + +__MATH_FUNCTIONS_DECL__ float lgamma(const float a) +{ + return lgammaf(a); +} + +__MATH_FUNCTIONS_DECL__ float tgamma(const float a) +{ + return tgammaf(a); +} + +__MATH_FUNCTIONS_DECL__ float copysign(const float a, const float b) +{ + return copysignf(a, b); +} + +__MATH_FUNCTIONS_DECL__ float nextafter(const float a, const float b) +{ + return nextafterf(a, b); +} + +__MATH_FUNCTIONS_DECL__ float remainder(const float a, const float b) +{ + return remainderf(a, b); +} + +__MATH_FUNCTIONS_DECL__ float remquo(const float a, const float b, int *quo) +{ + return remquof(a, b, quo); +} + +__MATH_FUNCTIONS_DECL__ float round(const float a) +{ + return roundf(a); +} + +__MATH_FUNCTIONS_DECL__ long int lround(const float a) +{ + return lroundf(a); +} + +__MATH_FUNCTIONS_DECL__ long long int llround(const float a) +{ + return llroundf(a); +} + +__MATH_FUNCTIONS_DECL__ float trunc(const float a) +{ + return truncf(a); +} + +__MATH_FUNCTIONS_DECL__ float rint(const float a) +{ + return rintf(a); +} + +__MATH_FUNCTIONS_DECL__ long int lrint(const float a) +{ + return lrintf(a); +} + +__MATH_FUNCTIONS_DECL__ long long int llrint(const float a) +{ + return llrintf(a); +} + +__MATH_FUNCTIONS_DECL__ float nearbyint(const float a) +{ + return nearbyintf(a); +} + +__MATH_FUNCTIONS_DECL__ float fdim(const float a, const float b) +{ + return fdimf(a, b); +} + +__MATH_FUNCTIONS_DECL__ float fma(const float a, const float b, const float c) +{ + return fmaf(a, b, c); +} + +__MATH_FUNCTIONS_DECL__ float fmax(const float a, const float b) +{ + return fmaxf(a, b); +} + +__MATH_FUNCTIONS_DECL__ float fmin(const float a, const float b) +{ + return fminf(a, b); +} +#endif /* !(((defined _GLIBCXX_MATH_H) && _GLIBCXX_MATH_H) && (__cplusplus >= 201103L)) */ +#endif /* !(!defined(__QNX__) && !(defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 3800)) */ +#if defined(__QNX__) && defined(_LIBCPP_VERSION) +_LIBCPP_END_NAMESPACE_STD +#endif +#endif /* __CUDACC_RTC__ || (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +__MATH_FUNCTIONS_DECL__ float exp10(const float a) +{ + return exp10f(a); +} + +__MATH_FUNCTIONS_DECL__ float rsqrt(const float a) +{ + return rsqrtf(a); +} + +__MATH_FUNCTIONS_DECL__ float rcbrt(const float a) +{ + return rcbrtf(a); +} + +__MATH_FUNCTIONS_DECL__ float sinpi(const float a) +{ + return sinpif(a); +} + +__MATH_FUNCTIONS_DECL__ float cospi(const float a) +{ + return cospif(a); +} + +__MATH_FUNCTIONS_DECL__ void sincospi(const float a, float *const sptr, float *const cptr) +{ + sincospif(a, sptr, cptr); +} + +__MATH_FUNCTIONS_DECL__ void sincos(const float a, float *const sptr, float *const cptr) +{ + sincosf(a, sptr, cptr); +} + +__MATH_FUNCTIONS_DECL__ float j0(const float a) +{ + return j0f(a); +} + +__MATH_FUNCTIONS_DECL__ float j1(const float a) +{ + return j1f(a); +} + +__MATH_FUNCTIONS_DECL__ float jn(const int n, const float a) +{ + return jnf(n, a); +} + +__MATH_FUNCTIONS_DECL__ float y0(const float a) +{ + return y0f(a); +} + +__MATH_FUNCTIONS_DECL__ float y1(const float a) +{ + return y1f(a); +} + +__MATH_FUNCTIONS_DECL__ float yn(const int n, const float a) +{ + return ynf(n, a); +} + +__MATH_FUNCTIONS_DEVICE_DECL__ float cyl_bessel_i0(const float a) +{ + return cyl_bessel_i0f(a); +} + +__MATH_FUNCTIONS_DEVICE_DECL__ float cyl_bessel_i1(const float a) +{ + return cyl_bessel_i1f(a); +} + +__MATH_FUNCTIONS_DECL__ float erfinv(const float a) +{ + return erfinvf(a); +} + +__MATH_FUNCTIONS_DECL__ float erfcinv(const float a) +{ + return erfcinvf(a); +} + +__MATH_FUNCTIONS_DECL__ float normcdfinv(const float a) +{ + return normcdfinvf(a); +} + +__MATH_FUNCTIONS_DECL__ float normcdf(const float a) +{ + return normcdff(a); +} + +__MATH_FUNCTIONS_DECL__ float erfcx(const float a) +{ + return erfcxf(a); +} + +__MATH_FUNCTIONS_DECL__ double copysign(const double a, const float b) +{ + return copysign(a, static_cast(b)); +} + +__MATH_FUNCTIONS_DECL__ double copysign(const float a, const double b) +{ + return copysign(static_cast(a), b); +} + +__MATH_FUNCTIONS_DECL__ unsigned int min(const unsigned int a, const unsigned int b) +{ + return umin(a, b); +} + +__MATH_FUNCTIONS_DECL__ unsigned int min(const int a, const unsigned int b) +{ + return umin(static_cast(a), b); +} + +__MATH_FUNCTIONS_DECL__ unsigned int min(const unsigned int a, const int b) +{ + return umin(a, static_cast(b)); +} + +__MATH_FUNCTIONS_DECL__ long int min(const long int a, const long int b) +{ + long int retval; + /* Suppress VS warning: warning C4127: conditional expression is constant */ +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (push) +#pragma warning (disable: 4127) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + /* long can be of 32-bit type on some systems. */ + if (sizeof(long int) == sizeof(int)) { +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (pop) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + retval = static_cast(min(static_cast(a), static_cast(b))); + } else { + retval = static_cast(llmin(static_cast(a), static_cast(b))); + } + return retval; +} + +__MATH_FUNCTIONS_DECL__ unsigned long int min(const unsigned long int a, const unsigned long int b) +{ + unsigned long int retval; +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (push) +#pragma warning (disable: 4127) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + if (sizeof(unsigned long int) == sizeof(unsigned int)) { +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (pop) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + retval = static_cast(umin(static_cast(a), static_cast(b))); + } else { + retval = static_cast(ullmin(static_cast(a), static_cast(b))); + } + return retval; +} + +__MATH_FUNCTIONS_DECL__ unsigned long int min(const long int a, const unsigned long int b) +{ + unsigned long int retval; +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (push) +#pragma warning (disable: 4127) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + if (sizeof(unsigned long int) == sizeof(unsigned int)) { +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (pop) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + retval = static_cast(umin(static_cast(a), static_cast(b))); + } else { + retval = static_cast(ullmin(static_cast(a), static_cast(b))); + } + return retval; +} + +__MATH_FUNCTIONS_DECL__ unsigned long int min(const unsigned long int a, const long int b) +{ + unsigned long int retval; +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (push) +#pragma warning (disable: 4127) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + if (sizeof(unsigned long int) == sizeof(unsigned int)) { +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (pop) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + retval = static_cast(umin(static_cast(a), static_cast(b))); + } else { + retval = static_cast(ullmin(static_cast(a), static_cast(b))); + } + return retval; +} + +__MATH_FUNCTIONS_DECL__ long long int min(const long long int a, const long long int b) +{ + return llmin(a, b); +} + +__MATH_FUNCTIONS_DECL__ unsigned long long int min(const unsigned long long int a, const unsigned long long int b) +{ + return ullmin(a, b); +} + +__MATH_FUNCTIONS_DECL__ unsigned long long int min(const long long int a, const unsigned long long int b) +{ + return ullmin(static_cast(a), b); +} + +__MATH_FUNCTIONS_DECL__ unsigned long long int min(const unsigned long long int a, const long long int b) +{ + return ullmin(a, static_cast(b)); +} + +__MATH_FUNCTIONS_DECL__ float min(const float a, const float b) +{ + return fminf(a, b); +} + +__MATH_FUNCTIONS_DECL__ double min(const double a, const double b) +{ + return fmin(a, b); +} + +__MATH_FUNCTIONS_DECL__ double min(const float a, const double b) +{ + return fmin(static_cast(a), b); +} + +__MATH_FUNCTIONS_DECL__ double min(const double a, const float b) +{ + return fmin(a, static_cast(b)); +} + +__MATH_FUNCTIONS_DECL__ unsigned int max(const unsigned int a, const unsigned int b) +{ + return umax(a, b); +} + +__MATH_FUNCTIONS_DECL__ unsigned int max(const int a, const unsigned int b) +{ + return umax(static_cast(a), b); +} + +__MATH_FUNCTIONS_DECL__ unsigned int max(const unsigned int a, const int b) +{ + return umax(a, static_cast(b)); +} + +__MATH_FUNCTIONS_DECL__ long int max(const long int a, const long int b) +{ + long int retval; + /* long can be of 32-bit type on some systems. */ +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (push) +#pragma warning (disable: 4127) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + if (sizeof(long int) == sizeof(int)) { +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (pop) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + retval = static_cast(max(static_cast(a), static_cast(b))); + } else { + retval = static_cast(llmax(static_cast(a), static_cast(b))); + } + return retval; +} + +__MATH_FUNCTIONS_DECL__ unsigned long int max(const unsigned long int a, const unsigned long int b) +{ + unsigned long int retval; +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (push) +#pragma warning (disable: 4127) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + if (sizeof(unsigned long int) == sizeof(unsigned int)) { +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (pop) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + retval = static_cast(umax(static_cast(a), static_cast(b))); + } else { + retval = static_cast(ullmax(static_cast(a), static_cast(b))); + } + return retval; +} + +__MATH_FUNCTIONS_DECL__ unsigned long int max(const long int a, const unsigned long int b) +{ + unsigned long int retval; +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (push) +#pragma warning (disable: 4127) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + if (sizeof(unsigned long int) == sizeof(unsigned int)) { +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (pop) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + retval = static_cast(umax(static_cast(a), static_cast(b))); + } else { + retval = static_cast(ullmax(static_cast(a), static_cast(b))); + } + return retval; +} + +__MATH_FUNCTIONS_DECL__ unsigned long int max(const unsigned long int a, const long int b) +{ + unsigned long int retval; +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (push) +#pragma warning (disable: 4127) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + if (sizeof(unsigned long int) == sizeof(unsigned int)) { +#if defined(_MSC_VER) && !defined(__CUDA_ARCH__) +#pragma warning (pop) +#endif /* _MSC_VER && !defined(__CUDA_ARCH__) */ + retval = static_cast(umax(static_cast(a), static_cast(b))); + } else { + retval = static_cast(ullmax(static_cast(a), static_cast(b))); + } + return retval; +} + +__MATH_FUNCTIONS_DECL__ long long int max(const long long int a, const long long int b) +{ + return llmax(a, b); +} + +__MATH_FUNCTIONS_DECL__ unsigned long long int max(const unsigned long long int a, const unsigned long long int b) +{ + return ullmax(a, b); +} + +__MATH_FUNCTIONS_DECL__ unsigned long long int max(const long long int a, const unsigned long long int b) +{ + return ullmax(static_cast(a), b); +} + +__MATH_FUNCTIONS_DECL__ unsigned long long int max(const unsigned long long int a, const long long int b) +{ + return ullmax(a, static_cast(b)); +} + +__MATH_FUNCTIONS_DECL__ float max(const float a, const float b) +{ + return fmaxf(a, b); +} + +__MATH_FUNCTIONS_DECL__ double max(const double a, const double b) +{ + return fmax(a, b); +} + +__MATH_FUNCTIONS_DECL__ double max(const float a, const double b) +{ + return fmax(static_cast(a), b); +} + +__MATH_FUNCTIONS_DECL__ double max(const double a, const float b) +{ + return fmax(a, static_cast(b)); +} + + +#if !defined(__CUDA_ARCH__) +#if defined(_WIN32) +#define __HELPER_FUNC_LINKAGE static inline __host__ __device__ +#pragma warning (push) +#pragma warning (disable : 4211) +#else /* !defined(_WIN32) */ +#define __HELPER_FUNC_LINKAGE inline __host__ __device__ +#endif /* defined(_WIN32) */ + +__HELPER_FUNC_LINKAGE int min(const int a, const int b) +{ + return (a < b) ? a : b; +} + +__HELPER_FUNC_LINKAGE unsigned int umin(const unsigned int a, const unsigned int b) +{ + return (a < b) ? a : b; +} + +__HELPER_FUNC_LINKAGE long long int llmin(const long long int a, const long long int b) +{ + return (a < b) ? a : b; +} + +__HELPER_FUNC_LINKAGE unsigned long long int ullmin(const unsigned long long int a, + const unsigned long long int b) +{ + return (a < b) ? a : b; +} + +__HELPER_FUNC_LINKAGE int max(const int a, const int b) +{ + return (a > b) ? a : b; +} + +__HELPER_FUNC_LINKAGE unsigned int umax(const unsigned int a, const unsigned int b) +{ + return (a > b) ? a : b; +} + +__HELPER_FUNC_LINKAGE long long int llmax(const long long int a, const long long int b) +{ + return (a > b) ? a : b; +} + +__HELPER_FUNC_LINKAGE unsigned long long int ullmax(const unsigned long long int a, + const unsigned long long int b) +{ + return (a > b) ? a : b; +} + +#if defined(_WIN32) +#pragma warning (pop) +#endif /* defined(_WIN32) */ + +#undef __HELPER_FUNC_LINKAGE + +#endif /* !defined(__CUDA_ARCH__) */ + +#undef __MATH_FUNCTIONS_DECL__ +#undef __MATH_FUNCTIONS_DEVICE_DECL__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#endif /* __cplusplus && __CUDACC__ */ +#if !defined(__CUDACC__) + +#include "host_defines.h" +#include "math_constants.h" + +#define __cuda_INT_MAX \ + ((int)((unsigned int)-1 >> 1)) + +/******************************************************************************* +* * +* ONLY FOR HOST CODE! NOT FOR DEVICE EXECUTION * +* * +*******************************************************************************/ + +#include + +#if defined(_WIN32) +#pragma warning (push) +#pragma warning (disable : 4211) + +#endif /* _WIN32 */ + +#if defined(_WIN32) || defined(__APPLE__) || defined (__ANDROID__) || defined(__QNX__) + +__func__(int __isnan(const double a)) +{ + unsigned long long int l; + memcpy(&l, &a, sizeof(double)); + return (l << 1ULL) > 0xffe0000000000000ULL; +} + +#endif /* _WIN32 || __APPLE__ || __ANDROID__ || __QNX__ */ + +#if defined(_WIN32) || defined(__APPLE__) || defined(__QNX__) + +/******************************************************************************* +* * +* HOST IMPLEMENTATION FOR DOUBLE ROUTINES FOR WINDOWS & APPLE PLATFORMS * +* * +*******************************************************************************/ + +__func__(double exp10(const double a)) +{ + return pow(10.0, a); +} + +__func__(float exp10f(const float a)) +{ + return static_cast(exp10(static_cast(a))); +} + +__func__(void sincos(const double a, double *sptr, double *cptr)) +{ + *sptr = sin(a); + *cptr = cos(a); +} + +__func__(void sincosf(const float a, float *sptr, float *cptr)) +{ + double s, c; + + sincos(static_cast(a), &s, &c); + *sptr = static_cast(s); + *cptr = static_cast(c); +} + +__func__(int __isinf(const double a)) +{ + unsigned long long int l; + memcpy(&l, &a, sizeof(double)); + return (l << 1ULL) == 0xffe0000000000000ULL; +} + +#endif /* _WIN32 || __APPLE__ */ + +#if defined(_WIN32) || defined (__ANDROID__) + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +__func__(double log2(const double a)) +{ + return log(a) * 1.44269504088896340; +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#endif /* _WIN32 || __ANDROID__ */ + +#if defined(_WIN32) + +/******************************************************************************* +* * +* HOST IMPLEMENTATION FOR DOUBLE ROUTINES FOR WINDOWS PLATFORM * +* * +*******************************************************************************/ + +__func__(int __signbit(double a)) +{ + signed long long int l; + memcpy(&l, &a, sizeof(double)); + return l < 0LL; +} + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +__func__(double copysign(double a, double b)) +{ + unsigned long long int la, lb; + memcpy(&la, &a, sizeof(double)); + memcpy(&lb, &b, sizeof(double)); + la = (la & 0x7fffffffffffffffULL) | (lb & 0x8000000000000000ULL); + memcpy(&a, &la, sizeof(double)); + return a; +} +#endif /* MSC_VER < 1800 */ + +__func__(int __finite(double a)) +{ + unsigned long long int l; + memcpy(&l, &a, sizeof(double)); + return (l << 1ULL) < 0xffe0000000000000ULL; +} + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +__func__(double fmax(double a, double b)) +{ + if (__isnan(a) && __isnan(b)) return a + b; + if (__isnan(a)) return b; + if (__isnan(b)) return a; + if ((a == 0.0) && (b == 0.0) && __signbit(b)) return a; + return a > b ? a : b; +} + +__func__(double fmin(double a, double b)) +{ + if (__isnan(a) && __isnan(b)) return a + b; + if (__isnan(a)) return b; + if (__isnan(b)) return a; + if ((a == 0.0) && (b == 0.0) && __signbit(a)) return a; + return a < b ? a : b; +} + +__func__(double trunc(double a)) +{ + return a < 0.0 ? ceil(a) : floor(a); +} + +__func__(double round(double a)) +{ + double fa = fabs(a); + + if (fa > CUDART_TWO_TO_52) { + return a; + } else { + double u = floor(fa + 0.5); + if (fa < 0.5) u = 0; + u = copysign (u, a); + return u; + } +} + +__func__(long int lround(double a)) +{ + return static_cast(round(a)); +} + +__func__(long long int llround(double a)) +{ + return static_cast(round(a)); +} + +__func__(double rint(double a)) +{ + double fa = fabs(a); + double u = CUDART_TWO_TO_52 + fa; + if (fa >= CUDART_TWO_TO_52) { + u = a; + } else { + u = u - CUDART_TWO_TO_52; + u = copysign (u, a); + } + return u; +} + +__func__(double nearbyint(double a)) +{ + return rint(a); +} + +__func__(long int lrint(double a)) +{ + return static_cast(rint(a)); +} + +__func__(long long int llrint(double a)) +{ + return static_cast(rint(a)); +} + +__func__(double fdim(double a, double b)) +{ + if (a > b) { + return (a - b); + } else if (a <= b) { + return 0.0; + } else if (__isnan(a)) { + return a; + } else { + return b; + } +} + +__func__(double scalbn(double a, int b)) +{ + return ldexp(a, b); +} + +__func__(double scalbln(double a, long int b)) +{ + int t; + + if (b > 2147483647L) { + t = 2147483647; + } else if (b < (-2147483647 - 1)) { + t = (-2147483647 - 1); + } else { + t = static_cast(b); + } + return scalbn(a, t); +} + +__func__(double exp2(double a)) +{ + return pow(2.0, a); +} + +/* + * The following is based on: David Goldberg, "What every computer scientist + * should know about floating-point arithmetic", ACM Computing Surveys, Volume + * 23, Issue 1, March 1991. + */ +__func__(double log1p(double a)) +{ + volatile double u, m; + + u = 1.0 + a; + if (u == 1.0) { + /* a very close to zero */ + u = a; + } else { + m = u - 1.0; + u = log(u); + if (a < 1.0) { + /* a somewhat close to zero */ + u = a * u; + u = u / m; + } + } + return u; +} + +/* + * This code based on: http://www.cs.berkeley.edu/~wkahan/Math128/Sumnfp.pdf + */ +__func__(double expm1(double a)) +{ + volatile double u, m; + + u = exp(a); + m = u - 1.0; + if (m == 0.0) { + /* a very close zero */ + m = a; + } + else if (fabs(a) < 1.0) { + /* a somewhat close zero */ + u = log(u); + m = m * a; + m = m / u; + } + return m; +} + +__func__(double cbrt(double a)) +{ + double s, t; + + if (a == 0.0 || __isinf(a)) { + return a; + } + s = fabs(a); + t = exp2(CUDART_THIRD * log2(s)); /* initial approximation */ + t = t - (t - (s / (t * t))) * CUDART_THIRD; /* refine approximation */ + t = copysign(t, a); + return t; +} + +__func__(double acosh(double a)) +{ + double s, t; + + t = a - 1.0; + if (t == a) { + return log(2.0) + log(a); + } else { + s = a + 1.0; + t = t + sqrt(s * t); + return log1p(t); + } +} + +__func__(double asinh(double a)) +{ + double fa, oofa, t; + + fa = fabs(a); + if (fa > 1e18) { + t = log(2.0) + log(fa); + } else { + oofa = 1.0 / fa; + t = fa + fa / (oofa + sqrt(1.0 + oofa * oofa)); + t = log1p(t); + } + t = copysign(t, a); + return t; +} + +__func__(double atanh(double a)) +{ + double fa, t; + + if (__isnan(a)) { + return a + a; + } + fa = fabs(a); + t = (2.0 * fa) / (1.0 - fa); + t = 0.5 * log1p(t); + if (__isnan(t) || !__signbit(a)) { + return t; + } + return -t; +} + +__func__(int ilogb(double a)) +{ + unsigned long long int i; + int expo = -1022; + + if (__isnan(a)) return -__cuda_INT_MAX-1; + if (__isinf(a)) return __cuda_INT_MAX; + memcpy(&i, &a, sizeof(double)); + i = i & 0x7fffffffffffffffULL; + if (i == 0) return -__cuda_INT_MAX-1; + if (i >= 0x0010000000000000ULL) { + return (int)(((i >> 52ULL) & 0x7ffU) - 1023); + } + while (i < 0x0010000000000000ULL) { + expo--; + i <<= 1; + } + return expo; +} + +__func__(double logb(double a)) +{ + unsigned long long int i; + int expo = -1022; + + if (__isnan(a)) return a + a; + if (__isinf(a)) return fabs(a); + memcpy(&i, &a, sizeof(double)); + i = i & 0x7fffffffffffffffULL; + if (i == 0) return -1.0/fabs(a); + if (i >= 0x0010000000000000ULL) { + return (double)((int)((i >> 52ULL) & 0x7ffU) - 1023); + } + while (i < 0x0010000000000000ULL) { + expo--; + i <<= 1; + } + return static_cast(expo); +} + +__func__(double remquo(double a, double b, int *quo)) +{ + unsigned long long int aa, bb; + int rem1 = 1; /* do FPREM1, a.k.a IEEE remainder */ + int expo_a; + int expo_b; + unsigned long long mant_a; + unsigned long long mant_b; + unsigned long long mant_c; + unsigned long long temp; + int sign_a; + int sign_b; + int sign_c; + int expo_c; + int expodiff; + int quot = 0; /* initialize quotient */ + int l; + int iter; + + memcpy(&aa, &a, sizeof(double)); + mant_a = (aa << 11ULL) | 0x8000000000000000ULL; + expo_a = (int)((aa >> 52ULL) & 0x7ffU) - 1023; + sign_a = (int)(aa >> 63ULL); + + memcpy(&bb, &b, sizeof(double)); + mant_b = (bb << 11ULL) | 0x8000000000000000ULL; + expo_b = (int)((bb >> 52ULL) & 0x7ffU) - 1023; + sign_b = (int)(bb >> 63ULL); + + sign_c = sign_a; /* remainder has sign of dividend */ + expo_c = expo_a; /* default */ + + /* handled NaNs and infinities */ + if (__isnan(a) || __isnan(b)) { + *quo = quot; + return a + b; + } + if (__isinf(a) || (b == 0.0)) { + *quo = quot; + aa = 0xfff8000000000000ULL; + memcpy(&a, &aa, sizeof(double)); + return a; + } + if ((a == 0.0) || (__isinf(b))) { + *quo = quot; + return a; + } + /* normalize denormals */ + if (expo_a < -1022) { + mant_a = mant_a + mant_a; + while (mant_a < 0x8000000000000000ULL) { + mant_a = mant_a + mant_a; + expo_a--; + } + } + if (expo_b < -1022) { + mant_b = mant_b + mant_b; + while (mant_b < 0x8000000000000000ULL) { + mant_b = mant_b + mant_b; + expo_b--; + } + } + expodiff = expo_a - expo_b; + /* clamp iterations if exponent difference negative */ + if (expodiff < 0) { + iter = -1; + } else { + iter = expodiff; + } + /* Shift dividend and divisor right by one bit to prevent overflow + during the division algorithm. + */ + mant_a = mant_a >> 1ULL; + mant_b = mant_b >> 1ULL; + expo_c = expo_a - iter; /* default exponent of result */ + + /* Use binary longhand division (restoring) */ + for (l = 0; l < (iter + 1); l++) { + mant_a = mant_a - mant_b; + if (mant_a & 0x8000000000000000ULL) { + mant_a = mant_a + mant_b; + quot = quot + quot; + } else { + quot = quot + quot + 1; + } + mant_a = mant_a + mant_a; + } + + /* Save current remainder */ + mant_c = mant_a; + /* If remainder's mantissa is all zeroes, final result is zero. */ + if (mant_c == 0) { + quot = quot & 7; + *quo = (sign_a ^ sign_b) ? -quot : quot; + aa = static_cast(sign_c) << 63ULL; + memcpy(&a, &aa, sizeof(double)); + return a; + } + /* Normalize result */ + while (!(mant_c & 0x8000000000000000ULL)) { + mant_c = mant_c + mant_c; + expo_c--; + } + /* For IEEE remainder (quotient rounded to nearest-even we might need to + do a final subtraction of the divisor from the remainder. + */ + if (rem1 && ((expodiff+1) >= 0)) { + temp = mant_a - mant_b; + /* round quotient to nearest even */ + if (((temp != 0ULL) && (!(temp & 0x8000000000000000ULL))) || + ((temp == 0ULL) && (quot & 1))) { + mant_a = mant_a >> 1ULL; + quot++; + /* Since the divisor is greater than the remainder, the result will + have opposite sign of the dividend. To avoid a negative mantissa + when subtracting the divisor from remainder, reverse subtraction + */ + sign_c = 1 ^ sign_c; + expo_c = expo_a - iter + 1; + mant_c = mant_b - mant_a; + /* normalize result */ + while (!(mant_c & 0x8000000000000000ULL)) { + mant_c = mant_c + mant_c; + expo_c--; + } + } + } + /* package up result */ + if (expo_c >= -1022) { /* normal */ + mant_c = ((mant_c >> 11ULL) + + (((static_cast(sign_c)) << 63ULL) + + (((unsigned long long)(expo_c + 1022)) << 52ULL))); + } else { /* denormal */ + mant_c = (((static_cast(sign_c)) << 63ULL) + + (mant_c >> (unsigned long long)(11 - expo_c - 1022))); + } + quot = quot & 7; /* mask quotient down to least significant three bits */ + *quo = (sign_a ^ sign_b) ? -quot : quot; + memcpy(&a, &mant_c, sizeof(double)); + return a; +} + +__func__(double remainder(double a, double b)) +{ + int quo; + return remquo (a, b, &quo); +} + +__func__(double fma (double a, double b, double c)) +{ + struct { + unsigned int lo; + unsigned int hi; + } xx, yy, zz, ww; + double d; + unsigned int s, t, u, prod0, prod1, prod2, prod3, expo_x, expo_y, expo_z; + + memcpy(&xx, &a, sizeof(double)); + memcpy(&yy, &b, sizeof(double)); + memcpy(&zz, &c, sizeof(double)); + + expo_z = 0x7FFU; + t = xx.hi >> 20; + expo_x = expo_z & t; + expo_x = expo_x - 1; /* expo(x) - 1 */ + t = yy.hi >> 20; + expo_y = expo_z & t; + expo_y = expo_y - 1; /* expo(y) - 1 */ + t = zz.hi >> 20; + expo_z = expo_z & t; + expo_z = expo_z - 1; /* expo(z) - 1 */ + + if (!((expo_x <= 0x7FDU) && + (expo_y <= 0x7FDU) && + (expo_z <= 0x7FDU))) { + + /* fma (nan, y, z) --> nan + fma (x, nan, z) --> nan + fma (x, y, nan) --> nan + */ + if (((yy.hi << 1) | (yy.lo != 0)) > 0xffe00000U) { + yy.hi |= 0x00080000U; + memcpy(&d, &yy, sizeof(double)); + return d; + } + if (((zz.hi << 1) | (zz.lo != 0)) > 0xffe00000U) { + zz.hi |= 0x00080000U; + memcpy(&d, &zz, sizeof(double)); + return d; + } + if (((xx.hi << 1) | (xx.lo != 0)) > 0xffe00000U) { + xx.hi |= 0x00080000U; + memcpy(&d, &xx, sizeof(double)); + return d; + } + + /* fma (0, inf, z) --> INDEFINITE + fma (inf, 0, z) --> INDEFINITE + fma (-inf,+y,+inf) --> INDEFINITE + fma (+x,-inf,+inf) --> INDEFINITE + fma (+inf,-y,+inf) --> INDEFINITE + fma (-x,+inf,+inf) --> INDEFINITE + fma (-inf,-y,-inf) --> INDEFINITE + fma (-x,-inf,-inf) --> INDEFINITE + fma (+inf,+y,-inf) --> INDEFINITE + fma (+x,+inf,-inf) --> INDEFINITE + */ + if (((((xx.hi << 1) | xx.lo) == 0) && + (((yy.hi << 1) | (yy.lo != 0)) == 0xffe00000U)) || + ((((yy.hi << 1) | yy.lo) == 0) && + (((xx.hi << 1) | (xx.lo != 0)) == 0xffe00000U))) { + xx.hi = 0xfff80000U; + xx.lo = 0x00000000U; + memcpy(&d, &xx, sizeof(double)); + return d; + } + if (((zz.hi << 1) | (zz.lo != 0)) == 0xffe00000U) { + if ((((yy.hi << 1) | (yy.lo != 0)) == 0xffe00000U) || + (((xx.hi << 1) | (xx.lo != 0)) == 0xffe00000U)) { + if ((int)(xx.hi ^ yy.hi ^ zz.hi) < 0) { + xx.hi = 0xfff80000U; + xx.lo = 0x00000000U; + memcpy(&d, &xx, sizeof(double)); + return d; + } + } + } + /* fma (inf, y, z) --> inf + fma (x, inf, z) --> inf + fma (x, y, inf) --> inf + */ + if (((xx.hi << 1) | (xx.lo != 0)) == 0xffe00000U) { + xx.hi = xx.hi ^ (yy.hi & 0x80000000U); + memcpy(&d, &xx, sizeof(double)); + return d; + } + if (((yy.hi << 1) | (yy.lo != 0)) == 0xffe00000U) { + yy.hi = yy.hi ^ (xx.hi & 0x80000000U); + memcpy(&d, &yy, sizeof(double)); + return d; + } + if (((zz.hi << 1) | (zz.lo != 0)) == 0xffe00000U) { + memcpy(&d, &zz, sizeof(double)); + return d; + } + /* fma (+0, -y, -0) --> -0 + fma (-0, +y, -0) --> -0 + fma (+x, -0, -0) --> -0 + fma (-x, +0, -0) --> -0 + */ + if ((zz.hi == 0x80000000U) && (zz.lo == 0)) { + if ((((xx.hi << 1) | xx.lo) == 0) || + (((yy.hi << 1) | yy.lo) == 0)) { + if ((int)(xx.hi ^ yy.hi) < 0) { + memcpy(&d, &zz, sizeof(double)); + return d; + } + } + } + /* fma (0, y, 0) --> +0 (-0 if round down and signs of addend differ) + fma (x, 0, 0) --> +0 (-0 if round down and signs of addend differ) + */ + if ((((zz.hi << 1) | zz.lo) == 0) && + ((((xx.hi << 1) | xx.lo) == 0) || + (((yy.hi << 1) | yy.lo) == 0))) { + zz.hi &= 0x7fffffffU; + memcpy(&d, &zz, sizeof(double)); + return d; + } + + /* fma (0, y, z) --> z + fma (x, 0, z) --> z + */ + if ((((xx.hi << 1) | xx.lo) == 0) || + (((yy.hi << 1) | yy.lo) == 0)) { + memcpy(&d, &zz, sizeof(double)); + return d; + } + + if (expo_x == 0xffffffffU) { + expo_x++; + t = xx.hi & 0x80000000U; + s = xx.lo >> 21; + xx.lo = xx.lo << 11; + xx.hi = xx.hi << 11; + xx.hi = xx.hi | s; + if (!xx.hi) { + xx.hi = xx.lo; + xx.lo = 0; + expo_x -= 32; + } + while (static_cast(xx.hi) > 0) { + s = xx.lo >> 31; + xx.lo = xx.lo + xx.lo; + xx.hi = xx.hi + xx.hi; + xx.hi = xx.hi | s; + expo_x--; + } + xx.lo = (xx.lo >> 11); + xx.lo |= (xx.hi << 21); + xx.hi = (xx.hi >> 11) | t; + } + if (expo_y == 0xffffffffU) { + expo_y++; + t = yy.hi & 0x80000000U; + s = yy.lo >> 21; + yy.lo = yy.lo << 11; + yy.hi = yy.hi << 11; + yy.hi = yy.hi | s; + if (!yy.hi) { + yy.hi = yy.lo; + yy.lo = 0; + expo_y -= 32; + } + while (static_cast(yy.hi) > 0) { + s = yy.lo >> 31; + yy.lo = yy.lo + yy.lo; + yy.hi = yy.hi + yy.hi; + yy.hi = yy.hi | s; + expo_y--; + } + yy.lo = (yy.lo >> 11); + yy.lo |= (yy.hi << 21); + yy.hi = (yy.hi >> 11) | t; + } + if (expo_z == 0xffffffffU) { + expo_z++; + t = zz.hi & 0x80000000U; + s = zz.lo >> 21; + zz.lo = zz.lo << 11; + zz.hi = zz.hi << 11; + zz.hi = zz.hi | s; + if (!zz.hi) { + zz.hi = zz.lo; + zz.lo = 0; + expo_z -= 32; + } + while (static_cast(zz.hi) > 0) { + s = zz.lo >> 31; + zz.lo = zz.lo + zz.lo; + zz.hi = zz.hi + zz.hi; + zz.hi = zz.hi | s; + expo_z--; + } + zz.lo = (zz.lo >> 11); + zz.lo |= (zz.hi << 21); + zz.hi = (zz.hi >> 11) | t; + } + } + + expo_x = expo_x + expo_y; + expo_y = xx.hi ^ yy.hi; + t = xx.lo >> 21; + xx.lo = xx.lo << 11; + xx.hi = xx.hi << 11; + xx.hi = xx.hi | t; + yy.hi = yy.hi & 0x000fffffU; + xx.hi = xx.hi | 0x80000000U; /* set mantissa hidden bit */ + yy.hi = yy.hi | 0x00100000U; /* set mantissa hidden bit */ + + prod0 = xx.lo * yy.lo; + prod1 =(unsigned)((static_cast(xx.lo)*static_cast(yy.lo))>>32ULL); + prod2 = xx.hi * yy.lo; + prod3 = xx.lo * yy.hi; + prod1 += prod2; + t = (unsigned)(prod1 < prod2); + prod1 += prod3; + t += prod1 < prod3; + prod2 =(unsigned)((static_cast(xx.hi)*static_cast(yy.lo))>>32ULL); + prod3 =(unsigned)((static_cast(xx.lo)*static_cast(yy.hi))>>32ULL); + prod2 += prod3; + s = (unsigned)(prod2 < prod3); + prod3 = xx.hi * yy.hi; + prod2 += prod3; + s += prod2 < prod3; + prod2 += t; + s += prod2 < t; + prod3 =(unsigned)((static_cast(xx.hi)*static_cast(yy.hi))>>32ULL); + prod3 = prod3 + s; + + yy.lo = prod0; /* mantissa */ + yy.hi = prod1; /* mantissa */ + xx.lo = prod2; /* mantissa */ + xx.hi = prod3; /* mantissa */ + expo_x = expo_x - (1023 - 2); /* expo-1 */ + expo_y = expo_y & 0x80000000U; /* sign */ + + if (xx.hi < 0x00100000U) { + s = xx.lo >> 31; + s = (xx.hi << 1) + s; + xx.hi = s; + s = yy.hi >> 31; + s = (xx.lo << 1) + s; + xx.lo = s; + s = yy.lo >> 31; + s = (yy.hi << 1) + s; + yy.hi = s; + s = yy.lo << 1; + yy.lo = s; + expo_x--; + } + + t = 0; + if (((zz.hi << 1) | zz.lo) != 0) { /* z is not zero */ + + s = zz.hi & 0x80000000U; + + zz.hi &= 0x000fffffU; + zz.hi |= 0x00100000U; + ww.hi = 0; + ww.lo = 0; + + /* compare and swap. put augend into xx:yy */ + if (static_cast(expo_z) > static_cast(expo_x)) { + t = expo_z; + expo_z = expo_x; + expo_x = t; + t = zz.hi; + zz.hi = xx.hi; + xx.hi = t; + t = zz.lo; + zz.lo = xx.lo; + xx.lo = t; + t = ww.hi; + ww.hi = yy.hi; + yy.hi = t; + t = ww.lo; + ww.lo = yy.lo; + yy.lo = t; + t = expo_y; + expo_y = s; + s = t; + } + + /* augend_sign = expo_y, augend_mant = xx:yy, augend_expo = expo_x */ + /* addend_sign = s, addend_mant = zz:ww, addend_expo = expo_z */ + expo_z = expo_x - expo_z; + u = expo_y ^ s; + if (expo_z <= 107) { + /* denormalize addend */ + t = 0; + while (expo_z >= 32) { + t = ww.lo | (t != 0); + ww.lo = ww.hi; + ww.hi = zz.lo; + zz.lo = zz.hi; + zz.hi = 0; + expo_z -= 32; + } + if (expo_z) { + t = (t >> expo_z) | (ww.lo << (32 - expo_z)) | + ((t << (32 - expo_z)) != 0); + ww.lo = (ww.lo >> expo_z) | (ww.hi << (32 - expo_z)); + ww.hi = (ww.hi >> expo_z) | (zz.lo << (32 - expo_z)); + zz.lo = (zz.lo >> expo_z) | (zz.hi << (32 - expo_z)); + zz.hi = (zz.hi >> expo_z); + } + } else { + t = 1; + ww.lo = 0; + ww.hi = 0; + zz.lo = 0; + zz.hi = 0; + } + if (static_cast(u) < 0) { + /* signs differ, effective subtraction */ + t = (unsigned)(-static_cast(t)); + s = (unsigned)(t != 0); + u = yy.lo - s; + s = (unsigned)(u > yy.lo); + yy.lo = u - ww.lo; + s += yy.lo > u; + u = yy.hi - s; + s = (unsigned)(u > yy.hi); + yy.hi = u - ww.hi; + s += yy.hi > u; + u = xx.lo - s; + s = (unsigned)(u > xx.lo); + xx.lo = u - zz.lo; + s += xx.lo > u; + xx.hi = (xx.hi - zz.hi) - s; + if (!(xx.hi | xx.lo | yy.hi | yy.lo | t)) { + /* complete cancelation, return 0 */ + memcpy(&d, &xx, sizeof(double)); + return d; + } + if (static_cast(xx.hi) < 0) { + /* Oops, augend had smaller mantissa. Negate mantissa and flip + sign of result + */ + t = ~t; + yy.lo = ~yy.lo; + yy.hi = ~yy.hi; + xx.lo = ~xx.lo; + xx.hi = ~xx.hi; + if (++t == 0) { + if (++yy.lo == 0) { + if (++yy.hi == 0) { + if (++xx.lo == 0) { + ++xx.hi; + } + } + } + } + expo_y ^= 0x80000000U; + } + + /* normalize mantissa, if necessary */ + while (!(xx.hi & 0x00100000U)) { + xx.hi = (xx.hi << 1) | (xx.lo >> 31); + xx.lo = (xx.lo << 1) | (yy.hi >> 31); + yy.hi = (yy.hi << 1) | (yy.lo >> 31); + yy.lo = (yy.lo << 1); + expo_x--; + } + } else { + /* signs are the same, effective addition */ + yy.lo = yy.lo + ww.lo; + s = (unsigned)(yy.lo < ww.lo); + yy.hi = yy.hi + s; + u = (unsigned)(yy.hi < s); + yy.hi = yy.hi + ww.hi; + u += yy.hi < ww.hi; + xx.lo = xx.lo + u; + s = (unsigned)(xx.lo < u); + xx.lo = xx.lo + zz.lo; + s += xx.lo < zz.lo; + xx.hi = xx.hi + zz.hi + s; + if (xx.hi & 0x00200000U) { + t = t | (yy.lo << 31); + yy.lo = (yy.lo >> 1) | (yy.hi << 31); + yy.hi = (yy.hi >> 1) | (xx.lo << 31); + xx.lo = (xx.lo >> 1) | (xx.hi << 31); + xx.hi = ((xx.hi & 0x80000000U) | (xx.hi >> 1)) & ~0x40000000U; + expo_x++; + } + } + } + t = yy.lo | (t != 0); + t = yy.hi | (t != 0); + + xx.hi |= expo_y; /* or in sign bit */ + if (expo_x <= 0x7FDU) { + /* normal */ + xx.hi = xx.hi & ~0x00100000U; /* lop off integer bit */ + s = xx.lo & 1; /* mantissa lsb */ + u = xx.lo; + xx.lo += (t == 0x80000000U) ? s : (t >> 31); + xx.hi += (u > xx.lo); + xx.hi += ((expo_x + 1) << 20); + memcpy(&d, &xx, sizeof(double)); + return d; + } else if (static_cast(expo_x) >= 2046) { + /* overflow */ + xx.hi = (xx.hi & 0x80000000U) | 0x7ff00000U; + xx.lo = 0; + memcpy(&d, &xx, sizeof(double)); + return d; + } + /* subnormal */ + expo_x = (unsigned)(-static_cast(expo_x)); + if (expo_x > 54) { + xx.hi = xx.hi & 0x80000000U; + xx.lo = 0; + memcpy(&d, &xx, sizeof(double)); + return d; + } + yy.hi = xx.hi & 0x80000000U; /* save sign bit */ + xx.hi = xx.hi & ~0xffe00000U; + if (expo_x >= 32) { + t = xx.lo | (t != 0); + xx.lo = xx.hi; + xx.hi = 0; + expo_x -= 32; + } + if (expo_x) { + t = (t >> expo_x) | (xx.lo << (32 - expo_x)) | (t != 0); + xx.lo = (xx.lo >> expo_x) | (xx.hi << (32 - expo_x)); + xx.hi = (xx.hi >> expo_x); + } + expo_x = xx.lo & 1; + u = xx.lo; + xx.lo += (t == 0x80000000U) ? expo_x : (t >> 31); + xx.hi += (u > xx.lo); + xx.hi |= yy.hi; + memcpy(&d, &xx, sizeof(double)); + return d; +} + +__func__(double nextafter(double a, double b)) +{ + unsigned long long int ia; + unsigned long long int ib; + memcpy(&ia, &a, sizeof(double)); + memcpy(&ib, &b, sizeof(double)); + if (__isnan(a) || __isnan(b)) return a + b; /* NaN */ + if (((ia | ib) << 1ULL) == 0ULL) return b; + if (a == 0.0) { + return copysign (4.9406564584124654e-324, b); /* crossover */ + } + if ((a < b) && (a < 0.0)) ia--; + if ((a < b) && (a > 0.0)) ia++; + if ((a > b) && (a < 0.0)) ia++; + if ((a > b) && (a > 0.0)) ia--; + memcpy(&a, &ia, sizeof(double)); + return a; +} + +__func__(double erf(double a)) +{ + double t, r, q; + + t = fabs(a); + if (t >= 1.0) { + r = -1.28836351230756500E-019; + r = r * t + 1.30597472161093370E-017; + r = r * t - 6.33924401259620500E-016; + r = r * t + 1.96231865908940140E-014; + r = r * t - 4.35272243559990750E-013; + r = r * t + 7.37083927929352150E-012; + r = r * t - 9.91402142550461630E-011; + r = r * t + 1.08817017167760820E-009; + r = r * t - 9.93918713097634620E-009; + r = r * t + 7.66739923255145500E-008; + r = r * t - 5.05440278302806720E-007; + r = r * t + 2.87474157099000620E-006; + r = r * t - 1.42246725399722510E-005; + r = r * t + 6.16994555079419460E-005; + r = r * t - 2.36305221938908790E-004; + r = r * t + 8.05032844055371070E-004; + r = r * t - 2.45833366629108140E-003; + r = r * t + 6.78340988296706120E-003; + r = r * t - 1.70509103597554640E-002; + r = r * t + 3.93322852515666300E-002; + r = r * t - 8.37271292613764040E-002; + r = r * t + 1.64870423707623280E-001; + r = r * t - 2.99729521787681470E-001; + r = r * t + 4.99394435612628580E-001; + r = r * t - 7.52014596480123030E-001; + r = r * t + 9.99933138314926250E-001; + r = r * t - 1.12836725321102670E+000; + r = r * t + 9.99998988715182450E-001; + q = exp (-t * t); + r = 1.0 - r * q; + if (t >= 6.5) { + r = 1.0; + } + a = copysign (r, a); + } else { + q = a * a; + r = -7.77946848895991420E-010; + r = r * q + 1.37109803980285950E-008; + r = r * q - 1.62063137584932240E-007; + r = r * q + 1.64471315712790040E-006; + r = r * q - 1.49247123020098620E-005; + r = r * q + 1.20552935769006260E-004; + r = r * q - 8.54832592931448980E-004; + r = r * q + 5.22397760611847340E-003; + r = r * q - 2.68661706431114690E-002; + r = r * q + 1.12837916709441850E-001; + r = r * q - 3.76126389031835210E-001; + r = r * q + 1.12837916709551260E+000; + a = r * a; + } + return a; +} + +__func__(double erfc(double a)) +{ + double p, q, h, l; + + if (a < 0.75) { + return 1.0 - erf(a); + } + if (a > 27.3) { + return 0.0; + } + if (a < 5.0) { + double t; + t = 1.0 / a; + p = 1.9759923722227928E-008; + p = p * t - 1.0000002670474897E+000; + p = p * t - 7.4935303236347828E-001; + p = p * t - 1.5648136328071860E-001; + p = p * t + 1.2871196242447239E-001; + p = p * t + 1.1126459974811195E-001; + p = p * t + 4.0678642255914332E-002; + p = p * t + 7.9915414156678296E-003; + p = p * t + 7.1458332107840234E-004; + q = t + 2.7493547525030619E+000; + q = q * t + 3.3984254815725423E+000; + q = q * t + 2.4635304979947761E+000; + q = q * t + 1.1405284734691286E+000; + q = q * t + 3.4130157606195649E-001; + q = q * t + 6.2250967676044953E-002; + q = q * t + 5.5661370941268700E-003; + q = q * t + 1.0575248365468671E-009; + p = p / q; + p = p * t; + h = ((int)(a * 16.0)) * 0.0625; + l = (a - h) * (a + h); + q = exp(-h * h) * exp(-l); + q = q * 0.5; + p = p * q + q; + p = p * t; + } else { + double ooa, ooasq; + + ooa = 1.0 / a; + ooasq = ooa * ooa; + p = -4.0025406686930527E+005; + p = p * ooasq + 1.4420582543942123E+005; + p = p * ooasq - 2.7664185780951841E+004; + p = p * ooasq + 4.1144611644767283E+003; + p = p * ooasq - 5.8706000519209351E+002; + p = p * ooasq + 9.1490086446323375E+001; + p = p * ooasq - 1.6659491387740221E+001; + p = p * ooasq + 3.7024804085481784E+000; + p = p * ooasq - 1.0578553994424316E+000; + p = p * ooasq + 4.2314218745087778E-001; + p = p * ooasq - 2.8209479177354962E-001; + p = p * ooasq + 5.6418958354775606E-001; + h = a * a; + h = ((int)(a * 16.0)) * 0.0625; + l = (a - h) * (a + h); + q = exp(-h * h) * exp(-l); + p = p * ooa; + p = p * q; + } + return p; +} + +__func__(double lgamma(double a)) +{ + double s; + double t; + double i; + double fa; + double sum; + long long int quot; + if (__isnan(a) || __isinf(a)) { + return a * a; + } + fa = fabs(a); + if (fa >= 3.0) { + if (fa >= 8.0) { + /* Stirling approximation; coefficients from Hart et al, "Computer + * Approximations", Wiley 1968. Approximation 5404. + */ + s = 1.0 / fa; + t = s * s; + sum = -0.1633436431e-2; + sum = sum * t + 0.83645878922e-3; + sum = sum * t - 0.5951896861197e-3; + sum = sum * t + 0.793650576493454e-3; + sum = sum * t - 0.277777777735865004e-2; + sum = sum * t + 0.833333333333331018375e-1; + sum = sum * s + 0.918938533204672; + s = 0.5 * log (fa); + t = fa - 0.5; + s = s * t; + t = s - fa; + s = s + sum; + t = t + s; + } else { + i = fa - 3.0; + s = -4.02412642744125560E+003; + s = s * i - 2.97693796998962000E+005; + s = s * i - 6.38367087682528790E+006; + s = s * i - 5.57807214576539320E+007; + s = s * i - 2.24585140671479230E+008; + s = s * i - 4.70690608529125090E+008; + s = s * i - 7.62587065363263010E+008; + s = s * i - 9.71405112477113250E+008; + t = i - 1.02277248359873170E+003; + t = t * i - 1.34815350617954480E+005; + t = t * i - 4.64321188814343610E+006; + t = t * i - 6.48011106025542540E+007; + t = t * i - 4.19763847787431360E+008; + t = t * i - 1.25629926018000720E+009; + t = t * i - 1.40144133846491690E+009; + t = s / t; + t = t + i; + } + } else if (fa >= 1.5) { + i = fa - 2.0; + t = 9.84839283076310610E-009; + t = t * i - 6.69743850483466500E-008; + t = t * i + 2.16565148880011450E-007; + t = t * i - 4.86170275781575260E-007; + t = t * i + 9.77962097401114400E-007; + t = t * i - 2.03041287574791810E-006; + t = t * i + 4.36119725805364580E-006; + t = t * i - 9.43829310866446590E-006; + t = t * i + 2.05106878496644220E-005; + t = t * i - 4.49271383742108440E-005; + t = t * i + 9.94570466342226000E-005; + t = t * i - 2.23154589559238440E-004; + t = t * i + 5.09669559149637430E-004; + t = t * i - 1.19275392649162300E-003; + t = t * i + 2.89051032936815490E-003; + t = t * i - 7.38555102806811700E-003; + t = t * i + 2.05808084278121250E-002; + t = t * i - 6.73523010532073720E-002; + t = t * i + 3.22467033424113040E-001; + t = t * i + 4.22784335098467190E-001; + t = t * i; + } else if (fa >= 0.7) { + i = 1.0 - fa; + t = 1.17786911519331130E-002; + t = t * i + 3.89046747413522300E-002; + t = t * i + 5.90045711362049900E-002; + t = t * i + 6.02143305254344420E-002; + t = t * i + 5.61652708964839180E-002; + t = t * i + 5.75052755193461370E-002; + t = t * i + 6.21061973447320710E-002; + t = t * i + 6.67614724532521880E-002; + t = t * i + 7.14856037245421020E-002; + t = t * i + 7.69311251313347100E-002; + t = t * i + 8.33503129714946310E-002; + t = t * i + 9.09538288991182800E-002; + t = t * i + 1.00099591546322310E-001; + t = t * i + 1.11334278141734510E-001; + t = t * i + 1.25509666613462880E-001; + t = t * i + 1.44049896457704160E-001; + t = t * i + 1.69557177031481600E-001; + t = t * i + 2.07385551032182120E-001; + t = t * i + 2.70580808427600350E-001; + t = t * i + 4.00685634386517050E-001; + t = t * i + 8.22467033424113540E-001; + t = t * i + 5.77215664901532870E-001; + t = t * i; + } else { + t = -9.04051686831357990E-008; + t = t * fa + 7.06814224969349250E-007; + t = t * fa - 3.80702154637902830E-007; + t = t * fa - 2.12880892189316100E-005; + t = t * fa + 1.29108470307156190E-004; + t = t * fa - 2.15932815215386580E-004; + t = t * fa - 1.16484324388538480E-003; + t = t * fa + 7.21883433044470670E-003; + t = t * fa - 9.62194579514229560E-003; + t = t * fa - 4.21977386992884450E-002; + t = t * fa + 1.66538611813682460E-001; + t = t * fa - 4.20026350606819980E-002; + t = t * fa - 6.55878071519427450E-001; + t = t * fa + 5.77215664901523870E-001; + t = t * fa; + t = t * fa + fa; + t = -log (t); + } + if (a >= 0.0) return t; + if (fa < 1e-19) return -log(fa); + i = floor(fa); + if (fa == i) return 1.0 / (fa - i); /* a is an integer: return infinity */ + i = rint (2.0 * fa); + quot = static_cast(i); + i = fa - 0.5 * i; + i = i * CUDART_PI; + if (quot & 1) { + i = cos(i); + } else { + i = sin(i); + } + i = fabs(i); + t = log(CUDART_PI / (i * fa)) - t; + return t; +} + +__func__(unsigned long long int __internal_host_nan_kernel(const char *s)) +{ + unsigned long long i = 0; + int c; + int ovfl = 0; + int invld = 0; + if (s && (*s == '0')) { + s++; + if ((*s == 'x') || (*s == 'X')) { + s++; + while (*s == '0') s++; + while (*s) { + if (i > 0x0fffffffffffffffULL) { + ovfl = 1; + } + c = (((*s) >= 'A') && ((*s) <= 'F')) ? (*s + 'a' - 'A') : (*s); + if ((c >= 'a') && (c <= 'f')) { + c = c - 'a' + 10; + i = i * 16 + c; + } else if ((c >= '0') && (c <= '9')) { + c = c - '0'; + i = i * 16 + c; + } else { + invld = 1; + } + s++; + } + } else { + while (*s == '0') s++; + while (*s) { + if (i > 0x1fffffffffffffffULL) { + ovfl = 1; + } + c = *s; + if ((c >= '0') && (c <= '7')) { + c = c - '0'; + i = i * 8 + c; + } else { + invld = 1; + } + s++; + } + } + } else if (s) { + while (*s) { + c = *s; + if ((i > 1844674407370955161ULL) || + ((i == 1844674407370955161ULL) && (c > '5'))) { + ovfl = 1; + } + if ((c >= '0') && (c <= '9')) { + c = c - '0'; + i = i * 10 + c; + } else { + invld = 1; + } + s++; + } + } + if (ovfl) { + i = ~0ULL; + } + if (invld) { + i = 0ULL; + } + i = (i & 0x000fffffffffffffULL) | 0x7ff8000000000000ULL; + return i; +} + +__func__(double nan(const char *tagp)) +{ + unsigned long long l; + double d; + l = __internal_host_nan_kernel(tagp); + memcpy(&d, &l, sizeof(double)); + return d; +} + +__func__(double __host_tgamma_kernel(double a)) +{ + double t; + t = - 4.4268934071252475E-010; + t = t * a - 2.0266591846658954E-007; + t = t * a + 1.1381211721119527E-006; + t = t * a - 1.2507734816630748E-006; + t = t * a - 2.0136501740408771E-005; + t = t * a + 1.2805012607354486E-004; + t = t * a - 2.1524140811527418E-004; + t = t * a - 1.1651675459704604E-003; + t = t * a + 7.2189432248466381E-003; + t = t * a - 9.6219715326862632E-003; + t = t * a - 4.2197734554722394E-002; + t = t * a + 1.6653861138250356E-001; + t = t * a - 4.2002635034105444E-002; + t = t * a - 6.5587807152025712E-001; + t = t * a + 5.7721566490153287E-001; + t = t * a + 1.0000000000000000E+000; + return t; +} + +__func__(double __host_stirling_poly(double a)) +{ + double x = 1.0 / a; + double z = 0.0; + z = + 8.3949872067208726e-004; + z = z * x - 5.1717909082605919e-005; + z = z * x - 5.9216643735369393e-004; + z = z * x + 6.9728137583658571e-005; + z = z * x + 7.8403922172006662e-004; + z = z * x - 2.2947209362139917e-004; + z = z * x - 2.6813271604938273e-003; + z = z * x + 3.4722222222222220e-003; + z = z * x + 8.3333333333333329e-002; + z = z * x + 1.0000000000000000e+000; + return z; +} + +__func__(double __host_tgamma_stirling(double a)) +{ + double z; + double x; + z = __host_stirling_poly (a); + if (a < 142.0) { + x = pow (a, a - 0.5); + a = x * exp (-a); + a = a * CUDART_SQRT_2PI; + return a * z; + } else if (a < 172.0) { + x = pow (a, 0.5 * a - 0.25); + a = x * exp (-a); + a = a * CUDART_SQRT_2PI; + a = a * z; + return a * x; + } else { + return exp(1000.0); /* INF */ + } +} + +__func__(double tgamma(double a)) +{ + double s, xx, x = a; + if (__isnan(a)) { + return a + a; + } + if (fabs(x) < 20.0) { + if (x >= 0.0) { + s = 1.0; + xx = x; + while (xx > 1.5) { + xx = xx - 1.0; + s = s * xx; + } + if (x >= 0.5) { + xx = xx - 1.0; + } + xx = __host_tgamma_kernel (xx); + if (x < 0.5) { + xx = xx * x; + } + s = s / xx; + } else { + xx = x; + s = xx; + if (x == floor(x)) { + return 0.0 / (x - floor(x)); + } + while (xx < -0.5) { + xx = xx + 1.0; + s = s * xx; + } + xx = __host_tgamma_kernel (xx); + s = s * xx; + s = 1.0 / s; + } + return s; + } else { + if (x >= 0.0) { + return __host_tgamma_stirling (x); + } else { + double t; + int quot; + if (x == floor(x)) { + return 0.0 / (x - floor(x)); + } + if (x < -185.0) { + int negative; + x = floor(x); + negative = ((x - (2.0 * floor(0.5 * x))) == 1.0); + return negative ? (-1.0 / 1e308 / 1e308) : CUDART_ZERO; + } + /* compute sin(pi*x) accurately */ + xx = rint (2.0 * x); + quot = static_cast(xx); + xx = -0.5 * xx + x; + xx = xx * CUDART_PI; + if (quot & 1) { + xx = cos (xx); + } else { + xx = sin (xx); + } + if (quot & 2) { + xx = -xx; + } + x = fabs (x); + s = exp (-x); + t = x - 0.5; + if (x > 140.0) t = 0.5 * t; + t = pow (x, t); + if (x > 140.0) s = s * t; + s = s * __host_stirling_poly (x); + s = s * x; + s = s * xx; + s = 1.0 / s; + s = s * CUDART_SQRT_PIO2; + s = s / t; + return s; + } + } +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +/******************************************************************************* +* * +* HOST IMPLEMENTATION FOR FLOAT AND LONG DOUBLE ROUTINES FOR WINDOWS PLATFORM * +* MAP FLOAT AND LONG DOUBLE ROUTINES TO DOUBLE ROUTINES * +* * +*******************************************************************************/ + +__func__(int __signbitl(const long double a)) +{ + return __signbit(static_cast(a)); +} + +__func__(int __signbitf(const float a)) +{ + return __signbit(static_cast(a)); +} + +__func__(int __finitel(const long double a)) +{ + return __finite(static_cast(a)); +} + +__func__(int __finitef(const float a)) +{ + return __finite(static_cast(a)); +} + +__func__(int __isinfl(const long double a)) +{ + return __isinf(static_cast(a)); +} + +__func__(int __isinff(const float a)) +{ + return __isinf(static_cast(a)); +} + +__func__(int __isnanl(const long double a)) +{ + return __isnan(static_cast(a)); +} + +__func__(int __isnanf(const float a)) +{ + return __isnan(static_cast(a)); +} + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +__func__(float fmaxf(const float a, const float b)) +{ + return static_cast(fmax(static_cast(a), static_cast(b))); +} + +__func__(float fminf(const float a, const float b)) +{ + return static_cast(fmin(static_cast(a), static_cast(b))); +} + +__func__(float roundf(const float a)) +{ + return static_cast(round(static_cast(a))); +} + +__func__(long int lroundf(const float a)) +{ + return lround(static_cast(a)); +} + +__func__(long long int llroundf(const float a)) +{ + return llround(static_cast(a)); +} + +__func__(float truncf(const float a)) +{ + return static_cast(trunc(static_cast(a))); +} + +__func__(float rintf(const float a)) +{ + return static_cast(rint(static_cast(a))); +} + +__func__(float nearbyintf(const float a)) +{ + return static_cast(nearbyint(static_cast(a))); +} + +__func__(long int lrintf(const float a)) +{ + return lrint(static_cast(a)); +} + +__func__(long long int llrintf(const float a)) +{ + return llrint(static_cast(a)); +} + +__func__(float logbf(const float a)) +{ + return static_cast(logb(static_cast(a))); +} + +__func__(float scalblnf(const float a, const long int b)) +{ + return static_cast(scalbln(static_cast(a), b)); +} + +__func__(float log2f(const float a)) +{ + return static_cast(log2(static_cast(a))); +} + +__func__(float exp2f(const float a)) +{ + return static_cast(exp2(static_cast(a))); +} + +__func__(float acoshf(const float a)) +{ + return static_cast(acosh(static_cast(a))); +} + +__func__(float asinhf(const float a)) +{ + return static_cast(asinh(static_cast(a))); +} + +__func__(float atanhf(const float a)) +{ + return static_cast(atanh(static_cast(a))); +} + +__func__(float cbrtf(const float a)) +{ + return static_cast(cbrt(static_cast(a))); +} + +__func__(float expm1f(const float a)) +{ + return static_cast(expm1(static_cast(a))); +} + +__func__(float fdimf(const float a, const float b)) +{ + return static_cast(fdim(static_cast(a), static_cast(b))); +} + +__func__(float log1pf(const float a)) +{ + return static_cast(log1p(static_cast(a))); +} + +__func__(float scalbnf(const float a, const int b)) +{ + return static_cast(scalbn(static_cast(a), b)); +} + +__func__(float fmaf(const float a, const float b, const float c)) +{ + return static_cast(fma(static_cast(a), static_cast(b), static_cast(c))); +} + +__func__(int ilogbf(const float a)) +{ + return ilogb(static_cast(a)); +} + +__func__(float erff(const float a)) +{ + return static_cast(erf(static_cast(a))); +} + +__func__(float erfcf(const float a)) +{ + return static_cast(erfc(static_cast(a))); +} + +__func__(float lgammaf(const float a)) +{ + return static_cast(lgamma(static_cast(a))); +} + +__func__(float tgammaf(const float a)) +{ + return static_cast(tgamma(static_cast(a))); +} + +__func__(float remquof(const float a, const float b, int *quo)) +{ + return static_cast(remquo(static_cast(a), static_cast(b), quo)); +} + +__func__(float remainderf(const float a, const float b)) +{ + return static_cast(remainder(static_cast(a), static_cast(b))); +} +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#if (defined _MSC_VER) && (_MSC_VER >= 1700) +__func__(float j0f(const float a)) +{ + return static_cast(_j0(static_cast(a))); +} + +__func__(float j1f(const float a)) +{ + return static_cast(_j1(static_cast(a))); +} + +__func__(float jnf(const int n, const float a)) +{ + return static_cast(_jn(n, static_cast(a))); +} + +__func__(float y0f(const float a)) +{ + return static_cast(_y0(static_cast(a))); +} + +__func__(float y1f(const float a)) +{ + return static_cast(_y1(static_cast(a))); +} + +__func__(float ynf(const int n, const float a)) +{ + return static_cast(_yn(n, static_cast(a))); +} +#endif /* (defined _MSC_VER) && (_MSC_VER >= 1700) */ + + +/******************************************************************************* +* * +* HOST IMPLEMENTATION FOR FLOAT ROUTINES FOR WINDOWS PLATFORM * +* * +*******************************************************************************/ + +#if (!defined(_MSC_VER) || _MSC_VER < 1800) +__func__(float copysignf(float a, const float b)) +{ + unsigned int aa, bb; + memcpy(&aa, &a, sizeof(float)); + memcpy(&bb, &b, sizeof(float)); + aa = (aa & ~0x80000000U) | (bb & 0x80000000U); + memcpy(&a, &aa, sizeof(float)); + return a; +} + +__func__(float nextafterf(float a, const float b)) +{ + unsigned int ia; + unsigned int ib; + memcpy(&ia, &a, sizeof(float)); + memcpy(&ib, &b, sizeof(float)); + if (__isnanf(a) || __isnanf(b)) return a + b; /*NaN*/ + if (((ia | ib) << 1U) == 0U) return b; + if (a == 0.0F) { + return copysignf(1.401298464e-045F, b); /*crossover*/ + } + if ((a < b) && (a < 0.0F)) ia--; + if ((a < b) && (a > 0.0F)) ia++; + if ((a > b) && (a < 0.0F)) ia++; + if ((a > b) && (a > 0.0F)) ia--; + memcpy(&a, &ia, sizeof(float)); + return a; +} + +__func__(float nanf(const char *tagp)) +{ + float f; + unsigned int i; + i = static_cast(__internal_host_nan_kernel(tagp)); + i = (i & 0x007fffffU) | 0x7fc00000U; + memcpy(&f, &i, sizeof(float)); + return f; +} + +#endif /* (!defined(_MSC_VER) || _MSC_VER < 1800) */ + +#endif /* _WIN32 */ + +/******************************************************************************* +* * +* HOST IMPLEMENTATION FOR DOUBLE AND FLOAT ROUTINES. ALL PLATFORMS * +* * +*******************************************************************************/ + +__func__(double rsqrt(const double a)) +{ + return 1.0 / sqrt(a); +} + +__func__(double rcbrt(const double a)) +{ + double s, t; + + if (__isnan(a)) { + return a + a; + } + if (a == 0.0 || __isinf(a)) { + return 1.0 / a; + } + s = fabs(a); + t = exp2(-CUDART_THIRD * log2(s)); /* initial approximation */ + t = ((t*t) * (-s*t) + 1.0) * (CUDART_THIRD*t) + t;/* refine approximation */ +#if defined(__APPLE__) + if (__signbitd(a)) +#else /* __APPLE__ */ + if (__signbit(a)) +#endif /* __APPLE__ */ + { + t = -t; + } + return t; +} + +__func__(double sinpi(double a)) +{ + int n; + + if (__isnan(a)) { + return a + a; + } + if (a == 0.0 || __isinf(a)) { + return sin (a); + } + if (a == floor(a)) { + return ((a / 1.0e308) / 1.0e308) / 1.0e308; + } + double twoa = a + a; + double rtwoa = round(twoa); + long long int l = (long long int)rtwoa; + n = (int)l; + a -= rtwoa * 0.5; + a = a * CUDART_PI; + if (n & 1) { + a = cos (a); + } else { + a = sin (a); + } + if (n & 2) { + a = -a; + } + return a; +} + +__func__(double cospi(double a)) +{ + int n; + + if (__isnan(a)) { + return a + a; + } + if (__isinf(a)) { + return cos (a); + } + if (fabs(a) > 9.0071992547409920e+015) { + a = 0.0; + } + double twoa = a + a; + double rtwoa = round(twoa); + long long int l = (long long int)rtwoa; + n = (int)l; + a -= rtwoa * 0.5; + a = a * CUDART_PI; + n++; + if (n & 1) { + a = cos (a); + } else { + a = sin (a); + } + if (n & 2) { + a = -a; + } + if (a == 0.0) { + a = fabs(a); + } + return a; +} + +__func__(void sincospi(const double a, double *sptr, double *cptr)) +{ + *sptr = sinpi(a); + *cptr = cospi(a); +} + +__func__(double erfinv(const double a)) +{ + double p, q, t, fa; + unsigned long long int l; + + fa = fabs(a); + if (fa >= 1.0) { + l = 0xfff8000000000000ULL; + memcpy(&t, &l, sizeof(double)); /* INDEFINITE */ + if (fa == 1.0) { + t = a * exp(1000.0); /* Infinity */ + } + } else if (fa >= 0.9375) { + /* Based on: J.M. Blair, C.A. Edwards, J.H. Johnson: Rational Chebyshev + Approximations for the Inverse of the Error Function. Mathematics of + Computation, Vol. 30, No. 136 (Oct. 1976), pp. 827-830. Table 59 + */ + t = log1p(-fa); + t = 1.0 / sqrt(-t); + p = 2.7834010353747001060e-3; + p = p * t + 8.6030097526280260580e-1; + p = p * t + 2.1371214997265515515e+0; + p = p * t + 3.1598519601132090206e+0; + p = p * t + 3.5780402569085996758e+0; + p = p * t + 1.5335297523989890804e+0; + p = p * t + 3.4839207139657522572e-1; + p = p * t + 5.3644861147153648366e-2; + p = p * t + 4.3836709877126095665e-3; + p = p * t + 1.3858518113496718808e-4; + p = p * t + 1.1738352509991666680e-6; + q = t + 2.2859981272422905412e+0; + q = q * t + 4.3859045256449554654e+0; + q = q * t + 4.6632960348736635331e+0; + q = q * t + 3.9846608184671757296e+0; + q = q * t + 1.6068377709719017609e+0; + q = q * t + 3.5609087305900265560e-1; + q = q * t + 5.3963550303200816744e-2; + q = q * t + 4.3873424022706935023e-3; + q = q * t + 1.3858762165532246059e-4; + q = q * t + 1.1738313872397777529e-6; + t = p / (q * t); + if (a < 0.0) t = -t; + } else if (fa >= 0.75) { + /* Based on: J.M. Blair, C.A. Edwards, J.H. Johnson: Rational Chebyshev + Approximations for the Inverse of the Error Function. Mathematics of + Computation, Vol. 30, No. 136 (Oct. 1976), pp. 827-830. Table 39 + */ + t = a * a - .87890625; + p = .21489185007307062000e+0; + p = p * t - .64200071507209448655e+1; + p = p * t + .29631331505876308123e+2; + p = p * t - .47644367129787181803e+2; + p = p * t + .34810057749357500873e+2; + p = p * t - .12954198980646771502e+2; + p = p * t + .25349389220714893917e+1; + p = p * t - .24758242362823355486e+0; + p = p * t + .94897362808681080020e-2; + q = t - .12831383833953226499e+2; + q = q * t + .41409991778428888716e+2; + q = q * t - .53715373448862143349e+2; + q = q * t + .33880176779595142685e+2; + q = q * t - .11315360624238054876e+2; + q = q * t + .20369295047216351160e+1; + q = q * t - .18611650627372178511e+0; + q = q * t + .67544512778850945940e-2; + p = p / q; + t = a * p; + } else { + /* Based on: J.M. Blair, C.A. Edwards, J.H. Johnson: Rational Chebyshev + Approximations for the Inverse of the Error Function. Mathematics of + Computation, Vol. 30, No. 136 (Oct. 1976), pp. 827-830. Table 18 + */ + t = a * a - .5625; + p = - .23886240104308755900e+2; + p = p * t + .45560204272689128170e+3; + p = p * t - .22977467176607144887e+4; + p = p * t + .46631433533434331287e+4; + p = p * t - .43799652308386926161e+4; + p = p * t + .19007153590528134753e+4; + p = p * t - .30786872642313695280e+3; + q = t - .83288327901936570000e+2; + q = q * t + .92741319160935318800e+3; + q = q * t - .35088976383877264098e+4; + q = q * t + .59039348134843665626e+4; + q = q * t - .48481635430048872102e+4; + q = q * t + .18997769186453057810e+4; + q = q * t - .28386514725366621129e+3; + p = p / q; + t = a * p; + } + return t; +} + +__func__(double erfcinv(const double a)) +{ + double t; + unsigned long long int l; + + if (__isnan(a)) { + return a + a; + } + if (a <= 0.0) { + l = 0xfff8000000000000ULL; + memcpy(&t, &l, sizeof(double)); /* INDEFINITE */ + if (a == 0.0) { + t = (1.0 - a) * exp(1000.0); /* Infinity */ + } + } + else if (a >= 0.0625) { + t = erfinv (1.0 - a); + } + else if (a >= 1e-100) { + /* Based on: J.M. Blair, C.A. Edwards, J.H. Johnson: Rational Chebyshev + Approximations for the Inverse of the Error Function. Mathematics of + Computation, Vol. 30, No. 136 (Oct. 1976), pp. 827-830. Table 59 + */ + double p, q; + t = log(a); + t = 1.0 / sqrt(-t); + p = 2.7834010353747001060e-3; + p = p * t + 8.6030097526280260580e-1; + p = p * t + 2.1371214997265515515e+0; + p = p * t + 3.1598519601132090206e+0; + p = p * t + 3.5780402569085996758e+0; + p = p * t + 1.5335297523989890804e+0; + p = p * t + 3.4839207139657522572e-1; + p = p * t + 5.3644861147153648366e-2; + p = p * t + 4.3836709877126095665e-3; + p = p * t + 1.3858518113496718808e-4; + p = p * t + 1.1738352509991666680e-6; + q = t + 2.2859981272422905412e+0; + q = q * t + 4.3859045256449554654e+0; + q = q * t + 4.6632960348736635331e+0; + q = q * t + 3.9846608184671757296e+0; + q = q * t + 1.6068377709719017609e+0; + q = q * t + 3.5609087305900265560e-1; + q = q * t + 5.3963550303200816744e-2; + q = q * t + 4.3873424022706935023e-3; + q = q * t + 1.3858762165532246059e-4; + q = q * t + 1.1738313872397777529e-6; + t = p / (q * t); + } + else { + /* Based on: J.M. Blair, C.A. Edwards, J.H. Johnson: Rational Chebyshev + Approximations for the Inverse of the Error Function. Mathematics of + Computation, Vol. 30, No. 136 (Oct. 1976), pp. 827-830. Table 82 + */ + double p, q; + t = log(a); + t = 1.0 / sqrt(-t); + p = 6.9952990607058154858e-1; + p = p * t + 1.9507620287580568829e+0; + p = p * t + 8.2810030904462690216e-1; + p = p * t + 1.1279046353630280005e-1; + p = p * t + 6.0537914739162189689e-3; + p = p * t + 1.3714329569665128933e-4; + p = p * t + 1.2964481560643197452e-6; + p = p * t + 4.6156006321345332510e-9; + p = p * t + 4.5344689563209398450e-12; + q = t + 1.5771922386662040546e+0; + q = q * t + 2.1238242087454993542e+0; + q = q * t + 8.4001814918178042919e-1; + q = q * t + 1.1311889334355782065e-1; + q = q * t + 6.0574830550097140404e-3; + q = q * t + 1.3715891988350205065e-4; + q = q * t + 1.2964671850944981713e-6; + q = q * t + 4.6156017600933592558e-9; + q = q * t + 4.5344687377088206783e-12; + t = p / (q * t); + } + return t; +} + +__func__(double normcdfinv(const double a)) +{ + return -1.4142135623730951 * erfcinv(a + a); +} + +__func__(double normcdf(double a)) +{ + double ah, al, t1, t2, u1, u2, v1, v2, z; + if (fabs (a) > 38.5) a = copysign (38.5, a); + ah = a * 134217729.0; + u1 = (a - ah) + ah; + u2 = a - u1; + v1 = -7.0710678398609161e-01; + v2 = 2.7995440410322203e-09; + t1 = a * -CUDART_SQRT_HALF_HI; + t2 = (((u1 * v1 - t1) + u1 * v2) + u2 * v1) + u2 * v2; + t2 = (a * -CUDART_SQRT_HALF_LO) + t2; + ah = t1 + t2; + z = erfc (ah); + if (a < -1.0) { + al = (t1 - ah) + t2; + t1 = -2.0 * ah * z; + z = t1 * al + z; + } + return 0.5 * z; +} + +__func__(double erfcx(const double a)) +{ + double x, t1, t2, t3; + + if (__isnan(a)) { + return a + a; + } + x = fabs(a); + if (x < 32.0) { + /* + * This implementation of erfcx() is based on the algorithm in: M. M. + * Shepherd and J. G. Laframboise, "Chebyshev Approximation of (1 + 2x) + * exp(x^2)erfc x in 0 <= x < INF", Mathematics of Computation, Vol. + * 36, No. 153, January 1981, pp. 249-253. For the core approximation, + * the input domain [0,INF] is transformed via (x-k) / (x+k) where k is + * a precision-dependent constant. Here, we choose k = 4.0, so the input + * domain [0, 27.3] is transformed into the core approximation domain + * [-1, 0.744409]. + */ + /* + // Compute (1+2*x)*exp(x*x)*erfc(x) + */ + /* t2 = (x-4.0)/(x+4.0), transforming [0,INF] to [-1,+1] */ + t1 = x - 4.0; + t2 = x + 4.0; + t2 = t1 / t2; + /* approximate on [-1, 0.744409] */ + t1 = - 3.5602694826817400E-010; + t1 = t1 * t2 - 9.7239122591447274E-009; + t1 = t1 * t2 - 8.9350224851649119E-009; + t1 = t1 * t2 + 1.0404430921625484E-007; + t1 = t1 * t2 + 5.8806698585341259E-008; + t1 = t1 * t2 - 8.2147414929116908E-007; + t1 = t1 * t2 + 3.0956409853306241E-007; + t1 = t1 * t2 + 5.7087871844325649E-006; + t1 = t1 * t2 - 1.1231787437600085E-005; + t1 = t1 * t2 - 2.4399558857200190E-005; + t1 = t1 * t2 + 1.5062557169571788E-004; + t1 = t1 * t2 - 1.9925637684786154E-004; + t1 = t1 * t2 - 7.5777429182785833E-004; + t1 = t1 * t2 + 5.0319698792599572E-003; + t1 = t1 * t2 - 1.6197733895953217E-002; + t1 = t1 * t2 + 3.7167515553018733E-002; + t1 = t1 * t2 - 6.6330365827532434E-002; + t1 = t1 * t2 + 9.3732834997115544E-002; + t1 = t1 * t2 - 1.0103906603555676E-001; + t1 = t1 * t2 + 6.8097054254735140E-002; + t1 = t1 * t2 + 1.5379652102605428E-002; + t1 = t1 * t2 - 1.3962111684056291E-001; + t1 = t1 * t2 + 1.2329951186255526E+000; + /* + // Note: (1+2*x)*exp(x*x)*erfc(x) / (1+2*x) = exp(x*x)*erfc(x) + */ + t2 = 2.0 * x + 1.0; + t1 = t1 / t2; + } else { + /* asymptotic expansion for large aguments */ + t2 = 1.0 / x; + t3 = t2 * t2; + t1 = -29.53125; + t1 = t1 * t3 + 6.5625; + t1 = t1 * t3 - 1.875; + t1 = t1 * t3 + 0.75; + t1 = t1 * t3 - 0.5; + t1 = t1 * t3 + 1.0; + t2 = t2 * 5.6418958354775628e-001; + t1 = t1 * t2; + } + if (a < 0.0) { + /* + // Note: erfcx(x) = 2*exp(x^2) - erfcx(|x|) + */ + t2 = (static_cast(x * 16.0)) * 0.0625; + t3 = (x - t2) * (x + t2); + t3 = exp(t2 * t2) * exp(t3); + t3 = t3 + t3; + t1 = t3 - t1; + } + return t1; +} + +__func__(float rsqrtf(const float a)) +{ + return static_cast(rsqrt(static_cast(a))); +} + +__func__(float rcbrtf(const float a)) +{ + return static_cast(rcbrt(static_cast(a))); +} + +__func__(float sinpif(const float a)) +{ + return static_cast(sinpi(static_cast(a))); +} + +__func__(float cospif(const float a)) +{ + return static_cast(cospi(static_cast(a))); +} + +__func__(void sincospif(const float a, float *sptr, float *cptr)) +{ + double s, c; + + sincospi(static_cast(a), &s, &c); + *sptr = static_cast(s); + *cptr = static_cast(c); +} + +__func__(float erfinvf(const float a)) +{ + return static_cast(erfinv(static_cast(a))); +} + +__func__(float erfcinvf(const float a)) +{ + return static_cast(erfcinv(static_cast(a))); +} + +__func__(float normcdfinvf(const float a)) +{ + return static_cast(normcdfinv(static_cast(a))); +} + +__func__(float normcdff(const float a)) +{ + return static_cast(normcdf(static_cast(a))); +} + +__func__(float erfcxf(const float a)) +{ + return static_cast(erfcx(static_cast(a))); +} + +#if defined(_WIN32) +#pragma warning (pop) +#endif /* _WIN32 */ + +#endif /* !__CUDACC__ */ + +#endif /* !__MATH_FUNCTIONS_HPP__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_MATH_FUNCTIONS_HPP__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_MATH_FUNCTIONS_HPP__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/mma.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/mma.h new file mode 100644 index 0000000000000000000000000000000000000000..7d0b79141f65461e0384f34f9e30c482969041ca --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/mma.h @@ -0,0 +1,761 @@ +/* + * Copyright 2017-2024 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/mma.h is an internal header file and must not be used directly. Please use mma.h instead.") +#else +#warning "crt/mma.h is an internal header file and must not be used directly. Please use mma.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_CUDA_MMA_H__ +#endif + +#if !defined(__CUDA_MMA_H__) +#define __CUDA_MMA_H__ + +#include +#include + +#define __CUDA_MMA_DEVICE_DECL__ static __device__ __inline__ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 700 + + +#if !defined(__CUDA_ARCH__) && !defined(_NVHPC_CUDA) +#define __DEF_IF_HOST { } +#else /* !__CUDA_ARCH__ && !_NVHPC_CUDA */ +#define __DEF_IF_HOST ; +#endif /* __CUDA_ARCH__ || _NVHPC_CUDA */ + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 720 +#define __CUDA_IMMA__ 1 +#endif /* !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 720 */ + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 730 +#define __CUDA_SUBBYTE_IMMA__ 1 +#endif /* !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 730 */ + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 800 +#define __CUDA_AMPERE_MMA__ 1 +#endif /* !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 800 */ + +namespace nvcuda { +namespace wmma { + + // utility functions +#ifdef __CUDA_AMPERE_MMA__ + inline __device__ float __float_to_tf32(float in) + { + float ret; + asm("{\n .reg .b32 __$1;" + "\n cvt.rna.tf32.f32 __$1, %1;" + "\n mov.b32 %0, __$1;\n}\n" : "=f"(ret) : "f"(in) ); + return ret; + } +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // tags + // + struct row_major; + struct col_major; + struct matrix_a; + struct matrix_b; + struct accumulator; + +#ifdef __CUDA_AMPERE_MMA__ + namespace precision { + struct tf32; + } +#endif /* __CUDA_AMPERE_MMA__ */ +#ifdef __CUDA_SUBBYTE_IMMA__ + namespace experimental { + namespace precision { + struct u4; // 4-bit unsigned + struct s4; // 4-bit signed + struct b1; // 1-bit + } + enum bmmaBitOp { bmmaBitOpXOR = 1 +#ifdef __CUDA_AMPERE_MMA__ + , bmmaBitOpAND = 2 +#endif /* __CUDA_AMPERE_MMA__ */ + }; + enum bmmaAccumulateOp { bmmaAccumulateOpPOPC = 1 }; + } +#endif /* __CUDA_SUBBYTE_IMMA__ */ + + // + // layout + // + enum layout_t { + mem_row_major, mem_col_major + }; + + template + struct helper_traits { + typedef T element_type; + typedef T storage_element_type; + typedef T fill_argument_type; + }; + +#ifdef __CUDA_SUBBYTE_IMMA__ + template<> struct helper_traits { + typedef experimental::precision::u4 element_type; + typedef unsigned int storage_element_type; + typedef unsigned int fill_argument_type; + }; + + template<> struct helper_traits { + typedef experimental::precision::s4 element_type; + typedef int storage_element_type; + typedef int fill_argument_type; + }; + + template<> struct helper_traits { + typedef experimental::precision::b1 element_type; + typedef unsigned int storage_element_type; + typedef unsigned int fill_argument_type; + }; +#endif /* __CUDA_SUBBYTE_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + template<> struct helper_traits { + typedef precision::tf32 element_type; + typedef float storage_element_type; + typedef float fill_argument_type; + }; +#endif /* __CUDA_AMPERE_MMA__ */ + +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4324) +#endif + // + // The base fragment type + // + /* note: alignment required for compiler implementation */ + template + struct __align__(8) __frag_base { + + /* Number of elements in the fragment */ + enum {num_elements = size}; + + /* Number of storage elements in the fragment. + + The elements of the fragment are packed together when the + fragment element type is experimental::precision::u4, + experimental::precision::s4 or experimental::precision::b1. + When elements are packed, num_storage_elements + will be smaller than num_elements. + */ + enum {num_storage_elements = packed_size}; + + /* element type of the fragment */ + typedef T element_type; + + /* element type of the storage representation. + + The mapping from element_type to storage_element_type is as follows: + experimental::precision::u4 -> unsigned (8 elements in 1 storage element) + experimental::precision::s4 -> int (8 elements in 1 storage element) + experimental::precision::b1 -> unsigned (32 elements in 1 storage element) + precision::tf32 -> float (1 element in 1 storage element) + all other types T -> T + */ + typedef typename helper_traits::storage_element_type storage_element_type; + + /* Storage for the (possibly packed) fragment elements. */ + storage_element_type x[num_storage_elements]; + }; +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + + template + static inline __device__ StorageType __get_storage_value(ArgType in) { return in; } + +#ifdef __CUDA_SUBBYTE_IMMA__ + template<> + __device__ inline unsigned + __get_storage_value(unsigned in) + { + /* For experimental::precision::u4 fragment element type, pack 8 elements into a single + 32-bit unsigned int storage element */ + unsigned val = in & 0xf; + return (val | (val << 4) | (val << 8) | (val << 12) | (val << 16) | + (val << 20) | (val << 24) | (val << 28)); + }; + + template<> + __device__ inline int + __get_storage_value(int in) + { + /* For experimental::precision::s4 fragment element type, pack 8 elements into a single + 32-bit signed int storage element */ + int val = in & 0xf; + return (val | (val << 4) | (val << 8) | (val << 12) | (val << 16) | + (val << 20) | (val << 24) | (val << 28)); + }; + + template<> + __device__ inline unsigned + __get_storage_value(unsigned in) + { + /* For experimental::precision::b1 fragment element type, pack 32 elements into a + single 32-bit unsigned int storage element */ + return (in & 0x1) ? 0xFFFFFFFFU : 0; + } +#endif /* __CUDA_SUBBYTE_IMMA__ */ + + template + __CUDA_MMA_DEVICE_DECL__ void fill_fragment(__frag_base& f, + /* The mapping from fragment element type (FragEleType) to fill_argument_type is: + experimental::precision::u4 -> unsigned (only lower 4 bits taken) + experimental::precision::s4 -> int (only lower 4 bits taken) + experimental::precision::b1 -> unsigned (only lowest 1 bit taken) + precision::tf32 -> float + all other types T -> T + */ + const typename helper_traits::fill_argument_type & in) { + + /* get the (possibly packed) storage element value. See the specializations above for fragment + element types where the storage representation is packed */ + typedef typename helper_traits::storage_element_type storage_type; + storage_type v = __get_storage_value(in); +#pragma unroll + for (int i=0; i< f.num_storage_elements; i++) + f.x[i] = v; + } + + // + // Fragment template + // + template class fragment; + + // + // Fragments for 16x16x16 + // + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 8> {}; + template<> class fragment : public __frag_base {}; + +#ifdef __CUDA_IMMA__ + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + template<> class fragment : public __frag_base<__nv_bfloat16, 8> {}; + template<> class fragment : public __frag_base<__nv_bfloat16, 8> {}; + template<> class fragment : public __frag_base<__nv_bfloat16, 8> {}; + template<> class fragment : public __frag_base<__nv_bfloat16, 8> {}; +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // Fragments for 32x8x16 + // + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 8> {}; + template<> class fragment : public __frag_base {}; + +#ifdef __CUDA_IMMA__ + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + template<> class fragment : public __frag_base<__nv_bfloat16, 16> {}; + template<> class fragment : public __frag_base<__nv_bfloat16, 16> {}; + template<> class fragment : public __frag_base<__nv_bfloat16, 4> {}; + template<> class fragment : public __frag_base<__nv_bfloat16, 4> {}; +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // Fragments for 8x32x16 + // + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 16> {}; + template<> class fragment : public __frag_base<__half, 8> {}; + template<> class fragment : public __frag_base {}; + +#ifdef __CUDA_IMMA__ + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + template<> class fragment : public __frag_base<__nv_bfloat16, 4> {}; + template<> class fragment : public __frag_base<__nv_bfloat16, 4> {}; + template<> class fragment : public __frag_base<__nv_bfloat16, 16> {}; + template<> class fragment : public __frag_base<__nv_bfloat16, 16> {}; +#endif /* __CUDA_AMPERE_MMA__ */ + +#ifdef __CUDA_SUBBYTE_IMMA__ + // + // Fragments for 8x8x32 + // + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + + // + // Fragments for 8x8x128 + // + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; +#endif /* __CUDA_SUBBYTE_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + // + // Fragments for 16x16x8 + // + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + + // + // Fragments for 8x8x4 + // + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; + template<> class fragment : public __frag_base {}; +#endif /* __CUDA_AMPERE_MMA__ */ + + + // + // Load functions for frags of shape m16n16k16 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm, layout_t layout) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm, layout_t layout) __DEF_IF_HOST + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const int* p, unsigned ldm, layout_t layout) __DEF_IF_HOST +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // Load functions for frags of shape m32n8k16 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm, layout_t layout) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm, layout_t layout) __DEF_IF_HOST + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const int* p, unsigned ldm, layout_t layout) __DEF_IF_HOST +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // Load functions for frags of shape m8n32k16 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm, layout_t layout) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm, layout_t layout) __DEF_IF_HOST + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const int* p, unsigned ldm, layout_t layout) __DEF_IF_HOST +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) __DEF_IF_HOST +#endif /* __CUDA_AMPERE_MMA__ */ + +#ifdef __CUDA_SUBBYTE_IMMA__ + // + // Load functions for frags of shape m8n8k32 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) __DEF_IF_HOST + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const int* p, unsigned ldm, layout_t layout) __DEF_IF_HOST + + // + // Load functions for frags of shape m8n8k128 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const int* p, unsigned ldm, layout_t layout) __DEF_IF_HOST + +#endif /* __CUDA_SUBBYTE_IMMA__ */ + + +#ifdef __CUDA_AMPERE_MMA__ + // + // Load functions for frags of shape m16n16k8 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm, layout_t layout) __DEF_IF_HOST + + // + // Load functions for frags of shape m8n8k4 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const double* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const double* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const double* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const double* p, unsigned ldm) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const double* p, unsigned ldm, layout_t layout) __DEF_IF_HOST +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // Store functions for frags of shape m16n16k16 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(__half *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(float *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(int *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST +#endif /* __CUDA_IMMA__ */ + + // + // Store functions for frags of shape m32n8k16 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(__half *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(float *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(int *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST +#endif /* __CUDA_IMMA__ */ + + // + // Store functions for frags of shape m8n32k16 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(__half *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(float *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(int *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_SUBBYTE_IMMA__ + // + // Store functions for frags of shape m8n8k32 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(int *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST + + // + // Store functions for frags of shape m8n8k128 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(int *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST + +#endif /* __CUDA_SUBBYTE_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + // + // Store functions for frags of shape m16n16k8 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(float *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST + + // + // Store functions for frags of shape m8n8k4 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(double *p, const fragment& a, unsigned ldm, layout_t layout) __DEF_IF_HOST +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // MMA functions for shape m16n16k16 + // + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // MMA functions for shape m32n8k16 + // + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // MMA functions for shape m8n32k16 + // + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST +#endif /* __CUDA_AMPERE_MMA__ */ + +#ifdef __CUDA_SUBBYTE_IMMA__ + // + // MMA functions for shape m8n8k32 + // + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf=false) __DEF_IF_HOST + + + // + // MMA functions for shape m8n8k128 + // + __CUDA_MMA_DEVICE_DECL__ void bmma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, + experimental::bmmaBitOp = experimental::bmmaBitOpXOR, + experimental::bmmaAccumulateOp = experimental::bmmaAccumulateOpPOPC) __DEF_IF_HOST + +#endif /* __CUDA_SUBBYTE_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + // + // MMA functions for shape m16n16k8 + // + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + + // + // MMA functions for shape m8n8k4 + // + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) __DEF_IF_HOST +#endif /* __CUDA_AMPERE_MMA__ */ +}; +}; + +#undef __DEF_IF_HOST +#undef __CUDA_IMMA__ +#undef __CUDA_SUBBYTE_IMMA__ +#undef __CUDA_AMPERE_MMA__ +#endif /* !__CUDA_ARCH__ || __CUDA_ARCH__ >= 700 */ + +#endif /* __cplusplus && __CUDACC__ */ + +#undef __CUDA_MMA_DEVICE_DECL__ + +#if defined(__CUDA_ARCH__) +#include "mma.hpp" +#endif /* defined(__CUDA_ARCH__) */ + + +#endif /* !__CUDA_MMA_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_CUDA_MMA_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_CUDA_MMA_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/mma.hpp b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/mma.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3e10f2a982bd2dcf9814a2fc05a3f200d5a1cb07 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/mma.hpp @@ -0,0 +1,1128 @@ +/* + * Copyright 2017-2020 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/mma.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/mma.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_CUDA_MMA_HPP__ +#endif + +#if !defined(__CUDA_MMA_HPP__) +#define __CUDA_MMA_HPP__ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 700 + +#include +#include + +#define __CUDA_MMA_DEVICE_DECL__ static __device__ __inline__ + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 720 +#define __CUDA_IMMA__ 1 +#endif /* !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 720 */ + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 730 +#define __CUDA_SUBBYTE_IMMA__ 1 +#endif /* !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 730 */ + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 800 +#define __CUDA_AMPERE_MMA__ 1 +#endif /* !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 800 */ + +namespace nvcuda { +namespace wmma { + + // + // Load functions for frags of shape m16n16k16 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m16n16k16_ld_a((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m16n16k16_ld_a((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m16n16k16_ld_b((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m16n16k16_ld_b((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m16n16k16_ld_c_f16((int*)&a, (const int*)p, ldm, 0); + else + __hmma_m16n16k16_ld_c_f16((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m16n16k16_ld_c_f32((float*)&a, (const float*)p, ldm, 0); + else + __hmma_m16n16k16_ld_c_f32((float*)&a, (const float*)p, ldm, 1); + } + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m16n16k16_ld_a_s8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m16n16k16_ld_a_s8((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m16n16k16_ld_a_u8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m16n16k16_ld_a_u8((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m16n16k16_ld_b_s8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m16n16k16_ld_b_s8((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m16n16k16_ld_b_u8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m16n16k16_ld_b_u8((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const int* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __imma_m16n16k16_ld_c((int *)&a, (const int*)p, ldm, 0); + else + __imma_m16n16k16_ld_c((int *)&a, (const int*)p, ldm, 1); + } +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m16n16k16_ld_a((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m16n16k16_ld_a((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m16n16k16_ld_b((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m16n16k16_ld_b((int*)&a, (const int*)p, ldm, 1); + } +#endif /* __CUDA_AMPERE_MMA__ */ + + + // + // Load functions for frags of shape m32n8k16 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m32n8k16_ld_a((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m32n8k16_ld_a((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m32n8k16_ld_b((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m32n8k16_ld_b((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m32n8k16_ld_c_f16((int*)&a, (const int*)p, ldm, 0); + else + __hmma_m32n8k16_ld_c_f16((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m32n8k16_ld_c_f32((float*)&a, (const float*)p, ldm, 0); + else + __hmma_m32n8k16_ld_c_f32((float*)&a, (const float*)p, ldm, 1); + } + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m32n8k16_ld_a_s8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m32n8k16_ld_a_s8((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m32n8k16_ld_a_u8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m32n8k16_ld_a_u8((int *)&a, (const int *)p, ldm, 1); + } + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m32n8k16_ld_b_s8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m32n8k16_ld_b_s8((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m32n8k16_ld_b_u8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m32n8k16_ld_b_u8((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const int* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __imma_m32n8k16_ld_c((int *)&a, (const int*)p, ldm, 0); + else + __imma_m32n8k16_ld_c((int *)&a, (const int*)p, ldm, 1); + } +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m32n8k16_ld_a((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m32n8k16_ld_a((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m32n8k16_ld_b((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m32n8k16_ld_b((int*)&a, (const int*)p, ldm, 1); + } +#endif /* __CUDA_AMPERE_MMA__ */ + + + // + // Load functions for frags of shape m8n32k16 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m8n32k16_ld_a((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m8n32k16_ld_a((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m8n32k16_ld_b((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm) { + __hmma_m8n32k16_ld_b((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __half* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m8n32k16_ld_c_f16((int*)&a, (const int*)p, ldm, 0); + else + __hmma_m8n32k16_ld_c_f16((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m8n32k16_ld_c_f32((float*)&a, (const float*)p, ldm, 0); + else + __hmma_m8n32k16_ld_c_f32((float*)&a, (const float*)p, ldm, 1); + } + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m8n32k16_ld_a_s8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m8n32k16_ld_a_s8((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m8n32k16_ld_a_u8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m8n32k16_ld_a_u8((int *)&a, (const int *)p, ldm, 1); + } + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m8n32k16_ld_b_s8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const signed char* p, unsigned ldm) { + __imma_m8n32k16_ld_b_s8((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m8n32k16_ld_b_u8((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const unsigned char* p, unsigned ldm) { + __imma_m8n32k16_ld_b_u8((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const int* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __imma_m8n32k16_ld_c((int *)&a, (const int*)p, ldm, 0); + else + __imma_m8n32k16_ld_c((int *)&a, (const int*)p, ldm, 1); + } +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m8n32k16_ld_a((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m8n32k16_ld_a((int*)&a, (const int*)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m8n32k16_ld_b((int*)&a, (const int*)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const __nv_bfloat16* p, unsigned ldm) { + __mma_bf16_m8n32k16_ld_b((int*)&a, (const int*)p, ldm, 1); + } +#endif /* __CUDA_AMPERE_MMA__ */ + + +#ifdef __CUDA_SUBBYTE_IMMA__ + // + // Load functions for frags of shape m8n8k32 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) { + __imma_m8n8k32_ld_a_s4((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) { + __imma_m8n8k32_ld_a_u4((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) { + __imma_m8n8k32_ld_b_s4((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) { + __imma_m8n8k32_ld_b_u4((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const int* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __imma_m8n8k32_ld_c((int *)&a, (const int*)p, ldm, 0); + else + __imma_m8n8k32_ld_c((int *)&a, (const int*)p, ldm, 1); + } + + // + // Load functions for frags of shape m8n8k128 + // + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) { + __bmma_m8n8k128_ld_a_b1((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const void* p, unsigned ldm) { + __bmma_m8n8k128_ld_b_b1((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const int* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __bmma_m8n8k128_ld_c((int *)&a, (const int*)p, ldm, 0); + else + __bmma_m8n8k128_ld_c((int *)&a, (const int*)p, ldm, 1); + } +#endif /* __CUDA_SUBBYTE_IMMA__ */ + + + +#ifdef __CUDA_AMPERE_MMA__ + // load functions for frags of shape m16n16k8 + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm) { + __mma_tf32_m16n16k8_ld_a((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm) { + __mma_tf32_m16n16k8_ld_a((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm) { + __mma_tf32_m16n16k8_ld_b((int *)&a, (const int *)p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm) { + __mma_tf32_m16n16k8_ld_b((int *)&a, (const int *)p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const float* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __mma_tf32_m16n16k8_ld_c((float *)&a, p, ldm, 0); + else + __mma_tf32_m16n16k8_ld_c((float *)&a, p, ldm, 1); + } + + // load functions for frags of shape m8n8k4 + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const double* p, unsigned ldm) { + __dmma_m8n8k4_ld_a((double *)&a, p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const double* p, unsigned ldm) { + __dmma_m8n8k4_ld_a((double *)&a, p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const double* p, unsigned ldm) { + __dmma_m8n8k4_ld_b((double *)&a, p, ldm, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const double* p, unsigned ldm) { + __dmma_m8n8k4_ld_b((double *)&a, p, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void load_matrix_sync(fragment& a, const double* p, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __dmma_m8n8k4_ld_c((double *)&a, p, ldm, 0); + else + __dmma_m8n8k4_ld_c((double *)&a, p, ldm, 1); + } +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // Store functions for frags of shape m16n16k16 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(__half *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m16n16k16_st_c_f16((int*)p, (int*)&a, ldm, 0); + else + __hmma_m16n16k16_st_c_f16((int*)p, (int*)&a, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(float *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m16n16k16_st_c_f32((float*)p, (float*)&a, ldm, 0); + else + __hmma_m16n16k16_st_c_f32((float*)p, (float*)&a, ldm, 1); + } + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(int *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __imma_m16n16k16_st_c_i32(p, (const int*)&a, ldm, 0); + else + __imma_m16n16k16_st_c_i32(p, (const int*)&a, ldm, 1); + } +#endif /* __CUDA_IMMA__ */ + + // + // Store functions for frags of shape m32n8k16 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(__half *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m32n8k16_st_c_f16((int*)p, (int*)&a, ldm, 0); + else + __hmma_m32n8k16_st_c_f16((int*)p, (int*)&a, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(float *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m32n8k16_st_c_f32((float*)p, (float*)&a, ldm, 0); + else + __hmma_m32n8k16_st_c_f32((float*)p, (float*)&a, ldm, 1); + } + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(int *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __imma_m32n8k16_st_c_i32(p, (const int*)&a, ldm, 0); + else + __imma_m32n8k16_st_c_i32(p, (const int*)&a, ldm, 1); + } +#endif /* __CUDA_IMMA__ */ + + // + // Store functions for frags of shape m8n32k16 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(__half *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m8n32k16_st_c_f16((int*)p, (int*)&a, ldm, 0); + else + __hmma_m8n32k16_st_c_f16((int*)p, (int*)&a, ldm, 1); + } + + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(float *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __hmma_m8n32k16_st_c_f32((float*)p, (float*)&a, ldm, 0); + else + __hmma_m8n32k16_st_c_f32((float*)p, (float*)&a, ldm, 1); + } + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(int *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __imma_m8n32k16_st_c_i32(p, (const int*)&a, ldm, 0); + else + __imma_m8n32k16_st_c_i32(p, (const int*)&a, ldm, 1); + } +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_SUBBYTE_IMMA__ + // + // Store functions for frags of shape m8n8k32 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(int *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __imma_m8n8k32_st_c_i32(p, (const int*)&a, ldm, 0); + else + __imma_m8n8k32_st_c_i32(p, (const int*)&a, ldm, 1); + } + + // + // Store functions for frags of shape m8n8k128 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(int *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __bmma_m8n8k128_st_c_i32(p, (const int*)&a, ldm, 0); + else + __bmma_m8n8k128_st_c_i32(p, (const int*)&a, ldm, 1); + } +#endif /* __CUDA_SUBBYTE_IMMA__ */ + + +#ifdef __CUDA_AMPERE_MMA__ + + // + // Store functions for frags of shape m16n16k8 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(float *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __mma_m16n16k8_st_c_f32(p, (const float*)&a, ldm, 0); + else + __mma_m16n16k8_st_c_f32(p, (const float*)&a, ldm, 1); + } + + + // + // Store functions for frags of shape m8n8k4 + // + __CUDA_MMA_DEVICE_DECL__ void store_matrix_sync(double *p, const fragment& a, unsigned ldm, layout_t layout) { + if (layout == mem_row_major) + __dmma_m8n8k4_st_c_f64(p, (const double*)&a, ldm, 0); + else + __dmma_m8n8k4_st_c_f64(p, (const double*)&a, ldm, 1); + } +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // MMA functions for shape m16n16k16 + // + // D fp16, C fp16 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 2, 0); + } + + // D fp32, C fp16 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 2, 0); + } + + // D fp32, C fp32 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 2, 0); + } + + // D fp16, C fp32 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m16n16k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 2, 0); + } + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m16n16k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 1, 1); + else + __imma_m16n16k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 1, 0); + } + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m16n16k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 3, 1); + else + __imma_m16n16k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m16n16k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 0, 1); + else + __imma_m16n16k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m16n16k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 2, 1); + else + __imma_m16n16k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 2, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m16n16k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 1, 1); + else + __imma_m16n16k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m16n16k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 3, 1); + else + __imma_m16n16k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m16n16k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 0, 1); + else + __imma_m16n16k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m16n16k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 2, 1); + else + __imma_m16n16k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int *)&c, 2, 0); + } +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m16n16k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m16n16k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m16n16k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m16n16k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 2, 0); + } +#endif /* __CUDA_AMPERE_MMA__ */ + + + // + // MMA functions for shape m32n8k16 + // + // D fp16, C fp16 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 2, 0); + } + + // D fp32, C fp16 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 2, 0); + } + + // D fp32, C fp32 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 2, 0); + } + + // D fp16, C fp32 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m32n8k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 2, 0); + } + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m32n8k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 1); + else + __imma_m32n8k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m32n8k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 3, 1); + else + __imma_m32n8k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m32n8k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 0, 1); + else + __imma_m32n8k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m32n8k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 2, 1); + else + __imma_m32n8k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 2, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m32n8k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 1); + else + __imma_m32n8k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m32n8k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 3, 1); + else + __imma_m32n8k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 3, 0); + + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m32n8k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 0, 1); + else + __imma_m32n8k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 0, 0); + + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m32n8k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 2, 1); + else + __imma_m32n8k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 2, 0); + + } +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m32n8k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m32n8k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m32n8k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m32n8k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 2, 0); + } +#endif /* __CUDA_AMPERE_MMA__ */ + + // + // MMA functions for shape m8n32k16 + // + // D fp16, C fp16 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f16f16((int*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 2, 0); + } + + // D fp32, C fp16 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f32f16((float*)&d, (const int*)&a, (const int*)&b, (const int*)&c, 2, 0); + } + + // D fp32, C fp32 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f32f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 2, 0); + } + + // D fp16, C fp32 + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __hmma_m8n32k16_mma_f16f32((int*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 2, 0); + } + +#ifdef __CUDA_IMMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m8n32k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 1); + else + __imma_m8n32k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m8n32k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 3, 1); + else + __imma_m8n32k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m8n32k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 0, 1); + else + __imma_m8n32k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m8n32k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 2, 1); + else + __imma_m8n32k16_mma_s8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 2, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m8n32k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 1); + else + __imma_m8n32k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m8n32k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 3, 1); + else + __imma_m8n32k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m8n32k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 0, 1); + else + __imma_m8n32k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m8n32k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 2, 1); + else + __imma_m8n32k16_mma_u8((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 2, 0); + } +#endif /* __CUDA_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m8n32k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m8n32k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m8n32k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_bf16_m8n32k16_mma_f32((float*)&d, (const int*)&a, (const int*)&b, (const float*)&c, 2, 0); + } +#endif /* __CUDA_AMPERE_MMA__ */ + + +#ifdef __CUDA_SUBBYTE_IMMA__ + // + // MMA functions for shape m8n8k32 + // + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m8n8k32_mma_s4((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 1); + else + __imma_m8n8k32_mma_s4((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, bool satf) { + if (satf) + __imma_m8n8k32_mma_u4((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 1); + else + __imma_m8n8k32_mma_u4((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1, 0); + } + + // + // MMA functions for shape m8n8k128 + // + __CUDA_MMA_DEVICE_DECL__ void bmma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c, + experimental::bmmaBitOp op, experimental::bmmaAccumulateOp) + { + +#ifdef __CUDA_AMPERE_MMA__ + if (op == experimental::bmmaBitOpAND) + __bmma_m8n8k128_mma_and_popc_b1((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1); + else +#endif /* __CUDA_AMPERE_MMA__ */ + __bmma_m8n8k128_mma_xor_popc_b1((int*)&d, (const int *)&a, (const int *)&b, (const int*)&c, 1); + } + + +#endif /* __CUDA_SUBBYTE_IMMA__ */ + +#ifdef __CUDA_AMPERE_MMA__ + // + // MMA functions for shape m16n16k8 + // + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_tf32_m16n16k8_mma_f32((float *)&d, (const int*)&a, (const int*)&b, (const float*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_tf32_m16n16k8_mma_f32((float *)&d, (const int*)&a, (const int*)&b, (const float*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_tf32_m16n16k8_mma_f32((float *)&d, (const int*)&a, (const int*)&b, (const float*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __mma_tf32_m16n16k8_mma_f32((float *)&d, (const int*)&a, (const int*)&b, (const float*)&c, 2, 0); + } + + + // + // MMA functions for shape m8n8k4 + // + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __dmma_m8n8k4_mma_f64((double *)&d, (const double*)&a, (const double*)&b, (const double*)&c, 1, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __dmma_m8n8k4_mma_f64((double *)&d, (const double*)&a, (const double*)&b, (const double*)&c, 3, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __dmma_m8n8k4_mma_f64((double *)&d, (const double*)&a, (const double*)&b, (const double*)&c, 0, 0); + } + + __CUDA_MMA_DEVICE_DECL__ void mma_sync(fragment& d, const fragment& a, const fragment& b, const fragment& c) { + __dmma_m8n8k4_mma_f64((double *)&d, (const double*)&a, (const double*)&b, (const double*)&c, 2, 0); + } + +#endif /* __CUDA_AMPERE_MMA__ */ + +}; +}; + +#undef __CUDA_IMMA__ +#undef __CUDA_SUBBYTE_IMMA__ +#undef __CUDA_MMA_DEVICE_DECL__ +#undef __CUDA_AMPERE_MMA__ + +#endif /* !__CUDA_ARCH__ || __CUDA_ARCH__ >= 700 */ + +#endif /* __cplusplus && __CUDACC__ */ + + +#endif /* __CUDA_MMA_HPP__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_CUDA_MMA_HPP__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_CUDA_MMA_HPP__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/nvfunctional b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/nvfunctional new file mode 100644 index 0000000000000000000000000000000000000000..5cb9ffeb9cb9f1d202cb1f5cb1d4d7e88a416475 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/nvfunctional @@ -0,0 +1,621 @@ +/* + * NVIDIA_COPYRIGHT_BEGIN + * + * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + * + * NVIDIA_COPYRIGHT_END + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/nvfunctional is an internal header file and must not be used directly. Please use nvfunctional instead.") +#else +#warning "crt/nvfunctional is an internal header file and must not be used directly. Please use nvfunctional instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_NV_LIBCXX_FUNCTIONAL_H__ +#endif + +#ifndef __NV_LIBCXX_FUNCTIONAL_H__ +#define __NV_LIBCXX_FUNCTIONAL_H__ + +#if __cplusplus < 201103L + #if defined(_MSC_VER) + #if _MSC_VER < 1800 + #error This library requires VS 2013 and above + #endif /* _MSC_VER < 1800 */ + #else /* !_MSC_VER */ + #error This library requires support for the ISO C++ 2011 standard + #endif /* _MSC_VER */ +#endif /* __cplusplus */ + +#if defined(_MSC_VER) + #define __NV_ALIGNOF __alignof + #define __NV_NOEXCEPT + #define __NV_CONSTEXPR +#else /* !_MSC_VER */ + #define __NV_ALIGNOF alignof + #define __NV_NOEXCEPT noexcept + #define __NV_CONSTEXPR constexpr +#endif /* _MSC_VER */ + +#include +#include +#include + +// n3290 20.8 +namespace nvstd +{ + +namespace internal { + +// D.8.1 base (deprecated) [depr.base] +template +struct unary_function +{ + typedef _Arg argument_type; + typedef _Result result_type; +}; + +template +struct binary_function +{ + typedef _Arg1 first_argument_type; + typedef _Arg2 second_argument_type; + typedef _Result result_type; +}; + +// move +template +inline __device__ __host__ +typename std::remove_reference<_T>::type&& move(_T&& __t) __NV_NOEXCEPT +{ + return static_cast::type&&>(__t); +} + +// 20.2.2 swap [utility.swap] +// swap +template::value && + std::is_move_assignable<_T>::value>::type> +inline __device__ __host__ +void swap(_T& __a, _T& __b) +#if !defined(_MSC_VER) +noexcept(std::is_nothrow_move_constructible<_T>::value && + std::is_nothrow_move_assignable<_T>::value) +#endif /* !defined(_MSC_VER) */ +{ + _T __t(internal::move(__a)); + __a = internal::move(__b); + __b = internal::move(__t); +} + +// 20.2.3 forward/move helpers [forward] +// forward +template +inline __device__ __host__ +_T&& forward(typename std::remove_reference<_T>::type& __t) __NV_NOEXCEPT +{ + return static_cast<_T&&>(__t); +} + +template +inline __device__ __host__ +_T&& forward(typename std::remove_reference<_T>::type&& __t) __NV_NOEXCEPT +{ + static_assert(!std::is_lvalue_reference<_T>::value, + "Error: __t is instantiated with an lvalue reference type"); + return static_cast<_T&&>(__t); +} + +} // namespace internal + +namespace __functional_helpers +{ + +struct __dummy_class; + +// Store small functors locally: +// a functor is legitimate to local storage if it is one of the following types: +// * member object pointer; +// * member function pointer; +// * closure type of size less than or equal to the largest size of +// the above types; +// * function pointer; +// * any callable class whose size is less than or equal to +// the largest one of the above types; +union _Small_functor_types +{ + void *__obj; + void (*__func_ptr)(); + void (__dummy_class::*mem_fn_ptr)(); +}; + +struct _Small_functor_data { + char __data[sizeof(_Small_functor_types)]; +}; + +template +struct __maybe_base_function +{ }; + +template +struct __maybe_base_function<_RetType(_T1)> + : public internal::unary_function<_T1, _RetType> +{ }; + +template +struct __maybe_base_function<_RetType(_T1, _T2)> + : public internal::binary_function<_T1, _T2, _RetType> +{ }; + +} // namespace __functional_helpers + +// 20.8.11 Polymorphic function wrappers [func.wrap] + +// 20.8.11.1 Class bad_function_call [func.wrap.badcall] +// unimplemented because of exception +// class bad_function_call : public std::exception + +// 20.8.11.2 Class template function [func.wrap.func] + +template class function; // undefined + +// Simplified version of template class function, which +// * does not support allocator_arg_t; +// * does not support target and target_type that rely on RTTI +// * does not throw bad_function_call exception on invoking a NULL target +template +class function<_RetType(_ArgTypes...)> + : public __functional_helpers::__maybe_base_function<_RetType(_ArgTypes...)> +{ + __functional_helpers::_Small_functor_data __small_functor_data; + void *__obj; + typedef _RetType(*__meta_fn_type)(void *, _ArgTypes...); + __meta_fn_type __meta_fn; + typedef void(*__cloner_type)(function &, const function &); + __cloner_type __cloner; + typedef void(*__destructor_type)(function *); + __destructor_type __destructor; + + #pragma nv_exec_check_disable + template + __device__ __host__ + __NV_CONSTEXPR bool __use_small_functor_data() const + { + return (sizeof(_F) <= sizeof(__small_functor_data) && + __NV_ALIGNOF(_F) <= __NV_ALIGNOF( + __functional_helpers::_Small_functor_types)); + } + + #pragma nv_exec_check_disable + __device__ __host__ + void* __get_small_functor_data() const + { + return (void*)(&__small_functor_data.__data[0]); + } + + #pragma nv_exec_check_disable + __device__ __host__ + bool __is_small_functor_data() const + { + return __obj == __get_small_functor_data(); + } + + #pragma nv_exec_check_disable + template + __device__ __host__ + static _F& __get_functor(void *__p) + { + return *((_F*)__p); + } + + #pragma nv_exec_check_disable + template + __device__ __host__ + static bool __is_empty_functor(const _F& /*__p*/) + { + return false; + } + + #pragma nv_exec_check_disable + template + __device__ __host__ + static bool __is_empty_functor(const _F* __p) + { + return !__p; + } + + #pragma nv_exec_check_disable + template + __device__ __host__ + static bool __is_empty_functor(const _Res _C::* __p) + { + return !__p; + } + + #pragma nv_exec_check_disable + template + __device__ __host__ + static bool __is_empty_functor(const function<_Res(_Args...)>& __p) + { + return !__p; + } + + template + struct __make_cloner + { + #pragma nv_exec_check_disable + __device__ __host__ + static void __clone_data(function &__dest, const function &__src) + { + if (__dest.__use_small_functor_data<_F>()) { + __dest.__obj = __dest.__get_small_functor_data(); + new (__dest.__obj) _F(__src.__get_functor<_F>(__src.__obj)); + } + else { + __dest.__obj = new _F(__src.__get_functor<_F>(__src.__obj)); + } + } + }; + + template + struct __make_destructor + { + #pragma nv_exec_check_disable + __device__ __host__ + static void __destruct(function *__fn) + { + if (__fn->__use_small_functor_data<_F>()) { + (__fn->__get_functor<_F>(__fn->__obj)).~_F(); + } + else { + delete (_F*)(__fn->__obj); + } + } + }; + + // We cannot simple define __make_functor in the following way: + // template + // __make_functor; + // template + // struct __make_functor<_RetType1(_ArgTypes1...), _F> + // + // because VS 2013 cannot unpack _RetType1(_ArgTypes1...) + template + struct __make_functor + { + typedef _RetType1 type; + + #pragma nv_exec_check_disable + __device__ __host__ + static _RetType1 __invoke(void *__d, _ArgTypes1... __args) + { + return __get_functor<_F>(__d)( + internal::forward<_ArgTypes1>(__args)...); + } + }; + + template + struct __make_functor<_RetType1, _M _C::*,_ArgTypes1...> + { + typedef _RetType1 type; + typedef _RetType1(*_Fn)(_ArgTypes1...); + + #pragma nv_exec_check_disable + __device__ __host__ + static _RetType1 __invoke(void *__d, _ArgTypes1... __args) + { + return __get_functor<_Fn>(__d)( + internal::forward<_ArgTypes1>(__args)...); + } + }; + +// workaround for GCC version below 4.8 +#if (__GNUC__ == 4) && (__GNUC_MINOR__ < 8) + template + struct __check_callability + : public std::integral_constant::value> + { }; +#elif defined(_MSC_VER) + // simulate VC 2013's behavior... + template + struct __check_callability1 + : public + std::integral_constant::value || + std::is_convertible< + _RetType, + typename std::result_of<_F(_ArgTypes...)>::type + >::value + > + { }; + + template + struct __check_callability + : public std::integral_constant< + bool, + !std::is_same<_F, function>::value && + __check_callability1::type>::value> + { }; +#else /* !((__GNUC__ == 4) && (__GNUC_MINOR__ < 8)) _MSC_VER */ + template ::type> + struct __check_callability + : public std::integral_constant< + bool, + !std::is_same<_F, function>::value && + std::is_convertible< _T, _RetType>::value> + { }; +#endif /* __GNUC__ == 4) && (__GNUC_MINOR__ < 8) */ + + #pragma nv_exec_check_disable + __device__ __host__ + void __destroy() + { + if (__obj) { + __destructor(this); + __obj = 0; + } + } + + #pragma nv_exec_check_disable + __device__ __host__ + void __clear() + { + __obj = 0; + __meta_fn = 0; + __cloner = 0; + __destructor = 0; + } + +public: + typedef _RetType result_type; + +/* + * These typedef(s) are derived from __maybe_base_function + * typedef T1 argument_type; // only if sizeof...(ArgTypes) == 1 and + * // the type in ArgTypes is T1 + * typedef T1 first_argument_type; // only if sizeof...(ArgTypes) == 2 and + * // ArgTypes contains T1 and T2 + * typedef T2 second_argument_type; // only if sizeof...(ArgTypes) == 2 and + * // ArgTypes contains T1 and T2 + */ + + // 20.8.11.2.1 construct/copy/destroy [func.wrap.con] + + #pragma nv_exec_check_disable + __device__ __host__ + function() __NV_NOEXCEPT + : __obj(0), __meta_fn(0), __cloner(0), __destructor(0) {} + + #pragma nv_exec_check_disable + __device__ __host__ + function(std::nullptr_t) __NV_NOEXCEPT + : __obj(0), __meta_fn(0), __cloner(0), __destructor(0) {} + + #pragma nv_exec_check_disable + __device__ __host__ + function(const function &__fn) + { + if (__fn.__obj == 0) { + __clear(); + } + else { + __meta_fn = __fn.__meta_fn; + __destructor = __fn.__destructor; + __fn.__cloner(*this, __fn); + __cloner = __fn.__cloner; + } + } + + #pragma nv_exec_check_disable + __device__ __host__ + function(function &&__fn) + { + __fn.swap(*this); + } + + // VS 2013 cannot process __check_callability type trait. + // So, we check callability using static_assert instead of + // using SFINAE such as + // template::value + // >::type> + + #pragma nv_exec_check_disable + template + __device__ __host__ + function(_F); + + // copy and swap + #pragma nv_exec_check_disable + __device__ __host__ + function& operator=(const function& __fn) + { + function(__fn).swap(*this); + return *this; + } + + #pragma nv_exec_check_disable + __device__ __host__ + function& operator=(function&& __fn) + { + function(internal::move(__fn)).swap(*this); + return *this; + } + + #pragma nv_exec_check_disable + __device__ __host__ + function& operator=(std::nullptr_t) + { + __destroy(); + return *this; + } + + #pragma nv_exec_check_disable + template + __device__ __host__ + function& + operator=(_F&& __fn) + { + static_assert(__check_callability<_F>::value, + "Unable to create functor object!"); + function(internal::forward<_F>(__fn)).swap(*this); + return *this; + } + + #pragma nv_exec_check_disable + __device__ __host__ + ~function() + { + __destroy(); + } + + // 20.8.11.2.2 function modifiers [func.wrap.func.mod] + #pragma nv_exec_check_disable + __device__ __host__ + void swap(function& __fn) __NV_NOEXCEPT + { + internal::swap(__meta_fn, __fn.__meta_fn); + internal::swap(__cloner, __fn.__cloner); + internal::swap(__destructor, __fn.__destructor); + + if (__is_small_functor_data() && __fn.__is_small_functor_data()) { + internal::swap(__small_functor_data, __fn.__small_functor_data); + } + else if (__is_small_functor_data()) { + internal::swap(__small_functor_data, __fn.__small_functor_data); + internal::swap(__obj, __fn.__obj); + __fn.__obj = __fn.__get_small_functor_data(); + } + else if (__fn.__is_small_functor_data()) { + internal::swap(__small_functor_data, __fn.__small_functor_data); + internal::swap(__obj, __fn.__obj); + __obj = __get_small_functor_data(); + } + else { + internal::swap(__obj, __fn.__obj); + } + } + + // 20.8.11.2.3 function capacity [func.wrap.func.cap] + #pragma nv_exec_check_disable + __device__ __host__ + explicit operator bool() const __NV_NOEXCEPT + { + return __obj; + } + + // 20.8.11.2.4 function invocation [func.wrap.func.inv] + // function::operator() can only be called in device code + // to avoid cross-execution space calls + #pragma nv_exec_check_disable + __device__ __host__ + _RetType operator()(_ArgTypes...) const; + +}; + +// Out-of-line definitions +#pragma nv_exec_check_disable +template +template +__device__ __host__ +function<_RetType(_ArgTypes...)>::function(_F __fn) + : __obj(0), __meta_fn(0), __cloner(0), __destructor(0) +{ + static_assert(__check_callability<_F>::value, + "Unable to construct functor object!"); + if (__is_empty_functor(__fn)) + return; + __meta_fn = &__make_functor<_RetType, _F, _ArgTypes...>::__invoke; + __cloner = &__make_cloner<_F>::__clone_data; + __destructor = &__make_destructor<_F>::__destruct; + + if (__use_small_functor_data<_F>()) { + __obj = __get_small_functor_data(); + new ((void*)__obj) _F(internal::move(__fn)); + } + else { + __obj = new _F(internal::move(__fn)); + } +} + +#pragma nv_exec_check_disable +template +__device__ __host__ +_RetType +function<_RetType(_ArgTypes...)>::operator()(_ArgTypes... __args) const +{ + return __meta_fn(__obj, internal::forward<_ArgTypes>(__args)...); +} + +// 20.8.11.2.6, Null pointer comparisons: + +#pragma nv_exec_check_disable +template +__device__ __host__ +bool operator==(const function<_R(_ArgTypes...)>& __fn, std::nullptr_t) +__NV_NOEXCEPT +{ + return !__fn; +} + +#pragma nv_exec_check_disable +template +__device__ __host__ +bool operator==(std::nullptr_t, const function<_R(_ArgTypes...)>& __fn) +__NV_NOEXCEPT +{ + return !__fn; +} + +#pragma nv_exec_check_disable +template +__device__ __host__ +bool operator!=(const function<_R(_ArgTypes...)>& __fn, std::nullptr_t) +__NV_NOEXCEPT +{ + return static_cast(__fn); +} + +#pragma nv_exec_check_disable +template +__device__ __host__ +bool operator!=(std::nullptr_t, const function<_R(_ArgTypes...)>& __fn) +__NV_NOEXCEPT +{ + return static_cast(__fn); +} + +// 20.8.11.2.7, specialized algorithms: +#pragma nv_exec_check_disable +template +__device__ __host__ +void swap(function<_R(_ArgTypes...)>& __fn1, function<_R(_ArgTypes...)>& __fn2) +{ + __fn1.swap(__fn2); +} + +} // namespace nvstd + +#undef __NV_NOEXCEPT +#undef __NV_CONSTEXPR +#undef __NV_ALIGNOF + +#endif // __NV_LIBCXX_FUNCTIONAL_H__ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_NV_LIBCXX_FUNCTIONAL_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_NV_LIBCXX_FUNCTIONAL_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_100_rt.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_100_rt.h new file mode 100644 index 0000000000000000000000000000000000000000..3d798a6e5392ed631ed3b546304b16c94d65a1c8 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_100_rt.h @@ -0,0 +1,252 @@ +/* + * Copyright 2024 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/sm_100_rt.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/sm_100_rt.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_100_RT_H__ +#endif + +#if !defined(__SM_100_RT_H__) +#define __SM_100_RT_H__ + +#if defined(__CUDACC_RTC__) +#define __SM_100_RT_DECL__ __host__ __device__ +#else /* !__CUDACC_RTC__ */ +#define __SM_100_RT_DECL__ static __device__ __inline__ +#endif /* __CUDACC_RTC__ */ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 1000 + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +#if !defined(__CUDA_ARCH__) && !defined(_NVHPC_CUDA) +#define __DEF_IF_HOST { } +#else /* !__CUDA_ARCH__ && !_NVHPC_CUDA */ +#define __DEF_IF_HOST ; +#endif /* __CUDA_ARCH__ || _NVHPC_CUDA */ + +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector fused multiply-add operation + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * in round-to-nearest-even mode. + * + * Numeric behavior per component is the same as ::__fmaf_rn(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __ffma2_rn(float2 x, float2 y, float2 z) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector fused multiply-add operation + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * in round-towards-zero mode. + * + * Numeric behavior per component is the same as ::__fmaf_rz(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __ffma2_rz(float2 x, float2 y, float2 z) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector fused multiply-add operation + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * in round-down mode. + * + * Numeric behavior per component is the same as ::__fmaf_rd(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __ffma2_rd(float2 x, float2 y, float2 z) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector fused multiply-add operation + * \cuda_math_formula x \times y + z \end_cuda_math_formula + * in round-up mode. + * + * Numeric behavior per component is the same as ::__fmaf_ru(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __ffma2_ru(float2 x, float2 y, float2 z) __DEF_IF_HOST + +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector add operation + * \cuda_math_formula x + y \end_cuda_math_formula + * in round-to-nearest-even mode. + * + * Numeric behavior per component is the same as ::__fadd_rn(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __fadd2_rn(float2 x, float2 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector add operation + * \cuda_math_formula x + y \end_cuda_math_formula + * in round-towards-zero mode. + * + * Numeric behavior per component is the same as ::__fadd_rz(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __fadd2_rz(float2 x, float2 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector add operation + * \cuda_math_formula x + y \end_cuda_math_formula + * in round-down mode. + * + * Numeric behavior per component is the same as ::__fadd_rd(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __fadd2_rd(float2 x, float2 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector add operation + * \cuda_math_formula x + y \end_cuda_math_formula + * in round-up mode. + * + * Numeric behavior per component is the same as ::__fadd_ru(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __fadd2_ru(float2 x, float2 y) __DEF_IF_HOST + +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector multiply operation + * \cuda_math_formula x \times y \end_cuda_math_formula + * in round-to-nearest-even mode. + * + * Numeric behavior per component is the same as ::__fmul_rn(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __fmul2_rn(float2 x, float2 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector multiply operation + * \cuda_math_formula x \times y \end_cuda_math_formula + * in round-towards-zero mode. + * + * Numeric behavior per component is the same as ::__fmul_rz(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __fmul2_rz(float2 x, float2 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector multiply operation + * \cuda_math_formula x \times y \end_cuda_math_formula + * in round-down mode. + * + * Numeric behavior per component is the same as ::__fmul_rd(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __fmul2_rd(float2 x, float2 y) __DEF_IF_HOST +/** + * \ingroup CUDA_MATH_INTRINSIC_SINGLE + * \brief Compute vector multiply operation + * \cuda_math_formula x \times y \end_cuda_math_formula + * in round-up mode. + * + * Numeric behavior per component is the same as ::__fmul_ru(). + * + * \note_requires_sm100 + * \note_float2_perf + */ +__SM_100_RT_DECL__ float2 __fmul2_ru(float2 x, float2 y) __DEF_IF_HOST + +#endif /* !__CUDA_ARCH__ || __CUDA_ARCH__ >= 1000 */ + +#endif /* __cplusplus && __CUDACC__ */ + +#undef __DEF_IF_HOST +#undef __SM_100_RT_DECL__ + +#if (!defined(__CUDACC_RTC__) && defined(__CUDA_ARCH__)) || defined(_NVHPC_CUDA) +#include "sm_100_rt.hpp" +#endif /* (!defined(__CUDACC_RTC__) && defined(__CUDA_ARCH__)) || defined(_NVHPC_CUDA) */ + +#endif /* !__SM_100_RT_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_100_RT_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_100_RT_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_100_rt.hpp b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_100_rt.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a5d620bf0b8091e0ea6cd48da00e8689b92cdd88 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_100_rt.hpp @@ -0,0 +1,157 @@ +/* + * Copyright 2024 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/sm_100_rt.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/sm_100_rt.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_100_RT_HPP__ +#endif + +#if !defined(__SM_100_RT_HPP__) +#define __SM_100_RT_HPP__ + +#if defined(__CUDACC_RTC__) +#define __SM_100_RT_DECL__ __host__ __device__ +#else /* !__CUDACC_RTC__ */ +#define __SM_100_RT_DECL__ static __device__ __inline__ +#endif /* __CUDACC_RTC__ */ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 1000 + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +/******************************************************************************* +* * +* Below are implementations of SM-10.0 builtin functions which are included * +* as source (instead of being built in to the compiler) * +* * +*******************************************************************************/ + +extern "C" { + __device__ __device_builtin__ float2 __ffma2_rn_impl(float2 x, float2 y, float2 z); + __device__ __device_builtin__ float2 __ffma2_rz_impl(float2 x, float2 y, float2 z); + __device__ __device_builtin__ float2 __ffma2_rd_impl(float2 x, float2 y, float2 z); + __device__ __device_builtin__ float2 __ffma2_ru_impl(float2 x, float2 y, float2 z); + + __device__ __device_builtin__ float2 __fadd2_rn_impl(float2 x, float2 y); + __device__ __device_builtin__ float2 __fadd2_rz_impl(float2 x, float2 y); + __device__ __device_builtin__ float2 __fadd2_rd_impl(float2 x, float2 y); + __device__ __device_builtin__ float2 __fadd2_ru_impl(float2 x, float2 y); + + __device__ __device_builtin__ float2 __fmul2_rn_impl(float2 x, float2 y); + __device__ __device_builtin__ float2 __fmul2_rz_impl(float2 x, float2 y); + __device__ __device_builtin__ float2 __fmul2_rd_impl(float2 x, float2 y); + __device__ __device_builtin__ float2 __fmul2_ru_impl(float2 x, float2 y); +} // extern "C" + +__SM_100_RT_DECL__ float2 __ffma2_rn(float2 x, float2 y, float2 z) { + return __ffma2_rn_impl(x, y, z); +} +__SM_100_RT_DECL__ float2 __ffma2_rz(float2 x, float2 y, float2 z) { + return __ffma2_rz_impl(x, y, z); +} +__SM_100_RT_DECL__ float2 __ffma2_rd(float2 x, float2 y, float2 z) { + return __ffma2_rd_impl(x, y, z); +} +__SM_100_RT_DECL__ float2 __ffma2_ru(float2 x, float2 y, float2 z) { + return __ffma2_ru_impl(x, y, z); +} + +__SM_100_RT_DECL__ float2 __fadd2_rn(float2 x, float2 y) { + return __fadd2_rn_impl(x, y); +} +__SM_100_RT_DECL__ float2 __fadd2_rz(float2 x, float2 y) { + return __fadd2_rz_impl(x, y); +} +__SM_100_RT_DECL__ float2 __fadd2_rd(float2 x, float2 y) { + return __fadd2_rd_impl(x, y); +} +__SM_100_RT_DECL__ float2 __fadd2_ru(float2 x, float2 y) { + return __fadd2_ru_impl(x, y); +} + +__SM_100_RT_DECL__ float2 __fmul2_rn(float2 x, float2 y) { + return __fmul2_rn_impl(x, y); +} +__SM_100_RT_DECL__ float2 __fmul2_rz(float2 x, float2 y) { + return __fmul2_rz_impl(x, y); +} +__SM_100_RT_DECL__ float2 __fmul2_rd(float2 x, float2 y) { + return __fmul2_rd_impl(x, y); +} +__SM_100_RT_DECL__ float2 __fmul2_ru(float2 x, float2 y) { + return __fmul2_ru_impl(x, y); +} + +#endif /* !__CUDA_ARCH__ || __CUDA_ARCH__ >= 1000 */ + +#endif /* __cplusplus && __CUDACC__ */ + +#undef __SM_100_RT_DECL__ + +#endif /* !__SM_100_RT_HPP__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_100_RT_HPP__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_100_RT_HPP__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_70_rt.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_70_rt.h new file mode 100644 index 0000000000000000000000000000000000000000..6046953afa8c5f71cf7058436de10397d6353e9e --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_70_rt.h @@ -0,0 +1,139 @@ +/* + * Copyright 2017-2018 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + + //NOTE: For NVRTC, these declarations have been moved into the compiler (to reduce compile time) +#define EXCLUDE_FROM_RTC + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/sm_70_rt.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/sm_70_rt.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_70_RT_H__ +#endif + +#if !defined(__SM_70_RT_H__) +#define __SM_70_RT_H__ + +#if defined(__CUDACC_RTC__) +#define __SM_70_RT_DECL__ __host__ __device__ +#elif defined(_NVHPC_CUDA) +#define __SM_70_RT_DECL__ extern __device__ __cudart_builtin__ +#else /* !__CUDACC_RTC__ */ +#define __SM_70_RT_DECL__ static __device__ __inline__ +#endif /* __CUDACC_RTC__ */ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 700 + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +#if !defined(__CUDA_ARCH__) && !defined(_NVHPC_CUDA) +#define __DEF_IF_HOST { } +#else /* !__CUDA_ARCH__ */ +#define __DEF_IF_HOST ; +#endif /* __CUDA_ARCH__ */ + + +/****************************************************************************** + * match * + ******************************************************************************/ +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, unsigned value) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, int value) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, unsigned long value) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, long value) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, unsigned long long value) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, long long value) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, float value) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, double value) __DEF_IF_HOST + +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, unsigned value, int *pred) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, int value, int *pred) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, unsigned long value, int *pred) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, long value, int *pred) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, unsigned long long value, int *pred) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, long long value, int *pred) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, float value, int *pred) __DEF_IF_HOST +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, double value, int *pred) __DEF_IF_HOST + +__SM_70_RT_DECL__ void __nanosleep(unsigned int ns) __DEF_IF_HOST + +__SM_70_RT_DECL__ unsigned short int atomicCAS(unsigned short int *address, unsigned short int compare, unsigned short int val) __DEF_IF_HOST + +#endif /* !__CUDA_ARCH__ || __CUDA_ARCH__ >= 700 */ + +#endif /* __cplusplus && __CUDACC__ */ + +#undef __DEF_IF_HOST +#undef __SM_70_RT_DECL__ + +#if (!defined(__CUDACC_RTC__) && defined(__CUDA_ARCH__)) || defined(_NVHPC_CUDA) +#include "sm_70_rt.hpp" +#endif /* (!defined(__CUDACC_RTC__) && defined(__CUDA_ARCH__)) || defined(_NVHPC_CUDA) */ + +#endif /* !__SM_70_RT_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_70_RT_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_70_RT_H__ +#endif + + +#undef EXCLUDE_FROM_RTC \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_70_rt.hpp b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_70_rt.hpp new file mode 100644 index 0000000000000000000000000000000000000000..322496587325a1387e4280a509455e3ccc7caa1b --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_70_rt.hpp @@ -0,0 +1,192 @@ +/* + * Copyright 2017-2021 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/sm_70_rt.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/sm_70_rt.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_70_RT_HPP__ +#endif + +#if !defined(__SM_70_RT_HPP__) +#define __SM_70_RT_HPP__ + +#if defined(__CUDACC_RTC__) +#define __SM_70_RT_DECL__ __host__ __device__ +#else /* !__CUDACC_RTC__ */ +#define __SM_70_RT_DECL__ static __device__ __inline__ +#endif /* __CUDACC_RTC__ */ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 700 + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +/******************************************************************************* +* * +* Below are implementations of SM-7.0 builtin functions which are included as * +* source (instead of being built in to the compiler) * +* * +*******************************************************************************/ + +// +// __match_any_sync +// +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, unsigned value) { + return __match32_any_sync(mask, value); +} + +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, int value) { + return __match32_any_sync(mask, value); +} + +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, unsigned long value) { + return (sizeof(long) == sizeof(long long)) ? + __match64_any_sync(mask, (unsigned long long)value): + __match32_any_sync(mask, (unsigned)value); +} + +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, long value) { + return (sizeof(long) == sizeof(long long)) ? + __match64_any_sync(mask, (unsigned long long)value): + __match32_any_sync(mask, (unsigned)value); +} + +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, unsigned long long value) { + return __match64_any_sync(mask, value); +} + +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, long long value) { + return __match64_any_sync(mask, value); +} + +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, float value) { + return __match32_any_sync(mask, __float_as_uint(value)); +} + +__SM_70_RT_DECL__ unsigned int __match_any_sync(unsigned mask, double value) { + return __match64_any_sync(mask, __double_as_longlong(value)); +} + +// +// __match_all_sync +// +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, unsigned value, int *pred) { + return __match32_all_sync(mask, value, pred); +} + +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, int value, int *pred) { + return __match32_all_sync(mask, value, pred); +} + +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, unsigned long value, int *pred) { + return (sizeof(long) == sizeof(long long)) ? + __match64_all_sync(mask, (unsigned long long)value, pred): + __match32_all_sync(mask, (unsigned)value, pred); +} + +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, long value, int *pred) { + return (sizeof(long) == sizeof(long long)) ? + __match64_all_sync(mask, (unsigned long long)value, pred): + __match32_all_sync(mask, (unsigned)value, pred); +} + +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, unsigned long long value, int *pred) { + return __match64_all_sync(mask, value, pred); +} + +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, long long value, int *pred) { + return __match64_all_sync(mask, value, pred); +} + +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, float value, int *pred) { + return __match32_all_sync(mask, __float_as_uint(value), pred); +} + +__SM_70_RT_DECL__ unsigned int __match_all_sync(unsigned mask, double value, int *pred) { + return __match64_all_sync(mask, __double_as_longlong(value), pred); +} + +__SM_70_RT_DECL__ void __nanosleep(unsigned int ns) { + asm volatile("nanosleep.u32 %0;" :: "r"(ns)); +} + + +extern "C" __device__ __device_builtin__ +unsigned short __usAtomicCAS(unsigned short *, unsigned short, unsigned short); + +__SM_70_RT_DECL__ unsigned short int atomicCAS(unsigned short int *address, unsigned short int compare, unsigned short int val) { + return __usAtomicCAS(address, compare, val); +} + + +#endif /* !__CUDA_ARCH__ || __CUDA_ARCH__ >= 700 */ + +#endif /* __cplusplus && __CUDACC__ */ + +#undef __SM_70_RT_DECL__ + +#endif /* !__SM_70_RT_HPP__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_70_RT_HPP__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_70_RT_HPP__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_80_rt.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_80_rt.h new file mode 100644 index 0000000000000000000000000000000000000000..cc18290966875591b6a6efa1f8564eb76e5aa34b --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_80_rt.h @@ -0,0 +1,164 @@ +/* + * Copyright 2017-2021 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/sm_80_rt.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/sm_80_rt.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_80_RT_H__ +#endif + +#if !defined(__SM_80_RT_H__) +#define __SM_80_RT_H__ + +#if defined(__CUDACC_RTC__) +#define __SM_80_RT_DECL__ __host__ __device__ +#elif defined(_NVHPC_CUDA) +#define __SM_80_RT_DECL__ extern __device__ __cudart_builtin__ +#else /* !__CUDACC_RTC__ */ +#define __SM_80_RT_DECL__ static __device__ __inline__ +#endif /* __CUDACC_RTC__ */ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 800 + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +#if !defined(__CUDA_ARCH__) && !defined(_NVHPC_CUDA) +#define __DEF_IF_HOST { } +#else /* !__CUDA_ARCH__ */ +#define __DEF_IF_HOST ; +#endif /* __CUDA_ARCH__ */ + + +//NOTE: For NVRTC, these declarations have been moved into the compiler (to reduce compile time) +#define EXCLUDE_FROM_RTC +/****************************************************************************** + * reduce * + ******************************************************************************/ +__SM_80_RT_DECL__ unsigned __reduce_add_sync(unsigned mask, unsigned value) __DEF_IF_HOST +__SM_80_RT_DECL__ unsigned __reduce_min_sync(unsigned mask, unsigned value) __DEF_IF_HOST +__SM_80_RT_DECL__ unsigned __reduce_max_sync(unsigned mask, unsigned value) __DEF_IF_HOST + +__SM_80_RT_DECL__ int __reduce_add_sync(unsigned mask, int value) __DEF_IF_HOST +__SM_80_RT_DECL__ int __reduce_min_sync(unsigned mask, int value) __DEF_IF_HOST +__SM_80_RT_DECL__ int __reduce_max_sync(unsigned mask, int value) __DEF_IF_HOST + +__SM_80_RT_DECL__ unsigned __reduce_and_sync(unsigned mask, unsigned value) __DEF_IF_HOST +__SM_80_RT_DECL__ unsigned __reduce_or_sync(unsigned mask, unsigned value) __DEF_IF_HOST +__SM_80_RT_DECL__ unsigned __reduce_xor_sync(unsigned mask, unsigned value) __DEF_IF_HOST + +#undef EXCLUDE_FROM_RTC + + +extern "C" { +inline __device__ void *__nv_associate_access_property(const void *ptr, + unsigned long long property) { + extern __device__ void *__nv_associate_access_property_impl(const void *, + unsigned long long); + return __nv_associate_access_property_impl(ptr, property); +} + +inline __device__ void __nv_memcpy_async_shared_global_4(void *dst, + const void *src, + unsigned src_size) { + extern __device__ void __nv_memcpy_async_shared_global_4_impl(void *, + const void *, + unsigned); + __nv_memcpy_async_shared_global_4_impl(dst, src, src_size); +} + +inline __device__ void __nv_memcpy_async_shared_global_8(void *dst, + const void *src, + unsigned src_size) { + extern __device__ void __nv_memcpy_async_shared_global_8_impl(void *, + const void *, + unsigned); + __nv_memcpy_async_shared_global_8_impl(dst, src, src_size); +} + +inline __device__ void __nv_memcpy_async_shared_global_16(void *dst, + const void *src, + unsigned src_size) { + extern __device__ void __nv_memcpy_async_shared_global_16_impl(void *, + const void *, + unsigned); + __nv_memcpy_async_shared_global_16_impl(dst, src, src_size); +} + +} +#endif /* !__CUDA_ARCH__ || __CUDA_ARCH__ >= 800 */ + +#endif /* __cplusplus && __CUDACC__ */ + +#undef __DEF_IF_HOST +#undef __SM_80_RT_DECL__ + +#if (!defined(__CUDACC_RTC__) && defined(__CUDA_ARCH__)) || defined(_NVHPC_CUDA) +#include "sm_80_rt.hpp" +#endif /* !__CUDACC_RTC__ && defined(__CUDA_ARCH__) */ + +#endif /* !__SM_80_RT_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_80_RT_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_80_RT_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_80_rt.hpp b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_80_rt.hpp new file mode 100644 index 0000000000000000000000000000000000000000..857bd44a3bb0d8480560047a85f9059bc370b52f --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_80_rt.hpp @@ -0,0 +1,148 @@ +/* + * Copyright 2017-2021 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/sm_80_rt.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/sm_80_rt.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_80_RT_HPP__ +#endif + +#if !defined(__SM_80_RT_HPP__) +#define __SM_80_RT_HPP__ + +#if defined(__CUDACC_RTC__) +#define __SM_80_RT_DECL__ __host__ __device__ +#else /* !__CUDACC_RTC__ */ +#define __SM_80_RT_DECL__ static __device__ __inline__ +#endif /* __CUDACC_RTC__ */ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 800 + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +/******************************************************************************* +* * +* Below are implementations of SM-8.0 builtin functions which are included as * +* source (instead of being built in to the compiler) * +* * +*******************************************************************************/ + +extern "C" { + __device_builtin__ __device__ unsigned __reduce_add_sync_unsigned_impl(unsigned, unsigned); + __device_builtin__ __device__ unsigned __reduce_min_sync_unsigned_impl(unsigned, unsigned); + __device_builtin__ __device__ unsigned __reduce_max_sync_unsigned_impl(unsigned, unsigned); + __device_builtin__ __device__ int __reduce_add_sync_signed_impl(unsigned, int); + __device_builtin__ __device__ int __reduce_min_sync_signed_impl(unsigned, int); + __device_builtin__ __device__ int __reduce_max_sync_signed_impl(unsigned, int); + __device_builtin__ __device__ unsigned __reduce_or_sync_unsigned_impl(unsigned, unsigned); + __device_builtin__ __device__ unsigned __reduce_and_sync_unsigned_impl(unsigned, unsigned); + __device_builtin__ __device__ unsigned __reduce_xor_sync_unsigned_impl(unsigned, unsigned); +} + +__SM_80_RT_DECL__ unsigned __reduce_add_sync(unsigned mask, unsigned value) { + return __reduce_add_sync_unsigned_impl(mask, value); +} + +__SM_80_RT_DECL__ unsigned __reduce_min_sync(unsigned mask, unsigned value) { + return __reduce_min_sync_unsigned_impl(mask, value); +} + +__SM_80_RT_DECL__ unsigned __reduce_max_sync(unsigned mask, unsigned value) { + return __reduce_max_sync_unsigned_impl(mask, value); +} + +__SM_80_RT_DECL__ int __reduce_add_sync(unsigned mask, int value) { + return __reduce_add_sync_signed_impl(mask, value); +} + +__SM_80_RT_DECL__ int __reduce_min_sync(unsigned mask, int value) { + return __reduce_min_sync_signed_impl(mask, value); +} + +__SM_80_RT_DECL__ int __reduce_max_sync(unsigned mask, int value) { + return __reduce_max_sync_signed_impl(mask, value); +} + +__SM_80_RT_DECL__ unsigned __reduce_and_sync(unsigned mask, unsigned value) { + return __reduce_and_sync_unsigned_impl(mask, value); +} + +__SM_80_RT_DECL__ unsigned __reduce_or_sync(unsigned mask, unsigned value) { + return __reduce_or_sync_unsigned_impl(mask, value); +} + +__SM_80_RT_DECL__ unsigned __reduce_xor_sync(unsigned mask, unsigned value) { + return __reduce_xor_sync_unsigned_impl(mask, value); +} +#endif /* !__CUDA_ARCH__ || __CUDA_ARCH__ >= 800 */ + +#endif /* __cplusplus && __CUDACC__ */ + +#undef __SM_80_RT_DECL__ + +#endif /* !__SM_80_RT_HPP__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_80_RT_HPP__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_80_RT_HPP__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_90_rt.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_90_rt.h new file mode 100644 index 0000000000000000000000000000000000000000..8e250634fe76651c2a15b5b492378efec1d3e0c5 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_90_rt.h @@ -0,0 +1,282 @@ +/* + * Copyright 2022-2023 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/sm_90_rt.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/sm_90_rt.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_90_RT_H__ +#endif + +#if !defined(__SM_90_RT_H__) +#define __SM_90_RT_H__ + +#if defined(__CUDACC_RTC__) +#define __SM_90_RT_DECL__ __host__ __device__ +#else /* !__CUDACC_RTC__ */ +#define __SM_90_RT_DECL__ static __device__ __inline__ +#endif /* __CUDACC_RTC__ */ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 900 + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +#if !defined(__CUDA_ARCH__) && !defined(_NVHPC_CUDA) +#define __DEF_IF_HOST { } +#else /* !__CUDA_ARCH__ && !_NVHPC_CUDA */ +#define __DEF_IF_HOST ; +#endif /* __CUDA_ARCH__ || _NVHPC_CUDA */ + +//NOTE: For NVRTC, these declarations have been moved into the compiler (to reduce compile time) +#define EXCLUDE_FROM_RTC + +__SM_90_RT_DECL__ unsigned __isCtaShared(const void *ptr) __DEF_IF_HOST +__SM_90_RT_DECL__ unsigned __isClusterShared(const void *ptr) __DEF_IF_HOST +__SM_90_RT_DECL__ void *__cluster_map_shared_rank(const void *ptr, unsigned target_block_rank) __DEF_IF_HOST +__SM_90_RT_DECL__ unsigned __cluster_query_shared_rank(const void *ptr) __DEF_IF_HOST +__SM_90_RT_DECL__ uint2 __cluster_map_shared_multicast(const void *ptr, unsigned cluster_cta_mask) __DEF_IF_HOST +__SM_90_RT_DECL__ unsigned __clusterDimIsSpecified() __DEF_IF_HOST +__SM_90_RT_DECL__ dim3 __clusterDim() __DEF_IF_HOST +__SM_90_RT_DECL__ dim3 __clusterRelativeBlockIdx() __DEF_IF_HOST +__SM_90_RT_DECL__ dim3 __clusterGridDimInClusters() __DEF_IF_HOST +__SM_90_RT_DECL__ dim3 __clusterIdx() __DEF_IF_HOST +__SM_90_RT_DECL__ unsigned __clusterRelativeBlockRank() __DEF_IF_HOST +__SM_90_RT_DECL__ unsigned __clusterSizeInBlocks() __DEF_IF_HOST +__SM_90_RT_DECL__ void __cluster_barrier_arrive() __DEF_IF_HOST +__SM_90_RT_DECL__ void __cluster_barrier_arrive_relaxed() __DEF_IF_HOST +__SM_90_RT_DECL__ void __cluster_barrier_wait() __DEF_IF_HOST +__SM_90_RT_DECL__ void __threadfence_cluster() __DEF_IF_HOST + +__SM_90_RT_DECL__ float2 atomicAdd(float2 *__address, float2 val) __DEF_IF_HOST +__SM_90_RT_DECL__ float2 atomicAdd_block(float2 *__address, float2 val) __DEF_IF_HOST +__SM_90_RT_DECL__ float2 atomicAdd_system(float2 *__address, float2 val) __DEF_IF_HOST +__SM_90_RT_DECL__ float4 atomicAdd(float4 *__address, float4 val) __DEF_IF_HOST +__SM_90_RT_DECL__ float4 atomicAdd_block(float4 *__address, float4 val) __DEF_IF_HOST +__SM_90_RT_DECL__ float4 atomicAdd_system(float4 *__address, float4 val) __DEF_IF_HOST + +#undef EXCLUDE_FROM_RTC + +//Note: below atomic functions are templates, so cannot be represented in NVRTC +//builtins representation, so they have to be parsed on every NVRTC compilation. +//(notice 'EXCLUDE_FROM_RTC' ends above) + + +#ifndef __NV_DISABLE_128_ATOMICS +// lgen definitions for 128b atomics +extern "C" { + __device__ __device_builtin__ void __u128AtomicCAS(void *, void *, void *, void *); + __device__ __device_builtin__ void __u128AtomicCAS_block(void *, void *, void *, void *); + __device__ __device_builtin__ void __u128AtomicCAS_system(void *, void *, void *, void *); + __device__ __device_builtin__ void __u128AtomicExch(void *, void *, void *); + __device__ __device_builtin__ void __u128AtomicExch_block(void *, void *, void *); + __device__ __device_builtin__ void __u128AtomicExch_system(void *, void *, void *); +} + +// macro to get address of object, to workaround situations where the type overloads the "&" operator +#define __NV_ATOMIC_ADDRESSOF(__val) \ + (void *)(&(const_cast(reinterpret_cast(__val)))) + +// enable_if +template +struct __nv_atomic_enable_if { }; + +template +struct __nv_atomic_enable_if { typedef _T __type; }; + +// alignof +#if defined(__CUDACC_RTC__) +#define __NV_ATOMIC_ALIGNOF __alignof__ +#else +#define __NV_ATOMIC_ALIGNOF __alignof +#endif + +// trivially copyable +template +struct __nv_atomic_triv_cp_helper { +#if defined(__GNUC__) +#if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) + static const bool __val = true; +#elif (__GNUC__ < 5) + static const bool __val = __has_trivial_copy(_T); +#else + static const bool __val = __is_trivially_copyable(_T); +#endif +#else + static const bool __val = __is_trivially_copyable(_T); +#endif +}; +#define __NV_ATOMIC_TRIVIALLY_COPYABLE(_T) \ + __nv_atomic_triv_cp_helper<_T>::__val + +// return type +#if __cplusplus >= 202002L // C++20 or greater +#define __NV_ATOMIC_RET_TYPE(_T) _T +#else +#define __NV_ATOMIC_RET_TYPE(_T) typename \ + __nv_atomic_enable_if= 16 && \ + __NV_ATOMIC_TRIVIALLY_COPYABLE(_T), _T>::__type +#endif + +// requires +#if __cplusplus >= 202002L // C++20 or greater +#define __NV_ATOMIC_REQUIRES(_T) \ + requires(sizeof(_T) == 16 && \ + __NV_ATOMIC_ALIGNOF(_T) >= 16 && \ + __NV_ATOMIC_TRIVIALLY_COPYABLE(_T)) +#else +#define __NV_ATOMIC_REQUIRES(_T) +#endif + +// temp value and return value +#if __cplusplus >= 201103L || defined(_MSC_VER) // C++11 or greater, or MSC +#define __NV_ATOMIC_TEMP(_T) union _U \ + {_T __ret; __device__ __inline__ _U() {}}; _U __u +#define __NV_ATOMIC_RET(_T) __u.__ret +#else +#define __NV_ATOMIC_TEMP(_T) _T __ret +#define __NV_ATOMIC_RET(_T) __ret +#endif + +// templated 128-bit atomics +template +__SM_90_RT_DECL__ __NV_ATOMIC_RET_TYPE(_T) +atomicCAS(_T *__address, _T __compare, _T __val) __NV_ATOMIC_REQUIRES(_T) { + __NV_ATOMIC_TEMP(_T); + __u128AtomicCAS((void *)(__address), + __NV_ATOMIC_ADDRESSOF(__compare), + __NV_ATOMIC_ADDRESSOF(__val), + __NV_ATOMIC_ADDRESSOF(__NV_ATOMIC_RET(_T))); + return __NV_ATOMIC_RET(_T); +} + +template +__SM_90_RT_DECL__ __NV_ATOMIC_RET_TYPE(_T) +atomicCAS_block(_T *__address, _T __compare, _T __val) __NV_ATOMIC_REQUIRES(_T) { + __NV_ATOMIC_TEMP(_T); + __u128AtomicCAS_block((void *)(__address), + __NV_ATOMIC_ADDRESSOF(__compare), + __NV_ATOMIC_ADDRESSOF(__val), + __NV_ATOMIC_ADDRESSOF(__NV_ATOMIC_RET(_T))); + return __NV_ATOMIC_RET(_T); +} + +template +__SM_90_RT_DECL__ __NV_ATOMIC_RET_TYPE(_T) +atomicCAS_system(_T *__address, _T __compare, _T __val) __NV_ATOMIC_REQUIRES(_T) { + __NV_ATOMIC_TEMP(_T); + __u128AtomicCAS_system((void *)(__address), + __NV_ATOMIC_ADDRESSOF(__compare), + __NV_ATOMIC_ADDRESSOF(__val), + __NV_ATOMIC_ADDRESSOF(__NV_ATOMIC_RET(_T))); + return __NV_ATOMIC_RET(_T); +} + +template +__SM_90_RT_DECL__ __NV_ATOMIC_RET_TYPE(_T) +atomicExch(_T *__address, _T __val) __NV_ATOMIC_REQUIRES(_T) { + __NV_ATOMIC_TEMP(_T); + __u128AtomicExch((void *)(__address), + __NV_ATOMIC_ADDRESSOF(__val), + __NV_ATOMIC_ADDRESSOF(__NV_ATOMIC_RET(_T))); + return __NV_ATOMIC_RET(_T); +} + +template +__SM_90_RT_DECL__ __NV_ATOMIC_RET_TYPE(_T) +atomicExch_block(_T *__address, _T __val) __NV_ATOMIC_REQUIRES(_T) { + __NV_ATOMIC_TEMP(_T); + __u128AtomicExch_block((void *)(__address), + __NV_ATOMIC_ADDRESSOF(__val), + __NV_ATOMIC_ADDRESSOF(__NV_ATOMIC_RET(_T))); + return __NV_ATOMIC_RET(_T); +} + +template +__SM_90_RT_DECL__ __NV_ATOMIC_RET_TYPE(_T) +atomicExch_system(_T *__address, _T __val) __NV_ATOMIC_REQUIRES(_T) { + __NV_ATOMIC_TEMP(_T); + __u128AtomicExch_system((void *)(__address), + __NV_ATOMIC_ADDRESSOF(__val), + __NV_ATOMIC_ADDRESSOF(__NV_ATOMIC_RET(_T))); + return __NV_ATOMIC_RET(_T); +} +#endif /* !__NV_DISABLE_128_ATOMICS */ + +#endif /* !__CUDA_ARCH__ || __CUDA_ARCH__ >= 900 */ + +#endif /* __cplusplus && __CUDACC__ */ + +#undef __DEF_IF_HOST +#undef __SM_90_RT_DECL__ + +#if (!defined(__CUDACC_RTC__) && defined(__CUDA_ARCH__)) || defined(_NVHPC_CUDA) +#include "sm_90_rt.hpp" +#endif /* (!defined(__CUDACC_RTC__) && defined(__CUDA_ARCH__)) || defined(_NVHPC_CUDA) */ + +#endif /* !__SM_90_RT_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_90_RT_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_90_RT_H__ +#endif + diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_90_rt.hpp b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_90_rt.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4e61ac78b996fa03cadf60208bbd58f2e781f3ec --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/sm_90_rt.hpp @@ -0,0 +1,248 @@ +/* + * Copyright 2022 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/sm_90_rt.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/sm_90_rt.hpp is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_90_RT_HPP__ +#endif + +#if !defined(__SM_90_RT_HPP__) +#define __SM_90_RT_HPP__ + +#if defined(__CUDACC_RTC__) +#define __SM_90_RT_DECL__ __host__ __device__ +#else /* !__CUDACC_RTC__ */ +#define __SM_90_RT_DECL__ static __device__ __inline__ +#endif /* __CUDACC_RTC__ */ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 900 + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#include "builtin_types.h" +#include "device_types.h" +#include "host_defines.h" + +/******************************************************************************* +* * +* Below are implementations of SM-9.0 builtin functions which are included as * +* source (instead of being built in to the compiler) * +* * +*******************************************************************************/ +extern "C" { + __device__ unsigned __nv_isClusterShared_impl(const void *); + __device__ void * __nv_cluster_map_shared_rank_impl(const void *, unsigned); + __device__ unsigned __nv_cluster_query_shared_rank_impl(const void *); + __device__ unsigned __nv_clusterDimIsSpecifed_impl(); + __device__ void __nv_clusterDim_impl(unsigned *, unsigned *, unsigned *); + __device__ void __nv_clusterRelativeBlockIdx_impl(unsigned *, + unsigned *, unsigned *); + __device__ void __nv_clusterGridDimInClusters_impl(unsigned *, + unsigned *, unsigned *); + __device__ void __nv_clusterIdx_impl(unsigned *, unsigned *, unsigned *); + __device__ unsigned __nv_clusterRelativeBlockRank_impl(); + __device__ unsigned __nv_clusterSizeInBlocks_impl(); + __device__ void __nv_cluster_barrier_arrive_impl(); + __device__ void __nv_cluster_barrier_arrive_relaxed_impl(); + __device__ void __nv_cluster_barrier_wait_impl(); + __device__ void __nv_threadfence_cluster_impl(); + + __device__ __device_builtin__ float2 __f2AtomicAdd(float2 *, float2); + __device__ __device_builtin__ float2 __f2AtomicAdd_block(float2 *, float2); + __device__ __device_builtin__ float2 __f2AtomicAdd_system(float2 *, float2); + __device__ __device_builtin__ float4 __f4AtomicAdd(float4 *, float4); + __device__ __device_builtin__ float4 __f4AtomicAdd_block(float4 *, float4); + __device__ __device_builtin__ float4 __f4AtomicAdd_system(float4 *, float4); +} // extern "C" + +__SM_90_RT_DECL__ unsigned __isCtaShared(const void *ptr) +{ + return __isShared(ptr); +} + +__SM_90_RT_DECL__ unsigned __isClusterShared(const void *ptr) +{ + return __nv_isClusterShared_impl(ptr); +} + +__SM_90_RT_DECL__ void *__cluster_map_shared_rank(const void *ptr, + unsigned target_block_rank) +{ + return __nv_cluster_map_shared_rank_impl(ptr, target_block_rank); +} + +__SM_90_RT_DECL__ unsigned __cluster_query_shared_rank(const void *ptr) +{ + return __nv_cluster_query_shared_rank_impl(ptr); +} + +__SM_90_RT_DECL__ uint2 __cluster_map_shared_multicast(const void *ptr, + unsigned int cluster_cta_mask) +{ + return make_uint2((unsigned)__cvta_generic_to_shared(ptr), cluster_cta_mask); +} + +__SM_90_RT_DECL__ unsigned __clusterDimIsSpecified() +{ + return __nv_clusterDimIsSpecifed_impl(); +} + +__SM_90_RT_DECL__ dim3 __clusterDim() +{ + unsigned x, y, z; + __nv_clusterDim_impl(&x, &y, &z); + return dim3(x,y,z); +} + +__SM_90_RT_DECL__ dim3 __clusterRelativeBlockIdx() +{ + unsigned x, y, z; + __nv_clusterRelativeBlockIdx_impl(&x, &y, &z); + return dim3(x,y,z); +} + +__SM_90_RT_DECL__ dim3 __clusterGridDimInClusters() +{ + unsigned x, y, z; + __nv_clusterGridDimInClusters_impl(&x, &y, &z); + return dim3(x,y,z); +} + +__SM_90_RT_DECL__ dim3 __clusterIdx() +{ + unsigned x, y, z; + __nv_clusterIdx_impl(&x, &y, &z); + return dim3(x,y,z); +} + +__SM_90_RT_DECL__ unsigned __clusterRelativeBlockRank() +{ + return __nv_clusterRelativeBlockRank_impl(); +} + +__SM_90_RT_DECL__ unsigned __clusterSizeInBlocks() +{ + return __nv_clusterSizeInBlocks_impl(); +} + +__SM_90_RT_DECL__ void __cluster_barrier_arrive() +{ + __nv_cluster_barrier_arrive_impl(); +} + +__SM_90_RT_DECL__ void __cluster_barrier_arrive_relaxed() +{ + __nv_cluster_barrier_arrive_relaxed_impl(); +} + +__SM_90_RT_DECL__ void __cluster_barrier_wait() +{ + __nv_cluster_barrier_wait_impl(); +} + +__SM_90_RT_DECL__ void __threadfence_cluster() +{ + __nv_threadfence_cluster_impl(); +} + + +/* Define __PTR for atomicAdd prototypes below, undef after done */ +#if (defined(_MSC_VER) && defined(_WIN64)) || defined(__LP64__) || defined(__CUDACC_RTC__) +#define __PTR "l" +#else +#define __PTR "r" +#endif /*(defined(_MSC_VER) && defined(_WIN64)) || defined(__LP64__) || defined(__CUDACC_RTC__)*/ + +__SM_90_RT_DECL__ float2 atomicAdd(float2 *address, float2 val) { + return __f2AtomicAdd(address, val); +} + +__SM_90_RT_DECL__ float2 atomicAdd_block(float2 *address, float2 val) { + return __f2AtomicAdd_block(address, val); +} + +__SM_90_RT_DECL__ float2 atomicAdd_system(float2 *address, float2 val) { + return __f2AtomicAdd_system(address, val); +} + +__SM_90_RT_DECL__ float4 atomicAdd(float4 *address, float4 val) { + return __f4AtomicAdd(address, val); +} + +__SM_90_RT_DECL__ float4 atomicAdd_block(float4 *address, float4 val) { + return __f4AtomicAdd_block(address, val); +} + +__SM_90_RT_DECL__ float4 atomicAdd_system(float4 *address, float4 val) { + return __f4AtomicAdd_system(address, val); +} + +#endif /* !__CUDA_ARCH__ || __CUDA_ARCH__ >= 900 */ + +#endif /* __cplusplus && __CUDACC__ */ + +#undef __SM_90_RT_DECL__ + +#endif /* !__SM_90_RT_HPP__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_90_RT_HPP__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_SM_90_RT_HPP__ +#endif diff --git a/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/storage_class.h b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/storage_class.h new file mode 100644 index 0000000000000000000000000000000000000000..1fb19bd46ebde4a53dfad866050fad9fb0cbd222 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-crt-dev_linux-64-12.8.93-h06a4308_3/targets/x86_64-linux/include/crt/storage_class.h @@ -0,0 +1,142 @@ +/* + * NVIDIA_COPYRIGHT_BEGIN + * + * Copyright (c) 2008-2018, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + * + * NVIDIA_COPYRIGHT_END + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/storage_class.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/storage_class.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_STORAGE_CLASS_H__ +#endif + +#if !defined(__STORAGE_CLASS_H__) +#define __STORAGE_CLASS_H__ + +#if !defined(__var_used__) + +#define __var_used__ + +#endif /* __var_used__ */ + +#if !defined(__loc_sc__) + +#define __loc_sc__(loc, size, sc) \ + __storage##_##sc##size##loc loc + +#endif /* !__loc_sc__ */ + +#if !defined(__storage___device__) +#define __storage___device__ static __var_used__ +#endif /* __storage___device__ */ + +#if !defined(__storage_extern__device__) +#define __storage_extern__device__ static __var_used__ +#endif /* __storage_extern__device__ */ + +#if !defined(__storage_auto__device__) +#define __storage_auto__device__ @@@ COMPILER @@@ ERROR @@@ +#endif /* __storage_auto__device__ */ + +#if !defined(__storage_static__device__) +#define __storage_static__device__ static __var_used__ +#endif /* __storage_static__device__ */ + +#if !defined(__storage___constant__) +#define __storage___constant__ static __var_used__ +#endif /* __storage___constant__ */ + +#if !defined(__storage_extern__constant__) +#define __storage_extern__constant__ static __var_used__ +#endif /* __storage_extern__constant__ */ + +#if !defined(__storage_auto__constant__) +#define __storage_auto__constant__ @@@ COMPILER @@@ ERROR @@@ +#endif /* __storage_auto__constant__ */ + +#if !defined(__storage_static__constant__) +#define __storage_static__constant__ static __var_used__ +#endif /* __storage_static__constant__ */ + +#if !defined(__storage___shared__) +#define __storage___shared__ static __var_used__ +#endif /* __storage___shared__ */ + +#if !defined(__storage_extern__shared__) +#define __storage_extern__shared__ static __var_used__ +#endif /* __storage_extern__shared__ */ + +#if !defined(__storage_auto__shared__) +#define __storage_auto__shared__ static +#endif /* __storage_auto__shared__ */ + +#if !defined(__storage_static__shared__) +#define __storage_static__shared__ static __var_used__ +#endif /* __storage_static__shared__ */ + +#if !defined(__storage__unsized__shared__) +#define __storage__unsized__shared__ @@@ COMPILER @@@ ERROR @@@ +#endif /* __storage__unsized__shared__ */ + +#if !defined(__storage_extern_unsized__shared__) +#define __storage_extern_unsized__shared__ static __var_used__ +#endif /* __storage_extern_unsized__shared__ */ + +#if !defined(__storage_auto_unsized__shared__) +#define __storage_auto_unsized__shared__ @@@ COMPILER @@@ ERROR @@@ +#endif /* __storage_auto_unsized__shared__ */ + +#if !defined(__storage_static_unsized__shared__) +#define __storage_static_unsized__shared__ @@@ COMPILER @@@ ERROR @@@ +#endif /* __storage_static_unsized__shared__ */ + +#if !defined(__storage___text__) +#define __storage___text__ static __var_used__ +#endif /* __storage___text__ */ + +#if !defined(__storage_extern__text__) +#define __storage_extern__text__ static __var_used__ +#endif /* __storage_extern__text__ */ + +#if !defined(__storage_auto__text__) +#define __storage_auto__text__ @@@ COMPILER @@@ ERROR @@@ +#endif /* __storage_auto__text__ */ + +#if !defined(__storage_static__text__) +#define __storage_static__text__ static __var_used__ +#endif /* __storage_static__text__ */ + +#if !defined(__storage___surf__) +#define __storage___surf__ static __var_used__ +#endif /* __storage___surf__ */ + +#if !defined(__storage_extern__surf__) +#define __storage_extern__surf__ static __var_used__ +#endif /* __storage_extern__surf__ */ + +#if !defined(__storage_auto__surf__) +#define __storage_auto__surf__ @@@ COMPILER @@@ ERROR @@@ +#endif /* __storage_auto__surf__ */ + +#if !defined(__storage_static__surf__) +#define __storage_static__surf__ static __var_used__ +#endif /* __storage_static__surf__ */ + +#endif /* !__STORAGE_CLASS_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_STORAGE_CLASS_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_STORAGE_CLASS_H__ +#endif diff --git a/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/about.json b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..0d25077547921b21e918be4a78030ca1f0d2ba14 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/about.json @@ -0,0 +1,138 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://conda.anaconda.org/nvidia/linux-64" + ], + "conda_build_version": "24.1.2", + "conda_version": "24.1.2", + "description": "Provides libraries to enable third party tools using GPU profiling APIs.\n", + "doc_url": "https://docs.nvidia.com/cuda/cupti/index.html", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "recipe-maintainers": [ + "conda-forge/cuda" + ] + }, + "home": "https://developer.nvidia.com/cuda-toolkit", + "identifiers": [], + "keywords": [], + "license": "LicenseRef-NVIDIA-End-User-License-Agreement", + "license_file": "LICENSE", + "license_url": "https://docs.nvidia.com/cuda/eula/index.html", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "_openmp_mutex 5.1 1_gnu", + "archspec 0.2.1 pyhd3eb1b0_0", + "boltons 23.0.0 py312h06a4308_0", + "brotli-python 1.0.9 py312h6a678d5_7", + "bzip2 1.0.8 h7b6447c_0", + "c-ares 1.19.1 h5eee18b_0", + "ca-certificates 2023.12.12 h06a4308_0", + "certifi 2024.2.2 py312h06a4308_0", + "cffi 1.16.0 py312h5eee18b_0", + "charset-normalizer 2.0.4 pyhd3eb1b0_0", + "conda 24.1.2 py312h06a4308_0", + "conda-content-trust 0.2.0 py312h06a4308_0", + "conda-libmamba-solver 23.12.0 pyhd3eb1b0_1", + "conda-package-handling 2.2.0 py312h06a4308_0", + "conda-package-streaming 0.9.0 py312h06a4308_0", + "cryptography 41.0.7 py312hdda0065_0", + "distro 1.8.0 py312h06a4308_0", + "expat 2.5.0 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_0", + "icu 73.1 h6a678d5_0", + "idna 3.4 py312h06a4308_0", + "jsonpatch 1.32 pyhd3eb1b0_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "krb5 1.20.1 h143b758_1", + "ld_impl_linux-64 2.38 h1181459_1", + "libarchive 3.6.2 h6ac8c49_2", + "libcurl 8.5.0 h251f7ec_0", + "libedit 3.1.20230828 h5eee18b_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_0", + "libgcc-ng 11.2.0 h1234567_1", + "libgomp 11.2.0 h1234567_1", + "libmamba 1.5.3 haf1ee3a_0", + "libmambapy 1.5.3 py312h2dafd23_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libsolv 0.7.24 he621ea3_0", + "libssh2 1.10.0 hdbd6064_2", + "libstdcxx-ng 11.2.0 h1234567_1", + "libuuid 1.41.5 h5eee18b_0", + "libxml2 2.10.4 hf1b16e4_1", + "lz4-c 1.9.4 h6a678d5_0", + "menuinst 2.0.2 py312h06a4308_0", + "ncurses 6.4 h6a678d5_0", + "openssl 3.0.13 h7f8727e_0", + "packaging 23.1 py312h06a4308_0", + "pcre2 10.42 hebb0a14_0", + "pip 23.3.1 py312h06a4308_0", + "platformdirs 3.10.0 py312h06a4308_0", + "pluggy 1.0.0 py312h06a4308_1", + "pybind11-abi 4 hd3eb1b0_1", + "pycosat 0.6.6 py312h5eee18b_0", + "pycparser 2.21 pyhd3eb1b0_0", + "pysocks 1.7.1 py312h06a4308_0", + "python 3.12.1 h996f2a0_0", + "readline 8.2 h5eee18b_0", + "reproc 14.2.4 h295c915_1", + "reproc-cpp 14.2.4 h295c915_1", + "requests 2.31.0 py312h06a4308_1", + "ruamel.yaml 0.17.21 py312h5eee18b_0", + "setuptools 68.2.2 py312h06a4308_0", + "sqlite 3.41.2 h5eee18b_0", + "tk 8.6.12 h1ccaba5_0", + "tqdm 4.65.0 py312he106c6f_0", + "truststore 0.8.0 py312h06a4308_0", + "tzdata 2023d h04d1e81_0", + "urllib3 2.1.0 py312h06a4308_1", + "wheel 0.41.2 py312h06a4308_0", + "xz 5.4.5 h5eee18b_0", + "yaml-cpp 0.8.0 h6a678d5_0", + "zlib 1.2.13 h5eee18b_0", + "zstandard 0.19.0 py312h5eee18b_0", + "zstd 1.5.5 hc292b87_0", + "anaconda-anon-usage 0.4.3 py312hfc0e8ea_100", + "anaconda-client 1.12.3 py312h06a4308_0", + "attrs 23.1.0 py312h06a4308_0", + "beautifulsoup4 4.12.2 py312h06a4308_0", + "chardet 4.0.0 py312h06a4308_1003", + "click 8.1.7 py312h06a4308_0", + "conda-build 24.1.2 py312h06a4308_0", + "conda-index 0.4.0 pyhd3eb1b0_0", + "defusedxml 0.7.1 pyhd3eb1b0_0", + "filelock 3.13.1 py312h06a4308_0", + "jinja2 3.1.3 py312h06a4308_0", + "jsonschema 4.19.2 py312h06a4308_0", + "jsonschema-specifications 2023.7.1 py312h06a4308_0", + "jupyter_core 5.5.0 py312h06a4308_0", + "liblief 0.12.3 h6a678d5_0", + "markupsafe 2.1.3 py312h5eee18b_0", + "more-itertools 10.1.0 py312h06a4308_0", + "nbformat 5.9.2 py312h06a4308_0", + "patch 2.7.6 h7b6447c_1001", + "patchelf 0.17.2 h6a678d5_0", + "pkginfo 1.9.6 py312h06a4308_0", + "psutil 5.9.0 py312h5eee18b_0", + "py-lief 0.12.3 py312h6a678d5_0", + "python-dateutil 2.8.2 pyhd3eb1b0_0", + "python-fastjsonschema 2.16.2 py312h06a4308_0", + "python-libarchive-c 2.9 pyhd3eb1b0_1", + "pytz 2023.3.post1 py312h06a4308_0", + "pyyaml 6.0.1 py312h5eee18b_0", + "referencing 0.30.2 py312h06a4308_0", + "requests-toolbelt 1.0.0 py312h06a4308_0", + "rpds-py 0.10.6 py312hb02cf49_0", + "six 1.16.0 pyhd3eb1b0_1", + "soupsieve 2.5 py312h06a4308_0", + "traitlets 5.7.1 py312h06a4308_0", + "yaml 0.2.5 h7b6447c_0" + ], + "summary": "Provides libraries to enable third party tools using GPU profiling APIs.", + "tags": [] +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/files b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..afa241f884ac3f9a448c1c596bd5ef10f6098cbb --- /dev/null +++ b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/files @@ -0,0 +1,4 @@ +lib/libcupti.so.12 +lib/libcupti.so.2025.2.1 +targets/x86_64-linux/lib/libcupti.so.12 +targets/x86_64-linux/lib/libcupti.so.2025.2.1 diff --git a/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/git b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/index.json b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..fe03f4b51782145d4dcf614f10ce711a448b8453 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/index.json @@ -0,0 +1,17 @@ +{ + "arch": "x86_64", + "build": "0", + "build_number": 0, + "depends": [ + "__glibc >=2.17,<3.0.a0", + "cuda-version >=12.9,<12.10.0a0", + "libgcc-ng >=11.2.0", + "libstdcxx-ng >=11.2.0" + ], + "license": "LicenseRef-NVIDIA-End-User-License-Agreement", + "name": "cuda-cupti", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1747088236280, + "version": "12.9.79" +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/licenses/LICENSE b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6f1ec5bb981fb94fb40e2bb5ef0b32910a6a7145 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/licenses/LICENSE @@ -0,0 +1,1640 @@ +End User License Agreement +-------------------------- + +NVIDIA Software License Agreement and CUDA Supplement to +Software License Agreement. + +The CUDA Toolkit End User License Agreement applies to the +NVIDIA CUDA Toolkit, the NVIDIA CUDA Samples, the NVIDIA +Display Driver, NVIDIA Nsight tools (Visual Studio Edition), +and the associated documentation on CUDA APIs, programming +model and development tools. If you do not agree with the +terms and conditions of the license agreement, then do not +download or use the software. + +Last updated: January 12, 2025 + + +Preface +------- + +The Software License Agreement in Chapter 1 and the Supplement +in Chapter 2 contain license terms and conditions that govern +the use of NVIDIA toolkit. By accepting this agreement, you +agree to comply with all the terms and conditions applicable +to the product(s) included herein. + + +NVIDIA Driver + + +Description + +This package contains the operating system driver and +fundamental system software components for NVIDIA GPUs. + + +NVIDIA CUDA Toolkit + + +Description + +The NVIDIA CUDA Toolkit provides command-line and graphical +tools for building, debugging and optimizing the performance +of applications accelerated by NVIDIA GPUs, runtime and math +libraries, and documentation including programming guides, +user manuals, and API references. + + +Default Install Location of CUDA Toolkit + +Windows platform: + +%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v#.# + +Linux platform: + +/usr/local/cuda-#.# + +Mac platform: + +/Developer/NVIDIA/CUDA-#.# + + +NVIDIA CUDA Samples + + +Description + +CUDA Samples are now located in +https://github.com/nvidia/cuda-samples, which includes +instructions for obtaining, building, and running the samples. +They are no longer included in the CUDA toolkit. + + +NVIDIA Nsight Visual Studio Edition (Windows only) + + +Description + +NVIDIA Nsight Development Platform, Visual Studio Edition is a +development environment integrated into Microsoft Visual +Studio that provides tools for debugging, profiling, analyzing +and optimizing your GPU computing and graphics applications. + + +Default Install Location of Nsight Visual Studio Edition + +Windows platform: + +%ProgramFiles(x86)%\NVIDIA Corporation\Nsight Visual Studio Edition #.# + + +1. License Agreement for NVIDIA Software Development Kits +--------------------------------------------------------- + + +Important Notice—Read before downloading, installing, +copying or using the licensed software: +------------------------------------------------------- + +This license agreement, including exhibits attached +("Agreement”) is a legal agreement between you and NVIDIA +Corporation ("NVIDIA") and governs your use of a NVIDIA +software development kit (“SDK”). + +Each SDK has its own set of software and materials, but here +is a description of the types of items that may be included in +a SDK: source code, header files, APIs, data sets and assets +(examples include images, textures, models, scenes, videos, +native API input/output files), binary software, sample code, +libraries, utility programs, programming code and +documentation. + +This Agreement can be accepted only by an adult of legal age +of majority in the country in which the SDK is used. + +If you are entering into this Agreement on behalf of a company +or other legal entity, you represent that you have the legal +authority to bind the entity to this Agreement, in which case +“you” will mean the entity you represent. + +If you don’t have the required age or authority to accept +this Agreement, or if you don’t accept all the terms and +conditions of this Agreement, do not download, install or use +the SDK. + +You agree to use the SDK only for purposes that are permitted +by (a) this Agreement, and (b) any applicable law, regulation +or generally accepted practices or guidelines in the relevant +jurisdictions. + + +1.1. License + + +1.1.1. License Grant + +Subject to the terms of this Agreement, NVIDIA hereby grants +you a non-exclusive, non-transferable license, without the +right to sublicense (except as expressly provided in this +Agreement) to: + + 1. Install and use the SDK, + + 2. Modify and create derivative works of sample source code + delivered in the SDK, and + + 3. Distribute those portions of the SDK that are identified + in this Agreement as distributable, as incorporated in + object code format into a software application that meets + the distribution requirements indicated in this Agreement. + + +1.1.2. Distribution Requirements + +These are the distribution requirements for you to exercise +the distribution grant: + + 1. Your application must have material additional + functionality, beyond the included portions of the SDK. + + 2. The distributable portions of the SDK shall only be + accessed by your application. + + 3. The following notice shall be included in modifications + and derivative works of sample source code distributed: + “This software contains source code provided by NVIDIA + Corporation.” + + 4. Unless a developer tool is identified in this Agreement + as distributable, it is delivered for your internal use + only. + + 5. The terms under which you distribute your application + must be consistent with the terms of this Agreement, + including (without limitation) terms relating to the + license grant and license restrictions and protection of + NVIDIA’s intellectual property rights. Additionally, you + agree that you will protect the privacy, security and + legal rights of your application users. + + 6. You agree to notify NVIDIA in writing of any known or + suspected distribution or use of the SDK not in compliance + with the requirements of this Agreement, and to enforce + the terms of your agreements with respect to distributed + SDK. + + +1.1.3. Authorized Users + +You may allow employees and contractors of your entity or of +your subsidiary(ies) to access and use the SDK from your +secure network to perform work on your behalf. + +If you are an academic institution you may allow users +enrolled or employed by the academic institution to access and +use the SDK from your secure network. + +You are responsible for the compliance with the terms of this +Agreement by your authorized users. If you become aware that +your authorized users didn’t follow the terms of this +Agreement, you agree to take reasonable steps to resolve the +non-compliance and prevent new occurrences. + + +1.1.4. Pre-Release SDK + +The SDK versions identified as alpha, beta, preview or +otherwise as pre-release, may not be fully functional, may +contain errors or design flaws, and may have reduced or +different security, privacy, accessibility, availability, and +reliability standards relative to commercial versions of +NVIDIA software and materials. Use of a pre-release SDK may +result in unexpected results, loss of data, project delays or +other unpredictable damage or loss. + +You may use a pre-release SDK at your own risk, understanding +that pre-release SDKs are not intended for use in production +or business-critical systems. + +NVIDIA may choose not to make available a commercial version +of any pre-release SDK. NVIDIA may also choose to abandon +development and terminate the availability of a pre-release +SDK at any time without liability. + + +1.1.5. Updates + +NVIDIA may, at its option, make available patches, workarounds +or other updates to this SDK. Unless the updates are provided +with their separate governing terms, they are deemed part of +the SDK licensed to you as provided in this Agreement. You +agree that the form and content of the SDK that NVIDIA +provides may change without prior notice to you. While NVIDIA +generally maintains compatibility between versions, NVIDIA may +in some cases make changes that introduce incompatibilities in +future versions of the SDK. + + +1.1.6. Components Under Other Licenses + +The SDK may come bundled with, or otherwise include or be +distributed with, NVIDIA or third-party components with +separate legal notices or terms as may be described in +proprietary notices accompanying the SDK. If and to the extent +there is a conflict between the terms in this Agreement and +the license terms associated with the component, the license +terms associated with the components control only to the +extent necessary to resolve the conflict. + +Subject to the other terms of this Agreement, you may use the +SDK to develop and test applications released under Open +Source Initiative (OSI) approved open source software +licenses. + + +1.1.7. Reservation of Rights + +NVIDIA reserves all rights, title, and interest in and to the +SDK, not expressly granted to you under this Agreement. + + +1.2. Limitations + +The following license limitations apply to your use of the +SDK: + + 1. You may not reverse engineer, decompile or disassemble, + or remove copyright or other proprietary notices from any + portion of the SDK or copies of the SDK. + + 2. Except as expressly provided in this Agreement, you may + not copy, sell, rent, sublicense, transfer, distribute, + modify, or create derivative works of any portion of the + SDK. For clarity, you may not distribute or sublicense the + SDK as a stand-alone product. + + 3. Unless you have an agreement with NVIDIA for this + purpose, you may not indicate that an application created + with the SDK is sponsored or endorsed by NVIDIA. + + 4. You may not bypass, disable, or circumvent any + encryption, security, digital rights management or + authentication mechanism in the SDK. + + 5. You may not use the SDK in any manner that would cause it + to become subject to an open source software license. As + examples, licenses that require as a condition of use, + modification, and/or distribution that the SDK be: + + a. Disclosed or distributed in source code form; + + b. Licensed for the purpose of making derivative works; + or + + c. Redistributable at no charge. + + 6. You acknowledge that the SDK as delivered is not tested + or certified by NVIDIA for use in connection with the + design, construction, maintenance, and/or operation of any + system where the use or failure of such system could + result in a situation that threatens the safety of human + life or results in catastrophic damages (each, a "Critical + Application"). Examples of Critical Applications include + use in avionics, navigation, autonomous vehicle + applications, ai solutions for automotive products, + military, medical, life support or other life critical + applications. NVIDIA shall not be liable to you or any + third party, in whole or in part, for any claims or + damages arising from such uses. You are solely responsible + for ensuring that any product or service developed with + the SDK as a whole includes sufficient features to comply + with all applicable legal and regulatory standards and + requirements. + + 7. You agree to defend, indemnify and hold harmless NVIDIA + and its affiliates, and their respective employees, + contractors, agents, officers and directors, from and + against any and all claims, damages, obligations, losses, + liabilities, costs or debt, fines, restitutions and + expenses (including but not limited to attorney’s fees + and costs incident to establishing the right of + indemnification) arising out of or related to products or + services that use the SDK in or for Critical Applications, + and for use of the SDK outside of the scope of this + Agreement or not in compliance with its terms. + + 8. You may not reverse engineer, decompile or disassemble + any portion of the output generated using SDK elements for + the purpose of translating such output artifacts to target + a non-NVIDIA platform. + + +1.3. Ownership + + 1. NVIDIA or its licensors hold all rights, title and + interest in and to the SDK and its modifications and + derivative works, including their respective intellectual + property rights, subject to your rights under Section + 1.3.2. This SDK may include software and materials from + NVIDIA’s licensors, and these licensors are intended + third party beneficiaries that may enforce this Agreement + with respect to their intellectual property rights. + + 2. You hold all rights, title and interest in and to your + applications and your derivative works of the sample + source code delivered in the SDK, including their + respective intellectual property rights, subject to + NVIDIA’s rights under Section 1.3.1. + + 3. You may, but don’t have to, provide to NVIDIA + suggestions, feature requests or other feedback regarding + the SDK, including possible enhancements or modifications + to the SDK. For any feedback that you voluntarily provide, + you hereby grant NVIDIA and its affiliates a perpetual, + non-exclusive, worldwide, irrevocable license to use, + reproduce, modify, license, sublicense (through multiple + tiers of sublicensees), and distribute (through multiple + tiers of distributors) it without the payment of any + royalties or fees to you. NVIDIA will use feedback at its + choice. NVIDIA is constantly looking for ways to improve + its products, so you may send feedback to NVIDIA through + the developer portal at https://developer.nvidia.com. + + +1.4. No Warranties + +THE SDK IS PROVIDED BY NVIDIA “AS IS” AND “WITH ALL +FAULTS.” TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND +ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND +OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, +BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, OR THE +ABSENCE OF ANY DEFECTS THEREIN, WHETHER LATENT OR PATENT. NO +WARRANTY IS MADE ON THE BASIS OF TRADE USAGE, COURSE OF +DEALING OR COURSE OF TRADE. + + +1.5. Limitation of Liability + +TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS +AFFILIATES SHALL NOT BE LIABLE FOR ANY (I) SPECIAL, INCIDENTAL, +PUNITIVE OR CONSEQUENTIAL DAMAGES, OR (II) DAMAGES FOR (A) ANY +LOST PROFITS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, +OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF +OR IN CONNECTION WITH THIS AGREEMENT OR THE USE OR PERFORMANCE +OF THE SDK, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED +UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING +NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR +THEORY OF LIABILITY. IN NO EVENT WILL NVIDIA’S AND ITS AFFILIATES +TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS +AGREEMENT EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE +NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS +LIMIT. + +These exclusions and limitations of liability shall apply +regardless if NVIDIA or its affiliates have been advised of +the possibility of such damages, and regardless of whether a +remedy fails its essential purpose. These exclusions and +limitations of liability form an essential basis of the +bargain between the parties, and, absent any of these +exclusions or limitations of liability, the provisions of this +Agreement, including, without limitation, the economic terms, +would be substantially different. + + +1.6. Termination + + 1. This Agreement will continue to apply until terminated by + either you or NVIDIA as described below. + + 2. If you want to terminate this Agreement, you may do so by + stopping to use the SDK. + + 3. NVIDIA may, at any time, terminate this Agreement if: + + a. (i) you fail to comply with any term of this + Agreement and the non-compliance is not fixed within + thirty (30) days following notice from NVIDIA (or + immediately if you violate NVIDIA’s intellectual + property rights); + + b. (ii) you commence or participate in any legal + proceeding against NVIDIA with respect to the SDK; or + + c. (iii) NVIDIA decides to no longer provide the SDK in + a country or, in NVIDIA’s sole discretion, the + continued use of it is no longer commercially viable. + + 4. Upon any termination of this Agreement, you agree to + promptly discontinue use of the SDK and destroy all copies + in your possession or control. Your prior distributions in + accordance with this Agreement are not affected by the + termination of this Agreement. Upon written request, you + will certify in writing that you have complied with your + commitments under this section. Upon any termination of + this Agreement all provisions survive except for the + license grant provisions. + + +1.7. General + +If you wish to assign this Agreement or your rights and +obligations, including by merger, consolidation, dissolution +or operation of law, contact NVIDIA to ask for permission. Any +attempted assignment not approved by NVIDIA in writing shall +be void and of no effect. NVIDIA may assign, delegate or +transfer this Agreement and its rights and obligations, and if +to a non-affiliate you will be notified. + +You agree to cooperate with NVIDIA and provide reasonably +requested information to verify your compliance with this +Agreement. + +This Agreement will be governed in all respects by the laws of +the United States and of the State of Delaware, without regard to the +conflicts of laws principles. The United Nations Convention on +Contracts for the International Sale of Goods is specifically +disclaimed. You agree to all terms of this Agreement in the +English language. + +The state or federal courts residing in Santa Clara County, +California shall have exclusive jurisdiction over any dispute +or claim arising out of this Agreement. Notwithstanding this, +you agree that NVIDIA shall still be allowed to apply for +injunctive remedies or an equivalent type of urgent legal +relief in any jurisdiction. + +If any court of competent jurisdiction determines that any +provision of this Agreement is illegal, invalid or +unenforceable, such provision will be construed as limited to +the extent necessary to be consistent with and fully +enforceable under the law and the remaining provisions will +remain in full force and effect. Unless otherwise specified, +remedies are cumulative. + +Each party acknowledges and agrees that the other is an +independent contractor in the performance of this Agreement. + +The SDK has been developed entirely at private expense and is +“commercial items” consisting of “commercial computer +software” and “commercial computer software +documentation” provided with RESTRICTED RIGHTS. Use, +duplication or disclosure by the U.S. Government or a U.S. +Government subcontractor is subject to the restrictions in +this Agreement pursuant to DFARS 227.7202-3(a) or as set forth +in subparagraphs (c)(1) and (2) of the Commercial Computer +Software - Restricted Rights clause at FAR 52.227-19, as +applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas +Expressway, Santa Clara, CA 95051. + +The SDK is subject to United States export laws and +regulations. You agree that you will not ship, transfer or +export the SDK into any country, or use the SDK in any manner, +prohibited by the United States Bureau of Industry and +Security or economic sanctions regulations administered by the +U.S. Department of Treasury’s Office of Foreign Assets +Control (OFAC), or any applicable export laws, restrictions or +regulations. These laws include restrictions on destinations, +end users and end use. By accepting this Agreement, you +confirm that you are not located in a country currently +embargoed by the U.S. or otherwise prohibited from receiving +the SDK under U.S. law. + +Any notice delivered by NVIDIA to you under this Agreement +will be delivered via mail, email or fax. You agree that any +notices that NVIDIA sends you electronically will satisfy any +legal communication requirements. Please direct your legal +notices or other correspondence to NVIDIA Corporation, 2788 +San Tomas Expressway, Santa Clara, California 95051, United +States of America, Attention: Legal Department. + +This Agreement and any exhibits incorporated into this +Agreement constitute the entire agreement of the parties with +respect to the subject matter of this Agreement and supersede +all prior negotiations or documentation exchanged between the +parties relating to this SDK license. Any additional and/or +conflicting terms on documents issued by you are null, void, +and invalid. Any amendment or waiver under this Agreement +shall be in writing and signed by representatives of both +parties. + + +2. CUDA Toolkit Supplement to Software License Agreement for +NVIDIA Software Development Kits +------------------------------------------------------------ + +The terms in this supplement govern your use of the NVIDIA +CUDA Toolkit SDK under the terms of your license agreement +(“Agreement”) as modified by this supplement. Capitalized +terms used but not defined below have the meaning assigned to +them in the Agreement. + +This supplement is an exhibit to the Agreement and is +incorporated as an integral part of the Agreement. In the +event of conflict between the terms in this supplement and the +terms in the Agreement, the terms in this supplement govern. + + +2.1. License Scope + +The SDK is licensed for you to develop applications only for +use in systems with NVIDIA GPUs. + + +2.2. Distribution + +The portions of the SDK that are distributable under the +Agreement are listed in Attachment A. + + +2.3. Operating Systems + +Those portions of the SDK designed exclusively for use on the +Linux or FreeBSD operating systems, or other operating systems +derived from the source code to these operating systems, may +be copied and redistributed for use in accordance with this +Agreement, provided that the object code files are not +modified in any way (except for unzipping of compressed +files). + + +2.4. Audio and Video Encoders and Decoders + +You acknowledge and agree that it is your sole responsibility +to obtain any additional third-party licenses required to +make, have made, use, have used, sell, import, and offer for +sale your products or services that include or incorporate any +third-party software and content relating to audio and/or +video encoders and decoders from, including but not limited +to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A., +MPEG-LA, and Coding Technologies. NVIDIA does not grant to you +under this Agreement any necessary patent or other rights with +respect to any audio and/or video encoders and decoders. + + +2.5. Licensing + +If the distribution terms in this Agreement are not suitable +for your organization, or for any questions regarding this +Agreement, please contact NVIDIA at +nvidia-compute-license-questions@nvidia.com. + + +2.6. Attachment A + +The following CUDA Toolkit files may be distributed with +applications developed by you, including certain +variations of these files that have version number or +architecture specific information embedded in the file name - +as an example only, for release version 9.0 of the 64-bit +Windows software, the file cudart64_90.dll is redistributable. + +Component + +CUDA Runtime + +Windows + +cudart.dll, cudart_static.lib, cudadevrt.lib + +Mac OSX + +libcudart.dylib, libcudart_static.a, libcudadevrt.a + +Linux + +libcudart.so, libcudart_static.a, libcudadevrt.a + +Android + +libcudart.so, libcudart_static.a, libcudadevrt.a + +Component + +CUDA FFT Library + +Windows + +cufft.dll, cufftw.dll, cufft.lib, cufftw.lib + +Mac OSX + +libcufft.dylib, libcufft_static.a, libcufftw.dylib, +libcufftw_static.a + +Linux + +libcufft.so, libcufft_static.a, libcufftw.so, +libcufftw_static.a + +Android + +libcufft.so, libcufft_static.a, libcufftw.so, +libcufftw_static.a + +Component + +CUDA BLAS Library + +Windows + +cublas.dll, cublasLt.dll + +Mac OSX + +libcublas.dylib, libcublasLt.dylib, libcublas_static.a, +libcublasLt_static.a + +Linux + +libcublas.so, libcublasLt.so, libcublas_static.a, +libcublasLt_static.a + +Android + +libcublas.so, libcublasLt.so, libcublas_static.a, +libcublasLt_static.a + +Component + +NVIDIA "Drop-in" BLAS Library + +Windows + +nvblas.dll + +Mac OSX + +libnvblas.dylib + +Linux + +libnvblas.so + +Component + +CUDA Sparse Matrix Library + +Windows + +cusparse.dll, cusparse.lib + +Mac OSX + +libcusparse.dylib, libcusparse_static.a + +Linux + +libcusparse.so, libcusparse_static.a + +Android + +libcusparse.so, libcusparse_static.a + +Component + +CUDA Linear Solver Library + +Windows + +cusolver.dll, cusolver.lib + +Mac OSX + +libcusolver.dylib, libcusolver_static.a + +Linux + +libcusolver.so, libcusolver_static.a + +Android + +libcusolver.so, libcusolver_static.a + +Component + +CUDA Random Number Generation Library + +Windows + +curand.dll, curand.lib + +Mac OSX + +libcurand.dylib, libcurand_static.a + +Linux + +libcurand.so, libcurand_static.a + +Android + +libcurand.so, libcurand_static.a + +Component + +NVIDIA Performance Primitives Library + +Windows + +nppc.dll, nppc.lib, nppial.dll, nppial.lib, nppicc.dll, +nppicc.lib, nppicom.dll, nppicom.lib, nppidei.dll, +nppidei.lib, nppif.dll, nppif.lib, nppig.dll, nppig.lib, +nppim.dll, nppim.lib, nppist.dll, nppist.lib, nppisu.dll, +nppisu.lib, nppitc.dll, nppitc.lib, npps.dll, npps.lib + +Mac OSX + +libnppc.dylib, libnppc_static.a, libnppial.dylib, +libnppial_static.a, libnppicc.dylib, libnppicc_static.a, +libnppicom.dylib, libnppicom_static.a, libnppidei.dylib, +libnppidei_static.a, libnppif.dylib, libnppif_static.a, +libnppig.dylib, libnppig_static.a, libnppim.dylib, +libnppisu_static.a, libnppitc.dylib, libnppitc_static.a, +libnpps.dylib, libnpps_static.a + +Linux + +libnppc.so, libnppc_static.a, libnppial.so, +libnppial_static.a, libnppicc.so, libnppicc_static.a, +libnppicom.so, libnppicom_static.a, libnppidei.so, +libnppidei_static.a, libnppif.so, libnppif_static.a +libnppig.so, libnppig_static.a, libnppim.so, +libnppim_static.a, libnppist.so, libnppist_static.a, +libnppisu.so, libnppisu_static.a, libnppitc.so +libnppitc_static.a, libnpps.so, libnpps_static.a + +Android + +libnppc.so, libnppc_static.a, libnppial.so, +libnppial_static.a, libnppicc.so, libnppicc_static.a, +libnppicom.so, libnppicom_static.a, libnppidei.so, +libnppidei_static.a, libnppif.so, libnppif_static.a +libnppig.so, libnppig_static.a, libnppim.so, +libnppim_static.a, libnppist.so, libnppist_static.a, +libnppisu.so, libnppisu_static.a, libnppitc.so +libnppitc_static.a, libnpps.so, libnpps_static.a + +Component + +NVIDIA JPEG Library + +Windows + +nvjpeg.lib, nvjpeg.dll + +Linux + +libnvjpeg.so, libnvjpeg_static.a + +Component + +Internal common library required for statically linking to +cuBLAS, cuSPARSE, cuFFT, cuRAND, nvJPEG and NPP + +Mac OSX + +libculibos.a + +Linux + +libculibos.a + +Component + +NVIDIA Runtime Compilation Library and Header + +All + +nvrtc.h + +Windows + +nvrtc.dll, nvrtc-builtins.dll + +Mac OSX + +libnvrtc.dylib, libnvrtc-builtins.dylib + +Linux + +libnvrtc.so, libnvrtc-builtins.so, libnvrtc_static.a, libnvrtx-builtins_static.a + +Component + +NVIDIA Optimizing Compiler Library + +Windows + +nvvm.dll + +Mac OSX + +libnvvm.dylib + +Linux + +libnvvm.so + +Component + +NVIDIA JIT Linking Library + +Windows + +libnvJitLink.dll, libnvJitLink.lib + +Linux + +libnvJitLink.so, libnvJitLink_static.a + +Component + +NVIDIA Common Device Math Functions Library + +Windows + +libdevice.10.bc + +Mac OSX + +libdevice.10.bc + +Linux + +libdevice.10.bc + +Component + +CUDA Occupancy Calculation Header Library + +All + +cuda_occupancy.h + +Component + +CUDA Floating Point Type Headers + +All + +cuda_fp16.h, cuda_fp16.hpp, cuda_bf16.h, cuda_bf16.hpp, cuda_fp8.h, cuda_fp8.hpp, cuda_fp6.h, cuda_fp6.hpp, cuda_fp4.h, cuda_fp4.hpp + +Component + +CUDA Headers for Runtime Compilation + +All + +crt/host_defines.h, cuComplex.h, cuda_awbarrier_helpers.h, cuda_awbarrier_primitives.h, cuda_awbarrier.h, cuda_pipeline_helpers.h, ccuda_pipeline_primitives.h, ccuda_pipeline.h, cuda_runtime_api.h, cuda.h, cuda/std/tuple, cuda/std/type_traits, cuda/std/type_traits, cuda/std/utility, device_types.h, vector_functions.h, vector_types.h + +Component + +CUDA Profiling Tools Interface (CUPTI) Library + +Windows + +cupti.dll + +Mac OSX + +libcupti.dylib + +Linux + +libcupti.so + +Component + +NVIDIA Tools Extension Library + +Windows + +nvToolsExt.dll, nvToolsExt.lib + +Mac OSX + +libnvToolsExt.dylib + +Linux + +libnvToolsExt.so + +Component + +NVIDIA CUDA Driver Libraries + +Linux + +libcuda.so, libnvidia-ptxjitcompiler.so, libnvptxcompiler_static.a + +Component + +NVIDIA CUDA File IO Libraries and Header + +All + +cufile.h + +Linux + +libcufile.so, libcufile_rdma.so, libcufile_static.a, +libcufile_rdma_static.a + +In addition to the rights above, for parties that are +developing software intended solely for use on Jetson +development kits or Jetson modules, and running Linux for +Tegra software, the following shall apply: + + * The SDK may be distributed in its entirety, as provided by + NVIDIA, and without separation of its components, for you + and/or your licensees to create software development kits + for use only on the Jetson platform and running Linux for + Tegra software. + + +2.7. Attachment B + + +Additional Licensing Obligations + +The following third party components included in the SOFTWARE +are licensed to Licensee pursuant to the following terms and +conditions: + + 1. Licensee's use of the GDB third party component is + subject to the terms and conditions of GNU GPL v3: + + This product includes copyrighted third-party software licensed + under the terms of the GNU General Public License v3 ("GPL v3"). + All third-party software packages are copyright by their respective + authors. GPL v3 terms and conditions are hereby incorporated into + the Agreement by this reference: http://www.gnu.org/licenses/gpl.txt + + Consistent with these licensing requirements, the software + listed below is provided under the terms of the specified + open source software licenses. To obtain source code for + software provided under licenses that require + redistribution of source code, including the GNU General + Public License (GPL) and GNU Lesser General Public License + (LGPL), contact oss-requests@nvidia.com. This offer is + valid for a period of three (3) years from the date of the + distribution of this product by NVIDIA CORPORATION. + + Component License + CUDA-GDB GPL v3 + + 2. Licensee represents and warrants that any and all third + party licensing and/or royalty payment obligations in + connection with Licensee's use of the H.264 video codecs + are solely the responsibility of Licensee. + + 3. Licensee's use of the Thrust library is subject to the + terms and conditions of the Apache License Version 2.0. + All third-party software packages are copyright by their + respective authors. Apache License Version 2.0 terms and + conditions are hereby incorporated into the Agreement by + this reference. + http://www.apache.org/licenses/LICENSE-2.0.html + + In addition, Licensee acknowledges the following notice: + Thrust includes source code from the Boost Iterator, + Tuple, System, and Random Number libraries. + + Boost Software License - Version 1.0 - August 17th, 2003 + . . . . + + Permission is hereby granted, free of charge, to any person or + organization obtaining a copy of the software and accompanying + documentation covered by this license (the "Software") to use, + reproduce, display, distribute, execute, and transmit the Software, + and to prepare derivative works of the Software, and to permit + third-parties to whom the Software is furnished to do so, all + subject to the following: + + The copyright notices in the Software and this entire statement, + including the above license grant, this restriction and the following + disclaimer, must be included in all copies of the Software, in whole + or in part, and all derivative works of the Software, unless such + copies or derivative works are solely in the form of machine-executable + object code generated by a source language processor. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND + NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR + OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + 4. Licensee's use of the LLVM third party component is + subject to the following terms and conditions: + + ====================================================== + LLVM Release License + ====================================================== + University of Illinois/NCSA + Open Source License + + Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign. + All rights reserved. + + Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal with the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at Urbana- + Champaign, nor the names of its contributors may be used to endorse or + promote products derived from this Software without specific prior + written permission. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS WITH THE SOFTWARE. + + 5. Licensee's use of the PCRE third party component is + subject to the following terms and conditions: + + ------------ + PCRE LICENCE + ------------ + PCRE is a library of functions to support regular expressions whose syntax + and semantics are as close as possible to those of the Perl 5 language. + Release 8 of PCRE is distributed under the terms of the "BSD" licence, as + specified below. The documentation for PCRE, supplied in the "doc" + directory, is distributed under the same terms as the software itself. The + basic library functions are written in C and are freestanding. Also + included in the distribution is a set of C++ wrapper functions, and a just- + in-time compiler that can be used to optimize pattern matching. These are + both optional features that can be omitted when the library is built. + + THE BASIC LIBRARY FUNCTIONS + --------------------------- + Written by: Philip Hazel + Email local part: ph10 + Email domain: cam.ac.uk + University of Cambridge Computing Service, + Cambridge, England. + Copyright (c) 1997-2012 University of Cambridge + All rights reserved. + + PCRE JUST-IN-TIME COMPILATION SUPPORT + ------------------------------------- + Written by: Zoltan Herczeg + Email local part: hzmester + Emain domain: freemail.hu + Copyright(c) 2010-2012 Zoltan Herczeg + All rights reserved. + + STACK-LESS JUST-IN-TIME COMPILER + -------------------------------- + Written by: Zoltan Herczeg + Email local part: hzmester + Emain domain: freemail.hu + Copyright(c) 2009-2012 Zoltan Herczeg + All rights reserved. + + THE C++ WRAPPER FUNCTIONS + ------------------------- + Contributed by: Google Inc. + Copyright (c) 2007-2012, Google Inc. + All rights reserved. + + THE "BSD" LICENCE + ----------------- + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the University of Cambridge nor the name of Google + Inc. nor the names of their contributors may be used to endorse or + promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + 6. Some of the cuBLAS library routines were written by or + derived from code written by Vasily Volkov and are subject + to the Modified Berkeley Software Distribution License as + follows: + + Copyright (c) 2007-2009, Regents of the University of California + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the University of California, Berkeley nor + the names of its contributors may be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + 7. Some of the cuBLAS library routines were written by or + derived from code written by Davide Barbieri and are + subject to the Modified Berkeley Software Distribution + License as follows: + + Copyright (c) 2008-2009 Davide Barbieri @ University of Rome Tor Vergata. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + 8. Some of the cuBLAS library routines were derived from + code developed by the University of Tennessee and are + subject to the Modified Berkeley Software Distribution + License as follows: + + Copyright (c) 2010 The University of Tennessee. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer listed in this license in the documentation and/or + other materials provided with the distribution. + * Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 9. Some of the cuBLAS library routines were written by or + derived from code written by Jonathan Hogg and are subject + to the Modified Berkeley Software Distribution License as + follows: + + Copyright (c) 2012, The Science and Technology Facilities Council (STFC). + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the STFC nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE STFC BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 10. Some of the cuBLAS library routines were written by or + derived from code written by Ahmad M. Abdelfattah, David + Keyes, and Hatem Ltaief, and are subject to the Apache + License, Version 2.0, as follows: + + -- (C) Copyright 2013 King Abdullah University of Science and Technology + Authors: + Ahmad Abdelfattah (ahmad.ahmad@kaust.edu.sa) + David Keyes (david.keyes@kaust.edu.sa) + Hatem Ltaief (hatem.ltaief@kaust.edu.sa) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the King Abdullah University of Science and + Technology nor the names of its contributors may be used to endorse + or promote products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE + + 11. Some of the cuSPARSE library routines were written by or + derived from code written by Li-Wen Chang and are subject + to the NCSA Open Source License as follows: + + Copyright (c) 2012, University of Illinois. + + All rights reserved. + + Developed by: IMPACT Group, University of Illinois, http://impact.crhc.illinois.edu + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal with the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimers in the documentation and/or other materials provided + with the distribution. + * Neither the names of IMPACT Group, University of Illinois, nor + the names of its contributors may be used to endorse or promote + products derived from this Software without specific prior + written permission. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR + IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE + SOFTWARE. + + 12. Some of the cuRAND library routines were written by or + derived from code written by Mutsuo Saito and Makoto + Matsumoto and are subject to the following license: + + Copyright (c) 2009, 2010 Mutsuo Saito, Makoto Matsumoto and Hiroshima + University. All rights reserved. + + Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima + University and University of Tokyo. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of the Hiroshima University nor the names of + its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 13. Some of the cuRAND library routines were derived from + code developed by D. E. Shaw Research and are subject to + the following license: + + Copyright 2010-2011, D. E. Shaw Research. + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions, and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of D. E. Shaw Research nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 14. Some of the Math library routines were written by or + derived from code developed by Norbert Juffa and are + subject to the following license: + + Copyright (c) 2015-2017, Norbert Juffa + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 15. Licensee's use of the lz4 third party component is + subject to the following terms and conditions: + + Copyright (C) 2011-2013, Yann Collet. + BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 16. The NPP library uses code from the Boost Math Toolkit, + and is subject to the following license: + + Boost Software License - Version 1.0 - August 17th, 2003 + . . . . + + Permission is hereby granted, free of charge, to any person or + organization obtaining a copy of the software and accompanying + documentation covered by this license (the "Software") to use, + reproduce, display, distribute, execute, and transmit the Software, + and to prepare derivative works of the Software, and to permit + third-parties to whom the Software is furnished to do so, all + subject to the following: + + The copyright notices in the Software and this entire statement, + including the above license grant, this restriction and the following + disclaimer, must be included in all copies of the Software, in whole + or in part, and all derivative works of the Software, unless such + copies or derivative works are solely in the form of machine-executable + object code generated by a source language processor. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND + NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR + OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + 17. Portions of the Nsight Eclipse Edition is subject to the + following license: + + The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content is provided + to you under the terms and conditions of the Eclipse Public License + Version 1.0 ("EPL"). A copy of the EPL is available at http:// + www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program" + will mean the Content. + + If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may apply to your + use of any object code in the Content. Check the Redistributor's + license that was provided with the Content. If no such license exists, + contact the Redistributor. Unless otherwise indicated below, the terms + and conditions of the EPL still apply to any source code in the + Content and such source code may be obtained at http://www.eclipse.org. + + 18. Some of the cuBLAS library routines uses code from + OpenAI, which is subject to the following license: + + License URL + https://github.com/openai/openai-gemm/blob/master/LICENSE + + License Text + The MIT License + + Copyright (c) 2016 OpenAI (http://openai.com), 2016 Google Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + 19. Licensee's use of the Visual Studio Setup Configuration + Samples is subject to the following license: + + The MIT License (MIT) + Copyright (C) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + 20. Licensee's use of linmath.h header for CPU functions for + GL vector/matrix operations from lunarG is subject to the + Apache License Version 2.0. + + 21. The DX12-CUDA sample uses the d3dx12.h header, which is + subject to the MIT license. + + 22. Components of the driver and compiler used for binary management, including + nvFatBin, nvcc, and cuobjdump, use the Zstandard library which is subject to + the following license: + + BSD License + + For Zstandard software + + Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Facebook, nor Meta, nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGE. + +----------------- diff --git a/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/paths.json b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..fa0fd42cf8def11dda7b3401d8a6fe382fe67c98 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/paths.json @@ -0,0 +1,29 @@ +{ + "paths": [ + { + "_path": "lib/libcupti.so.12", + "path_type": "softlink", + "sha256": "3e689bb5a670196c2d9e44179a0f70a9425d1475a0f14a5ad1bb5479ddfadfaa", + "size_in_bytes": 7618673 + }, + { + "_path": "lib/libcupti.so.2025.2.1", + "path_type": "softlink", + "sha256": "3e689bb5a670196c2d9e44179a0f70a9425d1475a0f14a5ad1bb5479ddfadfaa", + "size_in_bytes": 7618673 + }, + { + "_path": "targets/x86_64-linux/lib/libcupti.so.12", + "path_type": "softlink", + "sha256": "3e689bb5a670196c2d9e44179a0f70a9425d1475a0f14a5ad1bb5479ddfadfaa", + "size_in_bytes": 7618673 + }, + { + "_path": "targets/x86_64-linux/lib/libcupti.so.2025.2.1", + "path_type": "hardlink", + "sha256": "3e689bb5a670196c2d9e44179a0f70a9425d1475a0f14a5ad1bb5479ddfadfaa", + "size_in_bytes": 7618673 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/repodata_record.json b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..0a789f04e48c8467ac2d9c73295f4107fe3988bf --- /dev/null +++ b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/repodata_record.json @@ -0,0 +1,24 @@ +{ + "name": "cuda-cupti", + "version": "12.9.79", + "build": "0", + "build_number": 0, + "channel": "https://conda.anaconda.org/nvidia/linux-64", + "subdir": "linux-64", + "fn": "cuda-cupti-12.9.79-0.conda", + "md5": "256ad7f05454c8b7c7bd7c3245a00ee4", + "url": "https://conda.anaconda.org/nvidia/linux-64/cuda-cupti-12.9.79-0.conda", + "sha256": "b586bf782a3ca5f26b33671bff63af634087c5c810d82fce9dcb17ad89d01cbf", + "arch": "x86_64", + "platform": "linux", + "depends": [ + "__glibc >=2.17,<3.0.a0", + "cuda-version >=12.9,<12.10.0a0", + "libgcc-ng >=11.2.0", + "libstdcxx-ng >=11.2.0" + ], + "constrains": [], + "license": "LicenseRef-NVIDIA-End-User-License-Agreement", + "timestamp": 1747088236000, + "size": 1870657 +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/test/run_test.sh b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..9a4a93dbd64651d47e5d288bb6fd5241c4d80b93 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/test/run_test.sh @@ -0,0 +1,11 @@ + + +set -ex + + + +test -L $PREFIX/lib/libcupti.so.12 +test -L $PREFIX/lib/libcupti.so.2025.2.1 +test -L $PREFIX/targets/x86_64-linux/lib/libcupti.so.12 +test -f $PREFIX/targets/x86_64-linux/lib/libcupti.so.2025.2.1 +exit 0 diff --git a/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/test/test-rpath.sh b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/test/test-rpath.sh new file mode 100644 index 0000000000000000000000000000000000000000..16ad3a71a373bef7d2f5b75a3ef1329975e6f517 --- /dev/null +++ b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/test/test-rpath.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +[[ ${target_platform} == "linux-64" ]] && targetsDir="targets/x86_64-linux" +[[ ${target_platform} == "linux-ppc64le" ]] && targetsDir="targets/ppc64le-linux" +[[ ${target_platform} == "linux-aarch64" ]] && targetsDir="targets/sbsa-linux" + +errors="" + +for lib in `find ${PREFIX}/${targetsDir}/lib -type f`; do + [[ $lib =~ \.so ]] || continue + + rpath=$(patchelf --print-rpath $lib) + echo "$lib rpath: $rpath" + if [[ $rpath != "\$ORIGIN" ]]; then + errors+="$lib\n" + elif [[ $(objdump -x ${lib} | grep "PATH") == *"RUNPATH"* ]]; then + errors+="$lib\n" + fi +done + +if [[ $errors ]]; then + echo "The following libraries were found with an unexpected RPATH:" + echo -e "$errors" + + exit 1 +else + exit 0 +fi diff --git a/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/test/test_time_dependencies.json b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..2348db2f9ba7ce6dfba09665b32c65111d5b4afd --- /dev/null +++ b/data/miniconda3/pkgs/cuda-cupti-12.9.79-0/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["patchelf"] \ No newline at end of file diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/bin/libpng-config b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/bin/libpng-config new file mode 100644 index 0000000000000000000000000000000000000000..7980f79b1492a4357aee09b3173e85c32ec619a1 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/bin/libpng-config @@ -0,0 +1,127 @@ +#! /bin/sh + +# libpng-config +# provides configuration info for libpng. + +# Copyright (C) 2002, 2004, 2006, 2007 Glenn Randers-Pehrson + +# This code is released under the libpng license. +# For conditions of distribution and use, see the disclaimer +# and license in png.h + +# Modeled after libxml-config. + +version="1.6.55" +prefix="/home/conda/feedstock_root/build_artifacts/bld/rattler-build_libpng_1770691470/host_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho" +exec_prefix="${prefix}" +libdir="${exec_prefix}/lib" +includedir="${prefix}/include/libpng16" +libs="-lpng16" +all_libs="-lpng16 -lm -lz -lm " +I_opts="-I${includedir}" +L_opts="-L${libdir}" +R_opts="" +cppflags="" +ccopts="" +ldopts="" + +usage() +{ + cat < + */ + +#ifndef PNG_H +#define PNG_H + +/* This is not the place to learn how to use libpng. The file libpng-manual.txt + * describes how to use libpng, and the file example.c summarizes it + * with some code on which to build. This file is useful for looking + * at the actual function definitions and structure components. If that + * file has been stripped from your copy of libpng, you can find it at + * + * + * If you just need to read a PNG file and don't want to read the documentation + * skip to the end of this file and read the section entitled 'simplified API'. + */ + +/* Version information for png.h - this should match the version in png.c */ +#define PNG_LIBPNG_VER_STRING "1.6.55" +#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n" + +/* The versions of shared library builds should stay in sync, going forward */ +#define PNG_LIBPNG_VER_SHAREDLIB 16 +#define PNG_LIBPNG_VER_SONUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */ +#define PNG_LIBPNG_VER_DLLNUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */ + +/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ +#define PNG_LIBPNG_VER_MAJOR 1 +#define PNG_LIBPNG_VER_MINOR 6 +#define PNG_LIBPNG_VER_RELEASE 55 + +/* This should be zero for a public release, or non-zero for a + * development version. + */ +#define PNG_LIBPNG_VER_BUILD 0 + +/* Release Status */ +#define PNG_LIBPNG_BUILD_ALPHA 1 +#define PNG_LIBPNG_BUILD_BETA 2 +#define PNG_LIBPNG_BUILD_RC 3 +#define PNG_LIBPNG_BUILD_STABLE 4 +#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7 + +/* Release-Specific Flags */ +#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with + PNG_LIBPNG_BUILD_STABLE only */ +#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with + PNG_LIBPNG_BUILD_SPECIAL */ +#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with + PNG_LIBPNG_BUILD_PRIVATE */ + +#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE + +/* Careful here. At one time, Guy wanted to use 082, but that + * would be octal. We must not include leading zeros. + * Versions 0.7 through 1.0.0 were in the range 0 to 100 here + * (only version 1.0.0 was mis-numbered 100 instead of 10000). + * From version 1.0.1 it is: + * XXYYZZ, where XX=major, YY=minor, ZZ=release + */ +#define PNG_LIBPNG_VER 10655 /* 1.6.55 */ + +/* Library configuration: these options cannot be changed after + * the library has been built. + */ +#ifndef PNGLCONF_H +/* If pnglibconf.h is missing, you can + * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h + */ +# include "pnglibconf.h" +#endif + +#ifndef PNG_VERSION_INFO_ONLY +/* Machine specific configuration. */ +# include "pngconf.h" +#endif + +/* + * Added at libpng-1.2.8 + * + * Ref MSDN: Private as priority over Special + * VS_FF_PRIVATEBUILD File *was not* built using standard release + * procedures. If this value is given, the StringFileInfo block must + * contain a PrivateBuild string. + * + * VS_FF_SPECIALBUILD File *was* built by the original company using + * standard release procedures but is a variation of the standard + * file of the same version number. If this value is given, the + * StringFileInfo block must contain a SpecialBuild string. + */ + +#ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */ +# define PNG_LIBPNG_BUILD_TYPE \ + (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE) +#else +# ifdef PNG_LIBPNG_SPECIALBUILD +# define PNG_LIBPNG_BUILD_TYPE \ + (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL) +# else +# define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE) +# endif +#endif + +#ifndef PNG_VERSION_INFO_ONLY + +/* Inhibit C++ name-mangling for libpng functions but not for system calls. */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Version information for C files, stored in png.c. This had better match + * the version above. + */ +#define png_libpng_ver png_get_header_ver(NULL) + +/* This file is arranged in several sections: + * + * 1. [omitted] + * 2. Any configuration options that can be specified by for the application + * code when it is built. (Build time configuration is in pnglibconf.h) + * 3. Type definitions (base types are defined in pngconf.h), structure + * definitions. + * 4. Exported library functions. + * 5. Simplified API. + * 6. Implementation options. + * + * The library source code has additional files (principally pngpriv.h) that + * allow configuration of the library. + */ + +/* Section 1: [omitted] */ + +/* Section 2: run time configuration + * See pnglibconf.h for build time configuration + * + * Run time configuration allows the application to choose between + * implementations of certain arithmetic APIs. The default is set + * at build time and recorded in pnglibconf.h, but it is safe to + * override these (and only these) settings. Note that this won't + * change what the library does, only application code, and the + * settings can (and probably should) be made on a per-file basis + * by setting the #defines before including png.h + * + * Use macros to read integers from PNG data or use the exported + * functions? + * PNG_USE_READ_MACROS: use the macros (see below) Note that + * the macros evaluate their argument multiple times. + * PNG_NO_USE_READ_MACROS: call the relevant library function. + * + * Use the alternative algorithm for compositing alpha samples that + * does not use division? + * PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division' + * algorithm. + * PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm. + * + * How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is + * false? + * PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error + * APIs to png_warning. + * Otherwise the calls are mapped to png_error. + */ + +/* Section 3: type definitions, including structures and compile time + * constants. + * See pngconf.h for base types that vary by machine/system + */ + +/* This triggers a compiler error in png.c, if png.c and png.h + * do not agree upon the version number. + */ +typedef char *png_libpng_version_1_6_55; + +/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. + * + * png_struct is the cache of information used while reading or writing a single + * PNG file. One of these is always required, although the simplified API + * (below) hides the creation and destruction of it. + */ +typedef struct png_struct_def png_struct; +typedef const png_struct * png_const_structp; +typedef png_struct * png_structp; +typedef png_struct * * png_structpp; + +/* png_info contains information read from or to be written to a PNG file. One + * or more of these must exist while reading or creating a PNG file. The + * information is not used by libpng during read but is used to control what + * gets written when a PNG file is created. "png_get_" function calls read + * information during read and "png_set_" functions calls write information + * when creating a PNG. + * been moved into a separate header file that is not accessible to + * applications. Read libpng-manual.txt or libpng.3 for more info. + */ +typedef struct png_info_def png_info; +typedef png_info * png_infop; +typedef const png_info * png_const_infop; +typedef png_info * * png_infopp; + +/* Types with names ending 'p' are pointer types. The corresponding types with + * names ending 'rp' are identical pointer types except that the pointer is + * marked 'restrict', which means that it is the only pointer to the object + * passed to the function. Applications should not use the 'restrict' types; + * it is always valid to pass 'p' to a pointer with a function argument of the + * corresponding 'rp' type. Different compilers have different rules with + * regard to type matching in the presence of 'restrict'. For backward + * compatibility libpng callbacks never have 'restrict' in their parameters and, + * consequentially, writing portable application code is extremely difficult if + * an attempt is made to use 'restrict'. + */ +typedef png_struct * PNG_RESTRICT png_structrp; +typedef const png_struct * PNG_RESTRICT png_const_structrp; +typedef png_info * PNG_RESTRICT png_inforp; +typedef const png_info * PNG_RESTRICT png_const_inforp; + +/* Three color definitions. The order of the red, green, and blue, (and the + * exact size) is not important, although the size of the fields need to + * be png_byte or png_uint_16 (as defined below). + */ +typedef struct png_color_struct +{ + png_byte red; + png_byte green; + png_byte blue; +} png_color; +typedef png_color * png_colorp; +typedef const png_color * png_const_colorp; +typedef png_color * * png_colorpp; + +typedef struct png_color_16_struct +{ + png_byte index; /* used for palette files */ + png_uint_16 red; /* for use in red green blue files */ + png_uint_16 green; + png_uint_16 blue; + png_uint_16 gray; /* for use in grayscale files */ +} png_color_16; +typedef png_color_16 * png_color_16p; +typedef const png_color_16 * png_const_color_16p; +typedef png_color_16 * * png_color_16pp; + +typedef struct png_color_8_struct +{ + png_byte red; /* for use in red green blue files */ + png_byte green; + png_byte blue; + png_byte gray; /* for use in grayscale files */ + png_byte alpha; /* for alpha channel files */ +} png_color_8; +typedef png_color_8 * png_color_8p; +typedef const png_color_8 * png_const_color_8p; +typedef png_color_8 * * png_color_8pp; + +/* + * The following two structures are used for the in-core representation + * of sPLT chunks. + */ +typedef struct png_sPLT_entry_struct +{ + png_uint_16 red; + png_uint_16 green; + png_uint_16 blue; + png_uint_16 alpha; + png_uint_16 frequency; +} png_sPLT_entry; +typedef png_sPLT_entry * png_sPLT_entryp; +typedef const png_sPLT_entry * png_const_sPLT_entryp; +typedef png_sPLT_entry * * png_sPLT_entrypp; + +/* When the depth of the sPLT palette is 8 bits, the color and alpha samples + * occupy the LSB of their respective members, and the MSB of each member + * is zero-filled. The frequency member always occupies the full 16 bits. + */ + +typedef struct png_sPLT_struct +{ + png_charp name; /* palette name */ + png_byte depth; /* depth of palette samples */ + png_sPLT_entryp entries; /* palette entries */ + png_int_32 nentries; /* number of palette entries */ +} png_sPLT_t; +typedef png_sPLT_t * png_sPLT_tp; +typedef const png_sPLT_t * png_const_sPLT_tp; +typedef png_sPLT_t * * png_sPLT_tpp; + +#ifdef PNG_TEXT_SUPPORTED +/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, + * and whether that contents is compressed or not. The "key" field + * points to a regular zero-terminated C string. The "text" fields can be a + * regular C string, an empty string, or a NULL pointer. + * However, the structure returned by png_get_text() will always contain + * the "text" field as a regular zero-terminated C string (possibly + * empty), never a NULL pointer, so it can be safely used in printf() and + * other string-handling functions. Note that the "itxt_length", "lang", and + * "lang_key" members of the structure only exist when the library is built + * with iTXt chunk support. Prior to libpng-1.4.0 the library was built by + * default without iTXt support. Also note that when iTXt *is* supported, + * the "lang" and "lang_key" fields contain NULL pointers when the + * "compression" field contains * PNG_TEXT_COMPRESSION_NONE or + * PNG_TEXT_COMPRESSION_zTXt. Note that the "compression value" is not the + * same as what appears in the PNG tEXt/zTXt/iTXt chunk's "compression flag" + * which is always 0 or 1, or its "compression method" which is always 0. + */ +typedef struct png_text_struct +{ + int compression; /* compression value: + -1: tEXt, none + 0: zTXt, deflate + 1: iTXt, none + 2: iTXt, deflate */ + png_charp key; /* keyword, 1-79 character description of "text" */ + png_charp text; /* comment, may be an empty string (ie "") + or a NULL pointer */ + size_t text_length; /* length of the text string */ + size_t itxt_length; /* length of the itxt string */ + png_charp lang; /* language code, 0-79 characters + or a NULL pointer */ + png_charp lang_key; /* keyword translated UTF-8 string, 0 or more + chars or a NULL pointer */ +} png_text; +typedef png_text * png_textp; +typedef const png_text * png_const_textp; +typedef png_text * * png_textpp; +#endif + +/* Supported compression types for text in PNG files (tEXt, and zTXt). + * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */ +#define PNG_TEXT_COMPRESSION_NONE_WR -3 +#define PNG_TEXT_COMPRESSION_zTXt_WR -2 +#define PNG_TEXT_COMPRESSION_NONE -1 +#define PNG_TEXT_COMPRESSION_zTXt 0 +#define PNG_ITXT_COMPRESSION_NONE 1 +#define PNG_ITXT_COMPRESSION_zTXt 2 +#define PNG_TEXT_COMPRESSION_LAST 3 /* Not a valid value */ + +/* png_time is a way to hold the time in an machine independent way. + * Two conversions are provided, both from time_t and struct tm. There + * is no portable way to convert to either of these structures, as far + * as I know. If you know of a portable way, send it to me. As a side + * note - PNG has always been Year 2000 compliant! + */ +typedef struct png_time_struct +{ + png_uint_16 year; /* full year, as in, 1995 */ + png_byte month; /* month of year, 1 - 12 */ + png_byte day; /* day of month, 1 - 31 */ + png_byte hour; /* hour of day, 0 - 23 */ + png_byte minute; /* minute of hour, 0 - 59 */ + png_byte second; /* second of minute, 0 - 60 (for leap seconds) */ +} png_time; +typedef png_time * png_timep; +typedef const png_time * png_const_timep; +typedef png_time * * png_timepp; + +#if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) ||\ + defined(PNG_USER_CHUNKS_SUPPORTED) +/* png_unknown_chunk is a structure to hold queued chunks for which there is + * no specific support. The idea is that we can use this to queue + * up private chunks for output even though the library doesn't actually + * know about their semantics. + * + * The data in the structure is set by libpng on read and used on write. + */ +typedef struct png_unknown_chunk_t +{ + png_byte name[5]; /* Textual chunk name with '\0' terminator */ + png_byte *data; /* Data, should not be modified on read! */ + size_t size; + + /* On write 'location' must be set using the flag values listed below. + * Notice that on read it is set by libpng however the values stored have + * more bits set than are listed below. Always treat the value as a + * bitmask. On write set only one bit - setting multiple bits may cause the + * chunk to be written in multiple places. + */ + png_byte location; /* mode of operation at read time */ +} +png_unknown_chunk; + +typedef png_unknown_chunk * png_unknown_chunkp; +typedef const png_unknown_chunk * png_const_unknown_chunkp; +typedef png_unknown_chunk * * png_unknown_chunkpp; +#endif + +/* Flag values for the unknown chunk location byte. */ +#define PNG_HAVE_IHDR 0x01 +#define PNG_HAVE_PLTE 0x02 +#define PNG_AFTER_IDAT 0x08 + +/* Maximum positive integer used in PNG is (2^31)-1 */ +#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL) +#define PNG_UINT_32_MAX ((png_uint_32)(-1)) +#define PNG_SIZE_MAX ((size_t)(-1)) + +/* These are constants for fixed point values encoded in the + * PNG specification manner (x100000) + */ +#define PNG_FP_1 100000 +#define PNG_FP_HALF 50000 +#define PNG_FP_MAX ((png_fixed_point)0x7fffffffL) +#define PNG_FP_MIN (-PNG_FP_MAX) + +/* These describe the color_type field in png_info. */ +/* color type masks */ +#define PNG_COLOR_MASK_PALETTE 1 +#define PNG_COLOR_MASK_COLOR 2 +#define PNG_COLOR_MASK_ALPHA 4 + +/* color types. Note that not all combinations are legal */ +#define PNG_COLOR_TYPE_GRAY 0 +#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) +#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) +#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) +#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA) +/* aliases */ +#define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA +#define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA + +/* This is for compression type. PNG 1.0-1.2 only define the single type. */ +#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */ +#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE + +/* This is for filter type. PNG 1.0-1.2 only define the single type. */ +#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */ +#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */ +#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE + +/* These are for the interlacing type. These values should NOT be changed. */ +#define PNG_INTERLACE_NONE 0 /* Non-interlaced image */ +#define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */ +#define PNG_INTERLACE_LAST 2 /* Not a valid value */ + +/* These are for the oFFs chunk. These values should NOT be changed. */ +#define PNG_OFFSET_PIXEL 0 /* Offset in pixels */ +#define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */ +#define PNG_OFFSET_LAST 2 /* Not a valid value */ + +/* These are for the pCAL chunk. These values should NOT be changed. */ +#define PNG_EQUATION_LINEAR 0 /* Linear transformation */ +#define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */ +#define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */ +#define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */ +#define PNG_EQUATION_LAST 4 /* Not a valid value */ + +/* These are for the sCAL chunk. These values should NOT be changed. */ +#define PNG_SCALE_UNKNOWN 0 /* unknown unit (image scale) */ +#define PNG_SCALE_METER 1 /* meters per pixel */ +#define PNG_SCALE_RADIAN 2 /* radians per pixel */ +#define PNG_SCALE_LAST 3 /* Not a valid value */ + +/* These are for the pHYs chunk. These values should NOT be changed. */ +#define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */ +#define PNG_RESOLUTION_METER 1 /* pixels/meter */ +#define PNG_RESOLUTION_LAST 2 /* Not a valid value */ + +/* These are for the sRGB chunk. These values should NOT be changed. */ +#define PNG_sRGB_INTENT_PERCEPTUAL 0 +#define PNG_sRGB_INTENT_RELATIVE 1 +#define PNG_sRGB_INTENT_SATURATION 2 +#define PNG_sRGB_INTENT_ABSOLUTE 3 +#define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */ + +/* This is for text chunks */ +#define PNG_KEYWORD_MAX_LENGTH 79 + +/* Maximum number of entries in PLTE/sPLT/tRNS arrays */ +#define PNG_MAX_PALETTE_LENGTH 256 + +/* These determine if an ancillary chunk's data has been successfully read + * from the PNG header, or if the application has filled in the corresponding + * data in the info_struct to be written into the output file. The values + * of the PNG_INFO_ defines should NOT be changed. + */ +#define PNG_INFO_gAMA 0x0001U +#define PNG_INFO_sBIT 0x0002U +#define PNG_INFO_cHRM 0x0004U +#define PNG_INFO_PLTE 0x0008U +#define PNG_INFO_tRNS 0x0010U +#define PNG_INFO_bKGD 0x0020U +#define PNG_INFO_hIST 0x0040U +#define PNG_INFO_pHYs 0x0080U +#define PNG_INFO_oFFs 0x0100U +#define PNG_INFO_tIME 0x0200U +#define PNG_INFO_pCAL 0x0400U +#define PNG_INFO_sRGB 0x0800U /* GR-P, 0.96a */ +#define PNG_INFO_iCCP 0x1000U /* ESR, 1.0.6 */ +#define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */ +#define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */ +#define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */ +#define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */ +#define PNG_INFO_cICP 0x20000U /* PNGv3: 1.6.45 */ +#define PNG_INFO_cLLI 0x40000U /* PNGv3: 1.6.45 */ +#define PNG_INFO_mDCV 0x80000U /* PNGv3: 1.6.45 */ +/* APNG: these chunks are stored as unknown, these flags are never set + * however they are provided as a convenience for implementors of APNG and + * avoids any merge conflicts. + * + * Private chunks: these chunk names violate the chunk name recommendations + * because the chunk definitions have no signature and because the private + * chunks with these names have been reserved. Private definitions should + * avoid them. + */ +#define PNG_INFO_acTL 0x100000U /* PNGv3: 1.6.45: unknown */ +#define PNG_INFO_fcTL 0x200000U /* PNGv3: 1.6.45: unknown */ +#define PNG_INFO_fdAT 0x400000U /* PNGv3: 1.6.45: unknown */ + +/* This is used for the transformation routines, as some of them + * change these values for the row. It also should enable using + * the routines for other purposes. + */ +typedef struct png_row_info_struct +{ + png_uint_32 width; /* width of row */ + size_t rowbytes; /* number of bytes in row */ + png_byte color_type; /* color type of row */ + png_byte bit_depth; /* bit depth of row */ + png_byte channels; /* number of channels (1, 2, 3, or 4) */ + png_byte pixel_depth; /* bits per pixel (depth * channels) */ +} png_row_info; + +typedef png_row_info * png_row_infop; +typedef png_row_info * * png_row_infopp; + +/* These are the function types for the I/O functions and for the functions + * that allow the user to override the default I/O functions with his or her + * own. The png_error_ptr type should match that of user-supplied warning + * and error functions, while the png_rw_ptr type should match that of the + * user read/write data functions. Note that the 'write' function must not + * modify the buffer it is passed. The 'read' function, on the other hand, is + * expected to return the read data in the buffer. + */ +typedef PNG_CALLBACK(void, *png_error_ptr, + (png_structp, png_const_charp)); +typedef PNG_CALLBACK(void, *png_rw_ptr, + (png_structp, png_bytep, size_t)); +typedef PNG_CALLBACK(void, *png_flush_ptr, + (png_structp)); +typedef PNG_CALLBACK(void, *png_read_status_ptr, + (png_structp, png_uint_32, int)); +typedef PNG_CALLBACK(void, *png_write_status_ptr, + (png_structp, png_uint_32, int)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +typedef PNG_CALLBACK(void, *png_progressive_info_ptr, + (png_structp, png_infop)); +typedef PNG_CALLBACK(void, *png_progressive_end_ptr, + (png_structp, png_infop)); + +/* The following callback receives png_uint_32 row_number, int pass for the + * png_bytep data of the row. When transforming an interlaced image the + * row number is the row number within the sub-image of the interlace pass, so + * the value will increase to the height of the sub-image (not the full image) + * then reset to 0 for the next pass. + * + * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to + * find the output pixel (x,y) given an interlaced sub-image pixel + * (row,col,pass). (See below for these macros.) + */ +typedef PNG_CALLBACK(void, *png_progressive_row_ptr, + (png_structp, png_bytep, png_uint_32, int)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) +typedef PNG_CALLBACK(void, *png_user_transform_ptr, + (png_structp, png_row_infop, png_bytep)); +#endif + +#ifdef PNG_USER_CHUNKS_SUPPORTED +typedef PNG_CALLBACK(int, *png_user_chunk_ptr, + (png_structp, png_unknown_chunkp)); +#endif +#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED +/* not used anywhere */ +/* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */ +#endif + +#ifdef PNG_SETJMP_SUPPORTED +/* This must match the function definition in , and the application + * must include this before png.h to obtain the definition of jmp_buf. The + * function is required to be PNG_NORETURN, but this is not checked. If the + * function does return the application will crash via an abort() or similar + * system level call. + * + * If you get a warning here while building the library you may need to make + * changes to ensure that pnglibconf.h records the calling convention used by + * your compiler. This may be very difficult - try using a different compiler + * to build the library! + */ +PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), (jmp_buf, int), typedef); +#endif + +/* Transform masks for the high-level interface */ +#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ +#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ +#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ +#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ +#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ +#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ +#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ +#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ +#define PNG_TRANSFORM_BGR 0x0080 /* read and write */ +#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ +#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ +#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ +#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only */ +/* Added to libpng-1.2.34 */ +#define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER +#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */ +/* Added to libpng-1.4.0 */ +#define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ +/* Added to libpng-1.5.4 */ +#define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */ +#if ~0U > 0xffffU /* or else this might break on a 16-bit machine */ +#define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */ +#endif + +/* Flags for MNG supported features */ +#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 +#define PNG_FLAG_MNG_FILTER_64 0x04 +#define PNG_ALL_MNG_FEATURES 0x05 + +/* NOTE: prior to 1.5 these functions had no 'API' style declaration, + * this allowed the zlib default functions to be used on Windows + * platforms. In 1.5 the zlib default malloc (which just calls malloc and + * ignores the first argument) should be completely compatible with the + * following. + */ +typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, + (png_structp, png_alloc_size_t)); +typedef PNG_CALLBACK(void, *png_free_ptr, + (png_structp, png_voidp)); + +/* Section 4: exported functions + * Here are the function definitions most commonly used. This is not + * the place to find out how to use libpng. See libpng-manual.txt for the + * full explanation, see example.c for the summary. This just provides + * a simple one line description of the use of each function. + * + * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in + * pngconf.h and in the *.dfn files in the scripts directory. + * + * PNG_EXPORT(ordinal, type, name, (args)); + * + * ordinal: ordinal that is used while building + * *.def files. The ordinal value is only + * relevant when preprocessing png.h with + * the *.dfn files for building symbol table + * entries, and are removed by pngconf.h. + * type: return type of the function + * name: function name + * args: function arguments, with types + * + * When we wish to append attributes to a function prototype we use + * the PNG_EXPORTA() macro instead. + * + * PNG_EXPORTA(ordinal, type, name, (args), attributes); + * + * ordinal, type, name, and args: same as in PNG_EXPORT(). + * attributes: function attributes + */ + +/* Returns the version number of the library */ +PNG_EXPORT(1, png_uint_32, png_access_version_number, + (void)); + +/* Tell lib we have already handled the first magic bytes. + * Handling more than 8 bytes from the beginning of the file is an error. + */ +PNG_EXPORT(2, void, png_set_sig_bytes, + (png_structrp png_ptr, int num_bytes)); + +/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a + * PNG file. Returns zero if the supplied bytes match the 8-byte PNG + * signature, and non-zero otherwise. Having num_to_check == 0 or + * start > 7 will always fail (i.e. return non-zero). + */ +PNG_EXPORT(3, int, png_sig_cmp, + (png_const_bytep sig, size_t start, size_t num_to_check)); + +/* Simple signature checking function. This is the same as calling + * png_check_sig(sig, n) := (png_sig_cmp(sig, 0, n) == 0). + */ +#define png_check_sig(sig, n) (png_sig_cmp((sig), 0, (n)) == 0) /* DEPRECATED */ + +/* Allocate and initialize png_ptr struct for reading, and any other memory. */ +PNG_EXPORTA(4, png_structp, png_create_read_struct, + (png_const_charp user_png_ver, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), + PNG_ALLOCATED); + +/* Allocate and initialize png_ptr struct for writing, and any other memory */ +PNG_EXPORTA(5, png_structp, png_create_write_struct, + (png_const_charp user_png_ver, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), + PNG_ALLOCATED); + +PNG_EXPORT(6, size_t, png_get_compression_buffer_size, + (png_const_structrp png_ptr)); + +PNG_EXPORT(7, void, png_set_compression_buffer_size, + (png_structrp png_ptr, size_t size)); + +/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp + * match up. + */ +#ifdef PNG_SETJMP_SUPPORTED +/* This function returns the jmp_buf built in to *png_ptr. It must be + * supplied with an appropriate 'longjmp' function to use on that jmp_buf + * unless the default error function is overridden in which case NULL is + * acceptable. The size of the jmp_buf is checked against the actual size + * allocated by the library - the call will return NULL on a mismatch + * indicating an ABI mismatch. + */ +PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, + (png_structrp png_ptr, png_longjmp_ptr longjmp_fn, size_t jmp_buf_size)); +# define png_jmpbuf(png_ptr) \ + (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf)))) +#else +# define png_jmpbuf(png_ptr) \ + (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP) +#endif +/* This function should be used by libpng applications in place of + * longjmp(png_ptr->jmpbuf, val). If longjmp_fn() has been set, it + * will use it; otherwise it will call PNG_ABORT(). This function was + * added in libpng-1.5.0. + */ +PNG_EXPORTA(9, void, png_longjmp, + (png_const_structrp png_ptr, int val), + PNG_NORETURN); + +#ifdef PNG_READ_SUPPORTED +/* Reset the compression stream */ +PNG_EXPORTA(10, int, png_reset_zstream, + (png_structrp png_ptr), + PNG_DEPRECATED); +#endif + +/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ +#ifdef PNG_USER_MEM_SUPPORTED +PNG_EXPORTA(11, png_structp, png_create_read_struct_2, + (png_const_charp user_png_ver, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), + PNG_ALLOCATED); +PNG_EXPORTA(12, png_structp, png_create_write_struct_2, + (png_const_charp user_png_ver, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), + PNG_ALLOCATED); +#endif + +/* Write the PNG file signature. */ +PNG_EXPORT(13, void, png_write_sig, + (png_structrp png_ptr)); + +/* Write a PNG chunk - size, type, (optional) data, CRC. */ +PNG_EXPORT(14, void, png_write_chunk, + (png_structrp png_ptr, + png_const_bytep chunk_name, png_const_bytep data, size_t length)); + +/* Write the start of a PNG chunk - length and chunk name. */ +PNG_EXPORT(15, void, png_write_chunk_start, + (png_structrp png_ptr, + png_const_bytep chunk_name, png_uint_32 length)); + +/* Write the data of a PNG chunk started with png_write_chunk_start(). */ +PNG_EXPORT(16, void, png_write_chunk_data, + (png_structrp png_ptr, + png_const_bytep data, size_t length)); + +/* Finish a chunk started with png_write_chunk_start() (includes CRC). */ +PNG_EXPORT(17, void, png_write_chunk_end, + (png_structrp png_ptr)); + +/* Allocate and initialize the info structure */ +PNG_EXPORTA(18, png_infop, png_create_info_struct, + (png_const_structrp png_ptr), + PNG_ALLOCATED); + +/* DEPRECATED: this function allowed init structures to be created using the + * default allocation method (typically malloc). Use is deprecated in 1.6.0 and + * the API will be removed in the future. + */ +PNG_EXPORTA(19, void, png_info_init_3, + (png_infopp info_ptr, size_t png_info_struct_size), + PNG_DEPRECATED); + +/* Writes all the PNG information before the image. */ +PNG_EXPORT(20, void, png_write_info_before_PLTE, + (png_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(21, void, png_write_info, + (png_structrp png_ptr, png_const_inforp info_ptr)); + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read the information before the actual image data. */ +PNG_EXPORT(22, void, png_read_info, + (png_structrp png_ptr, png_inforp info_ptr)); +#endif + +#ifdef PNG_TIME_RFC1123_SUPPORTED + /* Convert to a US string format: there is no localization support in this + * routine. The original implementation used a 29 character buffer in + * png_struct, this will be removed in future versions. + */ +#if PNG_LIBPNG_VER < 10700 +/* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */ +PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, + (png_structrp png_ptr, png_const_timep ptime), + PNG_DEPRECATED); +#endif +PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, + (char out[29], png_const_timep ptime)); +#endif + +#ifdef PNG_CONVERT_tIME_SUPPORTED +/* Convert from a struct tm to png_time */ +PNG_EXPORT(24, void, png_convert_from_struct_tm, + (png_timep ptime, const struct tm * ttime)); + +/* Convert from time_t to png_time. Uses gmtime() */ +PNG_EXPORT(25, void, png_convert_from_time_t, + (png_timep ptime, time_t ttime)); +#endif /* CONVERT_tIME */ + +#ifdef PNG_READ_EXPAND_SUPPORTED +/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ +PNG_EXPORT(26, void, png_set_expand, + (png_structrp png_ptr)); +PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, + (png_structrp png_ptr)); +PNG_EXPORT(28, void, png_set_palette_to_rgb, + (png_structrp png_ptr)); +PNG_EXPORT(29, void, png_set_tRNS_to_alpha, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_EXPAND_16_SUPPORTED +/* Expand to 16-bit channels, forces conversion of palette to RGB and expansion + * of a tRNS chunk if present. + */ +PNG_EXPORT(221, void, png_set_expand_16, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +/* Use blue, green, red order for pixels. */ +PNG_EXPORT(30, void, png_set_bgr, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED +/* Expand the grayscale to 24-bit RGB if necessary. */ +PNG_EXPORT(31, void, png_set_gray_to_rgb, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED +/* Reduce RGB to grayscale. */ +#define PNG_ERROR_ACTION_NONE 1 +#define PNG_ERROR_ACTION_WARN 2 +#define PNG_ERROR_ACTION_ERROR 3 +#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/ + +PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, + (png_structrp png_ptr, + int error_action, double red, double green)) +PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, + (png_structrp png_ptr, + int error_action, png_fixed_point red, png_fixed_point green)) + +PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, + (png_const_structrp png_ptr)); +#endif + +#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED +PNG_EXPORT(35, void, png_build_grayscale_palette, + (int bit_depth, png_colorp palette)); +#endif + +#ifdef PNG_READ_ALPHA_MODE_SUPPORTED +/* How the alpha channel is interpreted - this affects how the color channels + * of a PNG file are returned to the calling application when an alpha channel, + * or a tRNS chunk in a palette file, is present. + * + * This has no effect on the way pixels are written into a PNG output + * datastream. The color samples in a PNG datastream are never premultiplied + * with the alpha samples. + * + * The default is to return data according to the PNG specification: the alpha + * channel is a linear measure of the contribution of the pixel to the + * corresponding composited pixel, and the color channels are unassociated + * (not premultiplied). The gamma encoded color channels must be scaled + * according to the contribution and to do this it is necessary to undo + * the encoding, scale the color values, perform the composition and re-encode + * the values. This is the 'PNG' mode. + * + * The alternative is to 'associate' the alpha with the color information by + * storing color channel values that have been scaled by the alpha. + * image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes + * (the latter being the two common names for associated alpha color channels). + * + * For the 'OPTIMIZED' mode, a pixel is treated as opaque only if the alpha + * value is equal to the maximum value. + * + * The final choice is to gamma encode the alpha channel as well. This is + * broken because, in practice, no implementation that uses this choice + * correctly undoes the encoding before handling alpha composition. Use this + * choice only if other serious errors in the software or hardware you use + * mandate it; the typical serious error is for dark halos to appear around + * opaque areas of the composited PNG image because of arithmetic overflow. + * + * The API function png_set_alpha_mode specifies which of these choices to use + * with an enumerated 'mode' value and the gamma of the required output: + */ +#define PNG_ALPHA_PNG 0 /* according to the PNG standard */ +#define PNG_ALPHA_STANDARD 1 /* according to Porter/Duff */ +#define PNG_ALPHA_ASSOCIATED 1 /* as above; this is the normal practice */ +#define PNG_ALPHA_PREMULTIPLIED 1 /* as above */ +#define PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */ +#define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */ + +PNG_FP_EXPORT(227, void, png_set_alpha_mode, + (png_structrp png_ptr, int mode, double output_gamma)) +PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, + (png_structrp png_ptr, int mode, png_fixed_point output_gamma)) +#endif + +#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED) +/* The output_gamma value is a screen gamma in libpng terminology: it expresses + * how to decode the output values, not how they are encoded. + */ +#define PNG_DEFAULT_sRGB -1 /* sRGB gamma and color space */ +#define PNG_GAMMA_MAC_18 -2 /* Old Mac '1.8' gamma and color space */ +#define PNG_GAMMA_sRGB 220000 /* Television standards--matches sRGB gamma */ +#define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */ +#endif + +/* The following are examples of calls to png_set_alpha_mode to achieve the + * required overall gamma correction and, where necessary, alpha + * premultiplication. + * + * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); + * This is the default libpng handling of the alpha channel - it is not + * pre-multiplied into the color components. In addition the call states + * that the output is for a sRGB system and causes all PNG files without gAMA + * chunks to be assumed to be encoded using sRGB. + * + * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); + * In this case the output is assumed to be something like an sRGB conformant + * display preceded by a power-law lookup table of power 1.45. This is how + * early Mac systems behaved. + * + * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR); + * This is the classic Jim Blinn approach and will work in academic + * environments where everything is done by the book. It has the shortcoming + * of assuming that input PNG data with no gamma information is linear - this + * is unlikely to be correct unless the PNG files where generated locally. + * Most of the time the output precision will be so low as to show + * significant banding in dark areas of the image. + * + * png_set_expand_16(pp); + * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB); + * This is a somewhat more realistic Jim Blinn inspired approach. PNG files + * are assumed to have the sRGB encoding if not marked with a gamma value and + * the output is always 16 bits per component. This permits accurate scaling + * and processing of the data. If you know that your input PNG files were + * generated locally you might need to replace PNG_DEFAULT_sRGB with the + * correct value for your system. + * + * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB); + * If you just need to composite the PNG image onto an existing background + * and if you control the code that does this you can use the optimization + * setting. In this case you just copy completely opaque pixels to the + * output. For pixels that are not completely transparent (you just skip + * those) you do the composition math using png_composite or png_composite_16 + * below then encode the resultant 8-bit or 16-bit values to match the output + * encoding. + * + * Other cases + * If neither the PNG nor the standard linear encoding work for you because + * of the software or hardware you use then you have a big problem. The PNG + * case will probably result in halos around the image. The linear encoding + * will probably result in a washed out, too bright, image (it's actually too + * contrasty.) Try the ALPHA_OPTIMIZED mode above - this will probably + * substantially reduce the halos. Alternatively try: + * + * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB); + * This option will also reduce the halos, but there will be slight dark + * halos round the opaque parts of the image where the background is light. + * In the OPTIMIZED mode the halos will be light halos where the background + * is dark. Take your pick - the halos are unavoidable unless you can get + * your hardware/software fixed! (The OPTIMIZED approach is slightly + * faster.) + * + * When the default gamma of PNG files doesn't match the output gamma. + * If you have PNG files with no gamma information png_set_alpha_mode allows + * you to provide a default gamma, but it also sets the output gamma to the + * matching value. If you know your PNG files have a gamma that doesn't + * match the output you can take advantage of the fact that + * png_set_alpha_mode always sets the output gamma but only sets the PNG + * default if it is not already set: + * + * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); + * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); + * The first call sets both the default and the output gamma values, the + * second call overrides the output gamma without changing the default. This + * is easier than achieving the same effect with png_set_gamma. You must use + * PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will + * fire if more than one call to png_set_alpha_mode and png_set_background is + * made in the same read operation, however multiple calls with PNG_ALPHA_PNG + * are ignored. + */ + +#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED +PNG_EXPORT(36, void, png_set_strip_alpha, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +PNG_EXPORT(37, void, png_set_swap_alpha, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +PNG_EXPORT(38, void, png_set_invert_alpha, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +/* Add a filler byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ +PNG_EXPORT(39, void, png_set_filler, + (png_structrp png_ptr, png_uint_32 filler, int flags)); +/* The values of the PNG_FILLER_ defines should NOT be changed */ +# define PNG_FILLER_BEFORE 0 +# define PNG_FILLER_AFTER 1 +/* Add an alpha byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ +PNG_EXPORT(40, void, png_set_add_alpha, + (png_structrp png_ptr, png_uint_32 filler, int flags)); +#endif /* READ_FILLER || WRITE_FILLER */ + +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +/* Swap bytes in 16-bit depth files. */ +PNG_EXPORT(41, void, png_set_swap, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) +/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ +PNG_EXPORT(42, void, png_set_packing, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ + defined(PNG_WRITE_PACKSWAP_SUPPORTED) +/* Swap packing order of pixels in bytes. */ +PNG_EXPORT(43, void, png_set_packswap, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) +/* Converts files to legal bit depths. */ +PNG_EXPORT(44, void, png_set_shift, + (png_structrp png_ptr, png_const_color_8p true_bits)); +#endif + +#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ + defined(PNG_WRITE_INTERLACING_SUPPORTED) +/* Have the code handle the interlacing. Returns the number of passes. + * MUST be called before png_read_update_info or png_start_read_image, + * otherwise it will not have the desired effect. Note that it is still + * necessary to call png_read_row or png_read_rows png_get_image_height + * times for each pass. +*/ +PNG_EXPORT(45, int, png_set_interlace_handling, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +/* Invert monochrome files */ +PNG_EXPORT(46, void, png_set_invert_mono, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_BACKGROUND_SUPPORTED +/* Handle alpha and tRNS by replacing with a background color. Prior to + * libpng-1.5.4 this API must not be called before the PNG file header has been + * read. Doing so will result in unexpected behavior and possible warnings or + * errors if the PNG file contains a bKGD chunk. + */ +PNG_FP_EXPORT(47, void, png_set_background, + (png_structrp png_ptr, + png_const_color_16p background_color, int background_gamma_code, + int need_expand, double background_gamma)) +PNG_FIXED_EXPORT(215, void, png_set_background_fixed, + (png_structrp png_ptr, + png_const_color_16p background_color, int background_gamma_code, + int need_expand, png_fixed_point background_gamma)) +#endif +#ifdef PNG_READ_BACKGROUND_SUPPORTED +# define PNG_BACKGROUND_GAMMA_UNKNOWN 0 +# define PNG_BACKGROUND_GAMMA_SCREEN 1 +# define PNG_BACKGROUND_GAMMA_FILE 2 +# define PNG_BACKGROUND_GAMMA_UNIQUE 3 +#endif + +#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED +/* Scale a 16-bit depth file down to 8-bit, accurately. */ +PNG_EXPORT(229, void, png_set_scale_16, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED +#define PNG_READ_16_TO_8_SUPPORTED /* Name prior to 1.5.4 */ +/* Strip the second byte of information from a 16-bit depth file. */ +PNG_EXPORT(48, void, png_set_strip_16, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_QUANTIZE_SUPPORTED +/* Turn on quantizing, and reduce the palette to the number of colors + * available. + */ +PNG_EXPORT(49, void, png_set_quantize, + (png_structrp png_ptr, + png_colorp palette, int num_palette, int maximum_colors, + png_const_uint_16p histogram, int full_quantize)); +#endif + +#ifdef PNG_READ_GAMMA_SUPPORTED +/* The threshold on gamma processing is configurable but hard-wired into the + * library. The following is the floating point variant. + */ +#define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001) + +/* Handle gamma correction. Screen_gamma=(display_exponent). + * NOTE: this API simply sets the screen and file gamma values. It will + * therefore override the value for gamma in a PNG file if it is called after + * the file header has been read - use with care - call before reading the PNG + * file for best results! + * + * These routines accept the same gamma values as png_set_alpha_mode (described + * above). The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either + * API (floating point or fixed.) Notice, however, that the 'file_gamma' value + * is the inverse of a 'screen gamma' value. + */ +PNG_FP_EXPORT(50, void, png_set_gamma, + (png_structrp png_ptr, + double screen_gamma, double override_file_gamma)) +PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, + (png_structrp png_ptr, + png_fixed_point screen_gamma, png_fixed_point override_file_gamma)) +#endif + +#ifdef PNG_WRITE_FLUSH_SUPPORTED +/* Set how many lines between output flushes - 0 for no flushing */ +PNG_EXPORT(51, void, png_set_flush, + (png_structrp png_ptr, int nrows)); +/* Flush the current PNG output buffer */ +PNG_EXPORT(52, void, png_write_flush, + (png_structrp png_ptr)); +#endif + +/* Optional update palette with requested transformations */ +PNG_EXPORT(53, void, png_start_read_image, + (png_structrp png_ptr)); + +/* Optional call to update the users info structure */ +PNG_EXPORT(54, void, png_read_update_info, + (png_structrp png_ptr, png_inforp info_ptr)); + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read one or more rows of image data. */ +PNG_EXPORT(55, void, png_read_rows, + (png_structrp png_ptr, png_bytepp row, + png_bytepp display_row, png_uint_32 num_rows)); +#endif + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read a row of data. */ +PNG_EXPORT(56, void, png_read_row, + (png_structrp png_ptr, png_bytep row, png_bytep display_row)); +#endif + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read the whole image into memory at once. */ +PNG_EXPORT(57, void, png_read_image, + (png_structrp png_ptr, png_bytepp image)); +#endif + +/* Write a row of image data */ +PNG_EXPORT(58, void, png_write_row, + (png_structrp png_ptr, png_const_bytep row)); + +/* Write a few rows of image data: (*row) is not written; however, the type + * is declared as writeable to maintain compatibility with previous versions + * of libpng and to allow the 'display_row' array from read_rows to be passed + * unchanged to write_rows. + */ +PNG_EXPORT(59, void, png_write_rows, + (png_structrp png_ptr, png_bytepp row, png_uint_32 num_rows)); + +/* Write the image data */ +PNG_EXPORT(60, void, png_write_image, + (png_structrp png_ptr, png_bytepp image)); + +/* Write the end of the PNG file. */ +PNG_EXPORT(61, void, png_write_end, + (png_structrp png_ptr, png_inforp info_ptr)); + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read the end of the PNG file. */ +PNG_EXPORT(62, void, png_read_end, + (png_structrp png_ptr, png_inforp info_ptr)); +#endif + +/* Free any memory associated with the png_info_struct */ +PNG_EXPORT(63, void, png_destroy_info_struct, + (png_const_structrp png_ptr, png_infopp info_ptr_ptr)); + +/* Free any memory associated with the png_struct and the png_info_structs */ +PNG_EXPORT(64, void, png_destroy_read_struct, + (png_structpp png_ptr_ptr, + png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); + +/* Free any memory associated with the png_struct and the png_info_structs */ +PNG_EXPORT(65, void, png_destroy_write_struct, + (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); + +/* Set the libpng method of handling chunk CRC errors */ +PNG_EXPORT(66, void, png_set_crc_action, + (png_structrp png_ptr, int crit_action, int ancil_action)); + +/* Values for png_set_crc_action() say how to handle CRC errors in + * ancillary and critical chunks, and whether to use the data contained + * therein. Note that it is impossible to "discard" data in a critical + * chunk. For versions prior to 0.90, the action was always error/quit, + * whereas in version 0.90 and later, the action for CRC errors in ancillary + * chunks is warn/discard. These values should NOT be changed. + * + * value action:critical action:ancillary + */ +#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ +#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ +#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ +#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ +#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ +#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ + +#ifdef PNG_WRITE_SUPPORTED +/* These functions give the user control over the scan-line filtering in + * libpng and the compression methods used by zlib. These functions are + * mainly useful for testing, as the defaults should work with most users. + * Those users who are tight on memory or want faster performance at the + * expense of compression can modify them. See the compression library + * header file (zlib.h) for an explanation of the compression functions. + */ + +/* Set the filtering method(s) used by libpng. Currently, the only valid + * value for "method" is 0. + */ +PNG_EXPORT(67, void, png_set_filter, + (png_structrp png_ptr, int method, int filters)); +#endif /* WRITE */ + +/* Flags for png_set_filter() to say which filters to use. The flags + * are chosen so that they don't conflict with real filter types + * below, in case they are supplied instead of the #defined constants. + * These values should NOT be changed. + */ +#define PNG_NO_FILTERS 0x00 +#define PNG_FILTER_NONE 0x08 +#define PNG_FILTER_SUB 0x10 +#define PNG_FILTER_UP 0x20 +#define PNG_FILTER_AVG 0x40 +#define PNG_FILTER_PAETH 0x80 +#define PNG_FAST_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP) +#define PNG_ALL_FILTERS (PNG_FAST_FILTERS | PNG_FILTER_AVG | PNG_FILTER_PAETH) + +/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. + * These defines should NOT be changed. + */ +#define PNG_FILTER_VALUE_NONE 0 +#define PNG_FILTER_VALUE_SUB 1 +#define PNG_FILTER_VALUE_UP 2 +#define PNG_FILTER_VALUE_AVG 3 +#define PNG_FILTER_VALUE_PAETH 4 +#define PNG_FILTER_VALUE_LAST 5 + +#ifdef PNG_WRITE_SUPPORTED +#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */ +PNG_FP_EXPORT(68, void, png_set_filter_heuristics, + (png_structrp png_ptr, + int heuristic_method, int num_weights, + png_const_doublep filter_weights, + png_const_doublep filter_costs)) +PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, + (png_structrp png_ptr, + int heuristic_method, int num_weights, + png_const_fixed_point_p filter_weights, + png_const_fixed_point_p filter_costs)) +#endif /* WRITE_WEIGHTED_FILTER */ + +/* The following are no longer used and will be removed from libpng-1.7: */ +#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ +#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ +#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ +#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ + +/* Set the library compression level. Currently, valid values range from + * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 + * (0 - no compression, 9 - "maximal" compression). Note that tests have + * shown that zlib compression levels 3-6 usually perform as well as level 9 + * for PNG images, and do considerably fewer calculations. In the future, + * these values may not correspond directly to the zlib compression levels. + */ +#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED +PNG_EXPORT(69, void, png_set_compression_level, + (png_structrp png_ptr, int level)); + +PNG_EXPORT(70, void, png_set_compression_mem_level, + (png_structrp png_ptr, int mem_level)); + +PNG_EXPORT(71, void, png_set_compression_strategy, + (png_structrp png_ptr, int strategy)); + +/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a + * smaller value of window_bits if it can do so safely. + */ +PNG_EXPORT(72, void, png_set_compression_window_bits, + (png_structrp png_ptr, int window_bits)); + +PNG_EXPORT(73, void, png_set_compression_method, + (png_structrp png_ptr, int method)); +#endif /* WRITE_CUSTOMIZE_COMPRESSION */ + +#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED +/* Also set zlib parameters for compressing non-IDAT chunks */ +PNG_EXPORT(222, void, png_set_text_compression_level, + (png_structrp png_ptr, int level)); + +PNG_EXPORT(223, void, png_set_text_compression_mem_level, + (png_structrp png_ptr, int mem_level)); + +PNG_EXPORT(224, void, png_set_text_compression_strategy, + (png_structrp png_ptr, int strategy)); + +/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a + * smaller value of window_bits if it can do so safely. + */ +PNG_EXPORT(225, void, png_set_text_compression_window_bits, + (png_structrp png_ptr, int window_bits)); + +PNG_EXPORT(226, void, png_set_text_compression_method, + (png_structrp png_ptr, int method)); +#endif /* WRITE_CUSTOMIZE_ZTXT_COMPRESSION */ +#endif /* WRITE */ + +/* These next functions are called for input/output, memory, and error + * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, + * and call standard C I/O routines such as fread(), fwrite(), and + * fprintf(). These functions can be made to use other I/O routines + * at run time for those applications that need to handle I/O in a + * different manner by calling png_set_???_fn(). See libpng-manual.txt for + * more information. + */ + +#ifdef PNG_STDIO_SUPPORTED +/* Initialize the input/output for the PNG file to the default functions. */ +PNG_EXPORT(74, void, png_init_io, + (png_structrp png_ptr, FILE *fp)); +#endif + +/* Replace the (error and abort), and warning functions with user + * supplied functions. If no messages are to be printed you must still + * write and use replacement functions. The replacement error_fn should + * still do a longjmp to the last setjmp location if you are using this + * method of error handling. If error_fn or warning_fn is NULL, the + * default function will be used. + */ + +PNG_EXPORT(75, void, png_set_error_fn, + (png_structrp png_ptr, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); + +/* Return the user pointer associated with the error functions */ +PNG_EXPORT(76, png_voidp, png_get_error_ptr, + (png_const_structrp png_ptr)); + +/* Replace the default data output functions with a user supplied one(s). + * If buffered output is not used, then output_flush_fn can be set to NULL. + * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time + * output_flush_fn will be ignored (and thus can be NULL). + * It is probably a mistake to use NULL for output_flush_fn if + * write_data_fn is not also NULL unless you have built libpng with + * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's + * default flush function, which uses the standard *FILE structure, will + * be used. + */ +PNG_EXPORT(77, void, png_set_write_fn, + (png_structrp png_ptr, + png_voidp io_ptr, + png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); + +/* Replace the default data input function with a user supplied one. */ +PNG_EXPORT(78, void, png_set_read_fn, + (png_structrp png_ptr, + png_voidp io_ptr, png_rw_ptr read_data_fn)); + +/* Return the user pointer associated with the I/O functions */ +PNG_EXPORT(79, png_voidp, png_get_io_ptr, + (png_const_structrp png_ptr)); + +PNG_EXPORT(80, void, png_set_read_status_fn, + (png_structrp png_ptr, png_read_status_ptr read_row_fn)); + +PNG_EXPORT(81, void, png_set_write_status_fn, + (png_structrp png_ptr, png_write_status_ptr write_row_fn)); + +#ifdef PNG_USER_MEM_SUPPORTED +/* Replace the default memory allocation functions with user supplied one(s). */ +PNG_EXPORT(82, void, png_set_mem_fn, + (png_structrp png_ptr, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +/* Return the user pointer associated with the memory functions */ +PNG_EXPORT(83, png_voidp, png_get_mem_ptr, + (png_const_structrp png_ptr)); +#endif + +#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED +PNG_EXPORT(84, void, png_set_read_user_transform_fn, + (png_structrp png_ptr, png_user_transform_ptr read_user_transform_fn)); +#endif + +#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED +PNG_EXPORT(85, void, png_set_write_user_transform_fn, + (png_structrp png_ptr, png_user_transform_ptr write_user_transform_fn)); +#endif + +#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED +PNG_EXPORT(86, void, png_set_user_transform_info, + (png_structrp png_ptr, + png_voidp user_transform_ptr, + int user_transform_depth, int user_transform_channels)); +/* Return the user pointer associated with the user transform functions */ +PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr, + (png_const_structrp png_ptr)); +#endif + +#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED +/* Return information about the row currently being processed. Note that these + * APIs do not fail but will return unexpected results if called outside a user + * transform callback. Also note that when transforming an interlaced image the + * row number is the row number within the sub-image of the interlace pass, so + * the value will increase to the height of the sub-image (not the full image) + * then reset to 0 for the next pass. + * + * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to + * find the output pixel (x,y) given an interlaced sub-image pixel + * (row,col,pass). (See below for these macros.) + */ +PNG_EXPORT(217, png_uint_32, png_get_current_row_number, + (png_const_structrp)); +PNG_EXPORT(218, png_byte, png_get_current_pass_number, + (png_const_structrp)); +#endif + +#ifdef PNG_READ_USER_CHUNKS_SUPPORTED +/* This callback is called only for *unknown* chunks. If + * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known + * chunks to be treated as unknown, however in this case the callback must do + * any processing required by the chunk (e.g. by calling the appropriate + * png_set_ APIs.) + * + * There is no write support - on write, by default, all the chunks in the + * 'unknown' list are written in the specified position. + * + * The integer return from the callback function is interpreted thus: + * + * negative: An error occurred; png_chunk_error will be called. + * zero: The chunk was not handled, the chunk will be saved. A critical + * chunk will cause an error at this point unless it is to be saved. + * positive: The chunk was handled, libpng will ignore/discard it. + * + * See "INTERACTION WITH USER CHUNK CALLBACKS" below for important notes about + * how this behavior will change in libpng 1.7 + */ +PNG_EXPORT(88, void, png_set_read_user_chunk_fn, + (png_structrp png_ptr, + png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); +#endif + +#ifdef PNG_USER_CHUNKS_SUPPORTED +PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, + (png_const_structrp png_ptr)); +#endif + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +/* Sets the function callbacks for the push reader, and a pointer to a + * user-defined structure available to the callback functions. + */ +PNG_EXPORT(90, void, png_set_progressive_read_fn, + (png_structrp png_ptr, + png_voidp progressive_ptr, png_progressive_info_ptr info_fn, + png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn)); + +/* Returns the user pointer associated with the push read functions */ +PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, + (png_const_structrp png_ptr)); + +/* Function to be called when data becomes available */ +PNG_EXPORT(92, void, png_process_data, + (png_structrp png_ptr, + png_inforp info_ptr, png_bytep buffer, size_t buffer_size)); + +/* A function which may be called *only* within png_process_data to stop the + * processing of any more data. The function returns the number of bytes + * remaining, excluding any that libpng has cached internally. A subsequent + * call to png_process_data must supply these bytes again. If the argument + * 'save' is set to true the routine will first save all the pending data and + * will always return 0. + */ +PNG_EXPORT(219, size_t, png_process_data_pause, + (png_structrp, int save)); + +/* A function which may be called *only* outside (after) a call to + * png_process_data. It returns the number of bytes of data to skip in the + * input. Normally it will return 0, but if it returns a non-zero value the + * application must skip than number of bytes of input data and pass the + * following data to the next call to png_process_data. + */ +PNG_EXPORT(220, png_uint_32, png_process_data_skip, + (png_structrp)); + +/* Function that combines rows. 'new_row' is a flag that should come from + * the callback and be non-NULL if anything needs to be done; the library + * stores its own version of the new data internally and ignores the passed + * in value. + */ +PNG_EXPORT(93, void, png_progressive_combine_row, + (png_const_structrp png_ptr, + png_bytep old_row, png_const_bytep new_row)); +#endif /* PROGRESSIVE_READ */ + +PNG_EXPORTA(94, png_voidp, png_malloc, + (png_const_structrp png_ptr, png_alloc_size_t size), + PNG_ALLOCATED); +/* Added at libpng version 1.4.0 */ +PNG_EXPORTA(95, png_voidp, png_calloc, + (png_const_structrp png_ptr, png_alloc_size_t size), + PNG_ALLOCATED); + +/* Added at libpng version 1.2.4 */ +PNG_EXPORTA(96, png_voidp, png_malloc_warn, + (png_const_structrp png_ptr, png_alloc_size_t size), + PNG_ALLOCATED); + +/* Frees a pointer allocated by png_malloc() */ +PNG_EXPORT(97, void, png_free, + (png_const_structrp png_ptr, png_voidp ptr)); + +/* Free data that was allocated internally */ +PNG_EXPORT(98, void, png_free_data, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_uint_32 free_me, int num)); + +/* Reassign the responsibility for freeing existing data, whether allocated + * by libpng or by the application; this works on the png_info structure passed + * in, without changing the state for other png_info structures. + */ +PNG_EXPORT(99, void, png_data_freer, + (png_const_structrp png_ptr, png_inforp info_ptr, + int freer, png_uint_32 mask)); + +/* Assignments for png_data_freer */ +#define PNG_DESTROY_WILL_FREE_DATA 1 +#define PNG_SET_WILL_FREE_DATA 1 +#define PNG_USER_WILL_FREE_DATA 2 +/* Flags for png_ptr->free_me and info_ptr->free_me */ +#define PNG_FREE_HIST 0x0008U +#define PNG_FREE_ICCP 0x0010U +#define PNG_FREE_SPLT 0x0020U +#define PNG_FREE_ROWS 0x0040U +#define PNG_FREE_PCAL 0x0080U +#define PNG_FREE_SCAL 0x0100U +#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED +# define PNG_FREE_UNKN 0x0200U +#endif +/* PNG_FREE_LIST 0x0400U removed in 1.6.0 because it is ignored */ +#define PNG_FREE_PLTE 0x1000U +#define PNG_FREE_TRNS 0x2000U +#define PNG_FREE_TEXT 0x4000U +#define PNG_FREE_EXIF 0x8000U /* Added at libpng-1.6.31 */ +#define PNG_FREE_ALL 0xffffU +#define PNG_FREE_MUL 0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ + +#ifdef PNG_USER_MEM_SUPPORTED +PNG_EXPORTA(100, png_voidp, png_malloc_default, + (png_const_structrp png_ptr, png_alloc_size_t size), + PNG_ALLOCATED PNG_DEPRECATED); +PNG_EXPORTA(101, void, png_free_default, + (png_const_structrp png_ptr, png_voidp ptr), + PNG_DEPRECATED); +#endif + +#ifdef PNG_ERROR_TEXT_SUPPORTED +/* Fatal error in PNG image of libpng - can't continue */ +PNG_EXPORTA(102, void, png_error, + (png_const_structrp png_ptr, png_const_charp error_message), + PNG_NORETURN); + +/* The same, but the chunk name is prepended to the error string. */ +PNG_EXPORTA(103, void, png_chunk_error, + (png_const_structrp png_ptr, png_const_charp error_message), + PNG_NORETURN); + +#else +/* Fatal error in PNG image of libpng - can't continue */ +PNG_EXPORTA(104, void, png_err, + (png_const_structrp png_ptr), + PNG_NORETURN); +# define png_error(s1,s2) png_err(s1) +# define png_chunk_error(s1,s2) png_err(s1) +#endif + +#ifdef PNG_WARNINGS_SUPPORTED +/* Non-fatal error in libpng. Can continue, but may have a problem. */ +PNG_EXPORT(105, void, png_warning, + (png_const_structrp png_ptr, png_const_charp warning_message)); + +/* Non-fatal error in libpng, chunk name is prepended to message. */ +PNG_EXPORT(106, void, png_chunk_warning, + (png_const_structrp png_ptr, png_const_charp warning_message)); +#else +# define png_warning(s1,s2) ((void)(s1)) +# define png_chunk_warning(s1,s2) ((void)(s1)) +#endif + +#ifdef PNG_BENIGN_ERRORS_SUPPORTED +/* Benign error in libpng. Can continue, but may have a problem. + * User can choose whether to handle as a fatal error or as a warning. */ +PNG_EXPORT(107, void, png_benign_error, + (png_const_structrp png_ptr, png_const_charp warning_message)); + +#ifdef PNG_READ_SUPPORTED +/* Same, chunk name is prepended to message (only during read) */ +PNG_EXPORT(108, void, png_chunk_benign_error, + (png_const_structrp png_ptr, png_const_charp warning_message)); +#endif + +PNG_EXPORT(109, void, png_set_benign_errors, + (png_structrp png_ptr, int allowed)); +#else +# ifdef PNG_ALLOW_BENIGN_ERRORS +# define png_benign_error png_warning +# define png_chunk_benign_error png_chunk_warning +# else +# define png_benign_error png_error +# define png_chunk_benign_error png_chunk_error +# endif +#endif + +/* The png_set_ functions are for storing values in the png_info_struct. + * Similarly, the png_get_ calls are used to read values from the + * png_info_struct, either storing the parameters in the passed variables, or + * setting pointers into the png_info_struct where the data is stored. The + * png_get_ functions return a non-zero value if the data was available + * in info_ptr, or return zero and do not change any of the parameters if the + * data was not available. + * + * These functions should be used instead of directly accessing png_info + * to avoid problems with future changes in the size and internal layout of + * png_info_struct. + */ +/* Returns "flag" if chunk data is valid in info_ptr. */ +PNG_EXPORT(110, png_uint_32, png_get_valid, + (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 flag)); + +/* Returns number of bytes needed to hold a transformed row. */ +PNG_EXPORT(111, size_t, png_get_rowbytes, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +#ifdef PNG_INFO_IMAGE_SUPPORTED +/* Returns row_pointers, which is an array of pointers to scanlines that was + * returned from png_read_png(). + */ +PNG_EXPORT(112, png_bytepp, png_get_rows, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Set row_pointers, which is an array of pointers to scanlines for use + * by png_write_png(). + */ +PNG_EXPORT(113, void, png_set_rows, + (png_const_structrp png_ptr, png_inforp info_ptr, png_bytepp row_pointers)); +#endif + +/* Returns number of color channels in image. */ +PNG_EXPORT(114, png_byte, png_get_channels, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +#ifdef PNG_EASY_ACCESS_SUPPORTED +/* Returns image width in pixels. */ +PNG_EXPORT(115, png_uint_32, png_get_image_width, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image height in pixels. */ +PNG_EXPORT(116, png_uint_32, png_get_image_height, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image bit_depth. */ +PNG_EXPORT(117, png_byte, png_get_bit_depth, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image color_type. */ +PNG_EXPORT(118, png_byte, png_get_color_type, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image filter_type. */ +PNG_EXPORT(119, png_byte, png_get_filter_type, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image interlace_type. */ +PNG_EXPORT(120, png_byte, png_get_interlace_type, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image compression_type. */ +PNG_EXPORT(121, png_byte, png_get_compression_type, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image resolution in pixels per meter, from pHYs chunk data. */ +PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns pixel aspect ratio, computed from pHYs chunk data. */ +PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) +PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) + +/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ +PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(128, png_int_32, png_get_x_offset_microns, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(129, png_int_32, png_get_y_offset_microns, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +#endif /* EASY_ACCESS */ + +#ifdef PNG_READ_SUPPORTED +/* Returns pointer to signature string read from PNG header */ +PNG_EXPORT(130, png_const_bytep, png_get_signature, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +#endif + +#ifdef PNG_bKGD_SUPPORTED +PNG_EXPORT(131, png_uint_32, png_get_bKGD, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_color_16p *background)); +#endif + +#ifdef PNG_bKGD_SUPPORTED +PNG_EXPORT(132, void, png_set_bKGD, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_color_16p background)); +#endif + +#ifdef PNG_cHRM_SUPPORTED +PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + double *white_x, double *white_y, + double *red_x, double *red_y, + double *green_x, double *green_y, + double *blue_x, double *blue_y)) +PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + double *red_X, double *red_Y, double *red_Z, + double *green_X, double *green_Y, double *green_Z, + double *blue_X, double *blue_Y, double *blue_Z)) +PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_fixed_point *int_white_x, png_fixed_point *int_white_y, + png_fixed_point *int_red_x, png_fixed_point *int_red_y, + png_fixed_point *int_green_x, png_fixed_point *int_green_y, + png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)) +PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_fixed_point *int_red_X, png_fixed_point *int_red_Y, + png_fixed_point *int_red_Z, + png_fixed_point *int_green_X, png_fixed_point *int_green_Y, + png_fixed_point *int_green_Z, + png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, + png_fixed_point *int_blue_Z)) +#endif + +#ifdef PNG_cHRM_SUPPORTED +PNG_FP_EXPORT(135, void, png_set_cHRM, + (png_const_structrp png_ptr, png_inforp info_ptr, + double white_x, double white_y, + double red_x, double red_y, + double green_x, double green_y, + double blue_x, double blue_y)) +PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, + (png_const_structrp png_ptr, png_inforp info_ptr, + double red_X, double red_Y, double red_Z, + double green_X, double green_Y, double green_Z, + double blue_X, double blue_Y, double blue_Z)) +PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, + png_fixed_point int_green_x, png_fixed_point int_green_y, + png_fixed_point int_blue_x, png_fixed_point int_blue_y)) +PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_fixed_point int_red_X, png_fixed_point int_red_Y, + png_fixed_point int_red_Z, + png_fixed_point int_green_X, png_fixed_point int_green_Y, + png_fixed_point int_green_Z, + png_fixed_point int_blue_X, png_fixed_point int_blue_Y, + png_fixed_point int_blue_Z)) +#endif + +#ifdef PNG_cICP_SUPPORTED +PNG_EXPORT(250, png_uint_32, png_get_cICP, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_bytep colour_primaries, png_bytep transfer_function, + png_bytep matrix_coefficients, png_bytep video_full_range_flag)); +#endif + +#ifdef PNG_cICP_SUPPORTED +PNG_EXPORT(251, void, png_set_cICP, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_byte colour_primaries, png_byte transfer_function, + png_byte matrix_coefficients, png_byte video_full_range_flag)); +#endif + +#ifdef PNG_cLLI_SUPPORTED +PNG_FP_EXPORT(252, png_uint_32, png_get_cLLI, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + double *maximum_content_light_level, + double *maximum_frame_average_light_level)) +PNG_FIXED_EXPORT(253, png_uint_32, png_get_cLLI_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + /* The values below are in cd/m2 (nits) and are scaled by 10,000; not + * 100,000 as in the case of png_fixed_point. + */ + png_uint_32p maximum_content_light_level_scaled_by_10000, + png_uint_32p maximum_frame_average_light_level_scaled_by_10000)) +#endif + +#ifdef PNG_cLLI_SUPPORTED +PNG_FP_EXPORT(254, void, png_set_cLLI, + (png_const_structrp png_ptr, png_inforp info_ptr, + double maximum_content_light_level, + double maximum_frame_average_light_level)) +PNG_FIXED_EXPORT(255, void, png_set_cLLI_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + /* The values below are in cd/m2 (nits) and are scaled by 10,000; not + * 100,000 as in the case of png_fixed_point. + */ + png_uint_32 maximum_content_light_level_scaled_by_10000, + png_uint_32 maximum_frame_average_light_level_scaled_by_10000)) +#endif + +#ifdef PNG_eXIf_SUPPORTED +PNG_EXPORT(246, png_uint_32, png_get_eXIf, + (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *exif)); +PNG_EXPORT(247, void, png_set_eXIf, + (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep exif)); + +PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_uint_32 *num_exif, png_bytep *exif)); +PNG_EXPORT(249, void, png_set_eXIf_1, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_uint_32 num_exif, png_bytep exif)); +#endif + +#ifdef PNG_gAMA_SUPPORTED +PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + double *file_gamma)) +PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_fixed_point *int_file_gamma)) +#endif + +#ifdef PNG_gAMA_SUPPORTED +PNG_FP_EXPORT(139, void, png_set_gAMA, + (png_const_structrp png_ptr, png_inforp info_ptr, + double file_gamma)) +PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_fixed_point int_file_gamma)) +#endif + +#ifdef PNG_hIST_SUPPORTED +PNG_EXPORT(141, png_uint_32, png_get_hIST, + (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_16p *hist)); +PNG_EXPORT(142, void, png_set_hIST, + (png_const_structrp png_ptr, png_inforp info_ptr, png_const_uint_16p hist)); +#endif + +PNG_EXPORT(143, png_uint_32, png_get_IHDR, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_uint_32 *width, png_uint_32 *height, + int *bit_depth, int *color_type, + int *interlace_method, int *compression_method, int *filter_method)); + +PNG_EXPORT(144, void, png_set_IHDR, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_uint_32 width, png_uint_32 height, + int bit_depth, int color_type, + int interlace_method, int compression_method, int filter_method)); + +#ifdef PNG_mDCV_SUPPORTED +PNG_FP_EXPORT(256, png_uint_32, png_get_mDCV, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + /* The chromaticities of the mastering display. As cHRM, but independent of + * the encoding endpoints in cHRM, or cICP, or iCCP. These values will + * always be in the range 0 to 1.3107. + */ + double *white_x, double *white_y, + double *red_x, double *red_y, + double *green_x, double *green_y, + double *blue_x, double *blue_y, + /* Mastering display luminance in cd/m2 (nits). */ + double *mastering_display_maximum_luminance, + double *mastering_display_minimum_luminance)) + +PNG_FIXED_EXPORT(257, png_uint_32, png_get_mDCV_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_fixed_point *int_white_x, png_fixed_point *int_white_y, + png_fixed_point *int_red_x, png_fixed_point *int_red_y, + png_fixed_point *int_green_x, png_fixed_point *int_green_y, + png_fixed_point *int_blue_x, png_fixed_point *int_blue_y, + /* Mastering display luminance in cd/m2 (nits) multiplied (scaled) by + * 10,000. + */ + png_uint_32p mastering_display_maximum_luminance_scaled_by_10000, + png_uint_32p mastering_display_minimum_luminance_scaled_by_10000)) +#endif + +#ifdef PNG_mDCV_SUPPORTED +PNG_FP_EXPORT(258, void, png_set_mDCV, + (png_const_structrp png_ptr, png_inforp info_ptr, + /* The chromaticities of the mastering display. As cHRM, but independent of + * the encoding endpoints in cHRM, or cICP, or iCCP. + */ + double white_x, double white_y, + double red_x, double red_y, + double green_x, double green_y, + double blue_x, double blue_y, + /* Mastering display luminance in cd/m2 (nits). */ + double mastering_display_maximum_luminance, + double mastering_display_minimum_luminance)) + +PNG_FIXED_EXPORT(259, void, png_set_mDCV_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + /* The admissible range of these values is not the full range of a PNG + * fixed point value. Negative values cannot be encoded and the maximum + * value is about 1.3 */ + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, + png_fixed_point int_green_x, png_fixed_point int_green_y, + png_fixed_point int_blue_x, png_fixed_point int_blue_y, + /* These are PNG unsigned 4 byte values: 31-bit unsigned values. The MSB + * must be zero. + */ + png_uint_32 mastering_display_maximum_luminance_scaled_by_10000, + png_uint_32 mastering_display_minimum_luminance_scaled_by_10000)) +#endif + +#ifdef PNG_oFFs_SUPPORTED +PNG_EXPORT(145, png_uint_32, png_get_oFFs, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)); +#endif + +#ifdef PNG_oFFs_SUPPORTED +PNG_EXPORT(146, void, png_set_oFFs, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_int_32 offset_x, png_int_32 offset_y, int unit_type)); +#endif + +#ifdef PNG_pCAL_SUPPORTED +PNG_EXPORT(147, png_uint_32, png_get_pCAL, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_charp *purpose, png_int_32 *X0, png_int_32 *X1, + int *type, int *nparams, png_charp *units, png_charpp *params)); +#endif + +#ifdef PNG_pCAL_SUPPORTED +PNG_EXPORT(148, void, png_set_pCAL, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_charp purpose, png_int_32 X0, png_int_32 X1, + int type, int nparams, png_const_charp units, png_charpp params)); +#endif + +#ifdef PNG_pHYs_SUPPORTED +PNG_EXPORT(149, png_uint_32, png_get_pHYs, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +#endif + +#ifdef PNG_pHYs_SUPPORTED +PNG_EXPORT(150, void, png_set_pHYs, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_uint_32 res_x, png_uint_32 res_y, int unit_type)); +#endif + +PNG_EXPORT(151, png_uint_32, png_get_PLTE, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_colorp *palette, int *num_palette)); + +PNG_EXPORT(152, void, png_set_PLTE, + (png_structrp png_ptr, png_inforp info_ptr, + png_const_colorp palette, int num_palette)); + +#ifdef PNG_sBIT_SUPPORTED +PNG_EXPORT(153, png_uint_32, png_get_sBIT, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_color_8p *sig_bit)); +#endif + +#ifdef PNG_sBIT_SUPPORTED +PNG_EXPORT(154, void, png_set_sBIT, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_color_8p sig_bit)); +#endif + +#ifdef PNG_sRGB_SUPPORTED +PNG_EXPORT(155, png_uint_32, png_get_sRGB, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + int *file_srgb_intent)); +#endif + +#ifdef PNG_sRGB_SUPPORTED +PNG_EXPORT(156, void, png_set_sRGB, + (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); +PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, + (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); +#endif + +#ifdef PNG_iCCP_SUPPORTED +PNG_EXPORT(158, png_uint_32, png_get_iCCP, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_charpp name, int *compression_type, + png_bytepp profile, png_uint_32 *proflen)); +#endif + +#ifdef PNG_iCCP_SUPPORTED +PNG_EXPORT(159, void, png_set_iCCP, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_charp name, int compression_type, + png_const_bytep profile, png_uint_32 proflen)); +#endif + +#ifdef PNG_sPLT_SUPPORTED +PNG_EXPORT(160, int, png_get_sPLT, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_sPLT_tpp entries)); +#endif + +#ifdef PNG_sPLT_SUPPORTED +PNG_EXPORT(161, void, png_set_sPLT, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_sPLT_tp entries, int nentries)); +#endif + +#ifdef PNG_TEXT_SUPPORTED +/* png_get_text also returns the number of text chunks in *num_text */ +PNG_EXPORT(162, int, png_get_text, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_textp *text_ptr, int *num_text)); +#endif + +/* Note while png_set_text() will accept a structure whose text, + * language, and translated keywords are NULL pointers, the structure + * returned by png_get_text will always contain regular + * zero-terminated C strings. They might be empty strings but + * they will never be NULL pointers. + */ + +#ifdef PNG_TEXT_SUPPORTED +PNG_EXPORT(163, void, png_set_text, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_textp text_ptr, int num_text)); +#endif + +#ifdef PNG_tIME_SUPPORTED +PNG_EXPORT(164, png_uint_32, png_get_tIME, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_timep *mod_time)); +#endif + +#ifdef PNG_tIME_SUPPORTED +PNG_EXPORT(165, void, png_set_tIME, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_timep mod_time)); +#endif + +#ifdef PNG_tRNS_SUPPORTED +PNG_EXPORT(166, png_uint_32, png_get_tRNS, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_bytep *trans_alpha, int *num_trans, + png_color_16p *trans_color)); +#endif + +#ifdef PNG_tRNS_SUPPORTED +PNG_EXPORT(167, void, png_set_tRNS, + (png_structrp png_ptr, png_inforp info_ptr, + png_const_bytep trans_alpha, int num_trans, + png_const_color_16p trans_color)); +#endif + +#ifdef PNG_sCAL_SUPPORTED +PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + int *unit, double *width, double *height)) +#if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \ + defined(PNG_FLOATING_POINT_SUPPORTED) +/* NOTE: this API is currently implemented using floating point arithmetic, + * consequently it can only be used on systems with floating point support. + * In any case the range of values supported by png_fixed_point is small and it + * is highly recommended that png_get_sCAL_s be used instead. + */ +PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + int *unit, png_fixed_point *width, png_fixed_point *height)) +#endif +PNG_EXPORT(169, png_uint_32, png_get_sCAL_s, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + int *unit, png_charpp swidth, png_charpp sheight)); + +PNG_FP_EXPORT(170, void, png_set_sCAL, + (png_const_structrp png_ptr, png_inforp info_ptr, + int unit, double width, double height)) +PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + int unit, png_fixed_point width, png_fixed_point height)) +PNG_EXPORT(171, void, png_set_sCAL_s, + (png_const_structrp png_ptr, png_inforp info_ptr, + int unit, png_const_charp swidth, png_const_charp sheight)); +#endif /* sCAL */ + +#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED +/* Provide the default handling for all unknown chunks or, optionally, for + * specific unknown chunks. + * + * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was + * ignored and the default was used, the per-chunk setting only had an effect on + * write. If you wish to have chunk-specific handling on read in code that must + * work on earlier versions you must use a user chunk callback to specify the + * desired handling (keep or discard.) + * + * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below. The + * parameter is interpreted as follows: + * + * READ: + * PNG_HANDLE_CHUNK_AS_DEFAULT: + * Known chunks: do normal libpng processing, do not keep the chunk (but + * see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED) + * Unknown chunks: for a specific chunk use the global default, when used + * as the default discard the chunk data. + * PNG_HANDLE_CHUNK_NEVER: + * Discard the chunk data. + * PNG_HANDLE_CHUNK_IF_SAFE: + * Keep the chunk data if the chunk is not critical else raise a chunk + * error. + * PNG_HANDLE_CHUNK_ALWAYS: + * Keep the chunk data. + * + * If the chunk data is saved it can be retrieved using png_get_unknown_chunks, + * below. Notice that specifying "AS_DEFAULT" as a global default is equivalent + * to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks + * it simply resets the behavior to the libpng default. + * + * INTERACTION WITH USER CHUNK CALLBACKS: + * The per-chunk handling is always used when there is a png_user_chunk_ptr + * callback and the callback returns 0; the chunk is then always stored *unless* + * it is critical and the per-chunk setting is other than ALWAYS. Notice that + * the global default is *not* used in this case. (In effect the per-chunk + * value is incremented to at least IF_SAFE.) + * + * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and + * per-chunk defaults will be honored. If you want to preserve the current + * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE + * as the default - if you don't do this libpng 1.6 will issue a warning. + * + * If you want unhandled unknown chunks to be discarded in libpng 1.6 and + * earlier simply return '1' (handled). + * + * PNG_HANDLE_AS_UNKNOWN_SUPPORTED: + * If this is *not* set known chunks will always be handled by libpng and + * will never be stored in the unknown chunk list. Known chunks listed to + * png_set_keep_unknown_chunks will have no effect. If it is set then known + * chunks listed with a keep other than AS_DEFAULT will *never* be processed + * by libpng, in addition critical chunks must either be processed by the + * callback or saved. + * + * The IHDR and IEND chunks must not be listed. Because this turns off the + * default handling for chunks that would otherwise be recognized the + * behavior of libpng transformations may well become incorrect! + * + * WRITE: + * When writing chunks the options only apply to the chunks specified by + * png_set_unknown_chunks (below), libpng will *always* write known chunks + * required by png_set_ calls and will always write the core critical chunks + * (as required for PLTE). + * + * Each chunk in the png_set_unknown_chunks list is looked up in the + * png_set_keep_unknown_chunks list to find the keep setting, this is then + * interpreted as follows: + * + * PNG_HANDLE_CHUNK_AS_DEFAULT: + * Write safe-to-copy chunks and write other chunks if the global + * default is set to _ALWAYS, otherwise don't write this chunk. + * PNG_HANDLE_CHUNK_NEVER: + * Do not write the chunk. + * PNG_HANDLE_CHUNK_IF_SAFE: + * Write the chunk if it is safe-to-copy, otherwise do not write it. + * PNG_HANDLE_CHUNK_ALWAYS: + * Write the chunk. + * + * Note that the default behavior is effectively the opposite of the read case - + * in read unknown chunks are not stored by default, in write they are written + * by default. Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different + * - on write the safe-to-copy bit is checked, on read the critical bit is + * checked and on read if the chunk is critical an error will be raised. + * + * num_chunks: + * =========== + * If num_chunks is positive, then the "keep" parameter specifies the manner + * for handling only those chunks appearing in the chunk_list array, + * otherwise the chunk list array is ignored. + * + * If num_chunks is 0 the "keep" parameter specifies the default behavior for + * unknown chunks, as described above. + * + * If num_chunks is negative, then the "keep" parameter specifies the manner + * for handling all unknown chunks plus all chunks recognized by libpng + * except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to + * be processed by libpng. + */ +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +PNG_EXPORT(172, void, png_set_keep_unknown_chunks, + (png_structrp png_ptr, + int keep, png_const_bytep chunk_list, int num_chunks)); +#endif /* HANDLE_AS_UNKNOWN */ + +/* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned; + * the result is therefore true (non-zero) if special handling is required, + * false for the default handling. + */ +PNG_EXPORT(173, int, png_handle_as_unknown, + (png_const_structrp png_ptr, png_const_bytep chunk_name)); +#endif /* SET_UNKNOWN_CHUNKS */ + +#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED +PNG_EXPORT(174, void, png_set_unknown_chunks, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_unknown_chunkp unknowns, int num_unknowns)); + /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added + * unknowns to the location currently stored in the png_struct. This is + * invariably the wrong value on write. To fix this call the following API + * for each chunk in the list with the correct location. If you know your + * code won't be compiled on earlier versions you can rely on + * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing + * the correct thing. + */ + +PNG_EXPORT(175, void, png_set_unknown_chunk_location, + (png_const_structrp png_ptr, png_inforp info_ptr, + int chunk, int location)); + +PNG_EXPORT(176, int, png_get_unknown_chunks, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_unknown_chunkpp entries)); +#endif + +/* Png_free_data() will turn off the "valid" flag for anything it frees. + * If you need to turn it off for a chunk that your application has freed, + * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); + */ +PNG_EXPORT(177, void, png_set_invalid, + (png_const_structrp png_ptr, png_inforp info_ptr, int mask)); + +#ifdef PNG_INFO_IMAGE_SUPPORTED +/* The "params" pointer is currently not used and is for future expansion. */ +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +PNG_EXPORT(178, void, png_read_png, + (png_structrp png_ptr, png_inforp info_ptr, + int transforms, png_voidp params)); +#endif +#ifdef PNG_WRITE_SUPPORTED +PNG_EXPORT(179, void, png_write_png, + (png_structrp png_ptr, png_inforp info_ptr, + int transforms, png_voidp params)); +#endif +#endif + +PNG_EXPORT(180, png_const_charp, png_get_copyright, + (png_const_structrp png_ptr)); +PNG_EXPORT(181, png_const_charp, png_get_header_ver, + (png_const_structrp png_ptr)); +PNG_EXPORT(182, png_const_charp, png_get_header_version, + (png_const_structrp png_ptr)); +PNG_EXPORT(183, png_const_charp, png_get_libpng_ver, + (png_const_structrp png_ptr)); + +#ifdef PNG_MNG_FEATURES_SUPPORTED +PNG_EXPORT(184, png_uint_32, png_permit_mng_features, + (png_structrp png_ptr, png_uint_32 mng_features_permitted)); +#endif + +/* For use in png_set_keep_unknown, added to version 1.2.6 */ +#define PNG_HANDLE_CHUNK_AS_DEFAULT 0 +#define PNG_HANDLE_CHUNK_NEVER 1 +#define PNG_HANDLE_CHUNK_IF_SAFE 2 +#define PNG_HANDLE_CHUNK_ALWAYS 3 +#define PNG_HANDLE_CHUNK_LAST 4 + +/* Strip the prepended error numbers ("#nnn ") from error and warning + * messages before passing them to the error or warning handler. + */ +#ifdef PNG_ERROR_NUMBERS_SUPPORTED +PNG_EXPORT(185, void, png_set_strip_error_numbers, + (png_structrp png_ptr, png_uint_32 strip_mode)); +#endif + +/* Added in libpng-1.2.6 */ +#ifdef PNG_SET_USER_LIMITS_SUPPORTED +PNG_EXPORT(186, void, png_set_user_limits, + (png_structrp png_ptr, + png_uint_32 user_width_max, png_uint_32 user_height_max)); +PNG_EXPORT(187, png_uint_32, png_get_user_width_max, + (png_const_structrp png_ptr)); +PNG_EXPORT(188, png_uint_32, png_get_user_height_max, + (png_const_structrp png_ptr)); +/* Added in libpng-1.4.0 */ +PNG_EXPORT(189, void, png_set_chunk_cache_max, + (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)); +PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max, + (png_const_structrp png_ptr)); +/* Added in libpng-1.4.1 */ +PNG_EXPORT(191, void, png_set_chunk_malloc_max, + (png_structrp png_ptr, png_alloc_size_t user_chunk_cache_max)); +PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max, + (png_const_structrp png_ptr)); +#endif + +#if defined(PNG_INCH_CONVERSIONS_SUPPORTED) +PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +PNG_FP_EXPORT(196, float, png_get_x_offset_inches, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) +#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ +PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) +#endif + +PNG_FP_EXPORT(197, float, png_get_y_offset_inches, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) +#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ +PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) +#endif + +# ifdef PNG_pHYs_SUPPORTED +PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +# endif /* pHYs */ +#endif /* INCH_CONVERSIONS */ + +/* Added in libpng-1.4.0 */ +#ifdef PNG_IO_STATE_SUPPORTED +PNG_EXPORT(199, png_uint_32, png_get_io_state, + (png_const_structrp png_ptr)); + +/* Removed from libpng 1.6; use png_get_io_chunk_type. */ +PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, + (png_structrp png_ptr), + PNG_DEPRECATED) + +PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, + (png_const_structrp png_ptr)); + +/* The flags returned by png_get_io_state() are the following: */ +# define PNG_IO_NONE 0x0000 /* no I/O at this moment */ +# define PNG_IO_READING 0x0001 /* currently reading */ +# define PNG_IO_WRITING 0x0002 /* currently writing */ +# define PNG_IO_SIGNATURE 0x0010 /* currently at the file signature */ +# define PNG_IO_CHUNK_HDR 0x0020 /* currently at the chunk header */ +# define PNG_IO_CHUNK_DATA 0x0040 /* currently at the chunk data */ +# define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */ +# define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */ +# define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */ +#endif /* IO_STATE */ + +/* Interlace support. The following macros are always defined so that if + * libpng interlace handling is turned off the macros may be used to handle + * interlaced images within the application. + */ +#define PNG_INTERLACE_ADAM7_PASSES 7 + +/* Two macros to return the first row and first column of the original, + * full, image which appears in a given pass. 'pass' is in the range 0 + * to 6 and the result is in the range 0 to 7. + */ +#define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7) +#define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7) + +/* A macro to return the offset between pixels in the output row for a pair of + * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that + * follows. Note that ROW_OFFSET is the offset from one row to the next whereas + * COL_OFFSET is from one column to the next, within a row. + */ +#define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8) +#define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1)) + +/* Two macros to help evaluate the number of rows or columns in each + * pass. This is expressed as a shift - effectively log2 of the number or + * rows or columns in each 8x8 tile of the original image. + */ +#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) +#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) + +/* Hence two macros to determine the number of rows or columns in a given + * pass of an image given its height or width. In fact these macros may + * return non-zero even though the sub-image is empty, because the other + * dimension may be empty for a small image. + */ +#define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) +#define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) + +/* For the reader row callbacks (both progressive and sequential) it is + * necessary to find the row in the output image given a row in an interlaced + * image, so two more macros: + */ +#define PNG_ROW_FROM_PASS_ROW(y_in, pass) \ + (((y_in)<>(((7-(off))-(pass))<<2)) & 0xF) | \ + ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0)) + +#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ + ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) +#define PNG_COL_IN_INTERLACE_PASS(x, pass) \ + ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) + +#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED +/* With these routines we avoid an integer divide, which will be slower on + * most machines. However, it does take more operations than the corresponding + * divide method, so it may be slower on a few RISC systems. There are two + * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. + * + * Note that the rounding factors are NOT supposed to be the same! 128 and + * 32768 are correct for the NODIV code; 127 and 32767 are correct for the + * standard method. + * + * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] + */ + + /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ + +# define png_composite(composite, fg, alpha, bg) \ + { \ + png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ + * (png_uint_16)(alpha) \ + + (png_uint_16)(bg)*(png_uint_16)(255 \ + - (png_uint_16)(alpha)) + 128); \ + (composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); \ + } + +# define png_composite_16(composite, fg, alpha, bg) \ + { \ + png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ + * (png_uint_32)(alpha) \ + + (png_uint_32)(bg)*(65535 \ + - (png_uint_32)(alpha)) + 32768); \ + (composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); \ + } + +#else /* Standard method using integer division */ + +# define png_composite(composite, fg, alpha, bg) \ + (composite) = \ + (png_byte)(0xff & (((png_uint_16)(fg) * (png_uint_16)(alpha) + \ + (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ + 127) / 255)) + +# define png_composite_16(composite, fg, alpha, bg) \ + (composite) = \ + (png_uint_16)(0xffff & (((png_uint_32)(fg) * (png_uint_32)(alpha) + \ + (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ + 32767) / 65535)) +#endif /* READ_COMPOSITE_NODIV */ + +#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED +PNG_EXPORT(201, png_uint_32, png_get_uint_32, + (png_const_bytep buf)); +PNG_EXPORT(202, png_uint_16, png_get_uint_16, + (png_const_bytep buf)); +PNG_EXPORT(203, png_int_32, png_get_int_32, + (png_const_bytep buf)); +#endif + +PNG_EXPORT(204, png_uint_32, png_get_uint_31, + (png_const_structrp png_ptr, png_const_bytep buf)); +/* No png_get_int_16 -- may be added if there's a real need for it. */ + +/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */ +#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED +PNG_EXPORT(205, void, png_save_uint_32, + (png_bytep buf, png_uint_32 i)); +#endif +#ifdef PNG_SAVE_INT_32_SUPPORTED +PNG_EXPORT(206, void, png_save_int_32, + (png_bytep buf, png_int_32 i)); +#endif + +/* Place a 16-bit number into a buffer in PNG byte order. + * The parameter is declared unsigned int, not png_uint_16, + * just to avoid potential problems on pre-ANSI C compilers. + */ +#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED +PNG_EXPORT(207, void, png_save_uint_16, + (png_bytep buf, unsigned int i)); +/* No png_save_int_16 -- may be added if there's a real need for it. */ +#endif + +#ifdef PNG_USE_READ_MACROS +/* Inline macros to do direct reads of bytes from the input buffer. + * The png_get_int_32() routine assumes we are using two's complement + * format for negative values, which is almost certainly true. + */ +# define PNG_get_uint_32(buf) \ + (((png_uint_32)(*(buf)) << 24) + \ + ((png_uint_32)(*((buf) + 1)) << 16) + \ + ((png_uint_32)(*((buf) + 2)) << 8) + \ + ((png_uint_32)(*((buf) + 3)))) + + /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the + * function) incorrectly returned a value of type png_uint_32. + */ +# define PNG_get_uint_16(buf) \ + ((png_uint_16) \ + (((unsigned int)(*(buf)) << 8) + \ + ((unsigned int)(*((buf) + 1))))) + +# define PNG_get_int_32(buf) \ + ((png_int_32)((*(buf) & 0x80) \ + ? -((png_int_32)(((png_get_uint_32(buf)^0xffffffffU)+1U)&0x7fffffffU)) \ + : (png_int_32)png_get_uint_32(buf))) + +/* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, + * but defining a macro name prefixed with PNG_PREFIX. + */ +# ifndef PNG_PREFIX +# define png_get_uint_32(buf) PNG_get_uint_32(buf) +# define png_get_uint_16(buf) PNG_get_uint_16(buf) +# define png_get_int_32(buf) PNG_get_int_32(buf) +# endif +#else +# ifdef PNG_PREFIX + /* No macros; revert to the (redefined) function */ +# define PNG_get_uint_32 (png_get_uint_32) +# define PNG_get_uint_16 (png_get_uint_16) +# define PNG_get_int_32 (png_get_int_32) +# endif +#endif + +#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED +PNG_EXPORT(242, void, png_set_check_for_invalid_index, + (png_structrp png_ptr, int allowed)); +# ifdef PNG_GET_PALETTE_MAX_SUPPORTED +PNG_EXPORT(243, int, png_get_palette_max, + (png_const_structp png_ptr, png_const_infop info_ptr)); +# endif +#endif /* CHECK_FOR_INVALID_INDEX */ + +/******************************************************************************* + * Section 5: SIMPLIFIED API + ******************************************************************************* + * + * Please read the documentation in libpng-manual.txt (TODO: write said + * documentation) if you don't understand what follows. + * + * The simplified API hides the details of both libpng and the PNG file format + * itself. It allows PNG files to be read into a very limited number of + * in-memory bitmap formats or to be written from the same formats. If these + * formats do not accommodate your needs then you can, and should, use the more + * sophisticated APIs above - these support a wide variety of in-memory formats + * and a wide variety of sophisticated transformations to those formats as well + * as a wide variety of APIs to manipulate ancillary information. + * + * To read a PNG file using the simplified API: + * + * 1) Declare a 'png_image' structure (see below) on the stack, set the + * version field to PNG_IMAGE_VERSION and the 'opaque' pointer to NULL + * (this is REQUIRED, your program may crash if you don't do it.) + * 2) Call the appropriate png_image_begin_read... function. + * 3) Set the png_image 'format' member to the required sample format. + * 4) Allocate a buffer for the image and, if required, the color-map. + * 5) Call png_image_finish_read to read the image and, if required, the + * color-map into your buffers. + * + * There are no restrictions on the format of the PNG input itself; all valid + * color types, bit depths, and interlace methods are acceptable, and the + * input image is transformed as necessary to the requested in-memory format + * during the png_image_finish_read() step. The only caveat is that if you + * request a color-mapped image from a PNG that is full-color or makes + * complex use of an alpha channel the transformation is extremely lossy and the + * result may look terrible. + * + * To write a PNG file using the simplified API: + * + * 1) Declare a 'png_image' structure on the stack and memset() it to all zero. + * 2) Initialize the members of the structure that describe the image, setting + * the 'format' member to the format of the image samples. + * 3) Call the appropriate png_image_write... function with a pointer to the + * image and, if necessary, the color-map to write the PNG data. + * + * png_image is a structure that describes the in-memory format of an image + * when it is being read or defines the in-memory format of an image that you + * need to write: + */ +#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \ + defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) + +#define PNG_IMAGE_VERSION 1 + +typedef struct png_control *png_controlp; +typedef struct +{ + png_controlp opaque; /* Initialize to NULL, free with png_image_free */ + png_uint_32 version; /* Set to PNG_IMAGE_VERSION */ + png_uint_32 width; /* Image width in pixels (columns) */ + png_uint_32 height; /* Image height in pixels (rows) */ + png_uint_32 format; /* Image format as defined below */ + png_uint_32 flags; /* A bit mask containing informational flags */ + png_uint_32 colormap_entries; + /* Number of entries in the color-map */ + + /* In the event of an error or warning the following field will be set to a + * non-zero value and the 'message' field will contain a '\0' terminated + * string with the libpng error or warning message. If both warnings and + * an error were encountered, only the error is recorded. If there + * are multiple warnings, only the first one is recorded. + * + * The upper 30 bits of this value are reserved, the low two bits contain + * a value as follows: + */ +# define PNG_IMAGE_WARNING 1 +# define PNG_IMAGE_ERROR 2 + /* + * The result is a two-bit code such that a value more than 1 indicates + * a failure in the API just called: + * + * 0 - no warning or error + * 1 - warning + * 2 - error + * 3 - error preceded by warning + */ +# define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1) + + png_uint_32 warning_or_error; + + char message[64]; +} png_image, *png_imagep; + +/* The samples of the image have one to four channels whose components have + * original values in the range 0 to 1.0: + * + * 1: A single gray or luminance channel (G). + * 2: A gray/luminance channel and an alpha channel (GA). + * 3: Three red, green, blue color channels (RGB). + * 4: Three color channels and an alpha channel (RGBA). + * + * The components are encoded in one of two ways: + * + * a) As a small integer, value 0..255, contained in a single byte. For the + * alpha channel the original value is simply value/255. For the color or + * luminance channels the value is encoded according to the sRGB specification + * and matches the 8-bit format expected by typical display devices. + * + * The color/gray channels are not scaled (pre-multiplied) by the alpha + * channel and are suitable for passing to color management software. + * + * b) As a value in the range 0..65535, contained in a 2-byte integer. All + * channels can be converted to the original value by dividing by 65535; all + * channels are linear. Color channels use the RGB encoding (RGB end-points) of + * the sRGB specification. This encoding is identified by the + * PNG_FORMAT_FLAG_LINEAR flag below. + * + * When the simplified API needs to convert between sRGB and linear colorspaces, + * the actual sRGB transfer curve defined in the sRGB specification (see the + * article at ) is used, not the gamma=1/2.2 + * approximation used elsewhere in libpng. + * + * When an alpha channel is present it is expected to denote pixel coverage + * of the color or luminance channels and is returned as an associated alpha + * channel: the color/gray channels are scaled (pre-multiplied) by the alpha + * value. + * + * The samples are either contained directly in the image data, between 1 and 8 + * bytes per pixel according to the encoding, or are held in a color-map indexed + * by bytes in the image data. In the case of a color-map the color-map entries + * are individual samples, encoded as above, and the image data has one byte per + * pixel to select the relevant sample from the color-map. + */ + +/* PNG_FORMAT_* + * + * #defines to be used in png_image::format. Each #define identifies a + * particular layout of sample data and, if present, alpha values. There are + * separate defines for each of the two component encodings. + * + * A format is built up using single bit flag values. All combinations are + * valid. Formats can be built up from the flag values or you can use one of + * the predefined values below. When testing formats always use the FORMAT_FLAG + * macros to test for individual features - future versions of the library may + * add new flags. + * + * When reading or writing color-mapped images the format should be set to the + * format of the entries in the color-map then png_image_{read,write}_colormap + * called to read or write the color-map and set the format correctly for the + * image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! + * + * NOTE: libpng can be built with particular features disabled. If you see + * compiler errors because the definition of one of the following flags has been + * compiled out it is because libpng does not have the required support. It is + * possible, however, for the libpng configuration to enable the format on just + * read or just write; in that case you may see an error at run time. You can + * guard against this by checking for the definition of the appropriate + * "_SUPPORTED" macro, one of: + * + * PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED + */ +#define PNG_FORMAT_FLAG_ALPHA 0x01U /* format with an alpha channel */ +#define PNG_FORMAT_FLAG_COLOR 0x02U /* color format: otherwise grayscale */ +#define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2-byte channels else 1-byte */ +#define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */ + +#ifdef PNG_FORMAT_BGR_SUPPORTED +# define PNG_FORMAT_FLAG_BGR 0x10U /* BGR colors, else order is RGB */ +#endif + +#ifdef PNG_FORMAT_AFIRST_SUPPORTED +# define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */ +#endif + +#define PNG_FORMAT_FLAG_ASSOCIATED_ALPHA 0x40U /* alpha channel is associated */ + +/* Commonly used formats have predefined macros. + * + * First the single byte (sRGB) formats: + */ +#define PNG_FORMAT_GRAY 0 +#define PNG_FORMAT_GA PNG_FORMAT_FLAG_ALPHA +#define PNG_FORMAT_AG (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST) +#define PNG_FORMAT_RGB PNG_FORMAT_FLAG_COLOR +#define PNG_FORMAT_BGR (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR) +#define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA) +#define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST) +#define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA) +#define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST) + +/* Then the linear 2-byte formats. When naming these "Y" is used to + * indicate a luminance (gray) channel. + */ +#define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR +#define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA) +#define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR) +#define PNG_FORMAT_LINEAR_RGB_ALPHA \ + (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA) + +/* With color-mapped formats the image data is one byte for each pixel, the byte + * is an index into the color-map which is formatted as above. To obtain a + * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP + * to one of the above definitions, or you can use one of the definitions below. + */ +#define PNG_FORMAT_RGB_COLORMAP (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP) +#define PNG_FORMAT_BGR_COLORMAP (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP) +#define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP) +#define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP) +#define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP) +#define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP) + +/* PNG_IMAGE macros + * + * These are convenience macros to derive information from a png_image + * structure. The PNG_IMAGE_SAMPLE_ macros return values appropriate to the + * actual image sample values - either the entries in the color-map or the + * pixels in the image. The PNG_IMAGE_PIXEL_ macros return corresponding values + * for the pixels and will always return 1 for color-mapped formats. The + * remaining macros return information about the rows in the image and the + * complete image. + * + * NOTE: All the macros that take a png_image::format parameter are compile time + * constants if the format parameter is, itself, a constant. Therefore these + * macros can be used in array declarations and case labels where required. + * Similarly the macros are also pre-processor constants (sizeof is not used) so + * they can be used in #if tests. + * + * First the information about the samples. + */ +#define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\ + (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1) + /* Return the total number of channels in a given format: 1..4 */ + +#define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\ + ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1) + /* Return the size in bytes of a single component of a pixel or color-map + * entry (as appropriate) in the image: 1 or 2. + */ + +#define PNG_IMAGE_SAMPLE_SIZE(fmt)\ + (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)) + /* This is the size of the sample data for one sample. If the image is + * color-mapped it is the size of one color-map entry (and image pixels are + * one byte in size), otherwise it is the size of one image pixel. + */ + +#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\ + (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256) + /* The maximum size of the color-map required by the format expressed in a + * count of components. This can be used to compile-time allocate a + * color-map: + * + * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)]; + * + * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)]; + * + * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the + * information from one of the png_image_begin_read_ APIs and dynamically + * allocate the required memory. + */ + +/* Corresponding information about the pixels */ +#define PNG_IMAGE_PIXEL_(test,fmt)\ + (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt)) + +#define PNG_IMAGE_PIXEL_CHANNELS(fmt)\ + PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt) + /* The number of separate channels (components) in a pixel; 1 for a + * color-mapped image. + */ + +#define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\ + PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt) + /* The size, in bytes, of each component in a pixel; 1 for a color-mapped + * image. + */ + +#define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt) + /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */ + +/* Information about the whole row, or whole image */ +#define PNG_IMAGE_ROW_STRIDE(image)\ + (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width) + /* Return the total number of components in a single row of the image; this + * is the minimum 'row stride', the minimum count of components between each + * row. For a color-mapped image this is the minimum number of bytes in a + * row. + * + * WARNING: this macro overflows for some images with more than one component + * and very large image widths. libpng will refuse to process an image where + * this macro would overflow. + */ + +#define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\ + (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride)) + /* Return the size, in bytes, of an image buffer given a png_image and a row + * stride - the number of components to leave space for in each row. + * + * WARNING: this macro overflows a 32-bit integer for some large PNG images, + * libpng will refuse to process an image where such an overflow would occur. + */ + +#define PNG_IMAGE_SIZE(image)\ + PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image)) + /* Return the size, in bytes, of the image in memory given just a png_image; + * the row stride is the minimum stride required for the image. + */ + +#define PNG_IMAGE_COLORMAP_SIZE(image)\ + (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries) + /* Return the size, in bytes, of the color-map of this image. If the image + * format is not a color-map format this will return a size sufficient for + * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if + * you don't want to allocate a color-map in this case. + */ + +/* PNG_IMAGE_FLAG_* + * + * Flags containing additional information about the image are held in the + * 'flags' field of png_image. + */ +#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01 + /* This indicates that the RGB values of the in-memory bitmap do not + * correspond to the red, green and blue end-points defined by sRGB. + */ + +#define PNG_IMAGE_FLAG_FAST 0x02 + /* On write emphasise speed over compression; the resultant PNG file will be + * larger but will be produced significantly faster, particular for large + * images. Do not use this option for images which will be distributed, only + * used it when producing intermediate files that will be read back in + * repeatedly. For a typical 24-bit image the option will double the read + * speed at the cost of increasing the image size by 25%, however for many + * more compressible images the PNG file can be 10 times larger with only a + * slight speed gain. + */ + +#define PNG_IMAGE_FLAG_16BIT_sRGB 0x04 + /* On read if the image is a 16-bit per component image and there is no gAMA + * or sRGB chunk assume that the components are sRGB encoded. Notice that + * images output by the simplified API always have gamma information; setting + * this flag only affects the interpretation of 16-bit images from an + * external source. It is recommended that the application expose this flag + * to the user; the user can normally easily recognize the difference between + * linear and sRGB encoding. This flag has no effect on write - the data + * passed to the write APIs must have the correct encoding (as defined + * above.) + * + * If the flag is not set (the default) input 16-bit per component data is + * assumed to be linear. + * + * NOTE: the flag can only be set after the png_image_begin_read_ call, + * because that call initializes the 'flags' field. + */ + +#ifdef PNG_SIMPLIFIED_READ_SUPPORTED +/* READ APIs + * --------- + * + * The png_image passed to the read APIs must have been initialized by setting + * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.) + */ +#ifdef PNG_STDIO_SUPPORTED +PNG_EXPORT(234, int, png_image_begin_read_from_file, + (png_imagep image, const char *file_name)); + /* The named file is opened for read and the image header is filled in + * from the PNG header in the file. + */ + +PNG_EXPORT(235, int, png_image_begin_read_from_stdio, + (png_imagep image, FILE *file)); + /* The PNG header is read from the stdio FILE object. */ +#endif /* STDIO */ + +PNG_EXPORT(236, int, png_image_begin_read_from_memory, + (png_imagep image, png_const_voidp memory, size_t size)); + /* The PNG header is read from the given memory buffer. */ + +PNG_EXPORT(237, int, png_image_finish_read, + (png_imagep image, + png_const_colorp background, void *buffer, png_int_32 row_stride, + void *colormap)); + /* Finish reading the image into the supplied buffer and clean up the + * png_image structure. + * + * row_stride is the step, in byte or 2-byte units as appropriate, + * between adjacent rows. A positive stride indicates that the top-most row + * is first in the buffer - the normal top-down arrangement. A negative + * stride indicates that the bottom-most row is first in the buffer. + * + * background need only be supplied if an alpha channel must be removed from + * a png_byte format and the removal is to be done by compositing on a solid + * color; otherwise it may be NULL and any composition will be done directly + * onto the buffer. The value is an sRGB color to use for the background, + * for grayscale output the green channel is used. + * + * background must be supplied when an alpha channel must be removed from a + * single byte color-mapped output format, in other words if: + * + * 1) The original format from png_image_begin_read_from_* had + * PNG_FORMAT_FLAG_ALPHA set. + * 2) The format set by the application does not. + * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and + * PNG_FORMAT_FLAG_LINEAR *not* set. + * + * For linear output removing the alpha channel is always done by compositing + * on black and background is ignored. + * + * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set. It must + * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE. + * image->colormap_entries will be updated to the actual number of entries + * written to the colormap; this may be less than the original value. + */ + +PNG_EXPORT(238, void, png_image_free, + (png_imagep image)); + /* Free any data allocated by libpng in image->opaque, setting the pointer to + * NULL. May be called at any time after the structure is initialized. + */ +#endif /* SIMPLIFIED_READ */ + +#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED +/* WRITE APIS + * ---------- + * For write you must initialize a png_image structure to describe the image to + * be written. To do this use memset to set the whole structure to 0 then + * initialize fields describing your image. + * + * version: must be set to PNG_IMAGE_VERSION + * opaque: must be initialized to NULL + * width: image width in pixels + * height: image height in rows + * format: the format of the data (image and color-map) you wish to write + * flags: set to 0 unless one of the defined flags applies; set + * PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB + * values do not correspond to the colors in sRGB. + * colormap_entries: set to the number of entries in the color-map (0 to 256) + */ +#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED +PNG_EXPORT(239, int, png_image_write_to_file, + (png_imagep image, + const char *file, int convert_to_8bit, const void *buffer, + png_int_32 row_stride, const void *colormap)); + /* Write the image to the named file. */ + +PNG_EXPORT(240, int, png_image_write_to_stdio, + (png_imagep image, + FILE *file, int convert_to_8_bit, const void *buffer, + png_int_32 row_stride, const void *colormap)); + /* Write the image to the given FILE object. */ +#endif /* SIMPLIFIED_WRITE_STDIO */ + +/* With all write APIs if image is in one of the linear formats with 16-bit + * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG + * gamma encoded according to the sRGB specification, otherwise a 16-bit linear + * encoded PNG file is written. + * + * With color-mapped data formats the colormap parameter point to a color-map + * with at least image->colormap_entries encoded in the specified format. If + * the format is linear the written PNG color-map will be converted to sRGB + * regardless of the convert_to_8_bit flag. + * + * With all APIs row_stride is handled as in the read APIs - it is the spacing + * from one row to the next in component sized units (1 or 2 bytes) and if + * negative indicates a bottom-up row layout in the buffer. If row_stride is + * zero, libpng will calculate it for you from the image width and number of + * channels. + * + * Note that the write API does not support interlacing, sub-8-bit pixels or + * most ancillary chunks. If you need to write text chunks (e.g. for copyright + * notices) you need to use one of the other APIs. + */ + +PNG_EXPORT(245, int, png_image_write_to_memory, + (png_imagep image, + void *memory, png_alloc_size_t * PNG_RESTRICT memory_bytes, + int convert_to_8_bit, + const void *buffer, png_int_32 row_stride, const void *colormap)); + /* Write the image to the given memory buffer. The function both writes the + * whole PNG data stream to *memory and updates *memory_bytes with the count + * of bytes written. + * + * 'memory' may be NULL. In this case *memory_bytes is not read however on + * success the number of bytes which would have been written will still be + * stored in *memory_bytes. On failure *memory_bytes will contain 0. + * + * If 'memory' is not NULL it must point to memory[*memory_bytes] of + * writeable memory. + * + * If the function returns success memory[*memory_bytes] (if 'memory' is not + * NULL) contains the written PNG data. *memory_bytes will always be less + * than or equal to the original value. + * + * If the function returns false and *memory_bytes was not changed an error + * occurred during write. If *memory_bytes was changed, or is not 0 if + * 'memory' was NULL, the write would have succeeded but for the memory + * buffer being too small. *memory_bytes contains the required number of + * bytes and will be bigger that the original value. + */ + +#define png_image_write_get_memory_size(image, size, convert_to_8_bit, buffer,\ + row_stride, colormap)\ + png_image_write_to_memory(&(image), 0, &(size), convert_to_8_bit, buffer,\ + row_stride, colormap) + /* Return the amount of memory in 'size' required to compress this image. + * The png_image structure 'image' must be filled in as in the above + * function and must not be changed before the actual write call, the buffer + * and all other parameters must also be identical to that in the final + * write call. The 'size' variable need not be initialized. + * + * NOTE: the macro returns true/false, if false is returned 'size' will be + * set to zero and the write failed and probably will fail if tried again. + */ + +/* You can pre-allocate the buffer by making sure it is of sufficient size + * regardless of the amount of compression achieved. The buffer size will + * always be bigger than the original image and it will never be filled. The + * following macros are provided to assist in allocating the buffer. + */ +#define PNG_IMAGE_DATA_SIZE(image) (PNG_IMAGE_SIZE(image)+(image).height) + /* The number of uncompressed bytes in the PNG byte encoding of the image; + * uncompressing the PNG IDAT data will give this number of bytes. + * + * NOTE: while PNG_IMAGE_SIZE cannot overflow for an image in memory this + * macro can because of the extra bytes used in the PNG byte encoding. You + * need to avoid this macro if your image size approaches 2^30 in width or + * height. The same goes for the remainder of these macros; they all produce + * bigger numbers than the actual in-memory image size. + */ +#ifndef PNG_ZLIB_MAX_SIZE +# define PNG_ZLIB_MAX_SIZE(b) ((b)+(((b)+7U)>>3)+(((b)+63U)>>6)+11U) + /* An upper bound on the number of compressed bytes given 'b' uncompressed + * bytes. This is based on deflateBounds() in zlib; different + * implementations of zlib compression may conceivably produce more data so + * if your zlib implementation is not zlib itself redefine this macro + * appropriately. + */ +#endif + +#define PNG_IMAGE_COMPRESSED_SIZE_MAX(image)\ + PNG_ZLIB_MAX_SIZE((png_alloc_size_t)PNG_IMAGE_DATA_SIZE(image)) + /* An upper bound on the size of the data in the PNG IDAT chunks. */ + +#define PNG_IMAGE_PNG_SIZE_MAX_(image, image_size)\ + ((8U/*sig*/+25U/*IHDR*/+16U/*gAMA*/+44U/*cHRM*/+12U/*IEND*/+\ + (((image).format&PNG_FORMAT_FLAG_COLORMAP)?/*colormap: PLTE, tRNS*/\ + 12U+3U*(image).colormap_entries/*PLTE data*/+\ + (((image).format&PNG_FORMAT_FLAG_ALPHA)?\ + 12U/*tRNS*/+(image).colormap_entries:0U):0U)+\ + 12U)+(12U*((image_size)/PNG_ZBUF_SIZE))/*IDAT*/+(image_size)) + /* A helper for the following macro; if your compiler cannot handle the + * following macro use this one with the result of + * PNG_IMAGE_COMPRESSED_SIZE_MAX(image) as the second argument (most + * compilers should handle this just fine.) + */ + +#define PNG_IMAGE_PNG_SIZE_MAX(image)\ + PNG_IMAGE_PNG_SIZE_MAX_(image, PNG_IMAGE_COMPRESSED_SIZE_MAX(image)) + /* An upper bound on the total length of the PNG data stream for 'image'. + * The result is of type png_alloc_size_t, on 32-bit systems this may + * overflow even though PNG_IMAGE_DATA_SIZE does not overflow; the write will + * run out of buffer space but return a corrected size which should work. + */ +#endif /* SIMPLIFIED_WRITE */ +/******************************************************************************* + * END OF SIMPLIFIED API + ******************************************************************************/ +#endif /* SIMPLIFIED_{READ|WRITE} */ + +/******************************************************************************* + * Section 6: IMPLEMENTATION OPTIONS + ******************************************************************************* + * + * Support for arbitrary implementation-specific optimizations. The API allows + * particular options to be turned on or off. 'Option' is the number of the + * option and 'onoff' is 0 (off) or non-0 (on). The value returned is given + * by the PNG_OPTION_ defines below. + * + * HARDWARE: normally hardware capabilities, such as the Intel SSE instructions, + * are detected at run time, however sometimes it may be impossible + * to do this in user mode, in which case it is necessary to discover + * the capabilities in an OS specific way. Such capabilities are + * listed here when libpng has support for them and must be turned + * ON by the application if present. + * + * SOFTWARE: sometimes software optimizations actually result in performance + * decrease on some architectures or systems, or with some sets of + * PNG images. 'Software' options allow such optimizations to be + * selected at run time. + */ +#ifdef PNG_SET_OPTION_SUPPORTED + +/* HARDWARE: ARM Neon SIMD instructions supported */ +#ifdef PNG_ARM_NEON_API_SUPPORTED +# define PNG_ARM_NEON 0 +#endif + +/* SOFTWARE: Force maximum window */ +#define PNG_MAXIMUM_INFLATE_WINDOW 2 + +/* SOFTWARE: Check ICC profile for sRGB */ +#define PNG_SKIP_sRGB_CHECK_PROFILE 4 + +/* HARDWARE: MIPS MSA SIMD instructions supported */ +#ifdef PNG_MIPS_MSA_API_SUPPORTED +# define PNG_MIPS_MSA 6 +#endif + +/* SOFTWARE: Disable Adler32 check on IDAT */ +#ifdef PNG_DISABLE_ADLER32_CHECK_SUPPORTED +# define PNG_IGNORE_ADLER32 8 +#endif + +/* HARDWARE: PowerPC VSX SIMD instructions supported */ +#ifdef PNG_POWERPC_VSX_API_SUPPORTED +# define PNG_POWERPC_VSX 10 +#endif + +/* HARDWARE: MIPS MMI SIMD instructions supported */ +#ifdef PNG_MIPS_MMI_API_SUPPORTED +# define PNG_MIPS_MMI 12 +#endif + +/* HARDWARE: RISC-V RVV SIMD instructions supported */ +#ifdef PNG_RISCV_RVV_API_SUPPORTED +# define PNG_RISCV_RVV 14 +#endif + +/* Next option - numbers must be even */ +#define PNG_OPTION_NEXT 16 + +/* Return values: NOTE: there are four values and 'off' is *not* zero */ +#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ +#define PNG_OPTION_INVALID 1 /* Option number out of range */ +#define PNG_OPTION_OFF 2 +#define PNG_OPTION_ON 3 + +PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, + int onoff)); +#endif /* SET_OPTION */ + +/******************************************************************************* + * END OF HARDWARE AND SOFTWARE OPTIONS + ******************************************************************************/ + +/* Maintainer: Put new public prototypes here ^, in libpng.3, in project + * defs, and in scripts/symbols.def. + */ + +/* The last ordinal number (this is the *last* one already used; the next + * one to use is one more than this.) + */ +#ifdef PNG_EXPORT_LAST_ORDINAL + PNG_EXPORT_LAST_ORDINAL(259); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* PNG_VERSION_INFO_ONLY */ +/* Do not put anything past this line */ +#endif /* PNG_H */ diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/libpng16/pngconf.h b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/libpng16/pngconf.h new file mode 100644 index 0000000000000000000000000000000000000000..4508452419788fde49df406205d0277f5d515e31 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/libpng16/pngconf.h @@ -0,0 +1,615 @@ +/* pngconf.h - machine-configurable file for libpng + * + * libpng version 1.6.55 + * + * Copyright (c) 2018-2026 Cosmin Truta + * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * Any machine specific code is near the front of this file, so if you + * are configuring libpng for a machine, you may want to read the section + * starting here down to where it starts to typedef png_color, png_text, + * and png_info. + */ + +#ifndef PNGCONF_H +#define PNGCONF_H + +#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ + +/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C + * compiler for correct compilation. The following header files are required by + * the standard. If your compiler doesn't provide these header files, or they + * do not match the standard, you will need to provide/improve them. + */ +#include +#include + +/* Library header files. These header files are all defined by ISOC90; libpng + * expects conformant implementations, however, an ISOC90 conformant system need + * not provide these header files if the functionality cannot be implemented. + * In this case it will be necessary to disable the relevant parts of libpng in + * the build of pnglibconf.h. + * + * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not + * include this unnecessary header file. + */ + +#ifdef PNG_STDIO_SUPPORTED + /* Required for the definition of FILE: */ +# include +#endif + +#ifdef PNG_SETJMP_SUPPORTED + /* Required for the definition of jmp_buf and the declaration of longjmp: */ +# include +#endif + +#ifdef PNG_CONVERT_tIME_SUPPORTED + /* Required for struct tm: */ +# include +#endif + +#endif /* PNG_BUILDING_SYMBOL_TABLE */ + +/* Prior to 1.6.0, it was possible to turn off 'const' in declarations, + * using PNG_NO_CONST. This is no longer supported. + */ +#define PNG_CONST const /* backward compatibility only */ + +/* This controls optimization of the reading of 16-bit and 32-bit + * values from PNG files. It can be set on a per-app-file basis: it + * just changes whether a macro is used when the function is called. + * The library builder sets the default; if read functions are not + * built into the library the macro implementation is forced on. + */ +#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED +# define PNG_USE_READ_MACROS +#endif +#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) +# if PNG_DEFAULT_READ_MACROS +# define PNG_USE_READ_MACROS +# endif +#endif + +/* COMPILER SPECIFIC OPTIONS. + * + * These options are provided so that a variety of difficult compilers + * can be used. Some are fixed at build time (e.g. PNG_API_RULE + * below) but still have compiler specific implementations, others + * may be changed on a per-file basis when compiling against libpng. + */ + +/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect + * against legacy (pre ISOC90) compilers that did not understand function + * prototypes. [Deprecated.] + */ +#ifndef PNGARG +# define PNGARG(arglist) arglist +#endif + +/* Function calling conventions. + * ============================= + * Normally it is not necessary to specify to the compiler how to call + * a function - it just does it - however on x86 systems derived from + * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems + * and some others) there are multiple ways to call a function and the + * default can be changed on the compiler command line. For this reason + * libpng specifies the calling convention of every exported function and + * every function called via a user supplied function pointer. This is + * done in this file by defining the following macros: + * + * PNGAPI Calling convention for exported functions. + * PNGCBAPI Calling convention for user provided (callback) functions. + * PNGCAPI Calling convention used by the ANSI-C library (required + * for longjmp callbacks and sometimes used internally to + * specify the calling convention for zlib). + * + * These macros should never be overridden. If it is necessary to + * change calling convention in a private build this can be done + * by setting PNG_API_RULE (which defaults to 0) to one of the values + * below to select the correct 'API' variants. + * + * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout. + * This is correct in every known environment. + * PNG_API_RULE=1 Use the operating system convention for PNGAPI and + * the 'C' calling convention (from PNGCAPI) for + * callbacks (PNGCBAPI). This is no longer required + * in any known environment - if it has to be used + * please post an explanation of the problem to the + * libpng mailing list. + * + * These cases only differ if the operating system does not use the C + * calling convention, at present this just means the above cases + * (x86 DOS/Windows systems) and, even then, this does not apply to + * Cygwin running on those systems. + * + * Note that the value must be defined in pnglibconf.h so that what + * the application uses to call the library matches the conventions + * set when building the library. + */ + +/* Symbol export + * ============= + * When building a shared library it is almost always necessary to tell + * the compiler which symbols to export. The png.h macro 'PNG_EXPORT' + * is used to mark the symbols. On some systems these symbols can be + * extracted at link time and need no special processing by the compiler, + * on other systems the symbols are flagged by the compiler and just + * the declaration requires a special tag applied (unfortunately) in a + * compiler dependent way. Some systems can do either. + * + * A small number of older systems also require a symbol from a DLL to + * be flagged to the program that calls it. This is a problem because + * we do not know in the header file included by application code that + * the symbol will come from a shared library, as opposed to a statically + * linked one. For this reason the application must tell us by setting + * the magic flag PNG_USE_DLL to turn on the special processing before + * it includes png.h. + * + * Four additional macros are used to make this happen: + * + * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from + * the build or imported if PNG_USE_DLL is set - compiler + * and system specific. + * + * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to + * 'type', compiler specific. + * + * PNG_DLL_EXPORT Set to the magic to use during a libpng build to + * make a symbol exported from the DLL. Not used in the + * public header files; see pngpriv.h for how it is used + * in the libpng build. + * + * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come + * from a DLL - used to define PNG_IMPEXP when + * PNG_USE_DLL is set. + */ + +/* System specific discovery. + * ========================== + * This code is used at build time to find PNG_IMPEXP, the API settings + * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL + * import processing is possible. On Windows systems it also sets + * compiler-specific macros to the values required to change the calling + * conventions of the various functions. + */ +#if defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || \ + defined(__CYGWIN__) + /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or + * MinGW on any architecture currently supported by Windows. Also includes + * Watcom builds but these need special treatment because they are not + * compatible with GCC or Visual C because of different calling conventions. + */ +# if PNG_API_RULE == 2 + /* If this line results in an error, either because __watcall is not + * understood or because of a redefine just below you cannot use *this* + * build of the library with the compiler you are using. *This* build was + * build using Watcom and applications must also be built using Watcom! + */ +# define PNGCAPI __watcall +# endif + +# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) +# define PNGCAPI __cdecl +# if PNG_API_RULE == 1 + /* If this line results in an error __stdcall is not understood and + * PNG_API_RULE should not have been set to '1'. + */ +# define PNGAPI __stdcall +# endif +# else + /* An older compiler, or one not detected (erroneously) above, + * if necessary override on the command line to get the correct + * variants for the compiler. + */ +# ifndef PNGCAPI +# define PNGCAPI _cdecl +# endif +# if PNG_API_RULE == 1 && !defined(PNGAPI) +# define PNGAPI _stdcall +# endif +# endif /* compiler/api */ + + /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ + +# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) +# error PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed +# endif + +# define PNG_DLL_EXPORT __declspec(dllexport) +# ifndef PNG_DLL_IMPORT +# define PNG_DLL_IMPORT __declspec(dllimport) +# endif + +#else /* !Windows */ +# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) +# define PNGAPI _System +# else /* !Windows/x86 && !OS/2 */ + /* Use the defaults, or define PNG*API on the command line (but + * this will have to be done for every compile!) + */ +# endif /* other system, !OS/2 */ +#endif /* !Windows/x86 */ + +/* Now do all the defaulting . */ +#ifndef PNGCAPI +# define PNGCAPI +#endif +#ifndef PNGCBAPI +# define PNGCBAPI PNGCAPI +#endif +#ifndef PNGAPI +# define PNGAPI PNGCAPI +#endif + +/* PNG_IMPEXP may be set on the compilation system command line or (if not set) + * then in an internal header file when building the library, otherwise (when + * using the library) it is set here. + */ +#ifndef PNG_IMPEXP +# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) + /* This forces use of a DLL, disallowing static linking */ +# define PNG_IMPEXP PNG_DLL_IMPORT +# endif + +# ifndef PNG_IMPEXP +# define PNG_IMPEXP +# endif +#endif + +/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat + * 'attributes' as a storage class - the attributes go at the start of the + * function definition, and attributes are always appended regardless of the + * compiler. This considerably simplifies these macros but may cause problems + * if any compilers both need function attributes and fail to handle them as + * a storage class (this is unlikely.) + */ +#ifndef PNG_FUNCTION +# define PNG_FUNCTION(type, name, args, attributes) attributes type name args +#endif + +#ifndef PNG_EXPORT_TYPE +# define PNG_EXPORT_TYPE(type) PNG_IMPEXP type +#endif + + /* The ordinal value is only relevant when preprocessing png.h for symbol + * table entries, so we discard it here. See the .dfn files in the + * scripts directory. + */ + +#ifndef PNG_EXPORTA +# define PNG_EXPORTA(ordinal, type, name, args, attributes) \ + PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), args, \ + PNG_LINKAGE_API attributes) +#endif + +/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument, + * so make something non-empty to satisfy the requirement: + */ +#define PNG_EMPTY /*empty list*/ + +#define PNG_EXPORT(ordinal, type, name, args) \ + PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY) + +/* Use PNG_REMOVED to comment out a removed interface. */ +#ifndef PNG_REMOVED +# define PNG_REMOVED(ordinal, type, name, args, attributes) +#endif + +#ifndef PNG_CALLBACK +# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) args +#endif + +/* Support for compiler specific function attributes. These are used + * so that where compiler support is available incorrect use of API + * functions in png.h will generate compiler warnings. + * + * Added at libpng-1.2.41. + */ + +#ifndef PNG_NO_PEDANTIC_WARNINGS +# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED +# define PNG_PEDANTIC_WARNINGS_SUPPORTED +# endif +#endif + +#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED + /* Support for compiler specific function attributes. These are used + * so that where compiler support is available, incorrect use of API + * functions in png.h will generate compiler warnings. Added at libpng + * version 1.2.41. Disabling these removes the warnings but may also produce + * less efficient code. + */ +# if defined(__clang__) && defined(__has_attribute) + /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ +# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__) +# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) +# endif +# if !defined(PNG_NORETURN) && __has_attribute(__noreturn__) +# define PNG_NORETURN __attribute__((__noreturn__)) +# endif +# if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__) +# define PNG_ALLOCATED __attribute__((__malloc__)) +# endif +# if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__) +# define PNG_DEPRECATED __attribute__((__deprecated__)) +# endif +# if !defined(PNG_PRIVATE) +# ifdef __has_extension +# if __has_extension(attribute_unavailable_with_message) +# define PNG_PRIVATE __attribute__((__unavailable__(\ + "This function is not exported by libpng."))) +# endif +# endif +# endif +# ifndef PNG_RESTRICT +# define PNG_RESTRICT __restrict +# endif + +# elif defined(__GNUC__) +# ifndef PNG_USE_RESULT +# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) +# endif +# ifndef PNG_NORETURN +# define PNG_NORETURN __attribute__((__noreturn__)) +# endif +# if __GNUC__ >= 3 +# ifndef PNG_ALLOCATED +# define PNG_ALLOCATED __attribute__((__malloc__)) +# endif +# ifndef PNG_DEPRECATED +# define PNG_DEPRECATED __attribute__((__deprecated__)) +# endif +# ifndef PNG_PRIVATE +# if 0 /* Doesn't work so we use deprecated instead*/ +# define PNG_PRIVATE \ + __attribute__((warning("This function is not exported by libpng."))) +# else +# define PNG_PRIVATE \ + __attribute__((__deprecated__)) +# endif +# endif +# if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1)) +# ifndef PNG_RESTRICT +# define PNG_RESTRICT __restrict +# endif +# endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */ +# endif /* __GNUC__ >= 3 */ + +# elif defined(_MSC_VER) && (_MSC_VER >= 1300) +# ifndef PNG_USE_RESULT +# define PNG_USE_RESULT /* not supported */ +# endif +# ifndef PNG_NORETURN +# define PNG_NORETURN __declspec(noreturn) +# endif +# ifndef PNG_ALLOCATED +# if (_MSC_VER >= 1400) +# define PNG_ALLOCATED __declspec(restrict) +# endif +# endif +# ifndef PNG_DEPRECATED +# define PNG_DEPRECATED __declspec(deprecated) +# endif +# ifndef PNG_PRIVATE +# define PNG_PRIVATE __declspec(deprecated) +# endif +# ifndef PNG_RESTRICT +# if (_MSC_VER >= 1400) +# define PNG_RESTRICT __restrict +# endif +# endif + +# elif defined(__WATCOMC__) +# ifndef PNG_RESTRICT +# define PNG_RESTRICT __restrict +# endif +# endif +#endif /* PNG_PEDANTIC_WARNINGS */ + +#ifndef PNG_DEPRECATED +# define PNG_DEPRECATED /* Use of this function is deprecated */ +#endif +#ifndef PNG_USE_RESULT +# define PNG_USE_RESULT /* The result of this function must be checked */ +#endif +#ifndef PNG_NORETURN +# define PNG_NORETURN /* This function does not return */ +#endif +#ifndef PNG_ALLOCATED +# define PNG_ALLOCATED /* The result of the function is new memory */ +#endif +#ifndef PNG_PRIVATE +# define PNG_PRIVATE /* This is a private libpng function */ +#endif +#ifndef PNG_RESTRICT +# define PNG_RESTRICT /* The C99 "restrict" feature */ +#endif + +#ifndef PNG_FP_EXPORT /* A floating point API. */ +# ifdef PNG_FLOATING_POINT_SUPPORTED +# define PNG_FP_EXPORT(ordinal, type, name, args)\ + PNG_EXPORT(ordinal, type, name, args); +# else /* No floating point APIs */ +# define PNG_FP_EXPORT(ordinal, type, name, args) +# endif +#endif +#ifndef PNG_FIXED_EXPORT /* A fixed point API. */ +# ifdef PNG_FIXED_POINT_SUPPORTED +# define PNG_FIXED_EXPORT(ordinal, type, name, args)\ + PNG_EXPORT(ordinal, type, name, args); +# else /* No fixed point APIs */ +# define PNG_FIXED_EXPORT(ordinal, type, name, args) +# endif +#endif + +#ifndef PNG_BUILDING_SYMBOL_TABLE +/* Some typedefs to get us started. These should be safe on most of the common + * platforms. + * + * png_uint_32 and png_int_32 may, currently, be larger than required to hold a + * 32-bit value however this is not normally advisable. + * + * png_uint_16 and png_int_16 should always be two bytes in size - this is + * verified at library build time. + * + * png_byte must always be one byte in size. + * + * The checks below use constants from limits.h, as defined by the ISOC90 + * standard. + */ +#if CHAR_BIT == 8 && UCHAR_MAX == 255 + typedef unsigned char png_byte; +#else +# error libpng requires 8-bit bytes +#endif + +#if INT_MIN == -32768 && INT_MAX == 32767 + typedef int png_int_16; +#elif SHRT_MIN == -32768 && SHRT_MAX == 32767 + typedef short png_int_16; +#else +# error libpng requires a signed 16-bit integer type +#endif + +#if UINT_MAX == 65535 + typedef unsigned int png_uint_16; +#elif USHRT_MAX == 65535 + typedef unsigned short png_uint_16; +#else +# error libpng requires an unsigned 16-bit integer type +#endif + +#if INT_MIN < -2147483646 && INT_MAX > 2147483646 + typedef int png_int_32; +#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646 + typedef long int png_int_32; +#else +# error libpng requires a signed 32-bit (or longer) integer type +#endif + +#if UINT_MAX > 4294967294U + typedef unsigned int png_uint_32; +#elif ULONG_MAX > 4294967294U + typedef unsigned long int png_uint_32; +#else +# error libpng requires an unsigned 32-bit (or longer) integer type +#endif + +/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t. + * From 1.6.0 onwards, an ISO C90 compiler, as well as a standard-compliant + * behavior of sizeof and ptrdiff_t are required. + * The legacy typedefs are provided here for backwards compatibility. + */ +typedef size_t png_size_t; +typedef ptrdiff_t png_ptrdiff_t; + +/* libpng needs to know the maximum value of 'size_t' and this controls the + * definition of png_alloc_size_t, below. This maximum value of size_t limits + * but does not control the maximum allocations the library makes - there is + * direct application control of this through png_set_user_limits(). + */ +#ifndef PNG_SMALL_SIZE_T + /* Compiler specific tests for systems where size_t is known to be less than + * 32 bits (some of these systems may no longer work because of the lack of + * 'far' support; see above.) + */ +# if (defined(__TURBOC__) && !defined(__FLAT__)) ||\ + (defined(_MSC_VER) && defined(MAXSEG_64K)) +# define PNG_SMALL_SIZE_T +# endif +#endif + +/* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller + * than png_uint_32. Casts from size_t or png_uint_32 to png_alloc_size_t are + * not necessary; in fact, it is recommended not to use them at all, so that + * the compiler can complain when something turns out to be problematic. + * + * Casts in the other direction (from png_alloc_size_t to size_t or + * png_uint_32) should be explicitly applied; however, we do not expect to + * encounter practical situations that require such conversions. + * + * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than + * 4294967295 - i.e. less than the maximum value of png_uint_32. + */ +#ifdef PNG_SMALL_SIZE_T + typedef png_uint_32 png_alloc_size_t; +#else + typedef size_t png_alloc_size_t; +#endif + +/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler + * implementations of Intel CPU specific support of user-mode segmented address + * spaces, where 16-bit pointers address more than 65536 bytes of memory using + * separate 'segment' registers. The implementation requires two different + * types of pointer (only one of which includes the segment value.) + * + * If required this support is available in version 1.2 of libpng and may be + * available in versions through 1.5, although the correctness of the code has + * not been verified recently. + */ + +/* Typedef for floating-point numbers that are converted to fixed-point with a + * multiple of 100,000, e.g., gamma + */ +typedef png_int_32 png_fixed_point; + +/* Add typedefs for pointers */ +typedef void * png_voidp; +typedef const void * png_const_voidp; +typedef png_byte * png_bytep; +typedef const png_byte * png_const_bytep; +typedef png_uint_32 * png_uint_32p; +typedef const png_uint_32 * png_const_uint_32p; +typedef png_int_32 * png_int_32p; +typedef const png_int_32 * png_const_int_32p; +typedef png_uint_16 * png_uint_16p; +typedef const png_uint_16 * png_const_uint_16p; +typedef png_int_16 * png_int_16p; +typedef const png_int_16 * png_const_int_16p; +typedef char * png_charp; +typedef const char * png_const_charp; +typedef png_fixed_point * png_fixed_point_p; +typedef const png_fixed_point * png_const_fixed_point_p; +typedef size_t * png_size_tp; +typedef const size_t * png_const_size_tp; + +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double * png_doublep; +typedef const double * png_const_doublep; +#endif + +/* Pointers to pointers; i.e. arrays */ +typedef png_byte * * png_bytepp; +typedef png_uint_32 * * png_uint_32pp; +typedef png_int_32 * * png_int_32pp; +typedef png_uint_16 * * png_uint_16pp; +typedef png_int_16 * * png_int_16pp; +typedef const char * * png_const_charpp; +typedef char * * png_charpp; +typedef png_fixed_point * * png_fixed_point_pp; +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double * * png_doublepp; +#endif + +/* Pointers to pointers to pointers; i.e., pointer to array */ +typedef char * * * png_charppp; + +#ifdef PNG_STDIO_SUPPORTED +/* With PNG_STDIO_SUPPORTED it was possible to use I/O streams that were + * not necessarily stdio FILE streams, to allow building Windows applications + * before Win32 and Windows CE applications before WinCE 3.0, but that kind + * of support has long been discontinued. + */ +typedef FILE * png_FILE_p; /* [Deprecated] */ +#endif + +#endif /* PNG_BUILDING_SYMBOL_TABLE */ + +#endif /* PNGCONF_H */ diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/libpng16/pnglibconf.h b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/libpng16/pnglibconf.h new file mode 100644 index 0000000000000000000000000000000000000000..92641e217960cd24c1c8d4c157c179ee4ae35900 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/libpng16/pnglibconf.h @@ -0,0 +1,233 @@ +/* pnglibconf.h - library build configuration */ + +/* libpng version 1.6.55 */ + +/* Copyright (c) 2018-2026 Cosmin Truta */ +/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */ + +/* This code is released under the libpng license. */ +/* For conditions of distribution and use, see the disclaimer */ +/* and license in png.h */ + +/* pnglibconf.h */ +/* Machine generated file: DO NOT EDIT */ +/* Derived from: scripts/pnglibconf.dfa */ +#ifndef PNGLCONF_H +#define PNGLCONF_H +/* options */ +#define PNG_16BIT_SUPPORTED +#define PNG_ALIGNED_MEMORY_SUPPORTED +/*#undef PNG_ARM_NEON_API_SUPPORTED*/ +/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/ +#define PNG_BENIGN_ERRORS_SUPPORTED +#define PNG_BENIGN_READ_ERRORS_SUPPORTED +/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/ +#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED +#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED +#define PNG_COLORSPACE_SUPPORTED +#define PNG_CONSOLE_IO_SUPPORTED +#define PNG_CONVERT_tIME_SUPPORTED +/*#undef PNG_DISABLE_ADLER32_CHECK_SUPPORTED*/ +#define PNG_EASY_ACCESS_SUPPORTED +/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/ +#define PNG_ERROR_TEXT_SUPPORTED +#define PNG_FIXED_POINT_SUPPORTED +#define PNG_FLOATING_ARITHMETIC_SUPPORTED +#define PNG_FLOATING_POINT_SUPPORTED +#define PNG_FORMAT_AFIRST_SUPPORTED +#define PNG_FORMAT_BGR_SUPPORTED +#define PNG_GAMMA_SUPPORTED +#define PNG_GET_PALETTE_MAX_SUPPORTED +#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +#define PNG_INCH_CONVERSIONS_SUPPORTED +#define PNG_INFO_IMAGE_SUPPORTED +#define PNG_IO_STATE_SUPPORTED +/*#undef PNG_MIPS_MMI_API_SUPPORTED*/ +/*#undef PNG_MIPS_MMI_CHECK_SUPPORTED*/ +/*#undef PNG_MIPS_MSA_API_SUPPORTED*/ +/*#undef PNG_MIPS_MSA_CHECK_SUPPORTED*/ +#define PNG_MNG_FEATURES_SUPPORTED +#define PNG_POINTER_INDEXING_SUPPORTED +/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/ +/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/ +#define PNG_PROGRESSIVE_READ_SUPPORTED +#define PNG_READ_16BIT_SUPPORTED +#define PNG_READ_ALPHA_MODE_SUPPORTED +#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED +#define PNG_READ_BACKGROUND_SUPPORTED +#define PNG_READ_BGR_SUPPORTED +#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED +#define PNG_READ_COMPOSITE_NODIV_SUPPORTED +#define PNG_READ_COMPRESSED_TEXT_SUPPORTED +#define PNG_READ_EXPAND_16_SUPPORTED +#define PNG_READ_EXPAND_SUPPORTED +#define PNG_READ_FILLER_SUPPORTED +#define PNG_READ_GAMMA_SUPPORTED +#define PNG_READ_GET_PALETTE_MAX_SUPPORTED +#define PNG_READ_GRAY_TO_RGB_SUPPORTED +#define PNG_READ_INTERLACING_SUPPORTED +#define PNG_READ_INT_FUNCTIONS_SUPPORTED +#define PNG_READ_INVERT_ALPHA_SUPPORTED +#define PNG_READ_INVERT_SUPPORTED +#define PNG_READ_OPT_PLTE_SUPPORTED +#define PNG_READ_PACKSWAP_SUPPORTED +#define PNG_READ_PACK_SUPPORTED +#define PNG_READ_QUANTIZE_SUPPORTED +#define PNG_READ_RGB_TO_GRAY_SUPPORTED +#define PNG_READ_SCALE_16_TO_8_SUPPORTED +#define PNG_READ_SHIFT_SUPPORTED +#define PNG_READ_STRIP_16_TO_8_SUPPORTED +#define PNG_READ_STRIP_ALPHA_SUPPORTED +#define PNG_READ_SUPPORTED +#define PNG_READ_SWAP_ALPHA_SUPPORTED +#define PNG_READ_SWAP_SUPPORTED +#define PNG_READ_TEXT_SUPPORTED +#define PNG_READ_TRANSFORMS_SUPPORTED +#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_READ_USER_CHUNKS_SUPPORTED +#define PNG_READ_USER_TRANSFORM_SUPPORTED +#define PNG_READ_bKGD_SUPPORTED +#define PNG_READ_cHRM_SUPPORTED +#define PNG_READ_cICP_SUPPORTED +#define PNG_READ_cLLI_SUPPORTED +#define PNG_READ_eXIf_SUPPORTED +#define PNG_READ_gAMA_SUPPORTED +#define PNG_READ_hIST_SUPPORTED +#define PNG_READ_iCCP_SUPPORTED +#define PNG_READ_iTXt_SUPPORTED +#define PNG_READ_mDCV_SUPPORTED +#define PNG_READ_oFFs_SUPPORTED +#define PNG_READ_pCAL_SUPPORTED +#define PNG_READ_pHYs_SUPPORTED +#define PNG_READ_sBIT_SUPPORTED +#define PNG_READ_sCAL_SUPPORTED +#define PNG_READ_sPLT_SUPPORTED +#define PNG_READ_sRGB_SUPPORTED +#define PNG_READ_tEXt_SUPPORTED +#define PNG_READ_tIME_SUPPORTED +#define PNG_READ_tRNS_SUPPORTED +#define PNG_READ_zTXt_SUPPORTED +#define PNG_SAVE_INT_32_SUPPORTED +#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_SEQUENTIAL_READ_SUPPORTED +#define PNG_SETJMP_SUPPORTED +#define PNG_SET_OPTION_SUPPORTED +#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_SET_USER_LIMITS_SUPPORTED +#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED +#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED +#define PNG_SIMPLIFIED_READ_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_SUPPORTED +#define PNG_STDIO_SUPPORTED +#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_TEXT_SUPPORTED +#define PNG_TIME_RFC1123_SUPPORTED +#define PNG_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_USER_CHUNKS_SUPPORTED +#define PNG_USER_LIMITS_SUPPORTED +#define PNG_USER_MEM_SUPPORTED +#define PNG_USER_TRANSFORM_INFO_SUPPORTED +#define PNG_USER_TRANSFORM_PTR_SUPPORTED +#define PNG_WARNINGS_SUPPORTED +#define PNG_WRITE_16BIT_SUPPORTED +#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED +#define PNG_WRITE_BGR_SUPPORTED +#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED +#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED +#define PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED +#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED +#define PNG_WRITE_FILLER_SUPPORTED +#define PNG_WRITE_FILTER_SUPPORTED +#define PNG_WRITE_FLUSH_SUPPORTED +#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED +#define PNG_WRITE_INTERLACING_SUPPORTED +#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED +#define PNG_WRITE_INVERT_ALPHA_SUPPORTED +#define PNG_WRITE_INVERT_SUPPORTED +#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED +#define PNG_WRITE_PACKSWAP_SUPPORTED +#define PNG_WRITE_PACK_SUPPORTED +#define PNG_WRITE_SHIFT_SUPPORTED +#define PNG_WRITE_SUPPORTED +#define PNG_WRITE_SWAP_ALPHA_SUPPORTED +#define PNG_WRITE_SWAP_SUPPORTED +#define PNG_WRITE_TEXT_SUPPORTED +#define PNG_WRITE_TRANSFORMS_SUPPORTED +#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_WRITE_USER_TRANSFORM_SUPPORTED +#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED +#define PNG_WRITE_bKGD_SUPPORTED +#define PNG_WRITE_cHRM_SUPPORTED +#define PNG_WRITE_cICP_SUPPORTED +#define PNG_WRITE_cLLI_SUPPORTED +#define PNG_WRITE_eXIf_SUPPORTED +#define PNG_WRITE_gAMA_SUPPORTED +#define PNG_WRITE_hIST_SUPPORTED +#define PNG_WRITE_iCCP_SUPPORTED +#define PNG_WRITE_iTXt_SUPPORTED +#define PNG_WRITE_mDCV_SUPPORTED +#define PNG_WRITE_oFFs_SUPPORTED +#define PNG_WRITE_pCAL_SUPPORTED +#define PNG_WRITE_pHYs_SUPPORTED +#define PNG_WRITE_sBIT_SUPPORTED +#define PNG_WRITE_sCAL_SUPPORTED +#define PNG_WRITE_sPLT_SUPPORTED +#define PNG_WRITE_sRGB_SUPPORTED +#define PNG_WRITE_tEXt_SUPPORTED +#define PNG_WRITE_tIME_SUPPORTED +#define PNG_WRITE_tRNS_SUPPORTED +#define PNG_WRITE_zTXt_SUPPORTED +#define PNG_bKGD_SUPPORTED +#define PNG_cHRM_SUPPORTED +#define PNG_cICP_SUPPORTED +#define PNG_cLLI_SUPPORTED +#define PNG_eXIf_SUPPORTED +#define PNG_gAMA_SUPPORTED +#define PNG_hIST_SUPPORTED +#define PNG_iCCP_SUPPORTED +#define PNG_iTXt_SUPPORTED +#define PNG_mDCV_SUPPORTED +#define PNG_oFFs_SUPPORTED +#define PNG_pCAL_SUPPORTED +#define PNG_pHYs_SUPPORTED +#define PNG_sBIT_SUPPORTED +#define PNG_sCAL_SUPPORTED +#define PNG_sPLT_SUPPORTED +#define PNG_sRGB_SUPPORTED +#define PNG_tEXt_SUPPORTED +#define PNG_tIME_SUPPORTED +#define PNG_tRNS_SUPPORTED +#define PNG_zTXt_SUPPORTED +/* end of options */ +/* settings */ +#define PNG_API_RULE 0 +#define PNG_DEFAULT_READ_MACROS 1 +#define PNG_GAMMA_THRESHOLD_FIXED 5000 +#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE +#define PNG_INFLATE_BUF_SIZE 1024 +#define PNG_LINKAGE_API extern +#define PNG_LINKAGE_CALLBACK extern +#define PNG_LINKAGE_DATA extern +#define PNG_LINKAGE_FUNCTION extern +#define PNG_MAX_GAMMA_8 11 +#define PNG_QUANTIZE_BLUE_BITS 5 +#define PNG_QUANTIZE_GREEN_BITS 5 +#define PNG_QUANTIZE_RED_BITS 5 +#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1) +#define PNG_TEXT_Z_DEFAULT_STRATEGY 0 +#define PNG_USER_CHUNK_CACHE_MAX 1000 +#define PNG_USER_CHUNK_MALLOC_MAX 8000000 +#define PNG_USER_HEIGHT_MAX 1000000 +#define PNG_USER_WIDTH_MAX 1000000 +#define PNG_ZBUF_SIZE 8192 +#define PNG_ZLIB_VERNUM 0x1310 +#define PNG_Z_DEFAULT_COMPRESSION (-1) +#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0 +#define PNG_Z_DEFAULT_STRATEGY 1 +#define PNG_sCAL_PRECISION 5 +#define PNG_sRGB_PROFILE_CHECKS 2 +/* end of settings */ +#endif /* PNGLCONF_H */ diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/png.h b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/png.h new file mode 100644 index 0000000000000000000000000000000000000000..38fd349e5fbfe7cd30978eb7bee46a2bce58189d --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/png.h @@ -0,0 +1,3526 @@ +/* png.h - header file for PNG reference library + * + * libpng version 1.6.55 + * + * Copyright (c) 2018-2026 Cosmin Truta + * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + * + * This code is released under the libpng license. (See LICENSE, below.) + * + * Authors and maintainers: + * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat + * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger + * libpng versions 0.97, January 1998, through 1.6.35, July 2018: + * Glenn Randers-Pehrson + * libpng versions 1.6.36, December 2018, through 1.6.55, February 2026: + * Cosmin Truta + * See also "Contributing Authors", below. + */ + +/* + * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE + * ========================================= + * + * PNG Reference Library License version 2 + * --------------------------------------- + * + * * Copyright (c) 1995-2026 The PNG Reference Library Authors. + * * Copyright (c) 2018-2026 Cosmin Truta. + * * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * * Copyright (c) 1996-1997 Andreas Dilger. + * * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + * + * The software is supplied "as is", without warranty of any kind, + * express or implied, including, without limitation, the warranties + * of merchantability, fitness for a particular purpose, title, and + * non-infringement. In no event shall the Copyright owners, or + * anyone distributing the software, be liable for any damages or + * other liability, whether in contract, tort or otherwise, arising + * from, out of, or in connection with the software, or the use or + * other dealings in the software, even if advised of the possibility + * of such damage. + * + * Permission is hereby granted to use, copy, modify, and distribute + * this software, or portions hereof, for any purpose, without fee, + * subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you + * must not claim that you wrote the original software. If you + * use this software in a product, an acknowledgment in the product + * documentation would be appreciated, but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must + * not be misrepresented as being the original software. + * + * 3. This Copyright notice may not be removed or altered from any + * source or altered source distribution. + * + * + * PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) + * ----------------------------------------------------------------------- + * + * libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are + * derived from libpng-1.0.6, and are distributed according to the same + * disclaimer and license as libpng-1.0.6 with the following individuals + * added to the list of Contributing Authors: + * + * Simon-Pierre Cadieux + * Eric S. Raymond + * Mans Rullgard + * Cosmin Truta + * Gilles Vollant + * James Yu + * Mandar Sahastrabuddhe + * Google Inc. + * Vadim Barkov + * + * and with the following additions to the disclaimer: + * + * There is no warranty against interference with your enjoyment of + * the library or against infringement. There is no warranty that our + * efforts or the library will fulfill any of your particular purposes + * or needs. This library is provided with all faults, and the entire + * risk of satisfactory quality, performance, accuracy, and effort is + * with the user. + * + * Some files in the "contrib" directory and some configure-generated + * files that are distributed with libpng have other copyright owners, and + * are released under other open source licenses. + * + * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are + * Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from + * libpng-0.96, and are distributed according to the same disclaimer and + * license as libpng-0.96, with the following individuals added to the + * list of Contributing Authors: + * + * Tom Lane + * Glenn Randers-Pehrson + * Willem van Schaik + * + * libpng versions 0.89, June 1996, through 0.96, May 1997, are + * Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, + * and are distributed according to the same disclaimer and license as + * libpng-0.88, with the following individuals added to the list of + * Contributing Authors: + * + * John Bowler + * Kevin Bracey + * Sam Bushell + * Magnus Holmgren + * Greg Roelofs + * Tom Tanner + * + * Some files in the "scripts" directory have other copyright owners, + * but are released under this license. + * + * libpng versions 0.5, May 1995, through 0.88, January 1996, are + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + * + * For the purposes of this copyright and license, "Contributing Authors" + * is defined as the following set of individuals: + * + * Andreas Dilger + * Dave Martindale + * Guy Eric Schalnat + * Paul Schmidt + * Tim Wegner + * + * The PNG Reference Library is supplied "AS IS". The Contributing + * Authors and Group 42, Inc. disclaim all warranties, expressed or + * implied, including, without limitation, the warranties of + * merchantability and of fitness for any purpose. The Contributing + * Authors and Group 42, Inc. assume no liability for direct, indirect, + * incidental, special, exemplary, or consequential damages, which may + * result from the use of the PNG Reference Library, even if advised of + * the possibility of such damage. + * + * Permission is hereby granted to use, copy, modify, and distribute this + * source code, or portions hereof, for any purpose, without fee, subject + * to the following restrictions: + * + * 1. The origin of this source code must not be misrepresented. + * + * 2. Altered versions must be plainly marked as such and must not + * be misrepresented as being the original source. + * + * 3. This Copyright notice may not be removed or altered from any + * source or altered source distribution. + * + * The Contributing Authors and Group 42, Inc. specifically permit, + * without fee, and encourage the use of this source code as a component + * to supporting the PNG file format in commercial products. If you use + * this source code in a product, acknowledgment is not required but would + * be appreciated. + * + * END OF COPYRIGHT NOTICE, DISCLAIMER, and LICENSE. + * + * TRADEMARK + * ========= + * + * The name "libpng" has not been registered by the Copyright owners + * as a trademark in any jurisdiction. However, because libpng has + * been distributed and maintained world-wide, continually since 1995, + * the Copyright owners claim "common-law trademark protection" in any + * jurisdiction where common-law trademark is recognized. + */ + +/* + * A "png_get_copyright" function is available, for convenient use in "about" + * boxes and the like: + * + * printf("%s", png_get_copyright(NULL)); + * + * Also, the PNG logo (in PNG format, of course) is supplied in the + * files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + */ + +/* + * The contributing authors would like to thank all those who helped + * with testing, bug fixes, and patience. This wouldn't have been + * possible without all of you. + * + * Thanks to Frank J. T. Wojcik for helping with the documentation. + */ + +/* Note about libpng version numbers: + * + * Due to various miscommunications, unforeseen code incompatibilities + * and occasional factors outside the authors' control, version numbering + * on the library has not always been consistent and straightforward. + * The following table summarizes matters since version 0.89c, which was + * the first widely used release: + * + * source png.h png.h shared-lib + * version string int version + * ------- ------ ----- ---------- + * 0.89c "1.0 beta 3" 0.89 89 1.0.89 + * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] + * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] + * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] + * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] + * 0.97c 0.97 97 2.0.97 + * 0.98 0.98 98 2.0.98 + * 0.99 0.99 98 2.0.99 + * 0.99a-m 0.99 99 2.0.99 + * 1.00 1.00 100 2.1.0 [100 should be 10000] + * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] + * 1.0.1 png.h string is 10001 2.1.0 + * 1.0.1a-e identical to the 10002 from here on, the shared library + * 1.0.2 source version) 10002 is 2.V where V is the source code + * 1.0.2a-b 10003 version, except as noted. + * 1.0.3 10003 + * 1.0.3a-d 10004 + * 1.0.4 10004 + * 1.0.4a-f 10005 + * 1.0.5 (+ 2 patches) 10005 + * 1.0.5a-d 10006 + * 1.0.5e-r 10100 (not source compatible) + * 1.0.5s-v 10006 (not binary compatible) + * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) + * 1.0.6d-f 10007 (still binary incompatible) + * 1.0.6g 10007 + * 1.0.6h 10007 10.6h (testing xy.z so-numbering) + * 1.0.6i 10007 10.6i + * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) + * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) + * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) + * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) + * 1.0.7 1 10007 (still compatible) + * ... + * 1.0.69 10 10069 10.so.0.69[.0] + * ... + * 1.2.59 13 10259 12.so.0.59[.0] + * ... + * 1.4.20 14 10420 14.so.0.20[.0] + * ... + * 1.5.30 15 10530 15.so.15.30[.0] + * ... + * 1.6.55 16 10655 16.so.16.55[.0] + * + * Henceforth the source version will match the shared-library major and + * minor numbers; the shared-library major version number will be used for + * changes in backward compatibility, as it is intended. + * The PNG_LIBPNG_VER macro, which is not used within libpng but is + * available for applications, is an unsigned integer of the form XYYZZ + * corresponding to the source version X.Y.Z (leading zeros in Y and Z). + * Beta versions were given the previous public release number plus a + * letter, until version 1.0.6j; from then on they were given the upcoming + * public release number plus "betaNN" or "rcNN". + * + * Binary incompatibility exists only when applications make direct access + * to the info_ptr or png_ptr members through png.h, and the compiled + * application is loaded with a different version of the library. + * + * See libpng.txt or libpng.3 for more information. The PNG specification + * is available as a W3C Recommendation and as an ISO/IEC Standard; see + * + */ + +#ifndef PNG_H +#define PNG_H + +/* This is not the place to learn how to use libpng. The file libpng-manual.txt + * describes how to use libpng, and the file example.c summarizes it + * with some code on which to build. This file is useful for looking + * at the actual function definitions and structure components. If that + * file has been stripped from your copy of libpng, you can find it at + * + * + * If you just need to read a PNG file and don't want to read the documentation + * skip to the end of this file and read the section entitled 'simplified API'. + */ + +/* Version information for png.h - this should match the version in png.c */ +#define PNG_LIBPNG_VER_STRING "1.6.55" +#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n" + +/* The versions of shared library builds should stay in sync, going forward */ +#define PNG_LIBPNG_VER_SHAREDLIB 16 +#define PNG_LIBPNG_VER_SONUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */ +#define PNG_LIBPNG_VER_DLLNUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */ + +/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ +#define PNG_LIBPNG_VER_MAJOR 1 +#define PNG_LIBPNG_VER_MINOR 6 +#define PNG_LIBPNG_VER_RELEASE 55 + +/* This should be zero for a public release, or non-zero for a + * development version. + */ +#define PNG_LIBPNG_VER_BUILD 0 + +/* Release Status */ +#define PNG_LIBPNG_BUILD_ALPHA 1 +#define PNG_LIBPNG_BUILD_BETA 2 +#define PNG_LIBPNG_BUILD_RC 3 +#define PNG_LIBPNG_BUILD_STABLE 4 +#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7 + +/* Release-Specific Flags */ +#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with + PNG_LIBPNG_BUILD_STABLE only */ +#define PNG_LIBPNG_BUILD_PRIVATE 16 /* Cannot be OR'ed with + PNG_LIBPNG_BUILD_SPECIAL */ +#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with + PNG_LIBPNG_BUILD_PRIVATE */ + +#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE + +/* Careful here. At one time, Guy wanted to use 082, but that + * would be octal. We must not include leading zeros. + * Versions 0.7 through 1.0.0 were in the range 0 to 100 here + * (only version 1.0.0 was mis-numbered 100 instead of 10000). + * From version 1.0.1 it is: + * XXYYZZ, where XX=major, YY=minor, ZZ=release + */ +#define PNG_LIBPNG_VER 10655 /* 1.6.55 */ + +/* Library configuration: these options cannot be changed after + * the library has been built. + */ +#ifndef PNGLCONF_H +/* If pnglibconf.h is missing, you can + * copy scripts/pnglibconf.h.prebuilt to pnglibconf.h + */ +# include "pnglibconf.h" +#endif + +#ifndef PNG_VERSION_INFO_ONLY +/* Machine specific configuration. */ +# include "pngconf.h" +#endif + +/* + * Added at libpng-1.2.8 + * + * Ref MSDN: Private as priority over Special + * VS_FF_PRIVATEBUILD File *was not* built using standard release + * procedures. If this value is given, the StringFileInfo block must + * contain a PrivateBuild string. + * + * VS_FF_SPECIALBUILD File *was* built by the original company using + * standard release procedures but is a variation of the standard + * file of the same version number. If this value is given, the + * StringFileInfo block must contain a SpecialBuild string. + */ + +#ifdef PNG_USER_PRIVATEBUILD /* From pnglibconf.h */ +# define PNG_LIBPNG_BUILD_TYPE \ + (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_PRIVATE) +#else +# ifdef PNG_LIBPNG_SPECIALBUILD +# define PNG_LIBPNG_BUILD_TYPE \ + (PNG_LIBPNG_BUILD_BASE_TYPE | PNG_LIBPNG_BUILD_SPECIAL) +# else +# define PNG_LIBPNG_BUILD_TYPE (PNG_LIBPNG_BUILD_BASE_TYPE) +# endif +#endif + +#ifndef PNG_VERSION_INFO_ONLY + +/* Inhibit C++ name-mangling for libpng functions but not for system calls. */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* Version information for C files, stored in png.c. This had better match + * the version above. + */ +#define png_libpng_ver png_get_header_ver(NULL) + +/* This file is arranged in several sections: + * + * 1. [omitted] + * 2. Any configuration options that can be specified by for the application + * code when it is built. (Build time configuration is in pnglibconf.h) + * 3. Type definitions (base types are defined in pngconf.h), structure + * definitions. + * 4. Exported library functions. + * 5. Simplified API. + * 6. Implementation options. + * + * The library source code has additional files (principally pngpriv.h) that + * allow configuration of the library. + */ + +/* Section 1: [omitted] */ + +/* Section 2: run time configuration + * See pnglibconf.h for build time configuration + * + * Run time configuration allows the application to choose between + * implementations of certain arithmetic APIs. The default is set + * at build time and recorded in pnglibconf.h, but it is safe to + * override these (and only these) settings. Note that this won't + * change what the library does, only application code, and the + * settings can (and probably should) be made on a per-file basis + * by setting the #defines before including png.h + * + * Use macros to read integers from PNG data or use the exported + * functions? + * PNG_USE_READ_MACROS: use the macros (see below) Note that + * the macros evaluate their argument multiple times. + * PNG_NO_USE_READ_MACROS: call the relevant library function. + * + * Use the alternative algorithm for compositing alpha samples that + * does not use division? + * PNG_READ_COMPOSITE_NODIV_SUPPORTED: use the 'no division' + * algorithm. + * PNG_NO_READ_COMPOSITE_NODIV: use the 'division' algorithm. + * + * How to handle benign errors if PNG_ALLOW_BENIGN_ERRORS is + * false? + * PNG_ALLOW_BENIGN_ERRORS: map calls to the benign error + * APIs to png_warning. + * Otherwise the calls are mapped to png_error. + */ + +/* Section 3: type definitions, including structures and compile time + * constants. + * See pngconf.h for base types that vary by machine/system + */ + +/* This triggers a compiler error in png.c, if png.c and png.h + * do not agree upon the version number. + */ +typedef char *png_libpng_version_1_6_55; + +/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. + * + * png_struct is the cache of information used while reading or writing a single + * PNG file. One of these is always required, although the simplified API + * (below) hides the creation and destruction of it. + */ +typedef struct png_struct_def png_struct; +typedef const png_struct * png_const_structp; +typedef png_struct * png_structp; +typedef png_struct * * png_structpp; + +/* png_info contains information read from or to be written to a PNG file. One + * or more of these must exist while reading or creating a PNG file. The + * information is not used by libpng during read but is used to control what + * gets written when a PNG file is created. "png_get_" function calls read + * information during read and "png_set_" functions calls write information + * when creating a PNG. + * been moved into a separate header file that is not accessible to + * applications. Read libpng-manual.txt or libpng.3 for more info. + */ +typedef struct png_info_def png_info; +typedef png_info * png_infop; +typedef const png_info * png_const_infop; +typedef png_info * * png_infopp; + +/* Types with names ending 'p' are pointer types. The corresponding types with + * names ending 'rp' are identical pointer types except that the pointer is + * marked 'restrict', which means that it is the only pointer to the object + * passed to the function. Applications should not use the 'restrict' types; + * it is always valid to pass 'p' to a pointer with a function argument of the + * corresponding 'rp' type. Different compilers have different rules with + * regard to type matching in the presence of 'restrict'. For backward + * compatibility libpng callbacks never have 'restrict' in their parameters and, + * consequentially, writing portable application code is extremely difficult if + * an attempt is made to use 'restrict'. + */ +typedef png_struct * PNG_RESTRICT png_structrp; +typedef const png_struct * PNG_RESTRICT png_const_structrp; +typedef png_info * PNG_RESTRICT png_inforp; +typedef const png_info * PNG_RESTRICT png_const_inforp; + +/* Three color definitions. The order of the red, green, and blue, (and the + * exact size) is not important, although the size of the fields need to + * be png_byte or png_uint_16 (as defined below). + */ +typedef struct png_color_struct +{ + png_byte red; + png_byte green; + png_byte blue; +} png_color; +typedef png_color * png_colorp; +typedef const png_color * png_const_colorp; +typedef png_color * * png_colorpp; + +typedef struct png_color_16_struct +{ + png_byte index; /* used for palette files */ + png_uint_16 red; /* for use in red green blue files */ + png_uint_16 green; + png_uint_16 blue; + png_uint_16 gray; /* for use in grayscale files */ +} png_color_16; +typedef png_color_16 * png_color_16p; +typedef const png_color_16 * png_const_color_16p; +typedef png_color_16 * * png_color_16pp; + +typedef struct png_color_8_struct +{ + png_byte red; /* for use in red green blue files */ + png_byte green; + png_byte blue; + png_byte gray; /* for use in grayscale files */ + png_byte alpha; /* for alpha channel files */ +} png_color_8; +typedef png_color_8 * png_color_8p; +typedef const png_color_8 * png_const_color_8p; +typedef png_color_8 * * png_color_8pp; + +/* + * The following two structures are used for the in-core representation + * of sPLT chunks. + */ +typedef struct png_sPLT_entry_struct +{ + png_uint_16 red; + png_uint_16 green; + png_uint_16 blue; + png_uint_16 alpha; + png_uint_16 frequency; +} png_sPLT_entry; +typedef png_sPLT_entry * png_sPLT_entryp; +typedef const png_sPLT_entry * png_const_sPLT_entryp; +typedef png_sPLT_entry * * png_sPLT_entrypp; + +/* When the depth of the sPLT palette is 8 bits, the color and alpha samples + * occupy the LSB of their respective members, and the MSB of each member + * is zero-filled. The frequency member always occupies the full 16 bits. + */ + +typedef struct png_sPLT_struct +{ + png_charp name; /* palette name */ + png_byte depth; /* depth of palette samples */ + png_sPLT_entryp entries; /* palette entries */ + png_int_32 nentries; /* number of palette entries */ +} png_sPLT_t; +typedef png_sPLT_t * png_sPLT_tp; +typedef const png_sPLT_t * png_const_sPLT_tp; +typedef png_sPLT_t * * png_sPLT_tpp; + +#ifdef PNG_TEXT_SUPPORTED +/* png_text holds the contents of a text/ztxt/itxt chunk in a PNG file, + * and whether that contents is compressed or not. The "key" field + * points to a regular zero-terminated C string. The "text" fields can be a + * regular C string, an empty string, or a NULL pointer. + * However, the structure returned by png_get_text() will always contain + * the "text" field as a regular zero-terminated C string (possibly + * empty), never a NULL pointer, so it can be safely used in printf() and + * other string-handling functions. Note that the "itxt_length", "lang", and + * "lang_key" members of the structure only exist when the library is built + * with iTXt chunk support. Prior to libpng-1.4.0 the library was built by + * default without iTXt support. Also note that when iTXt *is* supported, + * the "lang" and "lang_key" fields contain NULL pointers when the + * "compression" field contains * PNG_TEXT_COMPRESSION_NONE or + * PNG_TEXT_COMPRESSION_zTXt. Note that the "compression value" is not the + * same as what appears in the PNG tEXt/zTXt/iTXt chunk's "compression flag" + * which is always 0 or 1, or its "compression method" which is always 0. + */ +typedef struct png_text_struct +{ + int compression; /* compression value: + -1: tEXt, none + 0: zTXt, deflate + 1: iTXt, none + 2: iTXt, deflate */ + png_charp key; /* keyword, 1-79 character description of "text" */ + png_charp text; /* comment, may be an empty string (ie "") + or a NULL pointer */ + size_t text_length; /* length of the text string */ + size_t itxt_length; /* length of the itxt string */ + png_charp lang; /* language code, 0-79 characters + or a NULL pointer */ + png_charp lang_key; /* keyword translated UTF-8 string, 0 or more + chars or a NULL pointer */ +} png_text; +typedef png_text * png_textp; +typedef const png_text * png_const_textp; +typedef png_text * * png_textpp; +#endif + +/* Supported compression types for text in PNG files (tEXt, and zTXt). + * The values of the PNG_TEXT_COMPRESSION_ defines should NOT be changed. */ +#define PNG_TEXT_COMPRESSION_NONE_WR -3 +#define PNG_TEXT_COMPRESSION_zTXt_WR -2 +#define PNG_TEXT_COMPRESSION_NONE -1 +#define PNG_TEXT_COMPRESSION_zTXt 0 +#define PNG_ITXT_COMPRESSION_NONE 1 +#define PNG_ITXT_COMPRESSION_zTXt 2 +#define PNG_TEXT_COMPRESSION_LAST 3 /* Not a valid value */ + +/* png_time is a way to hold the time in an machine independent way. + * Two conversions are provided, both from time_t and struct tm. There + * is no portable way to convert to either of these structures, as far + * as I know. If you know of a portable way, send it to me. As a side + * note - PNG has always been Year 2000 compliant! + */ +typedef struct png_time_struct +{ + png_uint_16 year; /* full year, as in, 1995 */ + png_byte month; /* month of year, 1 - 12 */ + png_byte day; /* day of month, 1 - 31 */ + png_byte hour; /* hour of day, 0 - 23 */ + png_byte minute; /* minute of hour, 0 - 59 */ + png_byte second; /* second of minute, 0 - 60 (for leap seconds) */ +} png_time; +typedef png_time * png_timep; +typedef const png_time * png_const_timep; +typedef png_time * * png_timepp; + +#if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) ||\ + defined(PNG_USER_CHUNKS_SUPPORTED) +/* png_unknown_chunk is a structure to hold queued chunks for which there is + * no specific support. The idea is that we can use this to queue + * up private chunks for output even though the library doesn't actually + * know about their semantics. + * + * The data in the structure is set by libpng on read and used on write. + */ +typedef struct png_unknown_chunk_t +{ + png_byte name[5]; /* Textual chunk name with '\0' terminator */ + png_byte *data; /* Data, should not be modified on read! */ + size_t size; + + /* On write 'location' must be set using the flag values listed below. + * Notice that on read it is set by libpng however the values stored have + * more bits set than are listed below. Always treat the value as a + * bitmask. On write set only one bit - setting multiple bits may cause the + * chunk to be written in multiple places. + */ + png_byte location; /* mode of operation at read time */ +} +png_unknown_chunk; + +typedef png_unknown_chunk * png_unknown_chunkp; +typedef const png_unknown_chunk * png_const_unknown_chunkp; +typedef png_unknown_chunk * * png_unknown_chunkpp; +#endif + +/* Flag values for the unknown chunk location byte. */ +#define PNG_HAVE_IHDR 0x01 +#define PNG_HAVE_PLTE 0x02 +#define PNG_AFTER_IDAT 0x08 + +/* Maximum positive integer used in PNG is (2^31)-1 */ +#define PNG_UINT_31_MAX ((png_uint_32)0x7fffffffL) +#define PNG_UINT_32_MAX ((png_uint_32)(-1)) +#define PNG_SIZE_MAX ((size_t)(-1)) + +/* These are constants for fixed point values encoded in the + * PNG specification manner (x100000) + */ +#define PNG_FP_1 100000 +#define PNG_FP_HALF 50000 +#define PNG_FP_MAX ((png_fixed_point)0x7fffffffL) +#define PNG_FP_MIN (-PNG_FP_MAX) + +/* These describe the color_type field in png_info. */ +/* color type masks */ +#define PNG_COLOR_MASK_PALETTE 1 +#define PNG_COLOR_MASK_COLOR 2 +#define PNG_COLOR_MASK_ALPHA 4 + +/* color types. Note that not all combinations are legal */ +#define PNG_COLOR_TYPE_GRAY 0 +#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) +#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) +#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) +#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA) +/* aliases */ +#define PNG_COLOR_TYPE_RGBA PNG_COLOR_TYPE_RGB_ALPHA +#define PNG_COLOR_TYPE_GA PNG_COLOR_TYPE_GRAY_ALPHA + +/* This is for compression type. PNG 1.0-1.2 only define the single type. */ +#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */ +#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE + +/* This is for filter type. PNG 1.0-1.2 only define the single type. */ +#define PNG_FILTER_TYPE_BASE 0 /* Single row per-byte filtering */ +#define PNG_INTRAPIXEL_DIFFERENCING 64 /* Used only in MNG datastreams */ +#define PNG_FILTER_TYPE_DEFAULT PNG_FILTER_TYPE_BASE + +/* These are for the interlacing type. These values should NOT be changed. */ +#define PNG_INTERLACE_NONE 0 /* Non-interlaced image */ +#define PNG_INTERLACE_ADAM7 1 /* Adam7 interlacing */ +#define PNG_INTERLACE_LAST 2 /* Not a valid value */ + +/* These are for the oFFs chunk. These values should NOT be changed. */ +#define PNG_OFFSET_PIXEL 0 /* Offset in pixels */ +#define PNG_OFFSET_MICROMETER 1 /* Offset in micrometers (1/10^6 meter) */ +#define PNG_OFFSET_LAST 2 /* Not a valid value */ + +/* These are for the pCAL chunk. These values should NOT be changed. */ +#define PNG_EQUATION_LINEAR 0 /* Linear transformation */ +#define PNG_EQUATION_BASE_E 1 /* Exponential base e transform */ +#define PNG_EQUATION_ARBITRARY 2 /* Arbitrary base exponential transform */ +#define PNG_EQUATION_HYPERBOLIC 3 /* Hyperbolic sine transformation */ +#define PNG_EQUATION_LAST 4 /* Not a valid value */ + +/* These are for the sCAL chunk. These values should NOT be changed. */ +#define PNG_SCALE_UNKNOWN 0 /* unknown unit (image scale) */ +#define PNG_SCALE_METER 1 /* meters per pixel */ +#define PNG_SCALE_RADIAN 2 /* radians per pixel */ +#define PNG_SCALE_LAST 3 /* Not a valid value */ + +/* These are for the pHYs chunk. These values should NOT be changed. */ +#define PNG_RESOLUTION_UNKNOWN 0 /* pixels/unknown unit (aspect ratio) */ +#define PNG_RESOLUTION_METER 1 /* pixels/meter */ +#define PNG_RESOLUTION_LAST 2 /* Not a valid value */ + +/* These are for the sRGB chunk. These values should NOT be changed. */ +#define PNG_sRGB_INTENT_PERCEPTUAL 0 +#define PNG_sRGB_INTENT_RELATIVE 1 +#define PNG_sRGB_INTENT_SATURATION 2 +#define PNG_sRGB_INTENT_ABSOLUTE 3 +#define PNG_sRGB_INTENT_LAST 4 /* Not a valid value */ + +/* This is for text chunks */ +#define PNG_KEYWORD_MAX_LENGTH 79 + +/* Maximum number of entries in PLTE/sPLT/tRNS arrays */ +#define PNG_MAX_PALETTE_LENGTH 256 + +/* These determine if an ancillary chunk's data has been successfully read + * from the PNG header, or if the application has filled in the corresponding + * data in the info_struct to be written into the output file. The values + * of the PNG_INFO_ defines should NOT be changed. + */ +#define PNG_INFO_gAMA 0x0001U +#define PNG_INFO_sBIT 0x0002U +#define PNG_INFO_cHRM 0x0004U +#define PNG_INFO_PLTE 0x0008U +#define PNG_INFO_tRNS 0x0010U +#define PNG_INFO_bKGD 0x0020U +#define PNG_INFO_hIST 0x0040U +#define PNG_INFO_pHYs 0x0080U +#define PNG_INFO_oFFs 0x0100U +#define PNG_INFO_tIME 0x0200U +#define PNG_INFO_pCAL 0x0400U +#define PNG_INFO_sRGB 0x0800U /* GR-P, 0.96a */ +#define PNG_INFO_iCCP 0x1000U /* ESR, 1.0.6 */ +#define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */ +#define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */ +#define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */ +#define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */ +#define PNG_INFO_cICP 0x20000U /* PNGv3: 1.6.45 */ +#define PNG_INFO_cLLI 0x40000U /* PNGv3: 1.6.45 */ +#define PNG_INFO_mDCV 0x80000U /* PNGv3: 1.6.45 */ +/* APNG: these chunks are stored as unknown, these flags are never set + * however they are provided as a convenience for implementors of APNG and + * avoids any merge conflicts. + * + * Private chunks: these chunk names violate the chunk name recommendations + * because the chunk definitions have no signature and because the private + * chunks with these names have been reserved. Private definitions should + * avoid them. + */ +#define PNG_INFO_acTL 0x100000U /* PNGv3: 1.6.45: unknown */ +#define PNG_INFO_fcTL 0x200000U /* PNGv3: 1.6.45: unknown */ +#define PNG_INFO_fdAT 0x400000U /* PNGv3: 1.6.45: unknown */ + +/* This is used for the transformation routines, as some of them + * change these values for the row. It also should enable using + * the routines for other purposes. + */ +typedef struct png_row_info_struct +{ + png_uint_32 width; /* width of row */ + size_t rowbytes; /* number of bytes in row */ + png_byte color_type; /* color type of row */ + png_byte bit_depth; /* bit depth of row */ + png_byte channels; /* number of channels (1, 2, 3, or 4) */ + png_byte pixel_depth; /* bits per pixel (depth * channels) */ +} png_row_info; + +typedef png_row_info * png_row_infop; +typedef png_row_info * * png_row_infopp; + +/* These are the function types for the I/O functions and for the functions + * that allow the user to override the default I/O functions with his or her + * own. The png_error_ptr type should match that of user-supplied warning + * and error functions, while the png_rw_ptr type should match that of the + * user read/write data functions. Note that the 'write' function must not + * modify the buffer it is passed. The 'read' function, on the other hand, is + * expected to return the read data in the buffer. + */ +typedef PNG_CALLBACK(void, *png_error_ptr, + (png_structp, png_const_charp)); +typedef PNG_CALLBACK(void, *png_rw_ptr, + (png_structp, png_bytep, size_t)); +typedef PNG_CALLBACK(void, *png_flush_ptr, + (png_structp)); +typedef PNG_CALLBACK(void, *png_read_status_ptr, + (png_structp, png_uint_32, int)); +typedef PNG_CALLBACK(void, *png_write_status_ptr, + (png_structp, png_uint_32, int)); + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +typedef PNG_CALLBACK(void, *png_progressive_info_ptr, + (png_structp, png_infop)); +typedef PNG_CALLBACK(void, *png_progressive_end_ptr, + (png_structp, png_infop)); + +/* The following callback receives png_uint_32 row_number, int pass for the + * png_bytep data of the row. When transforming an interlaced image the + * row number is the row number within the sub-image of the interlace pass, so + * the value will increase to the height of the sub-image (not the full image) + * then reset to 0 for the next pass. + * + * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to + * find the output pixel (x,y) given an interlaced sub-image pixel + * (row,col,pass). (See below for these macros.) + */ +typedef PNG_CALLBACK(void, *png_progressive_row_ptr, + (png_structp, png_bytep, png_uint_32, int)); +#endif + +#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ + defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) +typedef PNG_CALLBACK(void, *png_user_transform_ptr, + (png_structp, png_row_infop, png_bytep)); +#endif + +#ifdef PNG_USER_CHUNKS_SUPPORTED +typedef PNG_CALLBACK(int, *png_user_chunk_ptr, + (png_structp, png_unknown_chunkp)); +#endif +#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED +/* not used anywhere */ +/* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */ +#endif + +#ifdef PNG_SETJMP_SUPPORTED +/* This must match the function definition in , and the application + * must include this before png.h to obtain the definition of jmp_buf. The + * function is required to be PNG_NORETURN, but this is not checked. If the + * function does return the application will crash via an abort() or similar + * system level call. + * + * If you get a warning here while building the library you may need to make + * changes to ensure that pnglibconf.h records the calling convention used by + * your compiler. This may be very difficult - try using a different compiler + * to build the library! + */ +PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), (jmp_buf, int), typedef); +#endif + +/* Transform masks for the high-level interface */ +#define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ +#define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ +#define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ +#define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ +#define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ +#define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ +#define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ +#define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ +#define PNG_TRANSFORM_BGR 0x0080 /* read and write */ +#define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ +#define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ +#define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ +#define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only */ +/* Added to libpng-1.2.34 */ +#define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER +#define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */ +/* Added to libpng-1.4.0 */ +#define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ +/* Added to libpng-1.5.4 */ +#define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */ +#if ~0U > 0xffffU /* or else this might break on a 16-bit machine */ +#define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */ +#endif + +/* Flags for MNG supported features */ +#define PNG_FLAG_MNG_EMPTY_PLTE 0x01 +#define PNG_FLAG_MNG_FILTER_64 0x04 +#define PNG_ALL_MNG_FEATURES 0x05 + +/* NOTE: prior to 1.5 these functions had no 'API' style declaration, + * this allowed the zlib default functions to be used on Windows + * platforms. In 1.5 the zlib default malloc (which just calls malloc and + * ignores the first argument) should be completely compatible with the + * following. + */ +typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, + (png_structp, png_alloc_size_t)); +typedef PNG_CALLBACK(void, *png_free_ptr, + (png_structp, png_voidp)); + +/* Section 4: exported functions + * Here are the function definitions most commonly used. This is not + * the place to find out how to use libpng. See libpng-manual.txt for the + * full explanation, see example.c for the summary. This just provides + * a simple one line description of the use of each function. + * + * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in + * pngconf.h and in the *.dfn files in the scripts directory. + * + * PNG_EXPORT(ordinal, type, name, (args)); + * + * ordinal: ordinal that is used while building + * *.def files. The ordinal value is only + * relevant when preprocessing png.h with + * the *.dfn files for building symbol table + * entries, and are removed by pngconf.h. + * type: return type of the function + * name: function name + * args: function arguments, with types + * + * When we wish to append attributes to a function prototype we use + * the PNG_EXPORTA() macro instead. + * + * PNG_EXPORTA(ordinal, type, name, (args), attributes); + * + * ordinal, type, name, and args: same as in PNG_EXPORT(). + * attributes: function attributes + */ + +/* Returns the version number of the library */ +PNG_EXPORT(1, png_uint_32, png_access_version_number, + (void)); + +/* Tell lib we have already handled the first magic bytes. + * Handling more than 8 bytes from the beginning of the file is an error. + */ +PNG_EXPORT(2, void, png_set_sig_bytes, + (png_structrp png_ptr, int num_bytes)); + +/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a + * PNG file. Returns zero if the supplied bytes match the 8-byte PNG + * signature, and non-zero otherwise. Having num_to_check == 0 or + * start > 7 will always fail (i.e. return non-zero). + */ +PNG_EXPORT(3, int, png_sig_cmp, + (png_const_bytep sig, size_t start, size_t num_to_check)); + +/* Simple signature checking function. This is the same as calling + * png_check_sig(sig, n) := (png_sig_cmp(sig, 0, n) == 0). + */ +#define png_check_sig(sig, n) (png_sig_cmp((sig), 0, (n)) == 0) /* DEPRECATED */ + +/* Allocate and initialize png_ptr struct for reading, and any other memory. */ +PNG_EXPORTA(4, png_structp, png_create_read_struct, + (png_const_charp user_png_ver, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), + PNG_ALLOCATED); + +/* Allocate and initialize png_ptr struct for writing, and any other memory */ +PNG_EXPORTA(5, png_structp, png_create_write_struct, + (png_const_charp user_png_ver, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), + PNG_ALLOCATED); + +PNG_EXPORT(6, size_t, png_get_compression_buffer_size, + (png_const_structrp png_ptr)); + +PNG_EXPORT(7, void, png_set_compression_buffer_size, + (png_structrp png_ptr, size_t size)); + +/* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp + * match up. + */ +#ifdef PNG_SETJMP_SUPPORTED +/* This function returns the jmp_buf built in to *png_ptr. It must be + * supplied with an appropriate 'longjmp' function to use on that jmp_buf + * unless the default error function is overridden in which case NULL is + * acceptable. The size of the jmp_buf is checked against the actual size + * allocated by the library - the call will return NULL on a mismatch + * indicating an ABI mismatch. + */ +PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, + (png_structrp png_ptr, png_longjmp_ptr longjmp_fn, size_t jmp_buf_size)); +# define png_jmpbuf(png_ptr) \ + (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf)))) +#else +# define png_jmpbuf(png_ptr) \ + (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP) +#endif +/* This function should be used by libpng applications in place of + * longjmp(png_ptr->jmpbuf, val). If longjmp_fn() has been set, it + * will use it; otherwise it will call PNG_ABORT(). This function was + * added in libpng-1.5.0. + */ +PNG_EXPORTA(9, void, png_longjmp, + (png_const_structrp png_ptr, int val), + PNG_NORETURN); + +#ifdef PNG_READ_SUPPORTED +/* Reset the compression stream */ +PNG_EXPORTA(10, int, png_reset_zstream, + (png_structrp png_ptr), + PNG_DEPRECATED); +#endif + +/* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ +#ifdef PNG_USER_MEM_SUPPORTED +PNG_EXPORTA(11, png_structp, png_create_read_struct_2, + (png_const_charp user_png_ver, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), + PNG_ALLOCATED); +PNG_EXPORTA(12, png_structp, png_create_write_struct_2, + (png_const_charp user_png_ver, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), + PNG_ALLOCATED); +#endif + +/* Write the PNG file signature. */ +PNG_EXPORT(13, void, png_write_sig, + (png_structrp png_ptr)); + +/* Write a PNG chunk - size, type, (optional) data, CRC. */ +PNG_EXPORT(14, void, png_write_chunk, + (png_structrp png_ptr, + png_const_bytep chunk_name, png_const_bytep data, size_t length)); + +/* Write the start of a PNG chunk - length and chunk name. */ +PNG_EXPORT(15, void, png_write_chunk_start, + (png_structrp png_ptr, + png_const_bytep chunk_name, png_uint_32 length)); + +/* Write the data of a PNG chunk started with png_write_chunk_start(). */ +PNG_EXPORT(16, void, png_write_chunk_data, + (png_structrp png_ptr, + png_const_bytep data, size_t length)); + +/* Finish a chunk started with png_write_chunk_start() (includes CRC). */ +PNG_EXPORT(17, void, png_write_chunk_end, + (png_structrp png_ptr)); + +/* Allocate and initialize the info structure */ +PNG_EXPORTA(18, png_infop, png_create_info_struct, + (png_const_structrp png_ptr), + PNG_ALLOCATED); + +/* DEPRECATED: this function allowed init structures to be created using the + * default allocation method (typically malloc). Use is deprecated in 1.6.0 and + * the API will be removed in the future. + */ +PNG_EXPORTA(19, void, png_info_init_3, + (png_infopp info_ptr, size_t png_info_struct_size), + PNG_DEPRECATED); + +/* Writes all the PNG information before the image. */ +PNG_EXPORT(20, void, png_write_info_before_PLTE, + (png_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(21, void, png_write_info, + (png_structrp png_ptr, png_const_inforp info_ptr)); + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read the information before the actual image data. */ +PNG_EXPORT(22, void, png_read_info, + (png_structrp png_ptr, png_inforp info_ptr)); +#endif + +#ifdef PNG_TIME_RFC1123_SUPPORTED + /* Convert to a US string format: there is no localization support in this + * routine. The original implementation used a 29 character buffer in + * png_struct, this will be removed in future versions. + */ +#if PNG_LIBPNG_VER < 10700 +/* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */ +PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, + (png_structrp png_ptr, png_const_timep ptime), + PNG_DEPRECATED); +#endif +PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, + (char out[29], png_const_timep ptime)); +#endif + +#ifdef PNG_CONVERT_tIME_SUPPORTED +/* Convert from a struct tm to png_time */ +PNG_EXPORT(24, void, png_convert_from_struct_tm, + (png_timep ptime, const struct tm * ttime)); + +/* Convert from time_t to png_time. Uses gmtime() */ +PNG_EXPORT(25, void, png_convert_from_time_t, + (png_timep ptime, time_t ttime)); +#endif /* CONVERT_tIME */ + +#ifdef PNG_READ_EXPAND_SUPPORTED +/* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ +PNG_EXPORT(26, void, png_set_expand, + (png_structrp png_ptr)); +PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, + (png_structrp png_ptr)); +PNG_EXPORT(28, void, png_set_palette_to_rgb, + (png_structrp png_ptr)); +PNG_EXPORT(29, void, png_set_tRNS_to_alpha, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_EXPAND_16_SUPPORTED +/* Expand to 16-bit channels, forces conversion of palette to RGB and expansion + * of a tRNS chunk if present. + */ +PNG_EXPORT(221, void, png_set_expand_16, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) +/* Use blue, green, red order for pixels. */ +PNG_EXPORT(30, void, png_set_bgr, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED +/* Expand the grayscale to 24-bit RGB if necessary. */ +PNG_EXPORT(31, void, png_set_gray_to_rgb, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED +/* Reduce RGB to grayscale. */ +#define PNG_ERROR_ACTION_NONE 1 +#define PNG_ERROR_ACTION_WARN 2 +#define PNG_ERROR_ACTION_ERROR 3 +#define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/ + +PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, + (png_structrp png_ptr, + int error_action, double red, double green)) +PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, + (png_structrp png_ptr, + int error_action, png_fixed_point red, png_fixed_point green)) + +PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, + (png_const_structrp png_ptr)); +#endif + +#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED +PNG_EXPORT(35, void, png_build_grayscale_palette, + (int bit_depth, png_colorp palette)); +#endif + +#ifdef PNG_READ_ALPHA_MODE_SUPPORTED +/* How the alpha channel is interpreted - this affects how the color channels + * of a PNG file are returned to the calling application when an alpha channel, + * or a tRNS chunk in a palette file, is present. + * + * This has no effect on the way pixels are written into a PNG output + * datastream. The color samples in a PNG datastream are never premultiplied + * with the alpha samples. + * + * The default is to return data according to the PNG specification: the alpha + * channel is a linear measure of the contribution of the pixel to the + * corresponding composited pixel, and the color channels are unassociated + * (not premultiplied). The gamma encoded color channels must be scaled + * according to the contribution and to do this it is necessary to undo + * the encoding, scale the color values, perform the composition and re-encode + * the values. This is the 'PNG' mode. + * + * The alternative is to 'associate' the alpha with the color information by + * storing color channel values that have been scaled by the alpha. + * image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes + * (the latter being the two common names for associated alpha color channels). + * + * For the 'OPTIMIZED' mode, a pixel is treated as opaque only if the alpha + * value is equal to the maximum value. + * + * The final choice is to gamma encode the alpha channel as well. This is + * broken because, in practice, no implementation that uses this choice + * correctly undoes the encoding before handling alpha composition. Use this + * choice only if other serious errors in the software or hardware you use + * mandate it; the typical serious error is for dark halos to appear around + * opaque areas of the composited PNG image because of arithmetic overflow. + * + * The API function png_set_alpha_mode specifies which of these choices to use + * with an enumerated 'mode' value and the gamma of the required output: + */ +#define PNG_ALPHA_PNG 0 /* according to the PNG standard */ +#define PNG_ALPHA_STANDARD 1 /* according to Porter/Duff */ +#define PNG_ALPHA_ASSOCIATED 1 /* as above; this is the normal practice */ +#define PNG_ALPHA_PREMULTIPLIED 1 /* as above */ +#define PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */ +#define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */ + +PNG_FP_EXPORT(227, void, png_set_alpha_mode, + (png_structrp png_ptr, int mode, double output_gamma)) +PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, + (png_structrp png_ptr, int mode, png_fixed_point output_gamma)) +#endif + +#if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED) +/* The output_gamma value is a screen gamma in libpng terminology: it expresses + * how to decode the output values, not how they are encoded. + */ +#define PNG_DEFAULT_sRGB -1 /* sRGB gamma and color space */ +#define PNG_GAMMA_MAC_18 -2 /* Old Mac '1.8' gamma and color space */ +#define PNG_GAMMA_sRGB 220000 /* Television standards--matches sRGB gamma */ +#define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */ +#endif + +/* The following are examples of calls to png_set_alpha_mode to achieve the + * required overall gamma correction and, where necessary, alpha + * premultiplication. + * + * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); + * This is the default libpng handling of the alpha channel - it is not + * pre-multiplied into the color components. In addition the call states + * that the output is for a sRGB system and causes all PNG files without gAMA + * chunks to be assumed to be encoded using sRGB. + * + * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); + * In this case the output is assumed to be something like an sRGB conformant + * display preceded by a power-law lookup table of power 1.45. This is how + * early Mac systems behaved. + * + * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR); + * This is the classic Jim Blinn approach and will work in academic + * environments where everything is done by the book. It has the shortcoming + * of assuming that input PNG data with no gamma information is linear - this + * is unlikely to be correct unless the PNG files where generated locally. + * Most of the time the output precision will be so low as to show + * significant banding in dark areas of the image. + * + * png_set_expand_16(pp); + * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB); + * This is a somewhat more realistic Jim Blinn inspired approach. PNG files + * are assumed to have the sRGB encoding if not marked with a gamma value and + * the output is always 16 bits per component. This permits accurate scaling + * and processing of the data. If you know that your input PNG files were + * generated locally you might need to replace PNG_DEFAULT_sRGB with the + * correct value for your system. + * + * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB); + * If you just need to composite the PNG image onto an existing background + * and if you control the code that does this you can use the optimization + * setting. In this case you just copy completely opaque pixels to the + * output. For pixels that are not completely transparent (you just skip + * those) you do the composition math using png_composite or png_composite_16 + * below then encode the resultant 8-bit or 16-bit values to match the output + * encoding. + * + * Other cases + * If neither the PNG nor the standard linear encoding work for you because + * of the software or hardware you use then you have a big problem. The PNG + * case will probably result in halos around the image. The linear encoding + * will probably result in a washed out, too bright, image (it's actually too + * contrasty.) Try the ALPHA_OPTIMIZED mode above - this will probably + * substantially reduce the halos. Alternatively try: + * + * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB); + * This option will also reduce the halos, but there will be slight dark + * halos round the opaque parts of the image where the background is light. + * In the OPTIMIZED mode the halos will be light halos where the background + * is dark. Take your pick - the halos are unavoidable unless you can get + * your hardware/software fixed! (The OPTIMIZED approach is slightly + * faster.) + * + * When the default gamma of PNG files doesn't match the output gamma. + * If you have PNG files with no gamma information png_set_alpha_mode allows + * you to provide a default gamma, but it also sets the output gamma to the + * matching value. If you know your PNG files have a gamma that doesn't + * match the output you can take advantage of the fact that + * png_set_alpha_mode always sets the output gamma but only sets the PNG + * default if it is not already set: + * + * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); + * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); + * The first call sets both the default and the output gamma values, the + * second call overrides the output gamma without changing the default. This + * is easier than achieving the same effect with png_set_gamma. You must use + * PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will + * fire if more than one call to png_set_alpha_mode and png_set_background is + * made in the same read operation, however multiple calls with PNG_ALPHA_PNG + * are ignored. + */ + +#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED +PNG_EXPORT(36, void, png_set_strip_alpha, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +PNG_EXPORT(37, void, png_set_swap_alpha, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ + defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +PNG_EXPORT(38, void, png_set_invert_alpha, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) +/* Add a filler byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ +PNG_EXPORT(39, void, png_set_filler, + (png_structrp png_ptr, png_uint_32 filler, int flags)); +/* The values of the PNG_FILLER_ defines should NOT be changed */ +# define PNG_FILLER_BEFORE 0 +# define PNG_FILLER_AFTER 1 +/* Add an alpha byte to 8-bit or 16-bit Gray or 24-bit or 48-bit RGB images. */ +PNG_EXPORT(40, void, png_set_add_alpha, + (png_structrp png_ptr, png_uint_32 filler, int flags)); +#endif /* READ_FILLER || WRITE_FILLER */ + +#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) +/* Swap bytes in 16-bit depth files. */ +PNG_EXPORT(41, void, png_set_swap, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) +/* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ +PNG_EXPORT(42, void, png_set_packing, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ + defined(PNG_WRITE_PACKSWAP_SUPPORTED) +/* Swap packing order of pixels in bytes. */ +PNG_EXPORT(43, void, png_set_packswap, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) +/* Converts files to legal bit depths. */ +PNG_EXPORT(44, void, png_set_shift, + (png_structrp png_ptr, png_const_color_8p true_bits)); +#endif + +#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ + defined(PNG_WRITE_INTERLACING_SUPPORTED) +/* Have the code handle the interlacing. Returns the number of passes. + * MUST be called before png_read_update_info or png_start_read_image, + * otherwise it will not have the desired effect. Note that it is still + * necessary to call png_read_row or png_read_rows png_get_image_height + * times for each pass. +*/ +PNG_EXPORT(45, int, png_set_interlace_handling, + (png_structrp png_ptr)); +#endif + +#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) +/* Invert monochrome files */ +PNG_EXPORT(46, void, png_set_invert_mono, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_BACKGROUND_SUPPORTED +/* Handle alpha and tRNS by replacing with a background color. Prior to + * libpng-1.5.4 this API must not be called before the PNG file header has been + * read. Doing so will result in unexpected behavior and possible warnings or + * errors if the PNG file contains a bKGD chunk. + */ +PNG_FP_EXPORT(47, void, png_set_background, + (png_structrp png_ptr, + png_const_color_16p background_color, int background_gamma_code, + int need_expand, double background_gamma)) +PNG_FIXED_EXPORT(215, void, png_set_background_fixed, + (png_structrp png_ptr, + png_const_color_16p background_color, int background_gamma_code, + int need_expand, png_fixed_point background_gamma)) +#endif +#ifdef PNG_READ_BACKGROUND_SUPPORTED +# define PNG_BACKGROUND_GAMMA_UNKNOWN 0 +# define PNG_BACKGROUND_GAMMA_SCREEN 1 +# define PNG_BACKGROUND_GAMMA_FILE 2 +# define PNG_BACKGROUND_GAMMA_UNIQUE 3 +#endif + +#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED +/* Scale a 16-bit depth file down to 8-bit, accurately. */ +PNG_EXPORT(229, void, png_set_scale_16, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED +#define PNG_READ_16_TO_8_SUPPORTED /* Name prior to 1.5.4 */ +/* Strip the second byte of information from a 16-bit depth file. */ +PNG_EXPORT(48, void, png_set_strip_16, + (png_structrp png_ptr)); +#endif + +#ifdef PNG_READ_QUANTIZE_SUPPORTED +/* Turn on quantizing, and reduce the palette to the number of colors + * available. + */ +PNG_EXPORT(49, void, png_set_quantize, + (png_structrp png_ptr, + png_colorp palette, int num_palette, int maximum_colors, + png_const_uint_16p histogram, int full_quantize)); +#endif + +#ifdef PNG_READ_GAMMA_SUPPORTED +/* The threshold on gamma processing is configurable but hard-wired into the + * library. The following is the floating point variant. + */ +#define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001) + +/* Handle gamma correction. Screen_gamma=(display_exponent). + * NOTE: this API simply sets the screen and file gamma values. It will + * therefore override the value for gamma in a PNG file if it is called after + * the file header has been read - use with care - call before reading the PNG + * file for best results! + * + * These routines accept the same gamma values as png_set_alpha_mode (described + * above). The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either + * API (floating point or fixed.) Notice, however, that the 'file_gamma' value + * is the inverse of a 'screen gamma' value. + */ +PNG_FP_EXPORT(50, void, png_set_gamma, + (png_structrp png_ptr, + double screen_gamma, double override_file_gamma)) +PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, + (png_structrp png_ptr, + png_fixed_point screen_gamma, png_fixed_point override_file_gamma)) +#endif + +#ifdef PNG_WRITE_FLUSH_SUPPORTED +/* Set how many lines between output flushes - 0 for no flushing */ +PNG_EXPORT(51, void, png_set_flush, + (png_structrp png_ptr, int nrows)); +/* Flush the current PNG output buffer */ +PNG_EXPORT(52, void, png_write_flush, + (png_structrp png_ptr)); +#endif + +/* Optional update palette with requested transformations */ +PNG_EXPORT(53, void, png_start_read_image, + (png_structrp png_ptr)); + +/* Optional call to update the users info structure */ +PNG_EXPORT(54, void, png_read_update_info, + (png_structrp png_ptr, png_inforp info_ptr)); + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read one or more rows of image data. */ +PNG_EXPORT(55, void, png_read_rows, + (png_structrp png_ptr, png_bytepp row, + png_bytepp display_row, png_uint_32 num_rows)); +#endif + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read a row of data. */ +PNG_EXPORT(56, void, png_read_row, + (png_structrp png_ptr, png_bytep row, png_bytep display_row)); +#endif + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read the whole image into memory at once. */ +PNG_EXPORT(57, void, png_read_image, + (png_structrp png_ptr, png_bytepp image)); +#endif + +/* Write a row of image data */ +PNG_EXPORT(58, void, png_write_row, + (png_structrp png_ptr, png_const_bytep row)); + +/* Write a few rows of image data: (*row) is not written; however, the type + * is declared as writeable to maintain compatibility with previous versions + * of libpng and to allow the 'display_row' array from read_rows to be passed + * unchanged to write_rows. + */ +PNG_EXPORT(59, void, png_write_rows, + (png_structrp png_ptr, png_bytepp row, png_uint_32 num_rows)); + +/* Write the image data */ +PNG_EXPORT(60, void, png_write_image, + (png_structrp png_ptr, png_bytepp image)); + +/* Write the end of the PNG file. */ +PNG_EXPORT(61, void, png_write_end, + (png_structrp png_ptr, png_inforp info_ptr)); + +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +/* Read the end of the PNG file. */ +PNG_EXPORT(62, void, png_read_end, + (png_structrp png_ptr, png_inforp info_ptr)); +#endif + +/* Free any memory associated with the png_info_struct */ +PNG_EXPORT(63, void, png_destroy_info_struct, + (png_const_structrp png_ptr, png_infopp info_ptr_ptr)); + +/* Free any memory associated with the png_struct and the png_info_structs */ +PNG_EXPORT(64, void, png_destroy_read_struct, + (png_structpp png_ptr_ptr, + png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); + +/* Free any memory associated with the png_struct and the png_info_structs */ +PNG_EXPORT(65, void, png_destroy_write_struct, + (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); + +/* Set the libpng method of handling chunk CRC errors */ +PNG_EXPORT(66, void, png_set_crc_action, + (png_structrp png_ptr, int crit_action, int ancil_action)); + +/* Values for png_set_crc_action() say how to handle CRC errors in + * ancillary and critical chunks, and whether to use the data contained + * therein. Note that it is impossible to "discard" data in a critical + * chunk. For versions prior to 0.90, the action was always error/quit, + * whereas in version 0.90 and later, the action for CRC errors in ancillary + * chunks is warn/discard. These values should NOT be changed. + * + * value action:critical action:ancillary + */ +#define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ +#define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ +#define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ +#define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ +#define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ +#define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ + +#ifdef PNG_WRITE_SUPPORTED +/* These functions give the user control over the scan-line filtering in + * libpng and the compression methods used by zlib. These functions are + * mainly useful for testing, as the defaults should work with most users. + * Those users who are tight on memory or want faster performance at the + * expense of compression can modify them. See the compression library + * header file (zlib.h) for an explanation of the compression functions. + */ + +/* Set the filtering method(s) used by libpng. Currently, the only valid + * value for "method" is 0. + */ +PNG_EXPORT(67, void, png_set_filter, + (png_structrp png_ptr, int method, int filters)); +#endif /* WRITE */ + +/* Flags for png_set_filter() to say which filters to use. The flags + * are chosen so that they don't conflict with real filter types + * below, in case they are supplied instead of the #defined constants. + * These values should NOT be changed. + */ +#define PNG_NO_FILTERS 0x00 +#define PNG_FILTER_NONE 0x08 +#define PNG_FILTER_SUB 0x10 +#define PNG_FILTER_UP 0x20 +#define PNG_FILTER_AVG 0x40 +#define PNG_FILTER_PAETH 0x80 +#define PNG_FAST_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP) +#define PNG_ALL_FILTERS (PNG_FAST_FILTERS | PNG_FILTER_AVG | PNG_FILTER_PAETH) + +/* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. + * These defines should NOT be changed. + */ +#define PNG_FILTER_VALUE_NONE 0 +#define PNG_FILTER_VALUE_SUB 1 +#define PNG_FILTER_VALUE_UP 2 +#define PNG_FILTER_VALUE_AVG 3 +#define PNG_FILTER_VALUE_PAETH 4 +#define PNG_FILTER_VALUE_LAST 5 + +#ifdef PNG_WRITE_SUPPORTED +#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* DEPRECATED */ +PNG_FP_EXPORT(68, void, png_set_filter_heuristics, + (png_structrp png_ptr, + int heuristic_method, int num_weights, + png_const_doublep filter_weights, + png_const_doublep filter_costs)) +PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, + (png_structrp png_ptr, + int heuristic_method, int num_weights, + png_const_fixed_point_p filter_weights, + png_const_fixed_point_p filter_costs)) +#endif /* WRITE_WEIGHTED_FILTER */ + +/* The following are no longer used and will be removed from libpng-1.7: */ +#define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ +#define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ +#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ +#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ + +/* Set the library compression level. Currently, valid values range from + * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 + * (0 - no compression, 9 - "maximal" compression). Note that tests have + * shown that zlib compression levels 3-6 usually perform as well as level 9 + * for PNG images, and do considerably fewer calculations. In the future, + * these values may not correspond directly to the zlib compression levels. + */ +#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED +PNG_EXPORT(69, void, png_set_compression_level, + (png_structrp png_ptr, int level)); + +PNG_EXPORT(70, void, png_set_compression_mem_level, + (png_structrp png_ptr, int mem_level)); + +PNG_EXPORT(71, void, png_set_compression_strategy, + (png_structrp png_ptr, int strategy)); + +/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a + * smaller value of window_bits if it can do so safely. + */ +PNG_EXPORT(72, void, png_set_compression_window_bits, + (png_structrp png_ptr, int window_bits)); + +PNG_EXPORT(73, void, png_set_compression_method, + (png_structrp png_ptr, int method)); +#endif /* WRITE_CUSTOMIZE_COMPRESSION */ + +#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED +/* Also set zlib parameters for compressing non-IDAT chunks */ +PNG_EXPORT(222, void, png_set_text_compression_level, + (png_structrp png_ptr, int level)); + +PNG_EXPORT(223, void, png_set_text_compression_mem_level, + (png_structrp png_ptr, int mem_level)); + +PNG_EXPORT(224, void, png_set_text_compression_strategy, + (png_structrp png_ptr, int strategy)); + +/* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a + * smaller value of window_bits if it can do so safely. + */ +PNG_EXPORT(225, void, png_set_text_compression_window_bits, + (png_structrp png_ptr, int window_bits)); + +PNG_EXPORT(226, void, png_set_text_compression_method, + (png_structrp png_ptr, int method)); +#endif /* WRITE_CUSTOMIZE_ZTXT_COMPRESSION */ +#endif /* WRITE */ + +/* These next functions are called for input/output, memory, and error + * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, + * and call standard C I/O routines such as fread(), fwrite(), and + * fprintf(). These functions can be made to use other I/O routines + * at run time for those applications that need to handle I/O in a + * different manner by calling png_set_???_fn(). See libpng-manual.txt for + * more information. + */ + +#ifdef PNG_STDIO_SUPPORTED +/* Initialize the input/output for the PNG file to the default functions. */ +PNG_EXPORT(74, void, png_init_io, + (png_structrp png_ptr, FILE *fp)); +#endif + +/* Replace the (error and abort), and warning functions with user + * supplied functions. If no messages are to be printed you must still + * write and use replacement functions. The replacement error_fn should + * still do a longjmp to the last setjmp location if you are using this + * method of error handling. If error_fn or warning_fn is NULL, the + * default function will be used. + */ + +PNG_EXPORT(75, void, png_set_error_fn, + (png_structrp png_ptr, + png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); + +/* Return the user pointer associated with the error functions */ +PNG_EXPORT(76, png_voidp, png_get_error_ptr, + (png_const_structrp png_ptr)); + +/* Replace the default data output functions with a user supplied one(s). + * If buffered output is not used, then output_flush_fn can be set to NULL. + * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time + * output_flush_fn will be ignored (and thus can be NULL). + * It is probably a mistake to use NULL for output_flush_fn if + * write_data_fn is not also NULL unless you have built libpng with + * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's + * default flush function, which uses the standard *FILE structure, will + * be used. + */ +PNG_EXPORT(77, void, png_set_write_fn, + (png_structrp png_ptr, + png_voidp io_ptr, + png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); + +/* Replace the default data input function with a user supplied one. */ +PNG_EXPORT(78, void, png_set_read_fn, + (png_structrp png_ptr, + png_voidp io_ptr, png_rw_ptr read_data_fn)); + +/* Return the user pointer associated with the I/O functions */ +PNG_EXPORT(79, png_voidp, png_get_io_ptr, + (png_const_structrp png_ptr)); + +PNG_EXPORT(80, void, png_set_read_status_fn, + (png_structrp png_ptr, png_read_status_ptr read_row_fn)); + +PNG_EXPORT(81, void, png_set_write_status_fn, + (png_structrp png_ptr, png_write_status_ptr write_row_fn)); + +#ifdef PNG_USER_MEM_SUPPORTED +/* Replace the default memory allocation functions with user supplied one(s). */ +PNG_EXPORT(82, void, png_set_mem_fn, + (png_structrp png_ptr, + png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); +/* Return the user pointer associated with the memory functions */ +PNG_EXPORT(83, png_voidp, png_get_mem_ptr, + (png_const_structrp png_ptr)); +#endif + +#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED +PNG_EXPORT(84, void, png_set_read_user_transform_fn, + (png_structrp png_ptr, png_user_transform_ptr read_user_transform_fn)); +#endif + +#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED +PNG_EXPORT(85, void, png_set_write_user_transform_fn, + (png_structrp png_ptr, png_user_transform_ptr write_user_transform_fn)); +#endif + +#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED +PNG_EXPORT(86, void, png_set_user_transform_info, + (png_structrp png_ptr, + png_voidp user_transform_ptr, + int user_transform_depth, int user_transform_channels)); +/* Return the user pointer associated with the user transform functions */ +PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr, + (png_const_structrp png_ptr)); +#endif + +#ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED +/* Return information about the row currently being processed. Note that these + * APIs do not fail but will return unexpected results if called outside a user + * transform callback. Also note that when transforming an interlaced image the + * row number is the row number within the sub-image of the interlace pass, so + * the value will increase to the height of the sub-image (not the full image) + * then reset to 0 for the next pass. + * + * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to + * find the output pixel (x,y) given an interlaced sub-image pixel + * (row,col,pass). (See below for these macros.) + */ +PNG_EXPORT(217, png_uint_32, png_get_current_row_number, + (png_const_structrp)); +PNG_EXPORT(218, png_byte, png_get_current_pass_number, + (png_const_structrp)); +#endif + +#ifdef PNG_READ_USER_CHUNKS_SUPPORTED +/* This callback is called only for *unknown* chunks. If + * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known + * chunks to be treated as unknown, however in this case the callback must do + * any processing required by the chunk (e.g. by calling the appropriate + * png_set_ APIs.) + * + * There is no write support - on write, by default, all the chunks in the + * 'unknown' list are written in the specified position. + * + * The integer return from the callback function is interpreted thus: + * + * negative: An error occurred; png_chunk_error will be called. + * zero: The chunk was not handled, the chunk will be saved. A critical + * chunk will cause an error at this point unless it is to be saved. + * positive: The chunk was handled, libpng will ignore/discard it. + * + * See "INTERACTION WITH USER CHUNK CALLBACKS" below for important notes about + * how this behavior will change in libpng 1.7 + */ +PNG_EXPORT(88, void, png_set_read_user_chunk_fn, + (png_structrp png_ptr, + png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); +#endif + +#ifdef PNG_USER_CHUNKS_SUPPORTED +PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, + (png_const_structrp png_ptr)); +#endif + +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED +/* Sets the function callbacks for the push reader, and a pointer to a + * user-defined structure available to the callback functions. + */ +PNG_EXPORT(90, void, png_set_progressive_read_fn, + (png_structrp png_ptr, + png_voidp progressive_ptr, png_progressive_info_ptr info_fn, + png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn)); + +/* Returns the user pointer associated with the push read functions */ +PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, + (png_const_structrp png_ptr)); + +/* Function to be called when data becomes available */ +PNG_EXPORT(92, void, png_process_data, + (png_structrp png_ptr, + png_inforp info_ptr, png_bytep buffer, size_t buffer_size)); + +/* A function which may be called *only* within png_process_data to stop the + * processing of any more data. The function returns the number of bytes + * remaining, excluding any that libpng has cached internally. A subsequent + * call to png_process_data must supply these bytes again. If the argument + * 'save' is set to true the routine will first save all the pending data and + * will always return 0. + */ +PNG_EXPORT(219, size_t, png_process_data_pause, + (png_structrp, int save)); + +/* A function which may be called *only* outside (after) a call to + * png_process_data. It returns the number of bytes of data to skip in the + * input. Normally it will return 0, but if it returns a non-zero value the + * application must skip than number of bytes of input data and pass the + * following data to the next call to png_process_data. + */ +PNG_EXPORT(220, png_uint_32, png_process_data_skip, + (png_structrp)); + +/* Function that combines rows. 'new_row' is a flag that should come from + * the callback and be non-NULL if anything needs to be done; the library + * stores its own version of the new data internally and ignores the passed + * in value. + */ +PNG_EXPORT(93, void, png_progressive_combine_row, + (png_const_structrp png_ptr, + png_bytep old_row, png_const_bytep new_row)); +#endif /* PROGRESSIVE_READ */ + +PNG_EXPORTA(94, png_voidp, png_malloc, + (png_const_structrp png_ptr, png_alloc_size_t size), + PNG_ALLOCATED); +/* Added at libpng version 1.4.0 */ +PNG_EXPORTA(95, png_voidp, png_calloc, + (png_const_structrp png_ptr, png_alloc_size_t size), + PNG_ALLOCATED); + +/* Added at libpng version 1.2.4 */ +PNG_EXPORTA(96, png_voidp, png_malloc_warn, + (png_const_structrp png_ptr, png_alloc_size_t size), + PNG_ALLOCATED); + +/* Frees a pointer allocated by png_malloc() */ +PNG_EXPORT(97, void, png_free, + (png_const_structrp png_ptr, png_voidp ptr)); + +/* Free data that was allocated internally */ +PNG_EXPORT(98, void, png_free_data, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_uint_32 free_me, int num)); + +/* Reassign the responsibility for freeing existing data, whether allocated + * by libpng or by the application; this works on the png_info structure passed + * in, without changing the state for other png_info structures. + */ +PNG_EXPORT(99, void, png_data_freer, + (png_const_structrp png_ptr, png_inforp info_ptr, + int freer, png_uint_32 mask)); + +/* Assignments for png_data_freer */ +#define PNG_DESTROY_WILL_FREE_DATA 1 +#define PNG_SET_WILL_FREE_DATA 1 +#define PNG_USER_WILL_FREE_DATA 2 +/* Flags for png_ptr->free_me and info_ptr->free_me */ +#define PNG_FREE_HIST 0x0008U +#define PNG_FREE_ICCP 0x0010U +#define PNG_FREE_SPLT 0x0020U +#define PNG_FREE_ROWS 0x0040U +#define PNG_FREE_PCAL 0x0080U +#define PNG_FREE_SCAL 0x0100U +#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED +# define PNG_FREE_UNKN 0x0200U +#endif +/* PNG_FREE_LIST 0x0400U removed in 1.6.0 because it is ignored */ +#define PNG_FREE_PLTE 0x1000U +#define PNG_FREE_TRNS 0x2000U +#define PNG_FREE_TEXT 0x4000U +#define PNG_FREE_EXIF 0x8000U /* Added at libpng-1.6.31 */ +#define PNG_FREE_ALL 0xffffU +#define PNG_FREE_MUL 0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ + +#ifdef PNG_USER_MEM_SUPPORTED +PNG_EXPORTA(100, png_voidp, png_malloc_default, + (png_const_structrp png_ptr, png_alloc_size_t size), + PNG_ALLOCATED PNG_DEPRECATED); +PNG_EXPORTA(101, void, png_free_default, + (png_const_structrp png_ptr, png_voidp ptr), + PNG_DEPRECATED); +#endif + +#ifdef PNG_ERROR_TEXT_SUPPORTED +/* Fatal error in PNG image of libpng - can't continue */ +PNG_EXPORTA(102, void, png_error, + (png_const_structrp png_ptr, png_const_charp error_message), + PNG_NORETURN); + +/* The same, but the chunk name is prepended to the error string. */ +PNG_EXPORTA(103, void, png_chunk_error, + (png_const_structrp png_ptr, png_const_charp error_message), + PNG_NORETURN); + +#else +/* Fatal error in PNG image of libpng - can't continue */ +PNG_EXPORTA(104, void, png_err, + (png_const_structrp png_ptr), + PNG_NORETURN); +# define png_error(s1,s2) png_err(s1) +# define png_chunk_error(s1,s2) png_err(s1) +#endif + +#ifdef PNG_WARNINGS_SUPPORTED +/* Non-fatal error in libpng. Can continue, but may have a problem. */ +PNG_EXPORT(105, void, png_warning, + (png_const_structrp png_ptr, png_const_charp warning_message)); + +/* Non-fatal error in libpng, chunk name is prepended to message. */ +PNG_EXPORT(106, void, png_chunk_warning, + (png_const_structrp png_ptr, png_const_charp warning_message)); +#else +# define png_warning(s1,s2) ((void)(s1)) +# define png_chunk_warning(s1,s2) ((void)(s1)) +#endif + +#ifdef PNG_BENIGN_ERRORS_SUPPORTED +/* Benign error in libpng. Can continue, but may have a problem. + * User can choose whether to handle as a fatal error or as a warning. */ +PNG_EXPORT(107, void, png_benign_error, + (png_const_structrp png_ptr, png_const_charp warning_message)); + +#ifdef PNG_READ_SUPPORTED +/* Same, chunk name is prepended to message (only during read) */ +PNG_EXPORT(108, void, png_chunk_benign_error, + (png_const_structrp png_ptr, png_const_charp warning_message)); +#endif + +PNG_EXPORT(109, void, png_set_benign_errors, + (png_structrp png_ptr, int allowed)); +#else +# ifdef PNG_ALLOW_BENIGN_ERRORS +# define png_benign_error png_warning +# define png_chunk_benign_error png_chunk_warning +# else +# define png_benign_error png_error +# define png_chunk_benign_error png_chunk_error +# endif +#endif + +/* The png_set_ functions are for storing values in the png_info_struct. + * Similarly, the png_get_ calls are used to read values from the + * png_info_struct, either storing the parameters in the passed variables, or + * setting pointers into the png_info_struct where the data is stored. The + * png_get_ functions return a non-zero value if the data was available + * in info_ptr, or return zero and do not change any of the parameters if the + * data was not available. + * + * These functions should be used instead of directly accessing png_info + * to avoid problems with future changes in the size and internal layout of + * png_info_struct. + */ +/* Returns "flag" if chunk data is valid in info_ptr. */ +PNG_EXPORT(110, png_uint_32, png_get_valid, + (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 flag)); + +/* Returns number of bytes needed to hold a transformed row. */ +PNG_EXPORT(111, size_t, png_get_rowbytes, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +#ifdef PNG_INFO_IMAGE_SUPPORTED +/* Returns row_pointers, which is an array of pointers to scanlines that was + * returned from png_read_png(). + */ +PNG_EXPORT(112, png_bytepp, png_get_rows, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Set row_pointers, which is an array of pointers to scanlines for use + * by png_write_png(). + */ +PNG_EXPORT(113, void, png_set_rows, + (png_const_structrp png_ptr, png_inforp info_ptr, png_bytepp row_pointers)); +#endif + +/* Returns number of color channels in image. */ +PNG_EXPORT(114, png_byte, png_get_channels, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +#ifdef PNG_EASY_ACCESS_SUPPORTED +/* Returns image width in pixels. */ +PNG_EXPORT(115, png_uint_32, png_get_image_width, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image height in pixels. */ +PNG_EXPORT(116, png_uint_32, png_get_image_height, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image bit_depth. */ +PNG_EXPORT(117, png_byte, png_get_bit_depth, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image color_type. */ +PNG_EXPORT(118, png_byte, png_get_color_type, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image filter_type. */ +PNG_EXPORT(119, png_byte, png_get_filter_type, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image interlace_type. */ +PNG_EXPORT(120, png_byte, png_get_interlace_type, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image compression_type. */ +PNG_EXPORT(121, png_byte, png_get_compression_type, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns image resolution in pixels per meter, from pHYs chunk data. */ +PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +/* Returns pixel aspect ratio, computed from pHYs chunk data. */ +PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) +PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) + +/* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ +PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(128, png_int_32, png_get_x_offset_microns, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +PNG_EXPORT(129, png_int_32, png_get_y_offset_microns, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +#endif /* EASY_ACCESS */ + +#ifdef PNG_READ_SUPPORTED +/* Returns pointer to signature string read from PNG header */ +PNG_EXPORT(130, png_const_bytep, png_get_signature, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); +#endif + +#ifdef PNG_bKGD_SUPPORTED +PNG_EXPORT(131, png_uint_32, png_get_bKGD, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_color_16p *background)); +#endif + +#ifdef PNG_bKGD_SUPPORTED +PNG_EXPORT(132, void, png_set_bKGD, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_color_16p background)); +#endif + +#ifdef PNG_cHRM_SUPPORTED +PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + double *white_x, double *white_y, + double *red_x, double *red_y, + double *green_x, double *green_y, + double *blue_x, double *blue_y)) +PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + double *red_X, double *red_Y, double *red_Z, + double *green_X, double *green_Y, double *green_Z, + double *blue_X, double *blue_Y, double *blue_Z)) +PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_fixed_point *int_white_x, png_fixed_point *int_white_y, + png_fixed_point *int_red_x, png_fixed_point *int_red_y, + png_fixed_point *int_green_x, png_fixed_point *int_green_y, + png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)) +PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_fixed_point *int_red_X, png_fixed_point *int_red_Y, + png_fixed_point *int_red_Z, + png_fixed_point *int_green_X, png_fixed_point *int_green_Y, + png_fixed_point *int_green_Z, + png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, + png_fixed_point *int_blue_Z)) +#endif + +#ifdef PNG_cHRM_SUPPORTED +PNG_FP_EXPORT(135, void, png_set_cHRM, + (png_const_structrp png_ptr, png_inforp info_ptr, + double white_x, double white_y, + double red_x, double red_y, + double green_x, double green_y, + double blue_x, double blue_y)) +PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, + (png_const_structrp png_ptr, png_inforp info_ptr, + double red_X, double red_Y, double red_Z, + double green_X, double green_Y, double green_Z, + double blue_X, double blue_Y, double blue_Z)) +PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, + png_fixed_point int_green_x, png_fixed_point int_green_y, + png_fixed_point int_blue_x, png_fixed_point int_blue_y)) +PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_fixed_point int_red_X, png_fixed_point int_red_Y, + png_fixed_point int_red_Z, + png_fixed_point int_green_X, png_fixed_point int_green_Y, + png_fixed_point int_green_Z, + png_fixed_point int_blue_X, png_fixed_point int_blue_Y, + png_fixed_point int_blue_Z)) +#endif + +#ifdef PNG_cICP_SUPPORTED +PNG_EXPORT(250, png_uint_32, png_get_cICP, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_bytep colour_primaries, png_bytep transfer_function, + png_bytep matrix_coefficients, png_bytep video_full_range_flag)); +#endif + +#ifdef PNG_cICP_SUPPORTED +PNG_EXPORT(251, void, png_set_cICP, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_byte colour_primaries, png_byte transfer_function, + png_byte matrix_coefficients, png_byte video_full_range_flag)); +#endif + +#ifdef PNG_cLLI_SUPPORTED +PNG_FP_EXPORT(252, png_uint_32, png_get_cLLI, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + double *maximum_content_light_level, + double *maximum_frame_average_light_level)) +PNG_FIXED_EXPORT(253, png_uint_32, png_get_cLLI_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + /* The values below are in cd/m2 (nits) and are scaled by 10,000; not + * 100,000 as in the case of png_fixed_point. + */ + png_uint_32p maximum_content_light_level_scaled_by_10000, + png_uint_32p maximum_frame_average_light_level_scaled_by_10000)) +#endif + +#ifdef PNG_cLLI_SUPPORTED +PNG_FP_EXPORT(254, void, png_set_cLLI, + (png_const_structrp png_ptr, png_inforp info_ptr, + double maximum_content_light_level, + double maximum_frame_average_light_level)) +PNG_FIXED_EXPORT(255, void, png_set_cLLI_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + /* The values below are in cd/m2 (nits) and are scaled by 10,000; not + * 100,000 as in the case of png_fixed_point. + */ + png_uint_32 maximum_content_light_level_scaled_by_10000, + png_uint_32 maximum_frame_average_light_level_scaled_by_10000)) +#endif + +#ifdef PNG_eXIf_SUPPORTED +PNG_EXPORT(246, png_uint_32, png_get_eXIf, + (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *exif)); +PNG_EXPORT(247, void, png_set_eXIf, + (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep exif)); + +PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_uint_32 *num_exif, png_bytep *exif)); +PNG_EXPORT(249, void, png_set_eXIf_1, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_uint_32 num_exif, png_bytep exif)); +#endif + +#ifdef PNG_gAMA_SUPPORTED +PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + double *file_gamma)) +PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_fixed_point *int_file_gamma)) +#endif + +#ifdef PNG_gAMA_SUPPORTED +PNG_FP_EXPORT(139, void, png_set_gAMA, + (png_const_structrp png_ptr, png_inforp info_ptr, + double file_gamma)) +PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_fixed_point int_file_gamma)) +#endif + +#ifdef PNG_hIST_SUPPORTED +PNG_EXPORT(141, png_uint_32, png_get_hIST, + (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_16p *hist)); +PNG_EXPORT(142, void, png_set_hIST, + (png_const_structrp png_ptr, png_inforp info_ptr, png_const_uint_16p hist)); +#endif + +PNG_EXPORT(143, png_uint_32, png_get_IHDR, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_uint_32 *width, png_uint_32 *height, + int *bit_depth, int *color_type, + int *interlace_method, int *compression_method, int *filter_method)); + +PNG_EXPORT(144, void, png_set_IHDR, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_uint_32 width, png_uint_32 height, + int bit_depth, int color_type, + int interlace_method, int compression_method, int filter_method)); + +#ifdef PNG_mDCV_SUPPORTED +PNG_FP_EXPORT(256, png_uint_32, png_get_mDCV, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + /* The chromaticities of the mastering display. As cHRM, but independent of + * the encoding endpoints in cHRM, or cICP, or iCCP. These values will + * always be in the range 0 to 1.3107. + */ + double *white_x, double *white_y, + double *red_x, double *red_y, + double *green_x, double *green_y, + double *blue_x, double *blue_y, + /* Mastering display luminance in cd/m2 (nits). */ + double *mastering_display_maximum_luminance, + double *mastering_display_minimum_luminance)) + +PNG_FIXED_EXPORT(257, png_uint_32, png_get_mDCV_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_fixed_point *int_white_x, png_fixed_point *int_white_y, + png_fixed_point *int_red_x, png_fixed_point *int_red_y, + png_fixed_point *int_green_x, png_fixed_point *int_green_y, + png_fixed_point *int_blue_x, png_fixed_point *int_blue_y, + /* Mastering display luminance in cd/m2 (nits) multiplied (scaled) by + * 10,000. + */ + png_uint_32p mastering_display_maximum_luminance_scaled_by_10000, + png_uint_32p mastering_display_minimum_luminance_scaled_by_10000)) +#endif + +#ifdef PNG_mDCV_SUPPORTED +PNG_FP_EXPORT(258, void, png_set_mDCV, + (png_const_structrp png_ptr, png_inforp info_ptr, + /* The chromaticities of the mastering display. As cHRM, but independent of + * the encoding endpoints in cHRM, or cICP, or iCCP. + */ + double white_x, double white_y, + double red_x, double red_y, + double green_x, double green_y, + double blue_x, double blue_y, + /* Mastering display luminance in cd/m2 (nits). */ + double mastering_display_maximum_luminance, + double mastering_display_minimum_luminance)) + +PNG_FIXED_EXPORT(259, void, png_set_mDCV_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + /* The admissible range of these values is not the full range of a PNG + * fixed point value. Negative values cannot be encoded and the maximum + * value is about 1.3 */ + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, + png_fixed_point int_green_x, png_fixed_point int_green_y, + png_fixed_point int_blue_x, png_fixed_point int_blue_y, + /* These are PNG unsigned 4 byte values: 31-bit unsigned values. The MSB + * must be zero. + */ + png_uint_32 mastering_display_maximum_luminance_scaled_by_10000, + png_uint_32 mastering_display_minimum_luminance_scaled_by_10000)) +#endif + +#ifdef PNG_oFFs_SUPPORTED +PNG_EXPORT(145, png_uint_32, png_get_oFFs, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)); +#endif + +#ifdef PNG_oFFs_SUPPORTED +PNG_EXPORT(146, void, png_set_oFFs, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_int_32 offset_x, png_int_32 offset_y, int unit_type)); +#endif + +#ifdef PNG_pCAL_SUPPORTED +PNG_EXPORT(147, png_uint_32, png_get_pCAL, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_charp *purpose, png_int_32 *X0, png_int_32 *X1, + int *type, int *nparams, png_charp *units, png_charpp *params)); +#endif + +#ifdef PNG_pCAL_SUPPORTED +PNG_EXPORT(148, void, png_set_pCAL, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_charp purpose, png_int_32 X0, png_int_32 X1, + int type, int nparams, png_const_charp units, png_charpp params)); +#endif + +#ifdef PNG_pHYs_SUPPORTED +PNG_EXPORT(149, png_uint_32, png_get_pHYs, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +#endif + +#ifdef PNG_pHYs_SUPPORTED +PNG_EXPORT(150, void, png_set_pHYs, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_uint_32 res_x, png_uint_32 res_y, int unit_type)); +#endif + +PNG_EXPORT(151, png_uint_32, png_get_PLTE, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_colorp *palette, int *num_palette)); + +PNG_EXPORT(152, void, png_set_PLTE, + (png_structrp png_ptr, png_inforp info_ptr, + png_const_colorp palette, int num_palette)); + +#ifdef PNG_sBIT_SUPPORTED +PNG_EXPORT(153, png_uint_32, png_get_sBIT, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_color_8p *sig_bit)); +#endif + +#ifdef PNG_sBIT_SUPPORTED +PNG_EXPORT(154, void, png_set_sBIT, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_color_8p sig_bit)); +#endif + +#ifdef PNG_sRGB_SUPPORTED +PNG_EXPORT(155, png_uint_32, png_get_sRGB, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + int *file_srgb_intent)); +#endif + +#ifdef PNG_sRGB_SUPPORTED +PNG_EXPORT(156, void, png_set_sRGB, + (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); +PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, + (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); +#endif + +#ifdef PNG_iCCP_SUPPORTED +PNG_EXPORT(158, png_uint_32, png_get_iCCP, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_charpp name, int *compression_type, + png_bytepp profile, png_uint_32 *proflen)); +#endif + +#ifdef PNG_iCCP_SUPPORTED +PNG_EXPORT(159, void, png_set_iCCP, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_charp name, int compression_type, + png_const_bytep profile, png_uint_32 proflen)); +#endif + +#ifdef PNG_sPLT_SUPPORTED +PNG_EXPORT(160, int, png_get_sPLT, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_sPLT_tpp entries)); +#endif + +#ifdef PNG_sPLT_SUPPORTED +PNG_EXPORT(161, void, png_set_sPLT, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_sPLT_tp entries, int nentries)); +#endif + +#ifdef PNG_TEXT_SUPPORTED +/* png_get_text also returns the number of text chunks in *num_text */ +PNG_EXPORT(162, int, png_get_text, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_textp *text_ptr, int *num_text)); +#endif + +/* Note while png_set_text() will accept a structure whose text, + * language, and translated keywords are NULL pointers, the structure + * returned by png_get_text will always contain regular + * zero-terminated C strings. They might be empty strings but + * they will never be NULL pointers. + */ + +#ifdef PNG_TEXT_SUPPORTED +PNG_EXPORT(163, void, png_set_text, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_textp text_ptr, int num_text)); +#endif + +#ifdef PNG_tIME_SUPPORTED +PNG_EXPORT(164, png_uint_32, png_get_tIME, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_timep *mod_time)); +#endif + +#ifdef PNG_tIME_SUPPORTED +PNG_EXPORT(165, void, png_set_tIME, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_timep mod_time)); +#endif + +#ifdef PNG_tRNS_SUPPORTED +PNG_EXPORT(166, png_uint_32, png_get_tRNS, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_bytep *trans_alpha, int *num_trans, + png_color_16p *trans_color)); +#endif + +#ifdef PNG_tRNS_SUPPORTED +PNG_EXPORT(167, void, png_set_tRNS, + (png_structrp png_ptr, png_inforp info_ptr, + png_const_bytep trans_alpha, int num_trans, + png_const_color_16p trans_color)); +#endif + +#ifdef PNG_sCAL_SUPPORTED +PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + int *unit, double *width, double *height)) +#if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \ + defined(PNG_FLOATING_POINT_SUPPORTED) +/* NOTE: this API is currently implemented using floating point arithmetic, + * consequently it can only be used on systems with floating point support. + * In any case the range of values supported by png_fixed_point is small and it + * is highly recommended that png_get_sCAL_s be used instead. + */ +PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + int *unit, png_fixed_point *width, png_fixed_point *height)) +#endif +PNG_EXPORT(169, png_uint_32, png_get_sCAL_s, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + int *unit, png_charpp swidth, png_charpp sheight)); + +PNG_FP_EXPORT(170, void, png_set_sCAL, + (png_const_structrp png_ptr, png_inforp info_ptr, + int unit, double width, double height)) +PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, + (png_const_structrp png_ptr, png_inforp info_ptr, + int unit, png_fixed_point width, png_fixed_point height)) +PNG_EXPORT(171, void, png_set_sCAL_s, + (png_const_structrp png_ptr, png_inforp info_ptr, + int unit, png_const_charp swidth, png_const_charp sheight)); +#endif /* sCAL */ + +#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED +/* Provide the default handling for all unknown chunks or, optionally, for + * specific unknown chunks. + * + * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was + * ignored and the default was used, the per-chunk setting only had an effect on + * write. If you wish to have chunk-specific handling on read in code that must + * work on earlier versions you must use a user chunk callback to specify the + * desired handling (keep or discard.) + * + * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below. The + * parameter is interpreted as follows: + * + * READ: + * PNG_HANDLE_CHUNK_AS_DEFAULT: + * Known chunks: do normal libpng processing, do not keep the chunk (but + * see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED) + * Unknown chunks: for a specific chunk use the global default, when used + * as the default discard the chunk data. + * PNG_HANDLE_CHUNK_NEVER: + * Discard the chunk data. + * PNG_HANDLE_CHUNK_IF_SAFE: + * Keep the chunk data if the chunk is not critical else raise a chunk + * error. + * PNG_HANDLE_CHUNK_ALWAYS: + * Keep the chunk data. + * + * If the chunk data is saved it can be retrieved using png_get_unknown_chunks, + * below. Notice that specifying "AS_DEFAULT" as a global default is equivalent + * to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks + * it simply resets the behavior to the libpng default. + * + * INTERACTION WITH USER CHUNK CALLBACKS: + * The per-chunk handling is always used when there is a png_user_chunk_ptr + * callback and the callback returns 0; the chunk is then always stored *unless* + * it is critical and the per-chunk setting is other than ALWAYS. Notice that + * the global default is *not* used in this case. (In effect the per-chunk + * value is incremented to at least IF_SAFE.) + * + * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and + * per-chunk defaults will be honored. If you want to preserve the current + * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE + * as the default - if you don't do this libpng 1.6 will issue a warning. + * + * If you want unhandled unknown chunks to be discarded in libpng 1.6 and + * earlier simply return '1' (handled). + * + * PNG_HANDLE_AS_UNKNOWN_SUPPORTED: + * If this is *not* set known chunks will always be handled by libpng and + * will never be stored in the unknown chunk list. Known chunks listed to + * png_set_keep_unknown_chunks will have no effect. If it is set then known + * chunks listed with a keep other than AS_DEFAULT will *never* be processed + * by libpng, in addition critical chunks must either be processed by the + * callback or saved. + * + * The IHDR and IEND chunks must not be listed. Because this turns off the + * default handling for chunks that would otherwise be recognized the + * behavior of libpng transformations may well become incorrect! + * + * WRITE: + * When writing chunks the options only apply to the chunks specified by + * png_set_unknown_chunks (below), libpng will *always* write known chunks + * required by png_set_ calls and will always write the core critical chunks + * (as required for PLTE). + * + * Each chunk in the png_set_unknown_chunks list is looked up in the + * png_set_keep_unknown_chunks list to find the keep setting, this is then + * interpreted as follows: + * + * PNG_HANDLE_CHUNK_AS_DEFAULT: + * Write safe-to-copy chunks and write other chunks if the global + * default is set to _ALWAYS, otherwise don't write this chunk. + * PNG_HANDLE_CHUNK_NEVER: + * Do not write the chunk. + * PNG_HANDLE_CHUNK_IF_SAFE: + * Write the chunk if it is safe-to-copy, otherwise do not write it. + * PNG_HANDLE_CHUNK_ALWAYS: + * Write the chunk. + * + * Note that the default behavior is effectively the opposite of the read case - + * in read unknown chunks are not stored by default, in write they are written + * by default. Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different + * - on write the safe-to-copy bit is checked, on read the critical bit is + * checked and on read if the chunk is critical an error will be raised. + * + * num_chunks: + * =========== + * If num_chunks is positive, then the "keep" parameter specifies the manner + * for handling only those chunks appearing in the chunk_list array, + * otherwise the chunk list array is ignored. + * + * If num_chunks is 0 the "keep" parameter specifies the default behavior for + * unknown chunks, as described above. + * + * If num_chunks is negative, then the "keep" parameter specifies the manner + * for handling all unknown chunks plus all chunks recognized by libpng + * except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to + * be processed by libpng. + */ +#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED +PNG_EXPORT(172, void, png_set_keep_unknown_chunks, + (png_structrp png_ptr, + int keep, png_const_bytep chunk_list, int num_chunks)); +#endif /* HANDLE_AS_UNKNOWN */ + +/* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned; + * the result is therefore true (non-zero) if special handling is required, + * false for the default handling. + */ +PNG_EXPORT(173, int, png_handle_as_unknown, + (png_const_structrp png_ptr, png_const_bytep chunk_name)); +#endif /* SET_UNKNOWN_CHUNKS */ + +#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED +PNG_EXPORT(174, void, png_set_unknown_chunks, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_const_unknown_chunkp unknowns, int num_unknowns)); + /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added + * unknowns to the location currently stored in the png_struct. This is + * invariably the wrong value on write. To fix this call the following API + * for each chunk in the list with the correct location. If you know your + * code won't be compiled on earlier versions you can rely on + * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing + * the correct thing. + */ + +PNG_EXPORT(175, void, png_set_unknown_chunk_location, + (png_const_structrp png_ptr, png_inforp info_ptr, + int chunk, int location)); + +PNG_EXPORT(176, int, png_get_unknown_chunks, + (png_const_structrp png_ptr, png_inforp info_ptr, + png_unknown_chunkpp entries)); +#endif + +/* Png_free_data() will turn off the "valid" flag for anything it frees. + * If you need to turn it off for a chunk that your application has freed, + * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); + */ +PNG_EXPORT(177, void, png_set_invalid, + (png_const_structrp png_ptr, png_inforp info_ptr, int mask)); + +#ifdef PNG_INFO_IMAGE_SUPPORTED +/* The "params" pointer is currently not used and is for future expansion. */ +#ifdef PNG_SEQUENTIAL_READ_SUPPORTED +PNG_EXPORT(178, void, png_read_png, + (png_structrp png_ptr, png_inforp info_ptr, + int transforms, png_voidp params)); +#endif +#ifdef PNG_WRITE_SUPPORTED +PNG_EXPORT(179, void, png_write_png, + (png_structrp png_ptr, png_inforp info_ptr, + int transforms, png_voidp params)); +#endif +#endif + +PNG_EXPORT(180, png_const_charp, png_get_copyright, + (png_const_structrp png_ptr)); +PNG_EXPORT(181, png_const_charp, png_get_header_ver, + (png_const_structrp png_ptr)); +PNG_EXPORT(182, png_const_charp, png_get_header_version, + (png_const_structrp png_ptr)); +PNG_EXPORT(183, png_const_charp, png_get_libpng_ver, + (png_const_structrp png_ptr)); + +#ifdef PNG_MNG_FEATURES_SUPPORTED +PNG_EXPORT(184, png_uint_32, png_permit_mng_features, + (png_structrp png_ptr, png_uint_32 mng_features_permitted)); +#endif + +/* For use in png_set_keep_unknown, added to version 1.2.6 */ +#define PNG_HANDLE_CHUNK_AS_DEFAULT 0 +#define PNG_HANDLE_CHUNK_NEVER 1 +#define PNG_HANDLE_CHUNK_IF_SAFE 2 +#define PNG_HANDLE_CHUNK_ALWAYS 3 +#define PNG_HANDLE_CHUNK_LAST 4 + +/* Strip the prepended error numbers ("#nnn ") from error and warning + * messages before passing them to the error or warning handler. + */ +#ifdef PNG_ERROR_NUMBERS_SUPPORTED +PNG_EXPORT(185, void, png_set_strip_error_numbers, + (png_structrp png_ptr, png_uint_32 strip_mode)); +#endif + +/* Added in libpng-1.2.6 */ +#ifdef PNG_SET_USER_LIMITS_SUPPORTED +PNG_EXPORT(186, void, png_set_user_limits, + (png_structrp png_ptr, + png_uint_32 user_width_max, png_uint_32 user_height_max)); +PNG_EXPORT(187, png_uint_32, png_get_user_width_max, + (png_const_structrp png_ptr)); +PNG_EXPORT(188, png_uint_32, png_get_user_height_max, + (png_const_structrp png_ptr)); +/* Added in libpng-1.4.0 */ +PNG_EXPORT(189, void, png_set_chunk_cache_max, + (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)); +PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max, + (png_const_structrp png_ptr)); +/* Added in libpng-1.4.1 */ +PNG_EXPORT(191, void, png_set_chunk_malloc_max, + (png_structrp png_ptr, png_alloc_size_t user_chunk_cache_max)); +PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max, + (png_const_structrp png_ptr)); +#endif + +#if defined(PNG_INCH_CONVERSIONS_SUPPORTED) +PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch, + (png_const_structrp png_ptr, png_const_inforp info_ptr)); + +PNG_FP_EXPORT(196, float, png_get_x_offset_inches, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) +#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ +PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) +#endif + +PNG_FP_EXPORT(197, float, png_get_y_offset_inches, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) +#ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ +PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed, + (png_const_structrp png_ptr, png_const_inforp info_ptr)) +#endif + +# ifdef PNG_pHYs_SUPPORTED +PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, + (png_const_structrp png_ptr, png_const_inforp info_ptr, + png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +# endif /* pHYs */ +#endif /* INCH_CONVERSIONS */ + +/* Added in libpng-1.4.0 */ +#ifdef PNG_IO_STATE_SUPPORTED +PNG_EXPORT(199, png_uint_32, png_get_io_state, + (png_const_structrp png_ptr)); + +/* Removed from libpng 1.6; use png_get_io_chunk_type. */ +PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, + (png_structrp png_ptr), + PNG_DEPRECATED) + +PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, + (png_const_structrp png_ptr)); + +/* The flags returned by png_get_io_state() are the following: */ +# define PNG_IO_NONE 0x0000 /* no I/O at this moment */ +# define PNG_IO_READING 0x0001 /* currently reading */ +# define PNG_IO_WRITING 0x0002 /* currently writing */ +# define PNG_IO_SIGNATURE 0x0010 /* currently at the file signature */ +# define PNG_IO_CHUNK_HDR 0x0020 /* currently at the chunk header */ +# define PNG_IO_CHUNK_DATA 0x0040 /* currently at the chunk data */ +# define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */ +# define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */ +# define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */ +#endif /* IO_STATE */ + +/* Interlace support. The following macros are always defined so that if + * libpng interlace handling is turned off the macros may be used to handle + * interlaced images within the application. + */ +#define PNG_INTERLACE_ADAM7_PASSES 7 + +/* Two macros to return the first row and first column of the original, + * full, image which appears in a given pass. 'pass' is in the range 0 + * to 6 and the result is in the range 0 to 7. + */ +#define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7) +#define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7) + +/* A macro to return the offset between pixels in the output row for a pair of + * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that + * follows. Note that ROW_OFFSET is the offset from one row to the next whereas + * COL_OFFSET is from one column to the next, within a row. + */ +#define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8) +#define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1)) + +/* Two macros to help evaluate the number of rows or columns in each + * pass. This is expressed as a shift - effectively log2 of the number or + * rows or columns in each 8x8 tile of the original image. + */ +#define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) +#define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) + +/* Hence two macros to determine the number of rows or columns in a given + * pass of an image given its height or width. In fact these macros may + * return non-zero even though the sub-image is empty, because the other + * dimension may be empty for a small image. + */ +#define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) +#define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) + +/* For the reader row callbacks (both progressive and sequential) it is + * necessary to find the row in the output image given a row in an interlaced + * image, so two more macros: + */ +#define PNG_ROW_FROM_PASS_ROW(y_in, pass) \ + (((y_in)<>(((7-(off))-(pass))<<2)) & 0xF) | \ + ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0)) + +#define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ + ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) +#define PNG_COL_IN_INTERLACE_PASS(x, pass) \ + ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) + +#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED +/* With these routines we avoid an integer divide, which will be slower on + * most machines. However, it does take more operations than the corresponding + * divide method, so it may be slower on a few RISC systems. There are two + * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. + * + * Note that the rounding factors are NOT supposed to be the same! 128 and + * 32768 are correct for the NODIV code; 127 and 32767 are correct for the + * standard method. + * + * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] + */ + + /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ + +# define png_composite(composite, fg, alpha, bg) \ + { \ + png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ + * (png_uint_16)(alpha) \ + + (png_uint_16)(bg)*(png_uint_16)(255 \ + - (png_uint_16)(alpha)) + 128); \ + (composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); \ + } + +# define png_composite_16(composite, fg, alpha, bg) \ + { \ + png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ + * (png_uint_32)(alpha) \ + + (png_uint_32)(bg)*(65535 \ + - (png_uint_32)(alpha)) + 32768); \ + (composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); \ + } + +#else /* Standard method using integer division */ + +# define png_composite(composite, fg, alpha, bg) \ + (composite) = \ + (png_byte)(0xff & (((png_uint_16)(fg) * (png_uint_16)(alpha) + \ + (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ + 127) / 255)) + +# define png_composite_16(composite, fg, alpha, bg) \ + (composite) = \ + (png_uint_16)(0xffff & (((png_uint_32)(fg) * (png_uint_32)(alpha) + \ + (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ + 32767) / 65535)) +#endif /* READ_COMPOSITE_NODIV */ + +#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED +PNG_EXPORT(201, png_uint_32, png_get_uint_32, + (png_const_bytep buf)); +PNG_EXPORT(202, png_uint_16, png_get_uint_16, + (png_const_bytep buf)); +PNG_EXPORT(203, png_int_32, png_get_int_32, + (png_const_bytep buf)); +#endif + +PNG_EXPORT(204, png_uint_32, png_get_uint_31, + (png_const_structrp png_ptr, png_const_bytep buf)); +/* No png_get_int_16 -- may be added if there's a real need for it. */ + +/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */ +#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED +PNG_EXPORT(205, void, png_save_uint_32, + (png_bytep buf, png_uint_32 i)); +#endif +#ifdef PNG_SAVE_INT_32_SUPPORTED +PNG_EXPORT(206, void, png_save_int_32, + (png_bytep buf, png_int_32 i)); +#endif + +/* Place a 16-bit number into a buffer in PNG byte order. + * The parameter is declared unsigned int, not png_uint_16, + * just to avoid potential problems on pre-ANSI C compilers. + */ +#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED +PNG_EXPORT(207, void, png_save_uint_16, + (png_bytep buf, unsigned int i)); +/* No png_save_int_16 -- may be added if there's a real need for it. */ +#endif + +#ifdef PNG_USE_READ_MACROS +/* Inline macros to do direct reads of bytes from the input buffer. + * The png_get_int_32() routine assumes we are using two's complement + * format for negative values, which is almost certainly true. + */ +# define PNG_get_uint_32(buf) \ + (((png_uint_32)(*(buf)) << 24) + \ + ((png_uint_32)(*((buf) + 1)) << 16) + \ + ((png_uint_32)(*((buf) + 2)) << 8) + \ + ((png_uint_32)(*((buf) + 3)))) + + /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the + * function) incorrectly returned a value of type png_uint_32. + */ +# define PNG_get_uint_16(buf) \ + ((png_uint_16) \ + (((unsigned int)(*(buf)) << 8) + \ + ((unsigned int)(*((buf) + 1))))) + +# define PNG_get_int_32(buf) \ + ((png_int_32)((*(buf) & 0x80) \ + ? -((png_int_32)(((png_get_uint_32(buf)^0xffffffffU)+1U)&0x7fffffffU)) \ + : (png_int_32)png_get_uint_32(buf))) + +/* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, + * but defining a macro name prefixed with PNG_PREFIX. + */ +# ifndef PNG_PREFIX +# define png_get_uint_32(buf) PNG_get_uint_32(buf) +# define png_get_uint_16(buf) PNG_get_uint_16(buf) +# define png_get_int_32(buf) PNG_get_int_32(buf) +# endif +#else +# ifdef PNG_PREFIX + /* No macros; revert to the (redefined) function */ +# define PNG_get_uint_32 (png_get_uint_32) +# define PNG_get_uint_16 (png_get_uint_16) +# define PNG_get_int_32 (png_get_int_32) +# endif +#endif + +#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED +PNG_EXPORT(242, void, png_set_check_for_invalid_index, + (png_structrp png_ptr, int allowed)); +# ifdef PNG_GET_PALETTE_MAX_SUPPORTED +PNG_EXPORT(243, int, png_get_palette_max, + (png_const_structp png_ptr, png_const_infop info_ptr)); +# endif +#endif /* CHECK_FOR_INVALID_INDEX */ + +/******************************************************************************* + * Section 5: SIMPLIFIED API + ******************************************************************************* + * + * Please read the documentation in libpng-manual.txt (TODO: write said + * documentation) if you don't understand what follows. + * + * The simplified API hides the details of both libpng and the PNG file format + * itself. It allows PNG files to be read into a very limited number of + * in-memory bitmap formats or to be written from the same formats. If these + * formats do not accommodate your needs then you can, and should, use the more + * sophisticated APIs above - these support a wide variety of in-memory formats + * and a wide variety of sophisticated transformations to those formats as well + * as a wide variety of APIs to manipulate ancillary information. + * + * To read a PNG file using the simplified API: + * + * 1) Declare a 'png_image' structure (see below) on the stack, set the + * version field to PNG_IMAGE_VERSION and the 'opaque' pointer to NULL + * (this is REQUIRED, your program may crash if you don't do it.) + * 2) Call the appropriate png_image_begin_read... function. + * 3) Set the png_image 'format' member to the required sample format. + * 4) Allocate a buffer for the image and, if required, the color-map. + * 5) Call png_image_finish_read to read the image and, if required, the + * color-map into your buffers. + * + * There are no restrictions on the format of the PNG input itself; all valid + * color types, bit depths, and interlace methods are acceptable, and the + * input image is transformed as necessary to the requested in-memory format + * during the png_image_finish_read() step. The only caveat is that if you + * request a color-mapped image from a PNG that is full-color or makes + * complex use of an alpha channel the transformation is extremely lossy and the + * result may look terrible. + * + * To write a PNG file using the simplified API: + * + * 1) Declare a 'png_image' structure on the stack and memset() it to all zero. + * 2) Initialize the members of the structure that describe the image, setting + * the 'format' member to the format of the image samples. + * 3) Call the appropriate png_image_write... function with a pointer to the + * image and, if necessary, the color-map to write the PNG data. + * + * png_image is a structure that describes the in-memory format of an image + * when it is being read or defines the in-memory format of an image that you + * need to write: + */ +#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \ + defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) + +#define PNG_IMAGE_VERSION 1 + +typedef struct png_control *png_controlp; +typedef struct +{ + png_controlp opaque; /* Initialize to NULL, free with png_image_free */ + png_uint_32 version; /* Set to PNG_IMAGE_VERSION */ + png_uint_32 width; /* Image width in pixels (columns) */ + png_uint_32 height; /* Image height in pixels (rows) */ + png_uint_32 format; /* Image format as defined below */ + png_uint_32 flags; /* A bit mask containing informational flags */ + png_uint_32 colormap_entries; + /* Number of entries in the color-map */ + + /* In the event of an error or warning the following field will be set to a + * non-zero value and the 'message' field will contain a '\0' terminated + * string with the libpng error or warning message. If both warnings and + * an error were encountered, only the error is recorded. If there + * are multiple warnings, only the first one is recorded. + * + * The upper 30 bits of this value are reserved, the low two bits contain + * a value as follows: + */ +# define PNG_IMAGE_WARNING 1 +# define PNG_IMAGE_ERROR 2 + /* + * The result is a two-bit code such that a value more than 1 indicates + * a failure in the API just called: + * + * 0 - no warning or error + * 1 - warning + * 2 - error + * 3 - error preceded by warning + */ +# define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1) + + png_uint_32 warning_or_error; + + char message[64]; +} png_image, *png_imagep; + +/* The samples of the image have one to four channels whose components have + * original values in the range 0 to 1.0: + * + * 1: A single gray or luminance channel (G). + * 2: A gray/luminance channel and an alpha channel (GA). + * 3: Three red, green, blue color channels (RGB). + * 4: Three color channels and an alpha channel (RGBA). + * + * The components are encoded in one of two ways: + * + * a) As a small integer, value 0..255, contained in a single byte. For the + * alpha channel the original value is simply value/255. For the color or + * luminance channels the value is encoded according to the sRGB specification + * and matches the 8-bit format expected by typical display devices. + * + * The color/gray channels are not scaled (pre-multiplied) by the alpha + * channel and are suitable for passing to color management software. + * + * b) As a value in the range 0..65535, contained in a 2-byte integer. All + * channels can be converted to the original value by dividing by 65535; all + * channels are linear. Color channels use the RGB encoding (RGB end-points) of + * the sRGB specification. This encoding is identified by the + * PNG_FORMAT_FLAG_LINEAR flag below. + * + * When the simplified API needs to convert between sRGB and linear colorspaces, + * the actual sRGB transfer curve defined in the sRGB specification (see the + * article at ) is used, not the gamma=1/2.2 + * approximation used elsewhere in libpng. + * + * When an alpha channel is present it is expected to denote pixel coverage + * of the color or luminance channels and is returned as an associated alpha + * channel: the color/gray channels are scaled (pre-multiplied) by the alpha + * value. + * + * The samples are either contained directly in the image data, between 1 and 8 + * bytes per pixel according to the encoding, or are held in a color-map indexed + * by bytes in the image data. In the case of a color-map the color-map entries + * are individual samples, encoded as above, and the image data has one byte per + * pixel to select the relevant sample from the color-map. + */ + +/* PNG_FORMAT_* + * + * #defines to be used in png_image::format. Each #define identifies a + * particular layout of sample data and, if present, alpha values. There are + * separate defines for each of the two component encodings. + * + * A format is built up using single bit flag values. All combinations are + * valid. Formats can be built up from the flag values or you can use one of + * the predefined values below. When testing formats always use the FORMAT_FLAG + * macros to test for individual features - future versions of the library may + * add new flags. + * + * When reading or writing color-mapped images the format should be set to the + * format of the entries in the color-map then png_image_{read,write}_colormap + * called to read or write the color-map and set the format correctly for the + * image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! + * + * NOTE: libpng can be built with particular features disabled. If you see + * compiler errors because the definition of one of the following flags has been + * compiled out it is because libpng does not have the required support. It is + * possible, however, for the libpng configuration to enable the format on just + * read or just write; in that case you may see an error at run time. You can + * guard against this by checking for the definition of the appropriate + * "_SUPPORTED" macro, one of: + * + * PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED + */ +#define PNG_FORMAT_FLAG_ALPHA 0x01U /* format with an alpha channel */ +#define PNG_FORMAT_FLAG_COLOR 0x02U /* color format: otherwise grayscale */ +#define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2-byte channels else 1-byte */ +#define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */ + +#ifdef PNG_FORMAT_BGR_SUPPORTED +# define PNG_FORMAT_FLAG_BGR 0x10U /* BGR colors, else order is RGB */ +#endif + +#ifdef PNG_FORMAT_AFIRST_SUPPORTED +# define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */ +#endif + +#define PNG_FORMAT_FLAG_ASSOCIATED_ALPHA 0x40U /* alpha channel is associated */ + +/* Commonly used formats have predefined macros. + * + * First the single byte (sRGB) formats: + */ +#define PNG_FORMAT_GRAY 0 +#define PNG_FORMAT_GA PNG_FORMAT_FLAG_ALPHA +#define PNG_FORMAT_AG (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST) +#define PNG_FORMAT_RGB PNG_FORMAT_FLAG_COLOR +#define PNG_FORMAT_BGR (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR) +#define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA) +#define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST) +#define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA) +#define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST) + +/* Then the linear 2-byte formats. When naming these "Y" is used to + * indicate a luminance (gray) channel. + */ +#define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR +#define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA) +#define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR) +#define PNG_FORMAT_LINEAR_RGB_ALPHA \ + (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA) + +/* With color-mapped formats the image data is one byte for each pixel, the byte + * is an index into the color-map which is formatted as above. To obtain a + * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP + * to one of the above definitions, or you can use one of the definitions below. + */ +#define PNG_FORMAT_RGB_COLORMAP (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP) +#define PNG_FORMAT_BGR_COLORMAP (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP) +#define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP) +#define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP) +#define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP) +#define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP) + +/* PNG_IMAGE macros + * + * These are convenience macros to derive information from a png_image + * structure. The PNG_IMAGE_SAMPLE_ macros return values appropriate to the + * actual image sample values - either the entries in the color-map or the + * pixels in the image. The PNG_IMAGE_PIXEL_ macros return corresponding values + * for the pixels and will always return 1 for color-mapped formats. The + * remaining macros return information about the rows in the image and the + * complete image. + * + * NOTE: All the macros that take a png_image::format parameter are compile time + * constants if the format parameter is, itself, a constant. Therefore these + * macros can be used in array declarations and case labels where required. + * Similarly the macros are also pre-processor constants (sizeof is not used) so + * they can be used in #if tests. + * + * First the information about the samples. + */ +#define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\ + (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1) + /* Return the total number of channels in a given format: 1..4 */ + +#define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\ + ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1) + /* Return the size in bytes of a single component of a pixel or color-map + * entry (as appropriate) in the image: 1 or 2. + */ + +#define PNG_IMAGE_SAMPLE_SIZE(fmt)\ + (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)) + /* This is the size of the sample data for one sample. If the image is + * color-mapped it is the size of one color-map entry (and image pixels are + * one byte in size), otherwise it is the size of one image pixel. + */ + +#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\ + (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256) + /* The maximum size of the color-map required by the format expressed in a + * count of components. This can be used to compile-time allocate a + * color-map: + * + * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)]; + * + * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)]; + * + * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the + * information from one of the png_image_begin_read_ APIs and dynamically + * allocate the required memory. + */ + +/* Corresponding information about the pixels */ +#define PNG_IMAGE_PIXEL_(test,fmt)\ + (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt)) + +#define PNG_IMAGE_PIXEL_CHANNELS(fmt)\ + PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt) + /* The number of separate channels (components) in a pixel; 1 for a + * color-mapped image. + */ + +#define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\ + PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt) + /* The size, in bytes, of each component in a pixel; 1 for a color-mapped + * image. + */ + +#define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt) + /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */ + +/* Information about the whole row, or whole image */ +#define PNG_IMAGE_ROW_STRIDE(image)\ + (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width) + /* Return the total number of components in a single row of the image; this + * is the minimum 'row stride', the minimum count of components between each + * row. For a color-mapped image this is the minimum number of bytes in a + * row. + * + * WARNING: this macro overflows for some images with more than one component + * and very large image widths. libpng will refuse to process an image where + * this macro would overflow. + */ + +#define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\ + (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride)) + /* Return the size, in bytes, of an image buffer given a png_image and a row + * stride - the number of components to leave space for in each row. + * + * WARNING: this macro overflows a 32-bit integer for some large PNG images, + * libpng will refuse to process an image where such an overflow would occur. + */ + +#define PNG_IMAGE_SIZE(image)\ + PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image)) + /* Return the size, in bytes, of the image in memory given just a png_image; + * the row stride is the minimum stride required for the image. + */ + +#define PNG_IMAGE_COLORMAP_SIZE(image)\ + (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries) + /* Return the size, in bytes, of the color-map of this image. If the image + * format is not a color-map format this will return a size sufficient for + * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if + * you don't want to allocate a color-map in this case. + */ + +/* PNG_IMAGE_FLAG_* + * + * Flags containing additional information about the image are held in the + * 'flags' field of png_image. + */ +#define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01 + /* This indicates that the RGB values of the in-memory bitmap do not + * correspond to the red, green and blue end-points defined by sRGB. + */ + +#define PNG_IMAGE_FLAG_FAST 0x02 + /* On write emphasise speed over compression; the resultant PNG file will be + * larger but will be produced significantly faster, particular for large + * images. Do not use this option for images which will be distributed, only + * used it when producing intermediate files that will be read back in + * repeatedly. For a typical 24-bit image the option will double the read + * speed at the cost of increasing the image size by 25%, however for many + * more compressible images the PNG file can be 10 times larger with only a + * slight speed gain. + */ + +#define PNG_IMAGE_FLAG_16BIT_sRGB 0x04 + /* On read if the image is a 16-bit per component image and there is no gAMA + * or sRGB chunk assume that the components are sRGB encoded. Notice that + * images output by the simplified API always have gamma information; setting + * this flag only affects the interpretation of 16-bit images from an + * external source. It is recommended that the application expose this flag + * to the user; the user can normally easily recognize the difference between + * linear and sRGB encoding. This flag has no effect on write - the data + * passed to the write APIs must have the correct encoding (as defined + * above.) + * + * If the flag is not set (the default) input 16-bit per component data is + * assumed to be linear. + * + * NOTE: the flag can only be set after the png_image_begin_read_ call, + * because that call initializes the 'flags' field. + */ + +#ifdef PNG_SIMPLIFIED_READ_SUPPORTED +/* READ APIs + * --------- + * + * The png_image passed to the read APIs must have been initialized by setting + * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.) + */ +#ifdef PNG_STDIO_SUPPORTED +PNG_EXPORT(234, int, png_image_begin_read_from_file, + (png_imagep image, const char *file_name)); + /* The named file is opened for read and the image header is filled in + * from the PNG header in the file. + */ + +PNG_EXPORT(235, int, png_image_begin_read_from_stdio, + (png_imagep image, FILE *file)); + /* The PNG header is read from the stdio FILE object. */ +#endif /* STDIO */ + +PNG_EXPORT(236, int, png_image_begin_read_from_memory, + (png_imagep image, png_const_voidp memory, size_t size)); + /* The PNG header is read from the given memory buffer. */ + +PNG_EXPORT(237, int, png_image_finish_read, + (png_imagep image, + png_const_colorp background, void *buffer, png_int_32 row_stride, + void *colormap)); + /* Finish reading the image into the supplied buffer and clean up the + * png_image structure. + * + * row_stride is the step, in byte or 2-byte units as appropriate, + * between adjacent rows. A positive stride indicates that the top-most row + * is first in the buffer - the normal top-down arrangement. A negative + * stride indicates that the bottom-most row is first in the buffer. + * + * background need only be supplied if an alpha channel must be removed from + * a png_byte format and the removal is to be done by compositing on a solid + * color; otherwise it may be NULL and any composition will be done directly + * onto the buffer. The value is an sRGB color to use for the background, + * for grayscale output the green channel is used. + * + * background must be supplied when an alpha channel must be removed from a + * single byte color-mapped output format, in other words if: + * + * 1) The original format from png_image_begin_read_from_* had + * PNG_FORMAT_FLAG_ALPHA set. + * 2) The format set by the application does not. + * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and + * PNG_FORMAT_FLAG_LINEAR *not* set. + * + * For linear output removing the alpha channel is always done by compositing + * on black and background is ignored. + * + * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set. It must + * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE. + * image->colormap_entries will be updated to the actual number of entries + * written to the colormap; this may be less than the original value. + */ + +PNG_EXPORT(238, void, png_image_free, + (png_imagep image)); + /* Free any data allocated by libpng in image->opaque, setting the pointer to + * NULL. May be called at any time after the structure is initialized. + */ +#endif /* SIMPLIFIED_READ */ + +#ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED +/* WRITE APIS + * ---------- + * For write you must initialize a png_image structure to describe the image to + * be written. To do this use memset to set the whole structure to 0 then + * initialize fields describing your image. + * + * version: must be set to PNG_IMAGE_VERSION + * opaque: must be initialized to NULL + * width: image width in pixels + * height: image height in rows + * format: the format of the data (image and color-map) you wish to write + * flags: set to 0 unless one of the defined flags applies; set + * PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB + * values do not correspond to the colors in sRGB. + * colormap_entries: set to the number of entries in the color-map (0 to 256) + */ +#ifdef PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED +PNG_EXPORT(239, int, png_image_write_to_file, + (png_imagep image, + const char *file, int convert_to_8bit, const void *buffer, + png_int_32 row_stride, const void *colormap)); + /* Write the image to the named file. */ + +PNG_EXPORT(240, int, png_image_write_to_stdio, + (png_imagep image, + FILE *file, int convert_to_8_bit, const void *buffer, + png_int_32 row_stride, const void *colormap)); + /* Write the image to the given FILE object. */ +#endif /* SIMPLIFIED_WRITE_STDIO */ + +/* With all write APIs if image is in one of the linear formats with 16-bit + * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG + * gamma encoded according to the sRGB specification, otherwise a 16-bit linear + * encoded PNG file is written. + * + * With color-mapped data formats the colormap parameter point to a color-map + * with at least image->colormap_entries encoded in the specified format. If + * the format is linear the written PNG color-map will be converted to sRGB + * regardless of the convert_to_8_bit flag. + * + * With all APIs row_stride is handled as in the read APIs - it is the spacing + * from one row to the next in component sized units (1 or 2 bytes) and if + * negative indicates a bottom-up row layout in the buffer. If row_stride is + * zero, libpng will calculate it for you from the image width and number of + * channels. + * + * Note that the write API does not support interlacing, sub-8-bit pixels or + * most ancillary chunks. If you need to write text chunks (e.g. for copyright + * notices) you need to use one of the other APIs. + */ + +PNG_EXPORT(245, int, png_image_write_to_memory, + (png_imagep image, + void *memory, png_alloc_size_t * PNG_RESTRICT memory_bytes, + int convert_to_8_bit, + const void *buffer, png_int_32 row_stride, const void *colormap)); + /* Write the image to the given memory buffer. The function both writes the + * whole PNG data stream to *memory and updates *memory_bytes with the count + * of bytes written. + * + * 'memory' may be NULL. In this case *memory_bytes is not read however on + * success the number of bytes which would have been written will still be + * stored in *memory_bytes. On failure *memory_bytes will contain 0. + * + * If 'memory' is not NULL it must point to memory[*memory_bytes] of + * writeable memory. + * + * If the function returns success memory[*memory_bytes] (if 'memory' is not + * NULL) contains the written PNG data. *memory_bytes will always be less + * than or equal to the original value. + * + * If the function returns false and *memory_bytes was not changed an error + * occurred during write. If *memory_bytes was changed, or is not 0 if + * 'memory' was NULL, the write would have succeeded but for the memory + * buffer being too small. *memory_bytes contains the required number of + * bytes and will be bigger that the original value. + */ + +#define png_image_write_get_memory_size(image, size, convert_to_8_bit, buffer,\ + row_stride, colormap)\ + png_image_write_to_memory(&(image), 0, &(size), convert_to_8_bit, buffer,\ + row_stride, colormap) + /* Return the amount of memory in 'size' required to compress this image. + * The png_image structure 'image' must be filled in as in the above + * function and must not be changed before the actual write call, the buffer + * and all other parameters must also be identical to that in the final + * write call. The 'size' variable need not be initialized. + * + * NOTE: the macro returns true/false, if false is returned 'size' will be + * set to zero and the write failed and probably will fail if tried again. + */ + +/* You can pre-allocate the buffer by making sure it is of sufficient size + * regardless of the amount of compression achieved. The buffer size will + * always be bigger than the original image and it will never be filled. The + * following macros are provided to assist in allocating the buffer. + */ +#define PNG_IMAGE_DATA_SIZE(image) (PNG_IMAGE_SIZE(image)+(image).height) + /* The number of uncompressed bytes in the PNG byte encoding of the image; + * uncompressing the PNG IDAT data will give this number of bytes. + * + * NOTE: while PNG_IMAGE_SIZE cannot overflow for an image in memory this + * macro can because of the extra bytes used in the PNG byte encoding. You + * need to avoid this macro if your image size approaches 2^30 in width or + * height. The same goes for the remainder of these macros; they all produce + * bigger numbers than the actual in-memory image size. + */ +#ifndef PNG_ZLIB_MAX_SIZE +# define PNG_ZLIB_MAX_SIZE(b) ((b)+(((b)+7U)>>3)+(((b)+63U)>>6)+11U) + /* An upper bound on the number of compressed bytes given 'b' uncompressed + * bytes. This is based on deflateBounds() in zlib; different + * implementations of zlib compression may conceivably produce more data so + * if your zlib implementation is not zlib itself redefine this macro + * appropriately. + */ +#endif + +#define PNG_IMAGE_COMPRESSED_SIZE_MAX(image)\ + PNG_ZLIB_MAX_SIZE((png_alloc_size_t)PNG_IMAGE_DATA_SIZE(image)) + /* An upper bound on the size of the data in the PNG IDAT chunks. */ + +#define PNG_IMAGE_PNG_SIZE_MAX_(image, image_size)\ + ((8U/*sig*/+25U/*IHDR*/+16U/*gAMA*/+44U/*cHRM*/+12U/*IEND*/+\ + (((image).format&PNG_FORMAT_FLAG_COLORMAP)?/*colormap: PLTE, tRNS*/\ + 12U+3U*(image).colormap_entries/*PLTE data*/+\ + (((image).format&PNG_FORMAT_FLAG_ALPHA)?\ + 12U/*tRNS*/+(image).colormap_entries:0U):0U)+\ + 12U)+(12U*((image_size)/PNG_ZBUF_SIZE))/*IDAT*/+(image_size)) + /* A helper for the following macro; if your compiler cannot handle the + * following macro use this one with the result of + * PNG_IMAGE_COMPRESSED_SIZE_MAX(image) as the second argument (most + * compilers should handle this just fine.) + */ + +#define PNG_IMAGE_PNG_SIZE_MAX(image)\ + PNG_IMAGE_PNG_SIZE_MAX_(image, PNG_IMAGE_COMPRESSED_SIZE_MAX(image)) + /* An upper bound on the total length of the PNG data stream for 'image'. + * The result is of type png_alloc_size_t, on 32-bit systems this may + * overflow even though PNG_IMAGE_DATA_SIZE does not overflow; the write will + * run out of buffer space but return a corrected size which should work. + */ +#endif /* SIMPLIFIED_WRITE */ +/******************************************************************************* + * END OF SIMPLIFIED API + ******************************************************************************/ +#endif /* SIMPLIFIED_{READ|WRITE} */ + +/******************************************************************************* + * Section 6: IMPLEMENTATION OPTIONS + ******************************************************************************* + * + * Support for arbitrary implementation-specific optimizations. The API allows + * particular options to be turned on or off. 'Option' is the number of the + * option and 'onoff' is 0 (off) or non-0 (on). The value returned is given + * by the PNG_OPTION_ defines below. + * + * HARDWARE: normally hardware capabilities, such as the Intel SSE instructions, + * are detected at run time, however sometimes it may be impossible + * to do this in user mode, in which case it is necessary to discover + * the capabilities in an OS specific way. Such capabilities are + * listed here when libpng has support for them and must be turned + * ON by the application if present. + * + * SOFTWARE: sometimes software optimizations actually result in performance + * decrease on some architectures or systems, or with some sets of + * PNG images. 'Software' options allow such optimizations to be + * selected at run time. + */ +#ifdef PNG_SET_OPTION_SUPPORTED + +/* HARDWARE: ARM Neon SIMD instructions supported */ +#ifdef PNG_ARM_NEON_API_SUPPORTED +# define PNG_ARM_NEON 0 +#endif + +/* SOFTWARE: Force maximum window */ +#define PNG_MAXIMUM_INFLATE_WINDOW 2 + +/* SOFTWARE: Check ICC profile for sRGB */ +#define PNG_SKIP_sRGB_CHECK_PROFILE 4 + +/* HARDWARE: MIPS MSA SIMD instructions supported */ +#ifdef PNG_MIPS_MSA_API_SUPPORTED +# define PNG_MIPS_MSA 6 +#endif + +/* SOFTWARE: Disable Adler32 check on IDAT */ +#ifdef PNG_DISABLE_ADLER32_CHECK_SUPPORTED +# define PNG_IGNORE_ADLER32 8 +#endif + +/* HARDWARE: PowerPC VSX SIMD instructions supported */ +#ifdef PNG_POWERPC_VSX_API_SUPPORTED +# define PNG_POWERPC_VSX 10 +#endif + +/* HARDWARE: MIPS MMI SIMD instructions supported */ +#ifdef PNG_MIPS_MMI_API_SUPPORTED +# define PNG_MIPS_MMI 12 +#endif + +/* HARDWARE: RISC-V RVV SIMD instructions supported */ +#ifdef PNG_RISCV_RVV_API_SUPPORTED +# define PNG_RISCV_RVV 14 +#endif + +/* Next option - numbers must be even */ +#define PNG_OPTION_NEXT 16 + +/* Return values: NOTE: there are four values and 'off' is *not* zero */ +#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ +#define PNG_OPTION_INVALID 1 /* Option number out of range */ +#define PNG_OPTION_OFF 2 +#define PNG_OPTION_ON 3 + +PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, + int onoff)); +#endif /* SET_OPTION */ + +/******************************************************************************* + * END OF HARDWARE AND SOFTWARE OPTIONS + ******************************************************************************/ + +/* Maintainer: Put new public prototypes here ^, in libpng.3, in project + * defs, and in scripts/symbols.def. + */ + +/* The last ordinal number (this is the *last* one already used; the next + * one to use is one more than this.) + */ +#ifdef PNG_EXPORT_LAST_ORDINAL + PNG_EXPORT_LAST_ORDINAL(259); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* PNG_VERSION_INFO_ONLY */ +/* Do not put anything past this line */ +#endif /* PNG_H */ diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/pngconf.h b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/pngconf.h new file mode 100644 index 0000000000000000000000000000000000000000..4508452419788fde49df406205d0277f5d515e31 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/pngconf.h @@ -0,0 +1,615 @@ +/* pngconf.h - machine-configurable file for libpng + * + * libpng version 1.6.55 + * + * Copyright (c) 2018-2026 Cosmin Truta + * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson + * Copyright (c) 1996-1997 Andreas Dilger + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h + * + * Any machine specific code is near the front of this file, so if you + * are configuring libpng for a machine, you may want to read the section + * starting here down to where it starts to typedef png_color, png_text, + * and png_info. + */ + +#ifndef PNGCONF_H +#define PNGCONF_H + +#ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ + +/* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C + * compiler for correct compilation. The following header files are required by + * the standard. If your compiler doesn't provide these header files, or they + * do not match the standard, you will need to provide/improve them. + */ +#include +#include + +/* Library header files. These header files are all defined by ISOC90; libpng + * expects conformant implementations, however, an ISOC90 conformant system need + * not provide these header files if the functionality cannot be implemented. + * In this case it will be necessary to disable the relevant parts of libpng in + * the build of pnglibconf.h. + * + * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not + * include this unnecessary header file. + */ + +#ifdef PNG_STDIO_SUPPORTED + /* Required for the definition of FILE: */ +# include +#endif + +#ifdef PNG_SETJMP_SUPPORTED + /* Required for the definition of jmp_buf and the declaration of longjmp: */ +# include +#endif + +#ifdef PNG_CONVERT_tIME_SUPPORTED + /* Required for struct tm: */ +# include +#endif + +#endif /* PNG_BUILDING_SYMBOL_TABLE */ + +/* Prior to 1.6.0, it was possible to turn off 'const' in declarations, + * using PNG_NO_CONST. This is no longer supported. + */ +#define PNG_CONST const /* backward compatibility only */ + +/* This controls optimization of the reading of 16-bit and 32-bit + * values from PNG files. It can be set on a per-app-file basis: it + * just changes whether a macro is used when the function is called. + * The library builder sets the default; if read functions are not + * built into the library the macro implementation is forced on. + */ +#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED +# define PNG_USE_READ_MACROS +#endif +#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) +# if PNG_DEFAULT_READ_MACROS +# define PNG_USE_READ_MACROS +# endif +#endif + +/* COMPILER SPECIFIC OPTIONS. + * + * These options are provided so that a variety of difficult compilers + * can be used. Some are fixed at build time (e.g. PNG_API_RULE + * below) but still have compiler specific implementations, others + * may be changed on a per-file basis when compiling against libpng. + */ + +/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect + * against legacy (pre ISOC90) compilers that did not understand function + * prototypes. [Deprecated.] + */ +#ifndef PNGARG +# define PNGARG(arglist) arglist +#endif + +/* Function calling conventions. + * ============================= + * Normally it is not necessary to specify to the compiler how to call + * a function - it just does it - however on x86 systems derived from + * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems + * and some others) there are multiple ways to call a function and the + * default can be changed on the compiler command line. For this reason + * libpng specifies the calling convention of every exported function and + * every function called via a user supplied function pointer. This is + * done in this file by defining the following macros: + * + * PNGAPI Calling convention for exported functions. + * PNGCBAPI Calling convention for user provided (callback) functions. + * PNGCAPI Calling convention used by the ANSI-C library (required + * for longjmp callbacks and sometimes used internally to + * specify the calling convention for zlib). + * + * These macros should never be overridden. If it is necessary to + * change calling convention in a private build this can be done + * by setting PNG_API_RULE (which defaults to 0) to one of the values + * below to select the correct 'API' variants. + * + * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout. + * This is correct in every known environment. + * PNG_API_RULE=1 Use the operating system convention for PNGAPI and + * the 'C' calling convention (from PNGCAPI) for + * callbacks (PNGCBAPI). This is no longer required + * in any known environment - if it has to be used + * please post an explanation of the problem to the + * libpng mailing list. + * + * These cases only differ if the operating system does not use the C + * calling convention, at present this just means the above cases + * (x86 DOS/Windows systems) and, even then, this does not apply to + * Cygwin running on those systems. + * + * Note that the value must be defined in pnglibconf.h so that what + * the application uses to call the library matches the conventions + * set when building the library. + */ + +/* Symbol export + * ============= + * When building a shared library it is almost always necessary to tell + * the compiler which symbols to export. The png.h macro 'PNG_EXPORT' + * is used to mark the symbols. On some systems these symbols can be + * extracted at link time and need no special processing by the compiler, + * on other systems the symbols are flagged by the compiler and just + * the declaration requires a special tag applied (unfortunately) in a + * compiler dependent way. Some systems can do either. + * + * A small number of older systems also require a symbol from a DLL to + * be flagged to the program that calls it. This is a problem because + * we do not know in the header file included by application code that + * the symbol will come from a shared library, as opposed to a statically + * linked one. For this reason the application must tell us by setting + * the magic flag PNG_USE_DLL to turn on the special processing before + * it includes png.h. + * + * Four additional macros are used to make this happen: + * + * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from + * the build or imported if PNG_USE_DLL is set - compiler + * and system specific. + * + * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to + * 'type', compiler specific. + * + * PNG_DLL_EXPORT Set to the magic to use during a libpng build to + * make a symbol exported from the DLL. Not used in the + * public header files; see pngpriv.h for how it is used + * in the libpng build. + * + * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come + * from a DLL - used to define PNG_IMPEXP when + * PNG_USE_DLL is set. + */ + +/* System specific discovery. + * ========================== + * This code is used at build time to find PNG_IMPEXP, the API settings + * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL + * import processing is possible. On Windows systems it also sets + * compiler-specific macros to the values required to change the calling + * conventions of the various functions. + */ +#if defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || \ + defined(__CYGWIN__) + /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or + * MinGW on any architecture currently supported by Windows. Also includes + * Watcom builds but these need special treatment because they are not + * compatible with GCC or Visual C because of different calling conventions. + */ +# if PNG_API_RULE == 2 + /* If this line results in an error, either because __watcall is not + * understood or because of a redefine just below you cannot use *this* + * build of the library with the compiler you are using. *This* build was + * build using Watcom and applications must also be built using Watcom! + */ +# define PNGCAPI __watcall +# endif + +# if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) +# define PNGCAPI __cdecl +# if PNG_API_RULE == 1 + /* If this line results in an error __stdcall is not understood and + * PNG_API_RULE should not have been set to '1'. + */ +# define PNGAPI __stdcall +# endif +# else + /* An older compiler, or one not detected (erroneously) above, + * if necessary override on the command line to get the correct + * variants for the compiler. + */ +# ifndef PNGCAPI +# define PNGCAPI _cdecl +# endif +# if PNG_API_RULE == 1 && !defined(PNGAPI) +# define PNGAPI _stdcall +# endif +# endif /* compiler/api */ + + /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ + +# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) +# error PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed +# endif + +# define PNG_DLL_EXPORT __declspec(dllexport) +# ifndef PNG_DLL_IMPORT +# define PNG_DLL_IMPORT __declspec(dllimport) +# endif + +#else /* !Windows */ +# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) +# define PNGAPI _System +# else /* !Windows/x86 && !OS/2 */ + /* Use the defaults, or define PNG*API on the command line (but + * this will have to be done for every compile!) + */ +# endif /* other system, !OS/2 */ +#endif /* !Windows/x86 */ + +/* Now do all the defaulting . */ +#ifndef PNGCAPI +# define PNGCAPI +#endif +#ifndef PNGCBAPI +# define PNGCBAPI PNGCAPI +#endif +#ifndef PNGAPI +# define PNGAPI PNGCAPI +#endif + +/* PNG_IMPEXP may be set on the compilation system command line or (if not set) + * then in an internal header file when building the library, otherwise (when + * using the library) it is set here. + */ +#ifndef PNG_IMPEXP +# if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) + /* This forces use of a DLL, disallowing static linking */ +# define PNG_IMPEXP PNG_DLL_IMPORT +# endif + +# ifndef PNG_IMPEXP +# define PNG_IMPEXP +# endif +#endif + +/* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat + * 'attributes' as a storage class - the attributes go at the start of the + * function definition, and attributes are always appended regardless of the + * compiler. This considerably simplifies these macros but may cause problems + * if any compilers both need function attributes and fail to handle them as + * a storage class (this is unlikely.) + */ +#ifndef PNG_FUNCTION +# define PNG_FUNCTION(type, name, args, attributes) attributes type name args +#endif + +#ifndef PNG_EXPORT_TYPE +# define PNG_EXPORT_TYPE(type) PNG_IMPEXP type +#endif + + /* The ordinal value is only relevant when preprocessing png.h for symbol + * table entries, so we discard it here. See the .dfn files in the + * scripts directory. + */ + +#ifndef PNG_EXPORTA +# define PNG_EXPORTA(ordinal, type, name, args, attributes) \ + PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), args, \ + PNG_LINKAGE_API attributes) +#endif + +/* ANSI-C (C90) does not permit a macro to be invoked with an empty argument, + * so make something non-empty to satisfy the requirement: + */ +#define PNG_EMPTY /*empty list*/ + +#define PNG_EXPORT(ordinal, type, name, args) \ + PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY) + +/* Use PNG_REMOVED to comment out a removed interface. */ +#ifndef PNG_REMOVED +# define PNG_REMOVED(ordinal, type, name, args, attributes) +#endif + +#ifndef PNG_CALLBACK +# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) args +#endif + +/* Support for compiler specific function attributes. These are used + * so that where compiler support is available incorrect use of API + * functions in png.h will generate compiler warnings. + * + * Added at libpng-1.2.41. + */ + +#ifndef PNG_NO_PEDANTIC_WARNINGS +# ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED +# define PNG_PEDANTIC_WARNINGS_SUPPORTED +# endif +#endif + +#ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED + /* Support for compiler specific function attributes. These are used + * so that where compiler support is available, incorrect use of API + * functions in png.h will generate compiler warnings. Added at libpng + * version 1.2.41. Disabling these removes the warnings but may also produce + * less efficient code. + */ +# if defined(__clang__) && defined(__has_attribute) + /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ +# if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__) +# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) +# endif +# if !defined(PNG_NORETURN) && __has_attribute(__noreturn__) +# define PNG_NORETURN __attribute__((__noreturn__)) +# endif +# if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__) +# define PNG_ALLOCATED __attribute__((__malloc__)) +# endif +# if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__) +# define PNG_DEPRECATED __attribute__((__deprecated__)) +# endif +# if !defined(PNG_PRIVATE) +# ifdef __has_extension +# if __has_extension(attribute_unavailable_with_message) +# define PNG_PRIVATE __attribute__((__unavailable__(\ + "This function is not exported by libpng."))) +# endif +# endif +# endif +# ifndef PNG_RESTRICT +# define PNG_RESTRICT __restrict +# endif + +# elif defined(__GNUC__) +# ifndef PNG_USE_RESULT +# define PNG_USE_RESULT __attribute__((__warn_unused_result__)) +# endif +# ifndef PNG_NORETURN +# define PNG_NORETURN __attribute__((__noreturn__)) +# endif +# if __GNUC__ >= 3 +# ifndef PNG_ALLOCATED +# define PNG_ALLOCATED __attribute__((__malloc__)) +# endif +# ifndef PNG_DEPRECATED +# define PNG_DEPRECATED __attribute__((__deprecated__)) +# endif +# ifndef PNG_PRIVATE +# if 0 /* Doesn't work so we use deprecated instead*/ +# define PNG_PRIVATE \ + __attribute__((warning("This function is not exported by libpng."))) +# else +# define PNG_PRIVATE \ + __attribute__((__deprecated__)) +# endif +# endif +# if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1)) +# ifndef PNG_RESTRICT +# define PNG_RESTRICT __restrict +# endif +# endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */ +# endif /* __GNUC__ >= 3 */ + +# elif defined(_MSC_VER) && (_MSC_VER >= 1300) +# ifndef PNG_USE_RESULT +# define PNG_USE_RESULT /* not supported */ +# endif +# ifndef PNG_NORETURN +# define PNG_NORETURN __declspec(noreturn) +# endif +# ifndef PNG_ALLOCATED +# if (_MSC_VER >= 1400) +# define PNG_ALLOCATED __declspec(restrict) +# endif +# endif +# ifndef PNG_DEPRECATED +# define PNG_DEPRECATED __declspec(deprecated) +# endif +# ifndef PNG_PRIVATE +# define PNG_PRIVATE __declspec(deprecated) +# endif +# ifndef PNG_RESTRICT +# if (_MSC_VER >= 1400) +# define PNG_RESTRICT __restrict +# endif +# endif + +# elif defined(__WATCOMC__) +# ifndef PNG_RESTRICT +# define PNG_RESTRICT __restrict +# endif +# endif +#endif /* PNG_PEDANTIC_WARNINGS */ + +#ifndef PNG_DEPRECATED +# define PNG_DEPRECATED /* Use of this function is deprecated */ +#endif +#ifndef PNG_USE_RESULT +# define PNG_USE_RESULT /* The result of this function must be checked */ +#endif +#ifndef PNG_NORETURN +# define PNG_NORETURN /* This function does not return */ +#endif +#ifndef PNG_ALLOCATED +# define PNG_ALLOCATED /* The result of the function is new memory */ +#endif +#ifndef PNG_PRIVATE +# define PNG_PRIVATE /* This is a private libpng function */ +#endif +#ifndef PNG_RESTRICT +# define PNG_RESTRICT /* The C99 "restrict" feature */ +#endif + +#ifndef PNG_FP_EXPORT /* A floating point API. */ +# ifdef PNG_FLOATING_POINT_SUPPORTED +# define PNG_FP_EXPORT(ordinal, type, name, args)\ + PNG_EXPORT(ordinal, type, name, args); +# else /* No floating point APIs */ +# define PNG_FP_EXPORT(ordinal, type, name, args) +# endif +#endif +#ifndef PNG_FIXED_EXPORT /* A fixed point API. */ +# ifdef PNG_FIXED_POINT_SUPPORTED +# define PNG_FIXED_EXPORT(ordinal, type, name, args)\ + PNG_EXPORT(ordinal, type, name, args); +# else /* No fixed point APIs */ +# define PNG_FIXED_EXPORT(ordinal, type, name, args) +# endif +#endif + +#ifndef PNG_BUILDING_SYMBOL_TABLE +/* Some typedefs to get us started. These should be safe on most of the common + * platforms. + * + * png_uint_32 and png_int_32 may, currently, be larger than required to hold a + * 32-bit value however this is not normally advisable. + * + * png_uint_16 and png_int_16 should always be two bytes in size - this is + * verified at library build time. + * + * png_byte must always be one byte in size. + * + * The checks below use constants from limits.h, as defined by the ISOC90 + * standard. + */ +#if CHAR_BIT == 8 && UCHAR_MAX == 255 + typedef unsigned char png_byte; +#else +# error libpng requires 8-bit bytes +#endif + +#if INT_MIN == -32768 && INT_MAX == 32767 + typedef int png_int_16; +#elif SHRT_MIN == -32768 && SHRT_MAX == 32767 + typedef short png_int_16; +#else +# error libpng requires a signed 16-bit integer type +#endif + +#if UINT_MAX == 65535 + typedef unsigned int png_uint_16; +#elif USHRT_MAX == 65535 + typedef unsigned short png_uint_16; +#else +# error libpng requires an unsigned 16-bit integer type +#endif + +#if INT_MIN < -2147483646 && INT_MAX > 2147483646 + typedef int png_int_32; +#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646 + typedef long int png_int_32; +#else +# error libpng requires a signed 32-bit (or longer) integer type +#endif + +#if UINT_MAX > 4294967294U + typedef unsigned int png_uint_32; +#elif ULONG_MAX > 4294967294U + typedef unsigned long int png_uint_32; +#else +# error libpng requires an unsigned 32-bit (or longer) integer type +#endif + +/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t. + * From 1.6.0 onwards, an ISO C90 compiler, as well as a standard-compliant + * behavior of sizeof and ptrdiff_t are required. + * The legacy typedefs are provided here for backwards compatibility. + */ +typedef size_t png_size_t; +typedef ptrdiff_t png_ptrdiff_t; + +/* libpng needs to know the maximum value of 'size_t' and this controls the + * definition of png_alloc_size_t, below. This maximum value of size_t limits + * but does not control the maximum allocations the library makes - there is + * direct application control of this through png_set_user_limits(). + */ +#ifndef PNG_SMALL_SIZE_T + /* Compiler specific tests for systems where size_t is known to be less than + * 32 bits (some of these systems may no longer work because of the lack of + * 'far' support; see above.) + */ +# if (defined(__TURBOC__) && !defined(__FLAT__)) ||\ + (defined(_MSC_VER) && defined(MAXSEG_64K)) +# define PNG_SMALL_SIZE_T +# endif +#endif + +/* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller + * than png_uint_32. Casts from size_t or png_uint_32 to png_alloc_size_t are + * not necessary; in fact, it is recommended not to use them at all, so that + * the compiler can complain when something turns out to be problematic. + * + * Casts in the other direction (from png_alloc_size_t to size_t or + * png_uint_32) should be explicitly applied; however, we do not expect to + * encounter practical situations that require such conversions. + * + * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than + * 4294967295 - i.e. less than the maximum value of png_uint_32. + */ +#ifdef PNG_SMALL_SIZE_T + typedef png_uint_32 png_alloc_size_t; +#else + typedef size_t png_alloc_size_t; +#endif + +/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler + * implementations of Intel CPU specific support of user-mode segmented address + * spaces, where 16-bit pointers address more than 65536 bytes of memory using + * separate 'segment' registers. The implementation requires two different + * types of pointer (only one of which includes the segment value.) + * + * If required this support is available in version 1.2 of libpng and may be + * available in versions through 1.5, although the correctness of the code has + * not been verified recently. + */ + +/* Typedef for floating-point numbers that are converted to fixed-point with a + * multiple of 100,000, e.g., gamma + */ +typedef png_int_32 png_fixed_point; + +/* Add typedefs for pointers */ +typedef void * png_voidp; +typedef const void * png_const_voidp; +typedef png_byte * png_bytep; +typedef const png_byte * png_const_bytep; +typedef png_uint_32 * png_uint_32p; +typedef const png_uint_32 * png_const_uint_32p; +typedef png_int_32 * png_int_32p; +typedef const png_int_32 * png_const_int_32p; +typedef png_uint_16 * png_uint_16p; +typedef const png_uint_16 * png_const_uint_16p; +typedef png_int_16 * png_int_16p; +typedef const png_int_16 * png_const_int_16p; +typedef char * png_charp; +typedef const char * png_const_charp; +typedef png_fixed_point * png_fixed_point_p; +typedef const png_fixed_point * png_const_fixed_point_p; +typedef size_t * png_size_tp; +typedef const size_t * png_const_size_tp; + +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double * png_doublep; +typedef const double * png_const_doublep; +#endif + +/* Pointers to pointers; i.e. arrays */ +typedef png_byte * * png_bytepp; +typedef png_uint_32 * * png_uint_32pp; +typedef png_int_32 * * png_int_32pp; +typedef png_uint_16 * * png_uint_16pp; +typedef png_int_16 * * png_int_16pp; +typedef const char * * png_const_charpp; +typedef char * * png_charpp; +typedef png_fixed_point * * png_fixed_point_pp; +#ifdef PNG_FLOATING_POINT_SUPPORTED +typedef double * * png_doublepp; +#endif + +/* Pointers to pointers to pointers; i.e., pointer to array */ +typedef char * * * png_charppp; + +#ifdef PNG_STDIO_SUPPORTED +/* With PNG_STDIO_SUPPORTED it was possible to use I/O streams that were + * not necessarily stdio FILE streams, to allow building Windows applications + * before Win32 and Windows CE applications before WinCE 3.0, but that kind + * of support has long been discontinued. + */ +typedef FILE * png_FILE_p; /* [Deprecated] */ +#endif + +#endif /* PNG_BUILDING_SYMBOL_TABLE */ + +#endif /* PNGCONF_H */ diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/pnglibconf.h b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/pnglibconf.h new file mode 100644 index 0000000000000000000000000000000000000000..92641e217960cd24c1c8d4c157c179ee4ae35900 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/include/pnglibconf.h @@ -0,0 +1,233 @@ +/* pnglibconf.h - library build configuration */ + +/* libpng version 1.6.55 */ + +/* Copyright (c) 2018-2026 Cosmin Truta */ +/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */ + +/* This code is released under the libpng license. */ +/* For conditions of distribution and use, see the disclaimer */ +/* and license in png.h */ + +/* pnglibconf.h */ +/* Machine generated file: DO NOT EDIT */ +/* Derived from: scripts/pnglibconf.dfa */ +#ifndef PNGLCONF_H +#define PNGLCONF_H +/* options */ +#define PNG_16BIT_SUPPORTED +#define PNG_ALIGNED_MEMORY_SUPPORTED +/*#undef PNG_ARM_NEON_API_SUPPORTED*/ +/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/ +#define PNG_BENIGN_ERRORS_SUPPORTED +#define PNG_BENIGN_READ_ERRORS_SUPPORTED +/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/ +#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED +#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED +#define PNG_COLORSPACE_SUPPORTED +#define PNG_CONSOLE_IO_SUPPORTED +#define PNG_CONVERT_tIME_SUPPORTED +/*#undef PNG_DISABLE_ADLER32_CHECK_SUPPORTED*/ +#define PNG_EASY_ACCESS_SUPPORTED +/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/ +#define PNG_ERROR_TEXT_SUPPORTED +#define PNG_FIXED_POINT_SUPPORTED +#define PNG_FLOATING_ARITHMETIC_SUPPORTED +#define PNG_FLOATING_POINT_SUPPORTED +#define PNG_FORMAT_AFIRST_SUPPORTED +#define PNG_FORMAT_BGR_SUPPORTED +#define PNG_GAMMA_SUPPORTED +#define PNG_GET_PALETTE_MAX_SUPPORTED +#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED +#define PNG_INCH_CONVERSIONS_SUPPORTED +#define PNG_INFO_IMAGE_SUPPORTED +#define PNG_IO_STATE_SUPPORTED +/*#undef PNG_MIPS_MMI_API_SUPPORTED*/ +/*#undef PNG_MIPS_MMI_CHECK_SUPPORTED*/ +/*#undef PNG_MIPS_MSA_API_SUPPORTED*/ +/*#undef PNG_MIPS_MSA_CHECK_SUPPORTED*/ +#define PNG_MNG_FEATURES_SUPPORTED +#define PNG_POINTER_INDEXING_SUPPORTED +/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/ +/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/ +#define PNG_PROGRESSIVE_READ_SUPPORTED +#define PNG_READ_16BIT_SUPPORTED +#define PNG_READ_ALPHA_MODE_SUPPORTED +#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED +#define PNG_READ_BACKGROUND_SUPPORTED +#define PNG_READ_BGR_SUPPORTED +#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED +#define PNG_READ_COMPOSITE_NODIV_SUPPORTED +#define PNG_READ_COMPRESSED_TEXT_SUPPORTED +#define PNG_READ_EXPAND_16_SUPPORTED +#define PNG_READ_EXPAND_SUPPORTED +#define PNG_READ_FILLER_SUPPORTED +#define PNG_READ_GAMMA_SUPPORTED +#define PNG_READ_GET_PALETTE_MAX_SUPPORTED +#define PNG_READ_GRAY_TO_RGB_SUPPORTED +#define PNG_READ_INTERLACING_SUPPORTED +#define PNG_READ_INT_FUNCTIONS_SUPPORTED +#define PNG_READ_INVERT_ALPHA_SUPPORTED +#define PNG_READ_INVERT_SUPPORTED +#define PNG_READ_OPT_PLTE_SUPPORTED +#define PNG_READ_PACKSWAP_SUPPORTED +#define PNG_READ_PACK_SUPPORTED +#define PNG_READ_QUANTIZE_SUPPORTED +#define PNG_READ_RGB_TO_GRAY_SUPPORTED +#define PNG_READ_SCALE_16_TO_8_SUPPORTED +#define PNG_READ_SHIFT_SUPPORTED +#define PNG_READ_STRIP_16_TO_8_SUPPORTED +#define PNG_READ_STRIP_ALPHA_SUPPORTED +#define PNG_READ_SUPPORTED +#define PNG_READ_SWAP_ALPHA_SUPPORTED +#define PNG_READ_SWAP_SUPPORTED +#define PNG_READ_TEXT_SUPPORTED +#define PNG_READ_TRANSFORMS_SUPPORTED +#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_READ_USER_CHUNKS_SUPPORTED +#define PNG_READ_USER_TRANSFORM_SUPPORTED +#define PNG_READ_bKGD_SUPPORTED +#define PNG_READ_cHRM_SUPPORTED +#define PNG_READ_cICP_SUPPORTED +#define PNG_READ_cLLI_SUPPORTED +#define PNG_READ_eXIf_SUPPORTED +#define PNG_READ_gAMA_SUPPORTED +#define PNG_READ_hIST_SUPPORTED +#define PNG_READ_iCCP_SUPPORTED +#define PNG_READ_iTXt_SUPPORTED +#define PNG_READ_mDCV_SUPPORTED +#define PNG_READ_oFFs_SUPPORTED +#define PNG_READ_pCAL_SUPPORTED +#define PNG_READ_pHYs_SUPPORTED +#define PNG_READ_sBIT_SUPPORTED +#define PNG_READ_sCAL_SUPPORTED +#define PNG_READ_sPLT_SUPPORTED +#define PNG_READ_sRGB_SUPPORTED +#define PNG_READ_tEXt_SUPPORTED +#define PNG_READ_tIME_SUPPORTED +#define PNG_READ_tRNS_SUPPORTED +#define PNG_READ_zTXt_SUPPORTED +#define PNG_SAVE_INT_32_SUPPORTED +#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_SEQUENTIAL_READ_SUPPORTED +#define PNG_SETJMP_SUPPORTED +#define PNG_SET_OPTION_SUPPORTED +#define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_SET_USER_LIMITS_SUPPORTED +#define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED +#define PNG_SIMPLIFIED_READ_BGR_SUPPORTED +#define PNG_SIMPLIFIED_READ_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_STDIO_SUPPORTED +#define PNG_SIMPLIFIED_WRITE_SUPPORTED +#define PNG_STDIO_SUPPORTED +#define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_TEXT_SUPPORTED +#define PNG_TIME_RFC1123_SUPPORTED +#define PNG_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_USER_CHUNKS_SUPPORTED +#define PNG_USER_LIMITS_SUPPORTED +#define PNG_USER_MEM_SUPPORTED +#define PNG_USER_TRANSFORM_INFO_SUPPORTED +#define PNG_USER_TRANSFORM_PTR_SUPPORTED +#define PNG_WARNINGS_SUPPORTED +#define PNG_WRITE_16BIT_SUPPORTED +#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED +#define PNG_WRITE_BGR_SUPPORTED +#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED +#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED +#define PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED +#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED +#define PNG_WRITE_FILLER_SUPPORTED +#define PNG_WRITE_FILTER_SUPPORTED +#define PNG_WRITE_FLUSH_SUPPORTED +#define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED +#define PNG_WRITE_INTERLACING_SUPPORTED +#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED +#define PNG_WRITE_INVERT_ALPHA_SUPPORTED +#define PNG_WRITE_INVERT_SUPPORTED +#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED +#define PNG_WRITE_PACKSWAP_SUPPORTED +#define PNG_WRITE_PACK_SUPPORTED +#define PNG_WRITE_SHIFT_SUPPORTED +#define PNG_WRITE_SUPPORTED +#define PNG_WRITE_SWAP_ALPHA_SUPPORTED +#define PNG_WRITE_SWAP_SUPPORTED +#define PNG_WRITE_TEXT_SUPPORTED +#define PNG_WRITE_TRANSFORMS_SUPPORTED +#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED +#define PNG_WRITE_USER_TRANSFORM_SUPPORTED +#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED +#define PNG_WRITE_bKGD_SUPPORTED +#define PNG_WRITE_cHRM_SUPPORTED +#define PNG_WRITE_cICP_SUPPORTED +#define PNG_WRITE_cLLI_SUPPORTED +#define PNG_WRITE_eXIf_SUPPORTED +#define PNG_WRITE_gAMA_SUPPORTED +#define PNG_WRITE_hIST_SUPPORTED +#define PNG_WRITE_iCCP_SUPPORTED +#define PNG_WRITE_iTXt_SUPPORTED +#define PNG_WRITE_mDCV_SUPPORTED +#define PNG_WRITE_oFFs_SUPPORTED +#define PNG_WRITE_pCAL_SUPPORTED +#define PNG_WRITE_pHYs_SUPPORTED +#define PNG_WRITE_sBIT_SUPPORTED +#define PNG_WRITE_sCAL_SUPPORTED +#define PNG_WRITE_sPLT_SUPPORTED +#define PNG_WRITE_sRGB_SUPPORTED +#define PNG_WRITE_tEXt_SUPPORTED +#define PNG_WRITE_tIME_SUPPORTED +#define PNG_WRITE_tRNS_SUPPORTED +#define PNG_WRITE_zTXt_SUPPORTED +#define PNG_bKGD_SUPPORTED +#define PNG_cHRM_SUPPORTED +#define PNG_cICP_SUPPORTED +#define PNG_cLLI_SUPPORTED +#define PNG_eXIf_SUPPORTED +#define PNG_gAMA_SUPPORTED +#define PNG_hIST_SUPPORTED +#define PNG_iCCP_SUPPORTED +#define PNG_iTXt_SUPPORTED +#define PNG_mDCV_SUPPORTED +#define PNG_oFFs_SUPPORTED +#define PNG_pCAL_SUPPORTED +#define PNG_pHYs_SUPPORTED +#define PNG_sBIT_SUPPORTED +#define PNG_sCAL_SUPPORTED +#define PNG_sPLT_SUPPORTED +#define PNG_sRGB_SUPPORTED +#define PNG_tEXt_SUPPORTED +#define PNG_tIME_SUPPORTED +#define PNG_tRNS_SUPPORTED +#define PNG_zTXt_SUPPORTED +/* end of options */ +/* settings */ +#define PNG_API_RULE 0 +#define PNG_DEFAULT_READ_MACROS 1 +#define PNG_GAMMA_THRESHOLD_FIXED 5000 +#define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE +#define PNG_INFLATE_BUF_SIZE 1024 +#define PNG_LINKAGE_API extern +#define PNG_LINKAGE_CALLBACK extern +#define PNG_LINKAGE_DATA extern +#define PNG_LINKAGE_FUNCTION extern +#define PNG_MAX_GAMMA_8 11 +#define PNG_QUANTIZE_BLUE_BITS 5 +#define PNG_QUANTIZE_GREEN_BITS 5 +#define PNG_QUANTIZE_RED_BITS 5 +#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1) +#define PNG_TEXT_Z_DEFAULT_STRATEGY 0 +#define PNG_USER_CHUNK_CACHE_MAX 1000 +#define PNG_USER_CHUNK_MALLOC_MAX 8000000 +#define PNG_USER_HEIGHT_MAX 1000000 +#define PNG_USER_WIDTH_MAX 1000000 +#define PNG_ZBUF_SIZE 8192 +#define PNG_ZLIB_VERNUM 0x1310 +#define PNG_Z_DEFAULT_COMPRESSION (-1) +#define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0 +#define PNG_Z_DEFAULT_STRATEGY 1 +#define PNG_sCAL_PRECISION 5 +#define PNG_sRGB_PROFILE_CHECKS 2 +/* end of settings */ +#endif /* PNGLCONF_H */ diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/about.json b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..0023a80cc4ab0c9c1fb17b4d5f3d4636faa21052 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/about.json @@ -0,0 +1,22 @@ +{ + "channels": [ + "https://conda.anaconda.org/conda-forge/" + ], + "description": "libpng is the official PNG reference library. It supports almost all PNG\nfeatures, is extensible, and has been extensively tested for over 20 years.", + "dev_url": "https://sourceforge.net/p/libpng/code/ci/libpng16/tree/", + "doc_url": "http://www.libpng.org/pub/png/libpng.html", + "extra": { + "flow_run_id": "azure_20260209.2.1", + "recipe-maintainers": [ + "ocefpaf", + "msarahan", + "pkgw", + "baszalmstra" + ], + "remote_url": "https://github.com/conda-forge/libpng-feedstock", + "sha": "f56f4f707aa286e3c52f3a13847930de92e7bdb3" + }, + "home": "http://www.libpng.org/pub/png/libpng.html", + "license": "zlib-acknowledgement", + "summary": "PNG reference library" +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/hash_input.json b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..0d1b0d81b06524b34bf13d1199a57a532815325c --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/hash_input.json @@ -0,0 +1 @@ +{"c_compiler": "gcc", "c_compiler_version": "14", "c_stdlib": "sysroot", "c_stdlib_version": "2.17", "channel_sources": "conda-forge", "channel_targets": "conda-forge main", "target_platform": "linux-64", "zlib": "1"} \ No newline at end of file diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/index.json b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..d427ee7c4f818325d57393208bb29d37d1583a3a --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/index.json @@ -0,0 +1,16 @@ +{ + "arch": "x86_64", + "build": "h421ea60_0", + "build_number": 0, + "depends": [ + "libgcc >=14", + "__glibc >=2.17,<3.0.a0", + "libzlib >=1.3.1,<2.0a0" + ], + "license": "zlib-acknowledgement", + "name": "libpng", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1770691470744, + "version": "1.6.55" +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/licenses/LICENSE b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1b765ae9f96abea77d3d9a88c543e3b5f4725813 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/licenses/LICENSE @@ -0,0 +1,134 @@ +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE +========================================= + +PNG Reference Library License version 2 +--------------------------------------- + + * Copyright (c) 1995-2026 The PNG Reference Library Authors. + * Copyright (c) 2018-2026 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no event shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. + +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the product + documentation would be appreciated, but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- + +libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are +Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. + +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners, and +are released under other open source licenses. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +Some files in the "scripts" directory have other copyright owners, +but are released under this license. + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/paths.json b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..c6c14bd1fdfeb6ed506cc446ec4d73a723a0eb7f --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/paths.json @@ -0,0 +1,135 @@ +{ + "paths": [ + { + "_path": "bin/libpng-config", + "path_type": "softlink", + "sha256": "c13ddb8e344e45d4d704a71b43c1e86caa9c1d1296153f5241dfbee481b21b15", + "size_in_bytes": 15 + }, + { + "_path": "bin/libpng16-config", + "path_type": "hardlink", + "file_mode": "text", + "prefix_placeholder": "/home/conda/feedstock_root/build_artifacts/bld/rattler-build_libpng_1770691470/host_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho", + "sha256": "c13ddb8e344e45d4d704a71b43c1e86caa9c1d1296153f5241dfbee481b21b15", + "size_in_bytes": 2572 + }, + { + "_path": "bin/png-fix-itxt", + "path_type": "hardlink", + "sha256": "36450dafb7910dd1565db22c0a768dec3100bed8c7839d95fd627cba5ac61564", + "size_in_bytes": 15952 + }, + { + "_path": "bin/pngfix", + "path_type": "hardlink", + "sha256": "2372c06b1219ea5e8bef0f27c9c634139d8f9d1777de8cb064ac2b67fc7c4a7b", + "size_in_bytes": 56272 + }, + { + "_path": "include/libpng16/png.h", + "path_type": "hardlink", + "sha256": "00e93d3c87cde182df182a3e6090e704b4208d48f9473a6af4c651b8a0be05f1", + "size_in_bytes": 148529 + }, + { + "_path": "include/libpng16/pngconf.h", + "path_type": "hardlink", + "sha256": "98e58d6b55dd1b952bcf31ed5f44aba684656bc6b91961ce8e52296d7e2b9312", + "size_in_bytes": 22673 + }, + { + "_path": "include/libpng16/pnglibconf.h", + "path_type": "hardlink", + "sha256": "25c52b0328bb207441601004a19602755f380d01dee1f8e1bd6e1ef2ec2989bb", + "size_in_bytes": 8081 + }, + { + "_path": "include/png.h", + "path_type": "softlink", + "sha256": "00e93d3c87cde182df182a3e6090e704b4208d48f9473a6af4c651b8a0be05f1", + "size_in_bytes": 14 + }, + { + "_path": "include/pngconf.h", + "path_type": "softlink", + "sha256": "98e58d6b55dd1b952bcf31ed5f44aba684656bc6b91961ce8e52296d7e2b9312", + "size_in_bytes": 18 + }, + { + "_path": "include/pnglibconf.h", + "path_type": "softlink", + "sha256": "25c52b0328bb207441601004a19602755f380d01dee1f8e1bd6e1ef2ec2989bb", + "size_in_bytes": 21 + }, + { + "_path": "lib/libpng.a", + "path_type": "softlink", + "sha256": "c892d0be8e120a51cc25058099f8de6561597d835901188ded6497259f1ca046", + "size_in_bytes": 10 + }, + { + "_path": "lib/libpng.so", + "path_type": "softlink", + "sha256": "732b8a31ae86a8f201185540e271b3dda5595317b7900050c2b1479c2abeb8a6", + "size_in_bytes": 11 + }, + { + "_path": "lib/libpng16.a", + "path_type": "hardlink", + "sha256": "c892d0be8e120a51cc25058099f8de6561597d835901188ded6497259f1ca046", + "size_in_bytes": 456680 + }, + { + "_path": "lib/libpng16.so", + "path_type": "softlink", + "sha256": "732b8a31ae86a8f201185540e271b3dda5595317b7900050c2b1479c2abeb8a6", + "size_in_bytes": 19 + }, + { + "_path": "lib/libpng16.so.16", + "path_type": "softlink", + "sha256": "732b8a31ae86a8f201185540e271b3dda5595317b7900050c2b1479c2abeb8a6", + "size_in_bytes": 19 + }, + { + "_path": "lib/libpng16.so.16.55.0", + "path_type": "hardlink", + "sha256": "732b8a31ae86a8f201185540e271b3dda5595317b7900050c2b1479c2abeb8a6", + "size_in_bytes": 280240 + }, + { + "_path": "lib/pkgconfig/libpng.pc", + "path_type": "softlink", + "sha256": "d9b126c36d7164c0acf667464230c03e7ee3d73df50e97ad7058dc7007f1591f", + "size_in_bytes": 11 + }, + { + "_path": "lib/pkgconfig/libpng16.pc", + "path_type": "hardlink", + "file_mode": "text", + "prefix_placeholder": "/home/conda/feedstock_root/build_artifacts/bld/rattler-build_libpng_1770691470/host_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho", + "sha256": "d9b126c36d7164c0acf667464230c03e7ee3d73df50e97ad7058dc7007f1591f", + "size_in_bytes": 518 + }, + { + "_path": "share/man/man3/libpng.3", + "path_type": "hardlink", + "sha256": "a0f36b448e643fd2042ef5b6a5bd4e3392ef3d000e21491176a9138d3c85d89e", + "size_in_bytes": 265461 + }, + { + "_path": "share/man/man3/libpngpf.3", + "path_type": "hardlink", + "sha256": "f2a546bdbffc1aea1e73da44956c29631bbcf479e6dd11ff035d24082551b19f", + "size_in_bytes": 422 + }, + { + "_path": "share/man/man5/png.5", + "path_type": "hardlink", + "sha256": "ce801d12559185bda64997e0977de08d625b16c8ae4ebfdd769f195a5531dbc1", + "size_in_bytes": 2266 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/build.bat b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/build.bat new file mode 100644 index 0000000000000000000000000000000000000000..765deb1c4bdca41314d401778bd886342c0c2800 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/build.bat @@ -0,0 +1,41 @@ +@echo on + +mkdir build-%SUBDIR%-%c_compiler% +cd build-%SUBDIR%-%c_compiler% + +:: Configure. +cmake %CMAKE_ARGS% -G Ninja ^ + -D CMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ + -D ZLIB_LIBRARY=%LIBRARY_LIB%\zlib.lib ^ + -D ZLIB_INCLUDE_DIR=%LIBRARY_INC% ^ + -DCMAKE_C_FLAGS="%CFLAGS% -DWIN32" ^ + -DCMAKE_BUILD_TYPE=Release ^ + %SRC_DIR% +if errorlevel 1 exit /b 1 + +cmake --build . --target install +if errorlevel 1 exit /b 1 + +:: Test. +:: TODO: check if there exists a emulator +if not "%CONDA_BUILD_SKIP_TESTS%"=="1" ( +if not "%CONDA_BUILD_CROSS_COMPILATION%" == "1" ( +ctest -C Release +if errorlevel 1 exit 1 +) +) + +:: Make copies of the .lib files without the embedded version number. +copy %LIBRARY_LIB%\libpng16.lib %LIBRARY_LIB%\libpng.lib +if errorlevel 1 exit 1 + +copy %LIBRARY_LIB%\libpng16_static.lib %LIBRARY_LIB%\libpng_static.lib +if errorlevel 1 exit 1 + +:: Make copies of the .lib files without the 'lib' prefix. +copy %LIBRARY_LIB%\libpng16.lib %LIBRARY_LIB%\png16.lib +if errorlevel 1 exit 1 + +copy %LIBRARY_LIB%\libpng16_static.lib %LIBRARY_LIB%\png16_static.lib +if errorlevel 1 exit 1 + diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/build.sh b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..16c826dc45e5a75790f7abbbf0fc7fb1fcb41494 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Get an updated config.sub and config.guess +cp $BUILD_PREFIX/share/libtool/build-aux/config.* . + +export CFLAGS="$CFLAGS -I$PREFIX/include -L$PREFIX/lib" +export CPPFLAGS="$CPPFLAGS -I$PREFIX/include" + +./configure --prefix=$PREFIX \ + --with-zlib-prefix=$PREFIX + +make -j${CPU_COUNT} ${VERBOSE_AT} +if [[ "${CONDA_BUILD_CROSS_COMPILATION}" != "1" ]]; then +make check +fi +make install + +# We can remove this when we start using the new conda-build. +find $PREFIX -name '*.la' -delete diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/recipe-scripts-license.txt b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/recipe-scripts-license.txt new file mode 100644 index 0000000000000000000000000000000000000000..2ec51d75f362bc4327a3cfe1c515c16bb3c57367 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/recipe-scripts-license.txt @@ -0,0 +1,27 @@ +BSD-3-Clause license +Copyright (c) 2015-2022, conda-forge contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/recipe.yaml b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/recipe.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1ebf7b8dff9c51281b464f42ac4995648166f14b --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/recipe.yaml @@ -0,0 +1,74 @@ +schema_version: 1 + +context: + version: "1.6.55" + short_version: ${{ (version|split('.'))[0:2]|join }} + +package: + name: libpng + version: ${{ version }} + +source: + url: https://downloads.sourceforge.net/project/libpng/libpng${{ short_version }}/${{ version }}/libpng-${{ version }}.tar.gz + sha256: 4b0abab6d219e95690ebe4db7fc9aa95f4006c83baaa022373c0c8442271283d + patches: + - patches/0001-Include-pkg-config-files-in-the-Windows-packages-too.patch + - patches/0002-Ensure-that-lm-is-not-included-in-Windows-pkg-config.patch + +build: + number: 0 + skip: + - win and vc<14 + +requirements: + build: + - ${{ compiler('c') }} + - ${{ stdlib("c") }} + - if: win + then: + - cmake + - ninja + - if: unix + then: + - make + - libtool + - automake + host: + - zlib + run_exports: + - ${{ pin_subpackage('libpng', upper_bound='x.x') }} + +tests: + - package_contents: + lib: + - if: win + then: libpng${{ short_version }} + else: png + include: + - libpng${{ short_version }}/png.h + - libpng${{ short_version }}/pngconf.h + - libpng${{ short_version }}/pnglibconf.h + - png.h + - pngconf.h + - pnglibconf.h + - script: + - if: not win + then: libpng-config --version + +about: + license: zlib-acknowledgement + license_file: LICENSE + summary: PNG reference library + description: | + libpng is the official PNG reference library. It supports almost all PNG + features, is extensible, and has been extensively tested for over 20 years. + homepage: http://www.libpng.org/pub/png/libpng.html + repository: https://sourceforge.net/p/libpng/code/ci/libpng16/tree/ + documentation: http://www.libpng.org/pub/png/libpng.html + +extra: + recipe-maintainers: + - ocefpaf + - msarahan + - pkgw + - baszalmstra diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/rendered_recipe.yaml b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/rendered_recipe.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dbc5d6b3cbad454da2588a5bd400c4ea2f4be67f --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/rendered_recipe.yaml @@ -0,0 +1,797 @@ +recipe: + schema_version: 1 + context: + version: 1.6.55 + short_version: 16 + package: + name: libpng + version: 1.6.55 + source: + - url: https://downloads.sourceforge.net/project/libpng/libpng16/1.6.55/libpng-1.6.55.tar.gz + sha256: 4b0abab6d219e95690ebe4db7fc9aa95f4006c83baaa022373c0c8442271283d + patches: + - patches/0001-Include-pkg-config-files-in-the-Windows-packages-too.patch + - patches/0002-Ensure-that-lm-is-not-included-in-Windows-pkg-config.patch + build: + number: 0 + string: h421ea60_0 + requirements: + build: + - gcc_linux-64 14.* + - sysroot_linux-64 2.17.* + - make + - libtool + - automake + host: + - zlib + run_exports: + weak: + - pin_subpackage: + name: libpng + lower_bound: x.x.x.x.x.x + upper_bound: x.x + tests: + - package_contents: + lib: + - png + include: + - libpng16/png.h + - libpng16/pngconf.h + - libpng16/pnglibconf.h + - png.h + - pngconf.h + - pnglibconf.h + - script: libpng-config --version + about: + homepage: http://www.libpng.org/pub/png/libpng.html + repository: https://sourceforge.net/p/libpng/code/ci/libpng16/tree/ + documentation: http://www.libpng.org/pub/png/libpng.html + license: zlib-acknowledgement + license_file: + - LICENSE + summary: PNG reference library + description: |- + libpng is the official PNG reference library. It supports almost all PNG + features, is extensible, and has been extensively tested for over 20 years. + extra: + recipe-maintainers: + - ocefpaf + - msarahan + - pkgw + - baszalmstra +build_configuration: + target_platform: linux-64 + host_platform: + platform: linux-64 + virtual_packages: + - __unix=0=0 + - __linux=6.11.0=0 + - __glibc=2.34=0 + - __archspec=1=zen2 + build_platform: + platform: linux-64 + virtual_packages: + - __unix=0=0 + - __linux=6.11.0=0 + - __glibc=2.34=0 + - __archspec=1=zen2 + variant: + c_compiler: gcc + c_compiler_version: '14' + c_stdlib: sysroot + c_stdlib_version: '2.17' + channel_sources: conda-forge + channel_targets: conda-forge main + target_platform: linux-64 + zlib: '1' + hash: + hash: 421ea60 + directories: + host_prefix: /home/conda/feedstock_root/build_artifacts/bld/rattler-build_libpng_1770691470/host_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho + build_prefix: /home/conda/feedstock_root/build_artifacts/bld/rattler-build_libpng_1770691470/build_env + work_dir: /home/conda/feedstock_root/build_artifacts/bld/rattler-build_libpng_1770691470/work + build_dir: /home/conda/feedstock_root/build_artifacts/bld/rattler-build_libpng_1770691470 + channels: + - https://conda.anaconda.org/conda-forge + channel_priority: strict + solve_strategy: highest + timestamp: 2026-02-10T02:44:30.744957391Z + subpackages: + libpng: + name: libpng + version: 1.6.55 + build_string: h421ea60_0 + packaging_settings: + archive_type: conda + compression_level: 15 +finalized_dependencies: + build: + specs: + - source: gcc_linux-64 14.* + - source: sysroot_linux-64 2.17.* + - source: make + - source: libtool + - source: automake + resolved: + - build: h298d278_20 + build_number: 20 + depends: + - gcc_impl_linux-64 14.3.0.* + - binutils_linux-64 + - sysroot_linux-64 + license: BSD-3-Clause + license_family: BSD + md5: 6a7d74012f6ff0b58fb8fcb5286fa584 + name: gcc_linux-64 + run_exports: + strong: + - libgcc >=14 + sha256: 5dd1fc1757e6d0354b6fd8f1917b334d46f01995401da02d7c4d5185edc0d895 + size: 28918 + subdir: linux-64 + timestamp: 1770277530099 + version: 14.3.0 + fn: gcc_linux-64-14.3.0-h298d278_20.conda + url: https://conda.anaconda.org/conda-forge/linux-64/gcc_linux-64-14.3.0-h298d278_20.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h0157908_18 + build_number: 18 + depends: + - kernel-headers_linux-64 3.10.0 he073ed8_18 + - tzdata + license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later AND MPL-2.0 + license_family: GPL + md5: 460eba7851277ec1fd80a1a24080787a + name: sysroot_linux-64 + noarch: generic + run_exports: + strong: + - __glibc >=2.17,<3.0.a0 + sha256: 69ab5804bdd2e8e493d5709eebff382a72fab3e9af6adf93a237ccf8f7dbd624 + size: 15166921 + subdir: noarch + timestamp: 1735290488259 + version: '2.17' + fn: sysroot_linux-64-2.17-h0157908_18.conda + url: https://conda.anaconda.org/conda-forge/noarch/sysroot_linux-64-2.17-h0157908_18.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: he073ed8_18 + build_number: 18 + constrains: + - sysroot_linux-64 ==2.17 + depends: [] + license: LGPL-2.0-or-later AND LGPL-2.0-or-later WITH exceptions AND GPL-2.0-or-later AND MPL-2.0 + license_family: GPL + md5: ad8527bf134a90e1c9ed35fa0b64318c + name: kernel-headers_linux-64 + noarch: generic + run_exports: {} + sha256: a922841ad80bd7b222502e65c07ecb67e4176c4fa5b03678a005f39fcc98be4b + size: 943486 + subdir: noarch + timestamp: 1729794504440 + version: 3.10.0 + fn: kernel-headers_linux-64-3.10.0-he073ed8_18.conda + url: https://conda.anaconda.org/conda-forge/noarch/kernel-headers_linux-64-3.10.0-he073ed8_18.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hb9d3cd8_2 + build_number: 2 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: GPL-3.0-or-later + license_family: GPL + md5: 33405d2a66b1411db9f7242c8b97c9e7 + name: make + run_exports: {} + sha256: d652c7bd4d3b6f82b0f6d063b0d8df6f54cc47531092d7ff008e780f3261bdda + size: 513088 + subdir: linux-64 + timestamp: 1727801714848 + version: 4.4.1 + fn: make-4.4.1-hb9d3cd8_2.conda + url: https://conda.anaconda.org/conda-forge/linux-64/make-4.4.1-hb9d3cd8_2.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h5888daf_0 + build_number: 0 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libltdl 2.4.3a h5888daf_0 + license: GPL-2.0-or-later + license_family: GPL + md5: 90697d80c181414aa3472199e136a04e + name: libtool + run_exports: {} + sha256: c8245c70ba5b075e0cd61f430afbda00b60931603ed4ea31ce89e7fe930e4e3d + size: 415044 + subdir: linux-64 + timestamp: 1740593851157 + version: 2.5.4 + fn: libtool-2.5.4-h5888daf_0.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libtool-2.5.4-h5888daf_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h5888daf_0 + build_number: 0 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: LGPL-2.0-or-later + license_family: LGPL + md5: 8e5de39cab514fa908fcaa7ba37a8738 + name: libltdl + run_exports: + weak: + - libltdl >=2.4.3a,<2.5.0a0 + sha256: 7620c6425d4491e17083106ca49624448fc16186c30a93cf2b58f862bba416d1 + size: 38472 + subdir: linux-64 + timestamp: 1740593829307 + version: 2.4.3a + fn: libltdl-2.4.3a-h5888daf_0.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libltdl-2.4.3a-h5888daf_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: pl5321ha770c72_0 + build_number: 0 + depends: + - autoconf + - m4 + - perl 5.* + license: GPL-3.0-or-later + license_family: GPL + md5: 31215fb10dea74a08fca01d36b793492 + name: automake + run_exports: {} + sha256: b5c383c4b95c405796c309d9149ae4dd314eab1e8cb0ba1925f0c8f7c304dd26 + size: 595151 + subdir: linux-64 + timestamp: 1724062205361 + version: '1.17' + fn: automake-1.17-pl5321ha770c72_0.conda + url: https://conda.anaconda.org/conda-forge/linux-64/automake-1.17-pl5321ha770c72_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hb1e0a52_17 + build_number: 17 + depends: + - binutils_impl_linux-64 >=2.45 + - libgcc >=14.3.0 + - libgcc-devel_linux-64 14.3.0 hf649bbc_117 + - libgomp >=14.3.0 + - libsanitizer 14.3.0 h8f1669f_17 + - libstdcxx >=14.3.0 + - libstdcxx-devel_linux-64 14.3.0 h9f08a49_117 + - sysroot_linux-64 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + md5: f5c501fe2a016ed0103f7a89d2ac0412 + name: gcc_impl_linux-64 + run_exports: {} + sha256: bc7014fcc7fcd54ae922fc3453ad8d88a26f439570bb6a89f785f8b5793306b2 + size: 74850589 + subdir: linux-64 + timestamp: 1770252142196 + version: 14.3.0 + fn: gcc_impl_linux-64-14.3.0-hb1e0a52_17.conda + url: https://conda.anaconda.org/conda-forge/linux-64/gcc_impl_linux-64-14.3.0-hb1e0a52_17.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h9f08a49_117 + build_number: 117 + depends: + - __unix + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + md5: 97f8b7e451f960200c057ca83d92f9be + name: libstdcxx-devel_linux-64 + noarch: generic + run_exports: {} + sha256: ffb164d31e09b18cf95c6330bfce9268c1ce799103e56b7c004250332e7f9ede + size: 20497917 + subdir: noarch + timestamp: 1770251920997 + version: 14.3.0 + fn: libstdcxx-devel_linux-64-14.3.0-h9f08a49_117.conda + url: https://conda.anaconda.org/conda-forge/noarch/libstdcxx-devel_linux-64-14.3.0-h9f08a49_117.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h8f1669f_17 + build_number: 17 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14.3.0 + - libstdcxx >=14.3.0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + md5: 5edfb6baf1af52fa7c0a7072a42d1558 + name: libsanitizer + run_exports: + weak: + - libsanitizer 14.3.0 + sha256: 48a1e008a44b7d630f1243915261628d72df1c1f477f44af2e93350937b496df + size: 7237991 + subdir: linux-64 + timestamp: 1770252070009 + version: 14.3.0 + fn: libsanitizer-14.3.0-h8f1669f_17.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libsanitizer-14.3.0-h8f1669f_17.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hf649bbc_117 + build_number: 117 + depends: + - __unix + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + md5: 50d5470d29a25808d108d3917426d24b + name: libgcc-devel_linux-64 + noarch: generic + run_exports: {} + sha256: 57ef92396b4dc06c5a34792c0f601bc49793a963712e8419d5f03cb4ff87729f + size: 3081070 + subdir: noarch + timestamp: 1770251857403 + version: 14.3.0 + fn: libgcc-devel_linux-64-14.3.0-hf649bbc_117.conda + url: https://conda.anaconda.org/conda-forge/noarch/libgcc-devel_linux-64-14.3.0-hf649bbc_117.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: default_h4852527_101 + build_number: 101 + depends: + - binutils_impl_linux-64 2.45.1 default_hfdba357_101 + license: GPL-3.0-only + license_family: GPL + md5: dec96579f9a7035a59492bf6ee613b53 + name: binutils_linux-64 + run_exports: {} + sha256: 4826f97d33cbe54459970a1e84500dbe0cccf8326aaf370e707372ae20ec5a47 + size: 36060 + subdir: linux-64 + timestamp: 1770267177798 + version: 2.45.1 + fn: binutils_linux-64-2.45.1-default_h4852527_101.conda + url: https://conda.anaconda.org/conda-forge/linux-64/binutils_linux-64-2.45.1-default_h4852527_101.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: default_hfdba357_101 + build_number: 101 + depends: + - ld_impl_linux-64 2.45.1 default_hbd61a6d_101 + - sysroot_linux-64 + - zstd >=1.5.7,<1.6.0a0 + license: GPL-3.0-only + license_family: GPL + md5: 83aa53cb3f5fc849851a84d777a60551 + name: binutils_impl_linux-64 + run_exports: {} + sha256: 74341b26a2b9475dc14ba3cf12432fcd10a23af285101883e720216d81d44676 + size: 3744895 + subdir: linux-64 + timestamp: 1770267152681 + version: 2.45.1 + fn: binutils_impl_linux-64-2.45.1-default_hfdba357_101.conda + url: https://conda.anaconda.org/conda-forge/linux-64/binutils_impl_linux-64-2.45.1-default_hfdba357_101.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: default_hbd61a6d_101 + build_number: 101 + constrains: + - binutils_impl_linux-64 2.45.1 + depends: + - __glibc >=2.17,<3.0.a0 + - zstd >=1.5.7,<1.6.0a0 + license: GPL-3.0-only + license_family: GPL + md5: 12bd9a3f089ee6c9266a37dab82afabd + name: ld_impl_linux-64 + run_exports: {} + sha256: 565941ac1f8b0d2f2e8f02827cbca648f4d18cd461afc31f15604cd291b5c5f3 + size: 725507 + subdir: linux-64 + timestamp: 1770267139900 + version: 2.45.1 + fn: ld_impl_linux-64-2.45.1-default_hbd61a6d_101.conda + url: https://conda.anaconda.org/conda-forge/linux-64/ld_impl_linux-64-2.45.1-default_hbd61a6d_101.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hc9c84f9_1 + build_number: 1 + depends: [] + license: LicenseRef-Public-Domain + md5: ad659d0a2b3e47e38d829aa8cad2d610 + name: tzdata + noarch: generic + run_exports: {} + sha256: 1d30098909076af33a35017eed6f2953af1c769e273a0626a04722ac4acaba3c + size: 119135 + subdir: noarch + timestamp: 1767016325805 + version: 2025c + fn: tzdata-2025c-hc9c84f9_1.conda + url: https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-hc9c84f9_1.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: he0feb66_17 + build_number: 17 + constrains: + - libgcc-ng ==15.2.0=*_17 + - libgomp 15.2.0 he0feb66_17 + depends: + - __glibc >=2.17,<3.0.a0 + - _openmp_mutex >=4.5 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + md5: 3c281169ea25b987311400d7a7e28445 + name: libgcc + run_exports: {} + sha256: 43860222cf3abf04ded0cf24541a105aa388e0e1d4d6ca46258e186d4e87ae3e + size: 1040478 + subdir: linux-64 + timestamp: 1770252533873 + version: 15.2.0 + fn: libgcc-15.2.0-he0feb66_17.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_17.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: he0feb66_17 + build_number: 17 + depends: + - __glibc >=2.17,<3.0.a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + md5: 51b78c6a757575c0d12f4401ffc67029 + name: libgomp + run_exports: + strong: + - _openmp_mutex >=4.5 + sha256: b961b5dd9761907a7179678b58a69bb4fc16b940eb477f635aea3aec0a3f17a6 + size: 603334 + subdir: linux-64 + timestamp: 1770252441199 + version: 15.2.0 + fn: libgomp-15.2.0-he0feb66_17.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_17.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h934c35e_17 + build_number: 17 + constrains: + - libstdcxx-ng ==15.2.0=*_17 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc 15.2.0 he0feb66_17 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + md5: 24c2fe35fa45cd71214beba6f337c071 + name: libstdcxx + run_exports: {} + sha256: 50c48cd3716a2e58e8e2e02edc78fef2d08fffe1e3b1ed40eb5f87e7e2d07889 + size: 5852406 + subdir: linux-64 + timestamp: 1770252584235 + version: 15.2.0 + fn: libstdcxx-15.2.0-h934c35e_17.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h934c35e_17.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: pl5321hbb4ee43_1 + build_number: 1 + depends: + - __glibc >=2.17,<3.0.a0 + - m4 + - perl 5.* + license: GPL-3.0-or-later + license_family: GPL + md5: 61a406051317df9dd63157c4c53899e6 + name: autoconf + run_exports: {} + sha256: 8297a545b15576a899ffc0293a9b25c7d9895e155c61d96f266d38c3c46640cb + size: 648370 + subdir: linux-64 + timestamp: 1747238591729 + version: '2.72' + fn: autoconf-2.72-pl5321hbb4ee43_1.conda + url: https://conda.anaconda.org/conda-forge/linux-64/autoconf-2.72-pl5321hbb4ee43_1.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hb03c661_0 + build_number: 0 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=14 + license: GPL-3.0-or-later + license_family: GPL + md5: 2c0696bb8251b054469ef84cc8953294 + name: m4 + run_exports: {} + sha256: 5602528aaeb58b02259d68bdc8eca934a18e449df8bf8f904c039c9749e3514c + size: 290659 + subdir: linux-64 + timestamp: 1770422672622 + version: 1.4.21 + fn: m4-1.4.21-hb03c661_0.conda + url: https://conda.anaconda.org/conda-forge/linux-64/m4-1.4.21-hb03c661_0.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: 7_hd590300_perl5 + build_number: 7 + depends: + - libgcc-ng >=12 + - libxcrypt >=4.4.36 + license: GPL-1.0-or-later OR Artistic-1.0-Perl + md5: f2cfec9406850991f4e3d960cc9e3321 + name: perl + run_exports: + weak: + - perl >=5.32.1,<5.33.0a0 *_perl5 + noarch: + - perl >=5.32.1,<6.0a0 *_perl5 + sha256: 9ec32b6936b0e37bcb0ed34f22ec3116e75b3c0964f9f50ecea5f58734ed6ce9 + size: 13344463 + subdir: linux-64 + timestamp: 1703310653947 + version: 5.32.1 + fn: perl-5.32.1-7_hd590300_perl5.conda + url: https://conda.anaconda.org/conda-forge/linux-64/perl-5.32.1-7_hd590300_perl5.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: h69a702a_17 + build_number: 17 + depends: + - libgcc 15.2.0 he0feb66_17 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + md5: 1478bfa85224a65ab096d69ffd2af1e5 + name: libgcc-ng + run_exports: + strong: + - libgcc + sha256: bdfe50501e4a2d904a5eae65a7ae26e2b7a29b473ab084ad55d96080b966502e + size: 27541 + subdir: linux-64 + timestamp: 1770252546553 + version: 15.2.0 + fn: libgcc-ng-15.2.0-h69a702a_17.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-15.2.0-h69a702a_17.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: 2_gnu + build_number: 16 + constrains: + - openmp_impl 9999 + depends: + - _libgcc_mutex 0.1 conda_forge + - libgomp >=7.5.0 + license: BSD-3-Clause + license_family: BSD + md5: 73aaf86a425cc6e73fcf236a5a46396d + name: _openmp_mutex + run_exports: + strong: + - _openmp_mutex >=4.5 + sha256: fbe2c5e56a653bebb982eda4876a9178aedfc2b545f25d0ce9c4c0b508253d22 + size: 23621 + subdir: linux-64 + timestamp: 1650670423406 + version: '4.5' + fn: _openmp_mutex-4.5-2_gnu.tar.bz2 + url: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 + channel: https://conda.anaconda.org/conda-forge/ + - build: conda_forge + build_number: 0 + depends: [] + license: None + md5: d7c89558ba9fa0495403155b64376d81 + name: _libgcc_mutex + run_exports: {} + sha256: fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726 + size: 2562 + subdir: linux-64 + timestamp: 1578324546067 + version: '0.1' + fn: _libgcc_mutex-0.1-conda_forge.tar.bz2 + url: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 + channel: https://conda.anaconda.org/conda-forge/ + - build: hd590300_1 + build_number: 1 + depends: + - libgcc-ng >=12 + license: LGPL-2.1-or-later + md5: 5aa797f8787fe7a17d1b0821485b5adc + name: libxcrypt + run_exports: + weak: + - libxcrypt >=4.4.36 + sha256: 6ae68e0b86423ef188196fff6207ed0c8195dd84273cb5623b85aa08033a410c + size: 100393 + subdir: linux-64 + timestamp: 1702724383534 + version: 4.4.36 + fn: libxcrypt-4.4.36-hd590300_1.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libxcrypt-4.4.36-hd590300_1.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hb78ec9c_6 + build_number: 6 + depends: + - __glibc >=2.17,<3.0.a0 + - libzlib >=1.3.1,<2.0a0 + license: BSD-3-Clause + license_family: BSD + md5: 4a13eeac0b5c8e5b8ab496e6c4ddd829 + name: zstd + run_exports: + weak: + - zstd >=1.5.7,<1.6.0a0 + sha256: 68f0206ca6e98fea941e5717cec780ed2873ffabc0e1ed34428c061e2c6268c7 + size: 601375 + subdir: linux-64 + timestamp: 1764777111296 + version: 1.5.7 + fn: zstd-1.5.7-hb78ec9c_6.conda + url: https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hb9d3cd8_2 + build_number: 2 + constrains: + - zlib 1.3.1 *_2 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: Zlib + license_family: Other + md5: edb0dca6bc32e4f4789199455a1dbeb8 + name: libzlib + run_exports: + weak: + - libzlib >=1.3.1,<2.0a0 + sha256: d4bfe88d7cb447768e31650f06257995601f89076080e76df55e3112d4e47dc4 + size: 60963 + subdir: linux-64 + timestamp: 1727963148474 + version: 1.3.1 + fn: libzlib-1.3.1-hb9d3cd8_2.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda + channel: https://conda.anaconda.org/conda-forge/ + host: + specs: + - variant: zlib + spec: zlib 1.* + - spec: libgcc >=14 + from: build + run_export: gcc_linux-64 + - spec: __glibc >=2.17,<3.0.a0 + from: build + run_export: sysroot_linux-64 + resolved: + - build: hb9d3cd8_2 + build_number: 2 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + - libzlib 1.3.1 hb9d3cd8_2 + license: Zlib + license_family: Other + md5: c9f075ab2f33b3bbee9e62d4ad0a6cd8 + name: zlib + run_exports: + weak: + - libzlib >=1.3.1,<2.0a0 + sha256: 5d7c0e5f0005f74112a34a7425179f4eb6e73c92f5d109e6af4ddeca407c92ab + size: 92286 + subdir: linux-64 + timestamp: 1727963153079 + version: 1.3.1 + fn: zlib-1.3.1-hb9d3cd8_2.conda + url: https://conda.anaconda.org/conda-forge/linux-64/zlib-1.3.1-hb9d3cd8_2.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: hb9d3cd8_2 + build_number: 2 + constrains: + - zlib 1.3.1 *_2 + depends: + - __glibc >=2.17,<3.0.a0 + - libgcc >=13 + license: Zlib + license_family: Other + md5: edb0dca6bc32e4f4789199455a1dbeb8 + name: libzlib + run_exports: + weak: + - libzlib >=1.3.1,<2.0a0 + sha256: d4bfe88d7cb447768e31650f06257995601f89076080e76df55e3112d4e47dc4 + size: 60963 + subdir: linux-64 + timestamp: 1727963148474 + version: 1.3.1 + fn: libzlib-1.3.1-hb9d3cd8_2.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: he0feb66_17 + build_number: 17 + constrains: + - libgcc-ng ==15.2.0=*_17 + - libgomp 15.2.0 he0feb66_17 + depends: + - __glibc >=2.17,<3.0.a0 + - _openmp_mutex >=4.5 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + md5: 3c281169ea25b987311400d7a7e28445 + name: libgcc + run_exports: {} + sha256: 43860222cf3abf04ded0cf24541a105aa388e0e1d4d6ca46258e186d4e87ae3e + size: 1040478 + subdir: linux-64 + timestamp: 1770252533873 + version: 15.2.0 + fn: libgcc-15.2.0-he0feb66_17.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-he0feb66_17.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: 2_gnu + build_number: 16 + constrains: + - openmp_impl 9999 + depends: + - _libgcc_mutex 0.1 conda_forge + - libgomp >=7.5.0 + license: BSD-3-Clause + license_family: BSD + md5: 73aaf86a425cc6e73fcf236a5a46396d + name: _openmp_mutex + run_exports: + strong: + - _openmp_mutex >=4.5 + sha256: fbe2c5e56a653bebb982eda4876a9178aedfc2b545f25d0ce9c4c0b508253d22 + size: 23621 + subdir: linux-64 + timestamp: 1650670423406 + version: '4.5' + fn: _openmp_mutex-4.5-2_gnu.tar.bz2 + url: https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2 + channel: https://conda.anaconda.org/conda-forge/ + - build: he0feb66_17 + build_number: 17 + depends: + - __glibc >=2.17,<3.0.a0 + license: GPL-3.0-only WITH GCC-exception-3.1 + license_family: GPL + md5: 51b78c6a757575c0d12f4401ffc67029 + name: libgomp + run_exports: + strong: + - _openmp_mutex >=4.5 + sha256: b961b5dd9761907a7179678b58a69bb4fc16b940eb477f635aea3aec0a3f17a6 + size: 603334 + subdir: linux-64 + timestamp: 1770252441199 + version: 15.2.0 + fn: libgomp-15.2.0-he0feb66_17.conda + url: https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-he0feb66_17.conda + channel: https://conda.anaconda.org/conda-forge/ + - build: conda_forge + build_number: 0 + depends: [] + license: None + md5: d7c89558ba9fa0495403155b64376d81 + name: _libgcc_mutex + run_exports: {} + sha256: fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726 + size: 2562 + subdir: linux-64 + timestamp: 1578324546067 + version: '0.1' + fn: _libgcc_mutex-0.1-conda_forge.tar.bz2 + url: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 + channel: https://conda.anaconda.org/conda-forge/ + run: + depends: + - spec: libgcc >=14 + from: build + run_export: gcc_linux-64 + - spec: __glibc >=2.17,<3.0.a0 + from: build + run_export: sysroot_linux-64 + - spec: libzlib >=1.3.1,<2.0a0 + from: host + run_export: zlib + constraints: [] + run_exports: + weak: + - libpng >=1.6.55,<1.7.0a0 +finalized_sources: +- url: https://downloads.sourceforge.net/project/libpng/libpng16/1.6.55/libpng-1.6.55.tar.gz + sha256: 4b0abab6d219e95690ebe4db7fc9aa95f4006c83baaa022373c0c8442271283d + patches: + - patches/0001-Include-pkg-config-files-in-the-Windows-packages-too.patch + - patches/0002-Ensure-that-lm-is-not-included-in-Windows-pkg-config.patch +system_tools: + rattler-build: 0.57.2 +extra_meta: + flow_run_id: azure_20260209.2.1 + remote_url: https://github.com/conda-forge/libpng-feedstock + sha: f56f4f707aa286e3c52f3a13847930de92e7bdb3 diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/variant_config.yaml b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/variant_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..897e094d4759b63fab61ceb7e33f2c404589ed7a --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/recipe/variant_config.yaml @@ -0,0 +1,8 @@ +c_compiler: gcc +c_compiler_version: '14' +c_stdlib: sysroot +c_stdlib_version: '2.17' +channel_sources: conda-forge +channel_targets: conda-forge main +target_platform: linux-64 +zlib: '1' diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/repodata_record.json b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..3b19bbd6d7eb9c0a32484e82a8eb764471856262 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/repodata_record.json @@ -0,0 +1,23 @@ +{ + "name": "libpng", + "version": "1.6.55", + "build": "h421ea60_0", + "build_number": 0, + "channel": "https://conda.anaconda.org/conda-forge/linux-64", + "subdir": "linux-64", + "fn": "libpng-1.6.55-h421ea60_0.conda", + "md5": "5f13ffc7d30ffec87864e678df9957b4", + "url": "https://conda.anaconda.org/conda-forge/linux-64/libpng-1.6.55-h421ea60_0.conda", + "sha256": "36ade759122cdf0f16e2a2562a19746d96cf9c863ffaa812f2f5071ebbe9c03c", + "arch": "x86_64", + "platform": "linux", + "depends": [ + "libgcc >=14", + "__glibc >=2.17,<3.0.a0", + "libzlib >=1.3.1,<2.0a0" + ], + "constrains": [], + "license": "zlib-acknowledgement", + "timestamp": 1770691470000, + "size": 317669 +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/run_exports.json b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/run_exports.json new file mode 100644 index 0000000000000000000000000000000000000000..f7c5cdcfd278a1c1447fb020aeda7096cdd5e59b --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/run_exports.json @@ -0,0 +1,5 @@ +{ + "weak": [ + "libpng >=1.6.55,<1.7.0a0" + ] +} \ No newline at end of file diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/tests/tests.yaml b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/tests/tests.yaml new file mode 100644 index 0000000000000000000000000000000000000000..990446ad288cdcb20fa83152f8c50f39e58c2a7e --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/info/tests/tests.yaml @@ -0,0 +1,2 @@ +- script: + content: libpng-config --version diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/lib/pkgconfig/libpng.pc b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/lib/pkgconfig/libpng.pc new file mode 100644 index 0000000000000000000000000000000000000000..99f5afef18c1aa01668a931b0ded9925df9f85be --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/lib/pkgconfig/libpng.pc @@ -0,0 +1,12 @@ +prefix=/home/conda/feedstock_root/build_artifacts/bld/rattler-build_libpng_1770691470/host_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include/libpng16 + +Name: libpng +Description: Loads and saves PNG files +Version: 1.6.55 +Requires.private: zlib +Libs: -L${libdir} -lpng16 +Libs.private: -lm -lz -lm +Cflags: -I${includedir} diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/lib/pkgconfig/libpng16.pc b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/lib/pkgconfig/libpng16.pc new file mode 100644 index 0000000000000000000000000000000000000000..99f5afef18c1aa01668a931b0ded9925df9f85be --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/lib/pkgconfig/libpng16.pc @@ -0,0 +1,12 @@ +prefix=/home/conda/feedstock_root/build_artifacts/bld/rattler-build_libpng_1770691470/host_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include/libpng16 + +Name: libpng +Description: Loads and saves PNG files +Version: 1.6.55 +Requires.private: zlib +Libs: -L${libdir} -lpng16 +Libs.private: -lm -lz -lm +Cflags: -I${includedir} diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/share/man/man3/libpng.3 b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/share/man/man3/libpng.3 new file mode 100644 index 0000000000000000000000000000000000000000..b7873e9c22534d138722840666d0609f25fe409a --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/share/man/man3/libpng.3 @@ -0,0 +1,6024 @@ +.TH LIBPNG 3 "February 9, 2026" +.SH NAME +libpng \- Portable Network Graphics (PNG) Reference Library 1.6.55 + +.SH SYNOPSIS +\fB#include \fP + +\fBpng_uint_32 png_access_version_number (void);\fP + +\fBvoid png_benign_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP + +\fBvoid png_build_grayscale_palette (int \fP\fIbit_depth\fP\fB, png_colorp \fIpalette\fP\fB);\fP + +\fBpng_voidp png_calloc (png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIsize\fP\fB);\fP + +\fBvoid png_chunk_benign_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP + +\fBvoid png_chunk_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP + +\fBvoid png_chunk_warning (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fImessage\fP\fB);\fP + +\fBvoid png_convert_from_struct_tm (png_timep \fP\fIptime\fP\fB, struct tm FAR * \fIttime\fP\fB);\fP + +\fBvoid png_convert_from_time_t (png_timep \fP\fIptime\fP\fB, time_t \fIttime\fP\fB);\fP + +\fBpng_charp png_convert_to_rfc1123 (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fIptime\fP\fB);\fP + +\fBpng_infop png_create_info_struct (png_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_structp png_create_read_struct (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarn_fn\fP\fB);\fP + +\fBpng_structp png_create_read_struct_2 (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP + +\fBpng_structp png_create_write_struct (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarn_fn\fP\fB);\fP + +\fBpng_structp png_create_write_struct_2 (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP + +\fBvoid png_data_freer (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIfreer\fP\fB, png_uint_32 \fImask\fP\fB);\fP + +\fBvoid png_destroy_info_struct (png_structp \fP\fIpng_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP + +\fBvoid png_destroy_read_struct (png_structpp \fP\fIpng_ptr_ptr\fP\fB, png_infopp \fP\fIinfo_ptr_ptr\fP\fB, png_infopp \fIend_info_ptr_ptr\fP\fB);\fP + +\fBvoid png_destroy_write_struct (png_structpp \fP\fIpng_ptr_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP + +\fBvoid png_err (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP + +\fBvoid png_free (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fIptr\fP\fB);\fP + +\fBvoid png_free_chunk_list (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_free_default (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fIptr\fP\fB);\fP + +\fBvoid png_free_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fInum\fP\fB);\fP + +\fBpng_byte png_get_bit_depth (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_bKGD (png_const_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fI*background\fP\fB);\fP + +\fBpng_byte png_get_channels (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_cHRM (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*white_x\fP\fB, double \fP\fI*white_y\fP\fB, double \fP\fI*red_x\fP\fB, double \fP\fI*red_y\fP\fB, double \fP\fI*green_x\fP\fB, double \fP\fI*green_y\fP\fB, double \fP\fI*blue_x\fP\fB, double \fI*blue_y\fP\fB);\fP + +\fBpng_uint_32 png_get_cHRM_fixed (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*white_x\fP\fB, png_uint_32 \fP\fI*white_y\fP\fB, png_uint_32 \fP\fI*red_x\fP\fB, png_uint_32 \fP\fI*red_y\fP\fB, png_uint_32 \fP\fI*green_x\fP\fB, png_uint_32 \fP\fI*green_y\fP\fB, png_uint_32 \fP\fI*blue_x\fP\fB, png_uint_32 \fI*blue_y\fP\fB);\fP + +\fBpng_uint_32 png_get_cHRM_XYZ (png_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*red_X\fP\fB, double \fP\fI*red_Y\fP\fB, double \fP\fI*red_Z\fP\fB, double \fP\fI*green_X\fP\fB, double \fP\fI*green_Y\fP\fB, double \fP\fI*green_Z\fP\fB, double \fP\fI*blue_X\fP\fB, double \fP\fI*blue_Y\fP\fB, double \fI*blue_Z\fP\fB);\fP + +\fBpng_uint_32 png_get_cHRM_XYZ_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_fixed_point \fP\fI*int_red_X\fP\fB, png_fixed_point \fP\fI*int_red_Y\fP\fB, png_fixed_point \fP\fI*int_red_Z\fP\fB, png_fixed_point \fP\fI*int_green_X\fP\fB, png_fixed_point \fP\fI*int_green_Y\fP\fB, png_fixed_point \fP\fI*int_green_Z\fP\fB, png_fixed_point \fP\fI*int_blue_X\fP\fB, png_fixed_point \fP\fI*int_blue_Y\fP\fB, png_fixed_point \fI*int_blue_Z\fP\fB);\fP + +\fBpng_uint_32 png_get_chunk_cache_max (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_alloc_size_t png_get_chunk_malloc_max (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_byte png_get_color_type (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_compression_buffer_size (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_byte png_get_compression_type (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_byte png_get_copyright (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_current_row_number \fI(png_const_structp\fP\fB);\fP + +\fBpng_byte png_get_current_pass_number \fI(png_const_structp\fP\fB);\fP + +\fBpng_voidp png_get_error_ptr (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_byte png_get_filter_type (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_gAMA (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, double \fI*file_gamma\fP\fB);\fP + +\fBpng_uint_32 png_get_gAMA_fixed (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fI*int_file_gamma\fP\fB);\fP + +\fBpng_byte png_get_header_ver (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_byte png_get_header_version (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_eXIf (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fI*exif\fP\fB);\fP + +\fBpng_uint_32 png_get_eXIf_1 (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_unit_32 \fP\fI*num_exif\fP\fB, png_bytep \fI*exif\fP\fB);\fP + +\fBpng_uint_32 png_get_hIST (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP + +\fBpng_uint_32 png_get_iCCP (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_charpp \fP\fIname\fP\fB, int \fP\fI*compression_type\fP\fB, png_bytepp \fP\fIprofile\fP\fB, png_uint_32 \fI*proflen\fP\fB);\fP + +\fBpng_uint_32 png_get_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*width\fP\fB, png_uint_32 \fP\fI*height\fP\fB, int \fP\fI*bit_depth\fP\fB, int \fP\fI*color_type\fP\fB, int \fP\fI*interlace_type\fP\fB, int \fP\fI*compression_type\fP\fB, int \fI*filter_type\fP\fB);\fP + +\fBpng_uint_32 png_get_image_height (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_image_width (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_int_32 png_get_int_32 (png_bytep \fIbuf\fP\fB);\fP + +\fBpng_byte png_get_interlace_type (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_io_chunk_type (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_voidp png_get_io_ptr (png_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_io_state (png_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_byte png_get_libpng_ver (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBint png_get_palette_max(png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_voidp png_get_mem_ptr (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_oFFs (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*offset_x\fP\fB, png_uint_32 \fP\fI*offset_y\fP\fB, int \fI*unit_type\fP\fB);\fP + +\fBpng_uint_32 png_get_pCAL (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fI*purpose\fP\fB, png_int_32 \fP\fI*X0\fP\fB, png_int_32 \fP\fI*X1\fP\fB, int \fP\fI*type\fP\fB, int \fP\fI*nparams\fP\fB, png_charp \fP\fI*units\fP\fB, png_charpp \fI*params\fP\fB);\fP + +\fBpng_uint_32 png_get_pHYs (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*res_x\fP\fB, png_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP + +\fBfloat png_get_pixel_aspect_ratio (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_pHYs_dpi (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*res_x\fP\fB, png_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP + +\fBpng_fixed_point png_get_pixel_aspect_ratio_fixed (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_pixels_per_inch (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_pixels_per_meter (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_voidp png_get_progressive_ptr (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_PLTE (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fI*palette\fP\fB, int \fI*num_palette\fP\fB);\fP + +\fBpng_byte png_get_rgb_to_gray_status (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_rowbytes (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_bytepp png_get_rows (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_sBIT (png_const_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fI*sig_bit\fP\fB);\fP + +\fBvoid png_get_sCAL (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, int* \fP\fIunit\fP\fB, double* \fP\fIwidth\fP\fB, double* \fIheight\fP\fB);\fP + +\fBvoid png_get_sCAL_fixed (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, int* \fP\fIunit\fP\fB, png_fixed_pointp \fP\fIwidth\fP\fB, png_fixed_pointp \fIheight\fP\fB);\fP + +\fBvoid png_get_sCAL_s (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, int* \fP\fIunit\fP\fB, png_charpp \fP\fIwidth\fP\fB, png_charpp \fIheight\fP\fB);\fP + +\fBpng_bytep png_get_signature (png_const_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_sPLT (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fI*splt_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_sRGB (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, int \fI*file_srgb_intent\fP\fB);\fP + +\fBpng_uint_32 png_get_text (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fI*text_ptr\fP\fB, int \fI*num_text\fP\fB);\fP + +\fBpng_uint_32 png_get_tIME (png_const_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fI*mod_time\fP\fB);\fP + +\fBpng_uint_32 png_get_tRNS (png_const_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fI*trans_alpha\fP\fB, int \fP\fI*num_trans\fP\fB, png_color_16p \fI*trans_color\fP\fB);\fP + +\fB/* This function is really an inline macro. \fI*/ + +\fBpng_uint_16 png_get_uint_16 (png_bytep \fIbuf\fP\fB);\fP + +\fBpng_uint_32 png_get_uint_31 (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIbuf\fP\fB);\fP + +\fB/* This function is really an inline macro. \fI*/ + +\fBpng_uint_32 png_get_uint_32 (png_bytep \fIbuf\fP\fB);\fP + +\fBpng_uint_32 png_get_unknown_chunks (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkpp \fIunknowns\fP\fB);\fP + +\fBpng_voidp png_get_user_chunk_ptr (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_user_height_max (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_voidp png_get_user_transform_ptr (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_user_width_max (png_const_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_valid (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIflag\fP\fB);\fP + +\fBfloat png_get_x_offset_inches (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_fixed_point png_get_x_offset_inches_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_int_32 png_get_x_offset_microns (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_int_32 png_get_x_offset_pixels (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_x_pixels_per_inch (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_x_pixels_per_meter (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBfloat png_get_y_offset_inches (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_fixed_point png_get_y_offset_inches_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_int_32 png_get_y_offset_microns (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_int_32 png_get_y_offset_pixels (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_y_pixels_per_inch (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBpng_uint_32 png_get_y_pixels_per_meter (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP + +\fBint png_handle_as_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP + +\fBint png_image_begin_read_from_file (png_imagep \fP\fIimage\fP\fB, const char \fI*file_name\fP\fB);\fP + +\fBint png_image_begin_read_from_stdio (png_imagep \fP\fIimage\fP\fB, FILE *\fIfile\fP\fB);\fP + +\fBint, png_image_begin_read_from_memory (png_imagep \fP\fIimage\fP\fB, png_const_voidp \fP\fImemory\fP\fB, size_t \fIsize\fP\fB);\fP + +\fBint png_image_finish_read (png_imagep \fP\fIimage\fP\fB, png_colorp \fP\fIbackground\fP\fB, void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP + +\fBvoid png_image_free (png_imagep \fIimage\fP\fB);\fP + +\fBint png_image_write_to_file (png_imagep \fP\fIimage\fP\fB, const char \fP\fI*file\fP\fB, int \fP\fIconvert_to_8bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP + +\fBint png_image_write_to_memory (png_imagep \fP\fIimage\fP\fB, void \fP\fI*memory\fP\fB, png_alloc_size_t * PNG_RESTRICT \fP\fImemory_bytes\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, const void \fI*colormap\fP\fB);\fP + +\fBint png_image_write_to_stdio (png_imagep \fP\fIimage\fP\fB, FILE \fP\fI*file\fP\fB, int \fP\fIconvert_to_8_bit\fP\fB, const void \fP\fI*buffer\fP\fB, png_int_32 \fP\fIrow_stride\fP\fB, void \fI*colormap\fP\fB);\fP + +\fBvoid png_info_init_3 (png_infopp \fP\fIinfo_ptr\fP\fB, size_t \fIpng_info_struct_size\fP\fB);\fP + +\fBvoid png_init_io (png_structp \fP\fIpng_ptr\fP\fB, FILE \fI*fp\fP\fB);\fP + +\fBvoid png_longjmp (png_structp \fP\fIpng_ptr\fP\fB, int \fIval\fP\fB);\fP + +\fBpng_voidp png_malloc (png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIsize\fP\fB);\fP + +\fBpng_voidp png_malloc_default (png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIsize\fP\fB);\fP + +\fBpng_voidp png_malloc_warn (png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIsize\fP\fB);\fP + +\fBpng_uint_32 png_permit_mng_features (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fImng_features_permitted\fP\fB);\fP + +\fBvoid png_process_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, size_t \fIbuffer_size\fP\fB);\fP + +\fBsize_t png_process_data_pause (png_structp \fP\fIpng_ptr\fP\fB, int \fIsave\fP\fB);\fP + +\fBpng_uint_32 png_process_data_skip (png_structp \fP\fIpng_ptr\fP\fB);\fP + +\fBvoid png_progressive_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIold_row\fP\fB, png_bytep \fInew_row\fP\fB);\fP + +\fBvoid png_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fBvoid png_read_image (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fIimage\fP\fB);\fP + +\fBvoid png_read_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fBvoid png_read_png (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fItransforms\fP\fB, png_voidp \fIparams\fP\fB);\fP + +\fBvoid png_read_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fIdisplay_row\fP\fB);\fP + +\fBvoid png_read_rows (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fP\fIrow\fP\fB, png_bytepp \fP\fIdisplay_row\fP\fB, png_uint_32 \fInum_rows\fP\fB);\fP + +\fBvoid png_read_update_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fBint png_reset_zstream (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_save_int_32 (png_bytep \fP\fIbuf\fP\fB, png_int_32 \fIi\fP\fB);\fP + +\fBvoid png_save_uint_16 (png_bytep \fP\fIbuf\fP\fB, unsigned int \fIi\fP\fB);\fP + +\fBvoid png_save_uint_32 (png_bytep \fP\fIbuf\fP\fB, png_uint_32 \fIi\fP\fB);\fP + +\fBvoid png_set_add_alpha (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP + +\fBvoid png_set_alpha_mode (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImode\fP\fB, double \fIoutput_gamma\fP\fB);\fP + +\fBvoid png_set_alpha_mode_fixed (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImode\fP\fB, png_fixed_point \fIoutput_gamma\fP\fB);\fP + +\fBvoid png_set_background (png_structp \fP\fIpng_ptr\fP\fB, png_color_16p \fP\fIbackground_color\fP\fB, int \fP\fIbackground_gamma_code\fP\fB, int \fP\fIneed_expand\fP\fB, double \fIbackground_gamma\fP\fB);\fP + +\fBvoid png_set_background_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_color_16p \fP\fIbackground_color\fP\fB, int \fP\fIbackground_gamma_code\fP\fB, int \fP\fIneed_expand\fP\fB, png_uint_32 \fIbackground_gamma\fP\fB);\fP + +\fBvoid png_set_benign_errors (png_structp \fP\fIpng_ptr\fP\fB, int \fIallowed\fP\fB);\fP + +\fBvoid png_set_bgr (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fIbackground\fP\fB);\fP + +\fBvoid png_set_check_for_invalid_index (png_structrp \fP\fIpng_ptr\fP\fB, int \fIallowed\fP\fB);\fP + +\fBvoid png_set_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP + +\fBvoid png_set_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP + +\fBvoid png_set_cHRM_XYZ (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fIred_X\fP\fB, double \fP\fIred_Y\fP\fB, double \fP\fIred_Z\fP\fB, double \fP\fIgreen_X\fP\fB, double \fP\fIgreen_Y\fP\fB, double \fP\fIgreen_Z\fP\fB, double \fP\fIblue_X\fP\fB, double \fP\fIblue_Y\fP\fB, double \fIblue_Z\fP\fB);\fP + +\fBvoid png_set_cHRM_XYZ_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_fixed_point \fP\fIint_red_X\fP\fB, png_fixed_point \fP\fIint_red_Y\fP\fB, png_fixed_point \fP\fIint_red_Z\fP\fB, png_fixed_point \fP\fIint_green_X\fP\fB, png_fixed_point \fP\fIint_green_Y\fP\fB, png_fixed_point \fP\fIint_green_Z\fP\fB, png_fixed_point \fP\fIint_blue_X\fP\fB, png_fixed_point \fP\fIint_blue_Y\fP\fB, png_fixed_point \fIint_blue_Z\fP\fB);\fP + +\fBvoid png_set_chunk_cache_max (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIuser_chunk_cache_max\fP\fB);\fP + +\fBvoid png_set_compression_level (png_structp \fP\fIpng_ptr\fP\fB, int \fIlevel\fP\fB);\fP + +\fBvoid png_set_compression_mem_level (png_structp \fP\fIpng_ptr\fP\fB, int \fImem_level\fP\fB);\fP + +\fBvoid png_set_compression_method (png_structp \fP\fIpng_ptr\fP\fB, int \fImethod\fP\fB);\fP + +\fBvoid png_set_compression_strategy (png_structp \fP\fIpng_ptr\fP\fB, int \fIstrategy\fP\fB);\fP + +\fBvoid png_set_compression_window_bits (png_structp \fP\fIpng_ptr\fP\fB, int \fIwindow_bits\fP\fB);\fP + +\fBvoid png_set_crc_action (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcrit_action\fP\fB, int \fIancil_action\fP\fB);\fP + +\fBvoid png_set_error_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fIwarning_fn\fP\fB);\fP + +\fBvoid png_set_expand (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_expand_16 (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_expand_gray_1_2_4_to_8 (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_filler (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP + +\fBvoid png_set_filter (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImethod\fP\fB, int \fIfilters\fP\fB);\fP + +\fBvoid png_set_filter_heuristics (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIheuristic_method\fP\fB, int \fP\fInum_weights\fP\fB, png_doublep \fP\fIfilter_weights\fP\fB, png_doublep \fIfilter_costs\fP\fB);\fP + +\fBvoid png_set_filter_heuristics_fixed (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIheuristic_method\fP\fB, int \fP\fInum_weights\fP\fB, png_fixed_point_p \fP\fIfilter_weights\fP\fB, png_fixed_point_p \fIfilter_costs\fP\fB);\fP + +\fBvoid png_set_flush (png_structp \fP\fIpng_ptr\fP\fB, int \fInrows\fP\fB);\fP + +\fBvoid png_set_gamma (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIscreen_gamma\fP\fB, double \fIdefault_file_gamma\fP\fB);\fP + +\fBvoid png_set_gamma_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIscreen_gamma\fP\fB, png_uint_32 \fIdefault_file_gamma\fP\fB);\fP + +\fBvoid png_set_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP + +\fBvoid png_set_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIfile_gamma\fP\fB);\fP + +\fBvoid png_set_gray_1_2_4_to_8 (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_gray_to_rgb (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_eXIf (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fIexif\fP\fB);\fP + +\fBvoid png_set_eXIf_1 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fInum_exif\fP\fB, png_bytep \fIexif\fP\fB);\fP + +\fBvoid png_set_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fIhist\fP\fB);\fP + +\fBvoid png_set_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_const_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_const_bytep \fP\fIprofile\fP\fB, png_uint_32 \fIproflen\fP\fB);\fP + +\fBint png_set_interlace_handling (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_invalid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fImask\fP\fB);\fP + +\fBvoid png_set_invert_alpha (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_invert_mono (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP + +\fBvoid png_set_keep_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIkeep\fP\fB, png_bytep \fP\fIchunk_list\fP\fB, int \fInum_chunks\fP\fB);\fP + +\fBjmp_buf* png_set_longjmp_fn (png_structp \fP\fIpng_ptr\fP\fB, png_longjmp_ptr \fP\fIlongjmp_fn\fP\fB, size_t \fIjmp_buf_size\fP\fB);\fP + +\fBvoid png_set_chunk_malloc_max (png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIuser_chunk_cache_max\fP\fB);\fP + +\fBvoid png_set_compression_buffer_size (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP + +\fBvoid png_set_mem_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP + +\fBvoid png_set_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIoffset_x\fP\fB, png_uint_32 \fP\fIoffset_y\fP\fB, int \fIunit_type\fP\fB);\fP + +\fBint png_set_option(png_structrp \fP\fIpng_ptr\fP\fB, int \fP\fIoption\fP\fB, int \fIonoff\fP\fB);\fP + +\fBvoid png_set_packing (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_packswap (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_palette_to_rgb (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP + +\fBvoid png_set_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fIres_x\fP\fB, png_uint_32 \fP\fIres_y\fP\fB, int \fIunit_type\fP\fB);\fP + +\fBvoid png_set_progressive_read_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIprogressive_ptr\fP\fB, png_progressive_info_ptr \fP\fIinfo_fn\fP\fB, png_progressive_row_ptr \fP\fIrow_fn\fP\fB, png_progressive_end_ptr \fIend_fn\fP\fB);\fP + +\fBvoid png_set_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP + +\fBvoid png_set_quantize (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fP\fInum_palette\fP\fB, int \fP\fImaximum_colors\fP\fB, png_uint_16p \fP\fIhistogram\fP\fB, int \fIfull_quantize\fP\fB);\fP + +\fBvoid png_set_read_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIio_ptr\fP\fB, png_rw_ptr \fIread_data_fn\fP\fB);\fP + +\fBvoid png_set_read_status_fn (png_structp \fP\fIpng_ptr\fP\fB, png_read_status_ptr \fIread_row_fn\fP\fB);\fP + +\fBvoid png_set_read_user_chunk_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_chunk_ptr\fP\fB, png_user_chunk_ptr \fIread_user_chunk_fn\fP\fB);\fP + +\fBvoid png_set_read_user_transform_fn (png_structp \fP\fIpng_ptr\fP\fB, png_user_transform_ptr \fIread_user_transform_fn\fP\fB);\fP + +\fBvoid png_set_rgb_to_gray (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIerror_action\fP\fB, double \fP\fIred\fP\fB, double \fIgreen\fP\fB);\fP + +\fBvoid png_set_rgb_to_gray_fixed (png_structp \fP\fIpng_ptr\fP\fB, int error_action png_uint_32 \fP\fIred\fP\fB, png_uint_32 \fIgreen\fP\fB);\fP + +\fBvoid png_set_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytepp \fIrow_pointers\fP\fB);\fP + +\fBvoid png_set_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fIsig_bit\fP\fB);\fP + +\fBvoid png_set_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP + +\fBvoid png_set_sCAL_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIunit\fP\fB, png_fixed_point \fP\fIwidth\fP\fB, png_fixed_point \fIheight\fP\fB);\fP + +\fBvoid png_set_sCAL_s (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIunit\fP\fB, png_charp \fP\fIwidth\fP\fB, png_charp \fIheight\fP\fB);\fP + +\fBvoid png_set_scale_16 (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_shift (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fItrue_bits\fP\fB);\fP + +\fBvoid png_set_sig_bytes (png_structp \fP\fIpng_ptr\fP\fB, int \fInum_bytes\fP\fB);\fP + +\fBvoid png_set_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fP\fIsplt_ptr\fP\fB, int \fInum_spalettes\fP\fB);\fP + +\fBvoid png_set_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fIsrgb_intent\fP\fB);\fP + +\fBvoid png_set_sRGB_gAMA_and_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fIsrgb_intent\fP\fB);\fP + +\fBvoid png_set_strip_16 (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_strip_alpha (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_strip_error_numbers (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIstrip_mode\fP\fB);\fP + +\fBvoid png_set_swap (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_swap_alpha (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_set_text (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP + +\fBvoid png_set_text_compression_level (png_structp \fP\fIpng_ptr\fP\fB, int \fIlevel\fP\fB);\fP + +\fBvoid png_set_text_compression_mem_level (png_structp \fP\fIpng_ptr\fP\fB, int \fImem_level\fP\fB);\fP + +\fBvoid png_set_text_compression_strategy (png_structp \fP\fIpng_ptr\fP\fB, int \fIstrategy\fP\fB);\fP + +\fBvoid png_set_text_compression_window_bits (png_structp \fP\fIpng_ptr\fP\fB, int \fIwindow_bits\fP\fB);\fP + +\fBvoid png_set_text_compression_method (png_structp \fP\fIpng_ptr\fP\fB, int \fImethod\fP\fB);\fP + +\fBvoid png_set_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP + +\fBvoid png_set_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fItrans_alpha\fP\fB, int \fP\fInum_trans\fP\fB, png_color_16p \fItrans_color\fP\fB);\fP + +\fBvoid png_set_tRNS_to_alpha (png_structp \fIpng_ptr\fP\fB);\fP + +\fBpng_uint_32 png_set_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkp \fP\fIunknowns\fP\fB, int \fP\fInum\fP\fB, int \fIlocation\fP\fB);\fP + +\fBvoid png_set_unknown_chunk_location (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIchunk\fP\fB, int \fIlocation\fP\fB);\fP + +\fBvoid png_set_user_limits (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIuser_width_max\fP\fB, png_uint_32 \fIuser_height_max\fP\fB);\fP + +\fBvoid png_set_user_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_transform_ptr\fP\fB, int \fP\fIuser_transform_depth\fP\fB, int \fIuser_transform_channels\fP\fB);\fP + +\fBvoid png_set_write_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIio_ptr\fP\fB, png_rw_ptr \fP\fIwrite_data_fn\fP\fB, png_flush_ptr \fIoutput_flush_fn\fP\fB);\fP + +\fBvoid png_set_write_status_fn (png_structp \fP\fIpng_ptr\fP\fB, png_write_status_ptr \fIwrite_row_fn\fP\fB);\fP + +\fBvoid png_set_write_user_transform_fn (png_structp \fP\fIpng_ptr\fP\fB, png_user_transform_ptr \fIwrite_user_transform_fn\fP\fB);\fP + +\fBint png_sig_cmp (png_bytep \fP\fIsig\fP\fB, size_t \fP\fIstart\fP\fB, size_t \fInum_to_check\fP\fB);\fP + +\fBvoid png_start_read_image (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_warning (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fImessage\fP\fB);\fP + +\fBvoid png_write_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIchunk_name\fP\fB, png_bytep \fP\fIdata\fP\fB, size_t \fIlength\fP\fB);\fP + +\fBvoid png_write_chunk_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, size_t \fIlength\fP\fB);\fP + +\fBvoid png_write_chunk_end (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_write_chunk_start (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIchunk_name\fP\fB, png_uint_32 \fIlength\fP\fB);\fP + +\fBvoid png_write_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fBvoid png_write_flush (png_structp \fIpng_ptr\fP\fB);\fP + +\fBvoid png_write_image (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fIimage\fP\fB);\fP + +\fBvoid png_write_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fBvoid png_write_info_before_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP + +\fBvoid png_write_png (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fItransforms\fP\fB, png_voidp \fIparams\fP\fB);\fP + +\fBvoid png_write_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP + +\fBvoid png_write_rows (png_structp \fP\fIpng_ptr\fP\fB, png_bytepp \fP\fIrow\fP\fB, png_uint_32 \fInum_rows\fP\fB);\fP + +\fBvoid png_write_sig (png_structp \fIpng_ptr\fP\fB);\fP + +.SH DESCRIPTION +The +.I libpng +library supports encoding, decoding, and various manipulations of +the Portable Network Graphics (PNG) format image files. It uses the +.IR zlib(3) +compression library. +Following is a copy of the libpng-manual.txt file that accompanies libpng. + +.SH LIBPNG.TXT +libpng-manual.txt - A description on how to use and modify libpng + + Copyright (c) 2018-2026 Cosmin Truta + Copyright (c) 1998-2018 Glenn Randers-Pehrson + + This document is released under the libpng license. + For conditions of distribution and use, see the disclaimer + and license in png.h + + Based on: + + libpng version 1.6.36, December 2018, through 1.6.55 - February 2026 + Updated and distributed by Cosmin Truta + Copyright (c) 2018-2026 Cosmin Truta + + libpng versions 0.97, January 1998, through 1.6.35 - July 2018 + Updated and distributed by Glenn Randers-Pehrson + Copyright (c) 1998-2018 Glenn Randers-Pehrson + + libpng 1.0 beta 6 - version 0.96 - May 28, 1997 + Updated and distributed by Andreas Dilger + Copyright (c) 1996, 1997 Andreas Dilger + + libpng 1.0 beta 2 - version 0.88 - January 26, 1996 + For conditions of distribution and use, see copyright + notice in png.h. Copyright (c) 1995, 1996 Guy Eric + Schalnat, Group 42, Inc. + + Updated/rewritten per request in the libpng FAQ + Copyright (c) 1995, 1996 Frank J. T. Wojcik + December 18, 1995 & January 20, 1996 + + TABLE OF CONTENTS + + I. Introduction + II. Structures + III. Reading + IV. Writing + V. Simplified API + VI. Modifying/Customizing libpng + VII. MNG support + VIII. Changes to Libpng from version 0.88 + IX. Changes to Libpng from version 1.0.x to 1.2.x + X. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x + XI. Changes to Libpng from version 1.4.x to 1.5.x + XII. Changes to Libpng from version 1.5.x to 1.6.x + XIII. Detecting libpng + XIV. Source code repository + XV. Coding style + +.SH I. Introduction + +This file describes how to use and modify the PNG reference library +(known as libpng) for your own use. In addition to this +file, example.c is a good starting point for using the library, as +it is heavily commented and should include everything most people +will need. We assume that libpng is already installed; see the +INSTALL file for instructions on how to configure and install libpng. + +For examples of libpng usage, see the files "example.c", "pngtest.c", +and the files in the "contrib" directory, all of which are included in +the libpng distribution. + +Libpng was written as a companion to the PNG specification, as a way +of reducing the amount of time and effort it takes to support the PNG +file format in application programs. + +The PNG specification (Third Edition), June 2025, is available as +a W3C Recommendation at +. + +The PNG specification (Second Edition), November 2003, is available as +a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at +. +The W3C and ISO documents have identical technical content. + +The PNG-1.2 specification is available at +. +It is technically equivalent to the PNG specification (Second Edition) +but has some additional material. + +The PNG-1.0 specification is available as RFC 2083 at + and as a +W3C Recommendation at . + +Some additional chunks are described in the special-purpose public chunks +documents at + +Other information +about PNG, and the latest version of libpng, can be found at the PNG home +page, . + +Most users will not have to modify the library significantly; advanced +users may want to modify it more. All attempts were made to make it as +complete as possible, while keeping the code easy to understand. +Currently, this library only supports C. Support for other languages +is being considered. + +Libpng has been designed to handle multiple sessions at one time, +to be easily modifiable, to be portable to the vast majority of +machines (ANSI, K&R, 16-, 32-, and 64-bit) available, and to be easy +to use. The ultimate goal of libpng is to promote the acceptance of +the PNG file format in whatever way possible. While there is still +work to be done (see the TODO file), libpng should cover the +majority of the needs of its users. + +Libpng uses zlib for its compression and decompression of PNG files. +Further information about zlib, and the latest version of zlib, can +be found at the zlib home page, . +The zlib compression utility is a general purpose utility that is +useful for more than PNG files, and can be used without libpng. +See the documentation delivered with zlib for more details. +You can usually find the source files for the zlib utility wherever you +find the libpng source files. + +Libpng is thread safe, provided the threads are using different +instances of the structures. Each thread should have its own +png_struct and png_info instances, and thus its own image. +Libpng does not protect itself against two threads using the +same instance of a structure. + +.SH II. Structures + +There are two main structures that are important to libpng, png_struct +and png_info. Both are internal structures that are no longer exposed +in the libpng interface (as of libpng 1.5.0). + +The png_info structure is designed to provide information about the +PNG file. At one time, the fields of png_info were intended to be +directly accessible to the user. However, this tended to cause problems +with applications using dynamically loaded libraries, and as a result +a set of interface functions for png_info (the png_get_*() and png_set_*() +functions) was developed, and direct access to the png_info fields was +deprecated.. + +The png_struct structure is the object used by the library to decode a +single image. As of 1.5.0 this structure is also not exposed. + +Almost all libpng APIs require a pointer to a png_struct as the first argument. +Many (in particular the png_set and png_get APIs) also require a pointer +to png_info as the second argument. Some application visible macros +defined in png.h designed for basic data access (reading and writing +integers in the PNG format) don't take a png_info pointer, but it's almost +always safe to assume that a (png_struct*) has to be passed to call an API +function. + +You can have more than one png_info structure associated with an image, +as illustrated in pngtest.c, one for information valid prior to the +IDAT chunks and another (called "end_info" below) for things after them. + +The png.h header file is an invaluable reference for programming with libpng. +And while I'm on the topic, make sure you include the libpng header file: + +#include + +and also (as of libpng-1.5.0) the zlib header file, if you need it: + +#include + +.SS Types + +The png.h header file defines a number of integral types used by the +APIs. Most of these are fairly obvious; for example types corresponding +to integers of particular sizes and types for passing color values. + +One exception is how non-integral numbers are handled. For application +convenience most APIs that take such numbers have C (double) arguments; +however, internally PNG, and libpng, use 32 bit signed integers and encode +the value by multiplying by 100,000. As of libpng 1.5.0 a convenience +macro PNG_FP_1 is defined in png.h along with a type (png_fixed_point) +which is simply (png_int_32). + +All APIs that take (double) arguments also have a matching API that +takes the corresponding fixed point integer arguments. The fixed point +API has the same name as the floating point one with "_fixed" appended. +The actual range of values permitted in the APIs is frequently less than +the full range of (png_fixed_point) (\-21474 to +21474). When APIs require +a non-negative argument the type is recorded as png_uint_32 above. Consult +the header file and the text below for more information. + +Special care must be take with sCAL chunk handling because the chunk itself +uses non-integral values encoded as strings containing decimal floating point +numbers. See the comments in the header file. + +.SS Configuration + +The main header file function declarations are frequently protected by C +preprocessing directives of the form: + + #ifdef PNG_feature_SUPPORTED + declare-function + #endif + ... + #ifdef PNG_feature_SUPPORTED + use-function + #endif + +The library can be built without support for these APIs, although a +standard build will have all implemented APIs. Application programs +should check the feature macros before using an API for maximum +portability. From libpng 1.5.0 the feature macros set during the build +of libpng are recorded in the header file "pnglibconf.h" and this file +is always included by png.h. + +If you don't need to change the library configuration from the default, skip to +the next section ("Reading"). + +Notice that some of the makefiles in the 'scripts' directory and (in 1.5.0) all +of the build project files in the 'projects' directory simply copy +scripts/pnglibconf.h.prebuilt to pnglibconf.h. This means that these build +systems do not permit easy auto-configuration of the library - they only +support the default configuration. + +The easiest way to make minor changes to the libpng configuration when +auto-configuration is supported is to add definitions to the command line +using (typically) CPPFLAGS. For example: + +CPPFLAGS=\-DPNG_NO_FLOATING_ARITHMETIC + +will change the internal libpng math implementation for gamma correction and +other arithmetic calculations to fixed point, avoiding the need for fast +floating point support. The result can be seen in the generated pnglibconf.h - +make sure it contains the changed feature macro setting. + +If you need to make more extensive configuration changes - more than one or two +feature macro settings - you can either add \-DPNG_USER_CONFIG to the build +command line and put a list of feature macro settings in pngusr.h or you can set +DFA_XTRA (a makefile variable) to a file containing the same information in the +form of 'option' settings. + +A. Changing pnglibconf.h + +A variety of methods exist to build libpng. Not all of these support +reconfiguration of pnglibconf.h. To reconfigure pnglibconf.h it must either be +rebuilt from scripts/pnglibconf.dfa using awk or it must be edited by hand. + +Hand editing is achieved by copying scripts/pnglibconf.h.prebuilt to +pnglibconf.h and changing the lines defining the supported features, paying +very close attention to the 'option' information in scripts/pnglibconf.dfa +that describes those features and their requirements. This is easy to get +wrong. + +B. Configuration using DFA_XTRA + +Rebuilding from pnglibconf.dfa is easy if a functioning 'awk', or a later +variant such as 'nawk' or 'gawk', is available. The configure build will +automatically find an appropriate awk and build pnglibconf.h. +The scripts/pnglibconf.mak file contains a set of make rules for doing the +same thing if configure is not used, and many of the makefiles in the scripts +directory use this approach. + +When rebuilding simply write a new file containing changed options and set +DFA_XTRA to the name of this file. This causes the build to append the new file +to the end of scripts/pnglibconf.dfa. The pngusr.dfa file should contain lines +of the following forms: + +everything = off + +This turns all optional features off. Include it at the start of pngusr.dfa to +make it easier to build a minimal configuration. You will need to turn at least +some features on afterward to enable either reading or writing code, or both. + +option feature on +option feature off + +Enable or disable a single feature. This will automatically enable other +features required by a feature that is turned on or disable other features that +require a feature which is turned off. Conflicting settings will cause an error +message to be emitted by awk. + +setting feature default value + +Changes the default value of setting 'feature' to 'value'. There are a small +number of settings listed at the top of pnglibconf.h, they are documented in the +source code. Most of these values have performance implications for the library +but most of them have no visible effect on the API. Some can also be overridden +from the API. + +This method of building a customized pnglibconf.h is illustrated in +contrib/pngminim/*. See the "$(PNGCONF):" target in the makefile and +pngusr.dfa in these directories. + +C. Configuration using PNG_USER_CONFIG + +If \-DPNG_USER_CONFIG is added to the CPPFLAGS when pnglibconf.h is built, +the file pngusr.h will automatically be included before the options in +scripts/pnglibconf.dfa are processed. Your pngusr.h file should contain only +macro definitions turning features on or off or setting settings. + +Apart from the global setting "everything = off" all the options listed above +can be set using macros in pngusr.h: + +#define PNG_feature_SUPPORTED + +is equivalent to: + +option feature on + +#define PNG_NO_feature + +is equivalent to: + +option feature off + +#define PNG_feature value + +is equivalent to: + +setting feature default value + +Notice that in both cases, pngusr.dfa and pngusr.h, the contents of the +pngusr file you supply override the contents of scripts/pnglibconf.dfa + +If confusing or incomprehensible behavior results it is possible to +examine the intermediate file pnglibconf.dfn to find the full set of +dependency information for each setting and option. Simply locate the +feature in the file and read the C comments that precede it. + +This method is also illustrated in the contrib/pngminim/* makefiles and +pngusr.h. + +.SH III. Reading + +We'll now walk you through the possible functions to call when reading +in a PNG file sequentially, briefly explaining the syntax and purpose +of each one. See example.c and png.h for more detail. While +progressive reading is covered in the next section, you will still +need some of the functions discussed in this section to read a PNG +file. + +.SS Setup + +You will want to do the I/O initialization(*) before you get into libpng, +so if it doesn't work, you don't have much to undo. Of course, you +will also want to insure that you are, in fact, dealing with a PNG +file. Libpng provides a simple check to see if a file is a PNG file. +To use it, pass in the first 1 to 8 bytes of the file to the function +png_sig_cmp(), and it will return 0 (false) if the bytes match the +corresponding bytes of the PNG signature, or nonzero (true) otherwise. +Of course, the more bytes you pass in, the greater the accuracy of the +prediction. + +If you are intending to keep the file pointer open for use in libpng, +you must ensure you don't read more than 8 bytes from the beginning +of the file, and you also have to make a call to png_set_sig_bytes() +with the number of bytes you read from the beginning. Libpng will +then only check the bytes (if any) that your program didn't read. + +(*): If you are not using the standard I/O functions, you will need +to replace them with custom functions. See the discussion under +Customizing libpng. + + FILE *fp = fopen(file_name, "rb"); + if (!fp) + { + return ERROR; + } + + if (fread(header, 1, number, fp) != number) + { + return ERROR; + } + + is_png = (png_sig_cmp(header, 0, number) == 0); + if (!is_png) + { + return NOT_PNG; + } + +Next, png_struct and png_info need to be allocated and initialized. In +order to ensure that the size of these structures is correct even with a +dynamically linked libpng, there are functions to initialize and +allocate the structures. We also pass the library version, optional +pointers to error handling functions, and a pointer to a data struct for +use by the error functions, if necessary (the pointer and functions can +be NULL if the default error handlers are to be used). See the section +on Changes to Libpng below regarding the old initialization functions. +The structure allocation functions quietly return NULL if they fail to +create the structure, so your application should check for that. + + png_structp png_ptr = png_create_read_struct + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn); + + if (!png_ptr) + return ERROR; + + png_infop info_ptr = png_create_info_struct(png_ptr); + + if (!info_ptr) + { + png_destroy_read_struct(&png_ptr, NULL, NULL); + return ERROR; + } + +If you want to use your own memory allocation routines, +use a libpng that was built with PNG_USER_MEM_SUPPORTED defined, and use +png_create_read_struct_2() instead of png_create_read_struct(): + + png_structp png_ptr = png_create_read_struct_2 + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn, (png_voidp) + user_mem_ptr, user_malloc_fn, user_free_fn); + +The error handling routines passed to png_create_read_struct() +and the memory alloc/free routines passed to png_create_struct_2() +are only necessary if you are not using the libpng supplied error +handling and memory alloc/free functions. + +When libpng encounters an error, it expects to longjmp back +to your routine. Therefore, you will need to call setjmp and pass +your png_jmpbuf(png_ptr). If you read the file from different +routines, you will need to update the longjmp buffer every time you enter +a new routine that will call a png_*() function. + +See your documentation of setjmp/longjmp for your compiler for more +information on setjmp/longjmp. See the discussion on libpng error +handling in the Customizing Libpng section below for more information +on the libpng error handling. If an error occurs, and libpng longjmp's +back to your setjmp, you will want to call png_destroy_read_struct() to +free any memory. + + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); + fclose(fp); + return ERROR; + } + +Pass NULL instead of &end_info if you didn't create an end_info +structure. + +If you would rather avoid the complexity of setjmp/longjmp issues, +you can compile libpng with PNG_NO_SETJMP, in which case +errors will result in a call to PNG_ABORT() which defaults to abort(). + +You can #define PNG_ABORT() to a function that does something +more useful than abort(), as long as your function does not +return. + +Now you need to set up the input code. The default for libpng is to +use the C function fread(). If you use this, you will need to pass a +valid FILE * in the function png_init_io(). Be sure that the file is +opened in binary mode. If you wish to handle reading data in another +way, you need not call the png_init_io() function, but you must then +implement the libpng I/O methods discussed in the Customizing Libpng +section below. + + png_init_io(png_ptr, fp); + +If you had previously opened the file and read any of the signature from +the beginning in order to see if this was a PNG file, you need to let +libpng know that there are some bytes missing from the start of the file. + + png_set_sig_bytes(png_ptr, number); + +You can change the zlib compression buffer size to be used while +reading compressed data with + + png_set_compression_buffer_size(png_ptr, buffer_size); + +where the default size is 8192 bytes. Note that the buffer size +is changed immediately and the buffer is reallocated immediately, +instead of setting a flag to be acted upon later. + +If you want CRC errors to be handled in a different manner than +the default, use + + png_set_crc_action(png_ptr, crit_action, ancil_action); + +The values for png_set_crc_action() say how libpng is to handle CRC errors in +ancillary and critical chunks, and whether to use the data contained +therein. Starting with libpng-1.6.26, this also governs how an ADLER32 error +is handled while reading the IDAT chunk. Note that it is impossible to +"discard" data in a critical chunk. + +Choices for (int) crit_action are + PNG_CRC_DEFAULT 0 error/quit + PNG_CRC_ERROR_QUIT 1 error/quit + PNG_CRC_WARN_USE 3 warn/use data + PNG_CRC_QUIET_USE 4 quiet/use data + PNG_CRC_NO_CHANGE 5 use the current value + +Choices for (int) ancil_action are + PNG_CRC_DEFAULT 0 error/quit + PNG_CRC_ERROR_QUIT 1 error/quit + PNG_CRC_WARN_DISCARD 2 warn/discard data + PNG_CRC_WARN_USE 3 warn/use data + PNG_CRC_QUIET_USE 4 quiet/use data + PNG_CRC_NO_CHANGE 5 use the current value + +When the setting for crit_action is PNG_CRC_QUIET_USE, the CRC and ADLER32 +checksums are not only ignored, but they are not evaluated. + +.SS Setting up callback code + +You can set up a callback function to handle any unknown chunks in the +input stream. You must supply the function + + read_chunk_callback(png_structp png_ptr, + png_unknown_chunkp chunk) + { + /* The unknown chunk structure contains your + chunk data, along with similar data for any other + unknown chunks: */ + + png_byte name[5]; + png_byte *data; + size_t size; + + /* Note that libpng has already taken care of + the CRC handling */ + + /* put your code here. Search for your chunk in the + unknown chunk structure, process it, and return one + of the following: */ + + return \-n; /* chunk had an error */ + return 0; /* did not recognize */ + return n; /* success */ + } + +(You can give your function another name that you like instead of +"read_chunk_callback") + +To inform libpng about your function, use + + png_set_read_user_chunk_fn(png_ptr, user_chunk_ptr, + read_chunk_callback); + +This names not only the callback function, but also a user pointer that +you can retrieve with + + png_get_user_chunk_ptr(png_ptr); + +If you call the png_set_read_user_chunk_fn() function, then all unknown +chunks which the callback does not handle will be saved when read. You can +cause them to be discarded by returning '1' ("handled") instead of '0'. This +behavior will change in libpng 1.7 and the default handling set by the +png_set_keep_unknown_chunks() function, described below, will be used when the +callback returns 0. If you want the existing behavior you should set the global +default to PNG_HANDLE_CHUNK_IF_SAFE now; this is compatible with all current +versions of libpng and with 1.7. Libpng 1.6 issues a warning if you keep the +default, or PNG_HANDLE_CHUNK_NEVER, and the callback returns 0. + +At this point, you can set up a callback function that will be +called after each row has been read, which you can use to control +a progress meter or the like. It's demonstrated in pngtest.c. +You must supply a function + + void read_row_callback(png_structp png_ptr, + png_uint_32 row, int pass) + { + /* put your code here */ + } + +(You can give it another name that you like instead of "read_row_callback") + +To inform libpng about your function, use + + png_set_read_status_fn(png_ptr, read_row_callback); + +When this function is called the row has already been completely processed and +the 'row' and 'pass' refer to the next row to be handled. For the +non-interlaced case the row that was just handled is simply one less than the +passed in row number, and pass will always be 0. For the interlaced case the +same applies unless the row value is 0, in which case the row just handled was +the last one from one of the preceding passes. Because interlacing may skip a +pass you cannot be sure that the preceding pass is just 'pass\-1'; if you really +need to know what the last pass is record (row,pass) from the callback and use +the last recorded value each time. + +As with the user transform you can find the output row using the +PNG_ROW_FROM_PASS_ROW macro. + +.SS Unknown-chunk handling + +Now you get to set the way the library processes unknown chunks in the +input PNG stream. Both known and unknown chunks will be read. Normal +behavior is that known chunks will be parsed into information in +various info_ptr members while unknown chunks will be discarded. This +behavior can be wasteful if your application will never use some known +chunk types. To change this, you can call: + + png_set_keep_unknown_chunks(png_ptr, keep, + chunk_list, num_chunks); + + keep - 0: default unknown chunk handling + 1: ignore; do not keep + 2: keep only if safe-to-copy + 3: keep even if unsafe-to-copy + + You can use these definitions: + PNG_HANDLE_CHUNK_AS_DEFAULT 0 + PNG_HANDLE_CHUNK_NEVER 1 + PNG_HANDLE_CHUNK_IF_SAFE 2 + PNG_HANDLE_CHUNK_ALWAYS 3 + + chunk_list - list of chunks affected (a byte string, + five bytes per chunk, NULL or '\0' if + num_chunks is positive; ignored if + numchunks <= 0). + + num_chunks - number of chunks affected; if 0, all + unknown chunks are affected. If positive, + only the chunks in the list are affected, + and if negative all unknown chunks and + all known chunks except for the IHDR, + PLTE, tRNS, IDAT, and IEND chunks are + affected. + +Unknown chunks declared in this way will be saved as raw data onto a +list of png_unknown_chunk structures. If a chunk that is normally +known to libpng is named in the list, it will be handled as unknown, +according to the "keep" directive. If a chunk is named in successive +instances of png_set_keep_unknown_chunks(), the final instance will +take precedence. The IHDR and IEND chunks should not be named in +chunk_list; if they are, libpng will process them normally anyway. +If you know that your application will never make use of some particular +chunks, use PNG_HANDLE_CHUNK_NEVER (or 1) as demonstrated below. + +Here is an example of the usage of png_set_keep_unknown_chunks(), +where the private "vpAg" chunk will later be processed by a user chunk +callback function: + + png_byte vpAg[5]={118, 112, 65, 103, (png_byte) '\0'}; + + #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + png_byte unused_chunks[]= + { + 104, 73, 83, 84, (png_byte) '\0', /* hIST */ + 105, 84, 88, 116, (png_byte) '\0', /* iTXt */ + 112, 67, 65, 76, (png_byte) '\0', /* pCAL */ + 115, 67, 65, 76, (png_byte) '\0', /* sCAL */ + 115, 80, 76, 84, (png_byte) '\0', /* sPLT */ + 116, 73, 77, 69, (png_byte) '\0', /* tIME */ + }; + #endif + + ... + + #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + /* ignore all unknown chunks + * (use global setting "2" for libpng16 and earlier): + */ + png_set_keep_unknown_chunks(read_ptr, 2, NULL, 0); + + /* except for vpAg: */ + png_set_keep_unknown_chunks(read_ptr, 2, vpAg, 1); + + /* also ignore unused known chunks: */ + png_set_keep_unknown_chunks(read_ptr, 1, unused_chunks, + (int)(sizeof unused_chunks)/5); + #endif + +.SS User limits + +The PNG specification allows the width and height of an image to be as +large as 2^(31\-1 (0x7fffffff), or about 2.147 billion rows and columns. +For safety, libpng imposes a default limit of 1 million rows and columns. +Larger images will be rejected immediately with a png_error() call. If +you wish to change these limits, you can use + + png_set_user_limits(png_ptr, width_max, height_max); + +to set your own limits (libpng may reject some very wide images +anyway because of potential buffer overflow conditions). + +You should put this statement after you create the PNG structure and +before calling png_read_info(), png_read_png(), or png_process_data(). + +When writing a PNG datastream, put this statement before calling +png_write_info() or png_write_png(). + +If you need to retrieve the limits that are being applied, use + + width_max = png_get_user_width_max(png_ptr); + height_max = png_get_user_height_max(png_ptr); + +The PNG specification sets no limit on the number of ancillary chunks +allowed in a PNG datastream. By default, libpng imposes a limit of +a total of 1000 sPLT, tEXt, iTXt, zTXt, and unknown chunks to be stored. +If you have set up both info_ptr and end_info_ptr, the limit applies +separately to each. You can change the limit on the total number of such +chunks that will be stored, with + + png_set_chunk_cache_max(png_ptr, user_chunk_cache_max); + +where 0x7fffffffL means unlimited. You can retrieve this limit with + + chunk_cache_max = png_get_chunk_cache_max(png_ptr); + +Libpng imposes a limit of 8 Megabytes (8,000,000 bytes) on the amount of +memory that any chunk other than IDAT can occupy, originally or when +decompressed (prior to libpng-1.6.32 the limit was only applied to compressed +chunks after decompression). You can change this limit with + + png_set_chunk_malloc_max(png_ptr, user_chunk_malloc_max); + +and you can retrieve the limit with + + chunk_malloc_max = png_get_chunk_malloc_max(png_ptr); + +Any chunks that would cause either of these limits to be exceeded will +be ignored. + +.SS Information about your system + +If you intend to display the PNG or to incorporate it in other image data you +need to tell libpng information about your display or drawing surface so that +libpng can convert the values in the image to match the display. + +From libpng-1.5.4 this information can be set before reading the PNG file +header. In earlier versions png_set_gamma() existed but behaved incorrectly if +called before the PNG file header had been read and png_set_alpha_mode() did not +exist. + +If you need to support versions prior to libpng-1.5.4 test the version number +as illustrated below using "PNG_LIBPNG_VER >= 10504" and follow the procedures +described in the appropriate manual page. + +You give libpng the encoding expected by your system expressed as a 'gamma' +value. You can also specify a default encoding for the PNG file in +case the required information is missing from the file. By default libpng +assumes that the PNG data matches your system, to keep this default call: + + png_set_gamma(png_ptr, screen_gamma, output_gamma); + +or you can use the fixed point equivalent: + + png_set_gamma_fixed(png_ptr, PNG_FP_1*screen_gamma, + PNG_FP_1*output_gamma); + +If you don't know the gamma for your system it is probably 2.2 - a good +approximation to the IEC standard for display systems (sRGB). If images are +too contrasty or washed out you got the value wrong - check your system +documentation! + +Many systems permit the system gamma to be changed via a lookup table in the +display driver, a few systems, including older Macs, change the response by +default. As of 1.5.4 three special values are available to handle common +situations: + + PNG_DEFAULT_sRGB: Indicates that the system conforms to the + IEC 61966-2-1 standard. This matches almost + all systems. + PNG_GAMMA_MAC_18: Indicates that the system is an older + (pre Mac OS 10.6) Apple Macintosh system with + the default settings. + PNG_GAMMA_LINEAR: Just the fixed point value for 1.0 - indicates + that the system expects data with no gamma + encoding. + +You would use the linear (unencoded) value if you need to process the pixel +values further because this avoids the need to decode and re-encode each +component value whenever arithmetic is performed. A lot of graphics software +uses linear values for this reason, often with higher precision component values +to preserve overall accuracy. + + +The output_gamma value expresses how to decode the output values, not how +they are encoded. The values used correspond to the normal numbers used to +describe the overall gamma of a computer display system; for example 2.2 for +an sRGB conformant system. The values are scaled by 100000 in the _fixed +version of the API (so 220000 for sRGB.) + +The inverse of the value is always used to provide a default for the PNG file +encoding if it has no gAMA chunk and if png_set_gamma() has not been called +to override the PNG gamma information. + +When the ALPHA_OPTIMIZED mode is selected the output gamma is used to encode +opaque pixels however pixels with lower alpha values are not encoded, +regardless of the output gamma setting. + +When the standard Porter Duff handling is requested with mode 1 the output +encoding is set to be linear and the output_gamma value is only relevant +as a default for input data that has no gamma information. The linear output +encoding will be overridden if png_set_gamma() is called - the results may be +highly unexpected! + +The following numbers are derived from the sRGB standard and the research +behind it. sRGB is defined to be approximated by a PNG gAMA chunk value of +0.45455 (1/2.2) for PNG. The value implicitly includes any viewing +correction required to take account of any differences in the color +environment of the original scene and the intended display environment; the +value expresses how to *decode* the image for display, not how the original +data was *encoded*. + +sRGB provides a peg for the PNG standard by defining a viewing environment. +sRGB itself, and earlier TV standards, actually use a more complex transform +(a linear portion then a gamma 2.4 power law) than PNG can express. (PNG is +limited to simple power laws.) By saying that an image for direct display on +an sRGB conformant system should be stored with a gAMA chunk value of 45455 +(11.3.3.2 and 11.3.3.5 of the ISO PNG specification) the PNG specification +makes it possible to derive values for other display systems and +environments. + +The Mac value is deduced from the sRGB based on an assumption that the actual +extra viewing correction used in early Mac display systems was implemented as +a power 1.45 lookup table. + +Any system where a programmable lookup table is used or where the behavior of +the final display device characteristics can be changed requires system +specific code to obtain the current characteristic. However this can be +difficult and most PNG gamma correction only requires an approximate value. + +By default, if png_set_alpha_mode() is not called, libpng assumes that all +values are unencoded, linear, values and that the output device also has a +linear characteristic. This is only very rarely correct - it is invariably +better to call png_set_alpha_mode() with PNG_DEFAULT_sRGB than rely on the +default if you don't know what the right answer is! + +The special value PNG_GAMMA_MAC_18 indicates an older Mac system (pre Mac OS +10.6) which used a correction table to implement a somewhat lower gamma on an +otherwise sRGB system. + +Both these values are reserved (not simple gamma values) in order to allow +more precise correction internally in the future. + +NOTE: the values can be passed to either the fixed or floating +point APIs, but the floating point API will also accept floating point +values. + +The second thing you may need to tell libpng about is how your system handles +alpha channel information. Some, but not all, PNG files contain an alpha +channel. To display these files correctly you need to compose the data onto a +suitable background, as described in the PNG specification. + +Libpng only supports composing onto a single color (using png_set_background; +see below). Otherwise you must do the composition yourself and, in this case, +you may need to call png_set_alpha_mode: + + #if PNG_LIBPNG_VER >= 10504 + png_set_alpha_mode(png_ptr, mode, screen_gamma); + #else + png_set_gamma(png_ptr, screen_gamma, 1.0/screen_gamma); + #endif + +The screen_gamma value is the same as the argument to png_set_gamma; however, +how it affects the output depends on the mode. png_set_alpha_mode() sets the +file gamma default to 1/screen_gamma, so normally you don't need to call +png_set_gamma. If you need different defaults call png_set_gamma() before +png_set_alpha_mode() - if you call it after it will override the settings made +by png_set_alpha_mode(). + +The mode is as follows: + + PNG_ALPHA_PNG: The data is encoded according to the PNG +specification. Red, green and blue, or gray, components are +gamma encoded color values and are not premultiplied by the +alpha value. The alpha value is a linear measure of the +contribution of the pixel to the corresponding final output pixel. + +You should normally use this format if you intend to perform +color correction on the color values; most, maybe all, color +correction software has no handling for the alpha channel and, +anyway, the math to handle pre-multiplied component values is +unnecessarily complex. + +Before you do any arithmetic on the component values you need +to remove the gamma encoding and multiply out the alpha +channel. See the PNG specification for more detail. It is +important to note that when an image with an alpha channel is +scaled, linear encoded, pre-multiplied component values must +be used! + +The remaining modes assume you don't need to do any further color correction or +that if you do, your color correction software knows all about alpha (it +probably doesn't!). They 'associate' the alpha with the color information by +storing color channel values that have been scaled by the alpha. The +advantage is that the color channels can be resampled (the image can be +scaled) in this form. The disadvantage is that normal practice is to store +linear, not (gamma) encoded, values and this requires 16-bit channels for +still images rather than the 8-bit channels that are just about sufficient if +gamma encoding is used. In addition all non-transparent pixel values, +including completely opaque ones, must be gamma encoded to produce the final +image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes +described below (the latter being the two common names for associated alpha +color channels). Note that PNG files always contain non-associated color +channels; png_set_alpha_mode() with one of the modes causes the decoder to +convert the pixels to an associated form before returning them to your +application. + +Since it is not necessary to perform arithmetic on opaque color values so +long as they are not to be resampled and are in the final color space it is +possible to optimize the handling of alpha by storing the opaque pixels in +the PNG format (adjusted for the output color space) while storing partially +opaque pixels in the standard, linear, format. The accuracy required for +standard alpha composition is relatively low, because the pixels are +isolated, therefore typically the accuracy loss in storing 8-bit linear +values is acceptable. (This is not true if the alpha channel is used to +simulate transparency over large areas - use 16 bits or the PNG mode in +this case!) This is the 'OPTIMIZED' mode. For this mode a pixel is +treated as opaque only if the alpha value is equal to the maximum value. + + PNG_ALPHA_STANDARD: The data libpng produces is encoded in the +standard way assumed by most correctly written graphics software. +The gamma encoding will be removed by libpng and the +linear component values will be pre-multiplied by the +alpha channel. + +With this format the final image must be re-encoded to +match the display gamma before the image is displayed. +If your system doesn't do that, yet still seems to +perform arithmetic on the pixels without decoding them, +it is broken - check out the modes below. + +With PNG_ALPHA_STANDARD libpng always produces linear +component values, whatever screen_gamma you supply. The +screen_gamma value is, however, used as a default for +the file gamma if the PNG file has no gamma information. + +If you call png_set_gamma() after png_set_alpha_mode() you +will override the linear encoding. Instead the +pre-multiplied pixel values will be gamma encoded but +the alpha channel will still be linear. This may +actually match the requirements of some broken software, +but it is unlikely. + +While linear 8-bit data is often used it has +insufficient precision for any image with a reasonable +dynamic range. To avoid problems, and if your software +supports it, use png_set_expand_16() to force all +components to 16 bits. + + PNG_ALPHA_OPTIMIZED: This mode is the same as PNG_ALPHA_STANDARD +except that completely opaque pixels are gamma encoded according to +the screen_gamma value. Pixels with alpha less than 1.0 +will still have linear components. + +Use this format if you have control over your +compositing software and so don't do other arithmetic +(such as scaling) on the data you get from libpng. Your +compositing software can simply copy opaque pixels to +the output but still has linear values for the +non-opaque pixels. + +In normal compositing, where the alpha channel encodes +partial pixel coverage (as opposed to broad area +translucency), the inaccuracies of the 8-bit +representation of non-opaque pixels are irrelevant. + +You can also try this format if your software is broken; +it might look better. + + PNG_ALPHA_BROKEN: This is PNG_ALPHA_STANDARD; however, all component +values, including the alpha channel are gamma encoded. This is +broken because, in practice, no implementation that uses this choice +correctly undoes the encoding before handling alpha composition. Use this +choice only if other serious errors in the software or hardware you use +mandate it. In most cases of broken software or hardware the bug in the +final display manifests as a subtle halo around composited parts of the +image. You may not even perceive this as a halo; the composited part of +the image may simply appear separate from the background, as though it had +been cut out of paper and pasted on afterward. + +If you don't have to deal with bugs in software or hardware, or if you can fix +them, there are three recommended ways of using png_set_alpha_mode(): + + png_set_alpha_mode(png_ptr, PNG_ALPHA_PNG, + screen_gamma); + +You can do color correction on the result (libpng does not currently +support color correction internally). When you handle the alpha channel +you need to undo the gamma encoding and multiply out the alpha. + + png_set_alpha_mode(png_ptr, PNG_ALPHA_STANDARD, + screen_gamma); + png_set_expand_16(png_ptr); + +If you are using the high level interface, don't call png_set_expand_16(); +instead pass PNG_TRANSFORM_EXPAND_16 to the interface. + +With this mode you can't do color correction, but you can do arithmetic, +including composition and scaling, on the data without further processing. + + png_set_alpha_mode(png_ptr, PNG_ALPHA_OPTIMIZED, + screen_gamma); + +You can avoid the expansion to 16-bit components with this mode, but you +lose the ability to scale the image or perform other linear arithmetic. +All you can do is compose the result onto a matching output. Since this +mode is libpng-specific you also need to write your own composition +software. + +The following are examples of calls to png_set_alpha_mode to achieve the +required overall gamma correction and, where necessary, alpha +premultiplication. + + png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); + +Choices for the alpha_mode are + + PNG_ALPHA_PNG 0 /* according to the PNG standard */ + PNG_ALPHA_STANDARD 1 /* according to Porter/Duff */ + PNG_ALPHA_ASSOCIATED 1 /* as above; this is the normal practice */ + PNG_ALPHA_PREMULTIPLIED 1 /* as above */ + PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */ + PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */ + +PNG_ALPHA_PNG is the default libpng handling of the alpha channel. It is not +pre-multiplied into the color components. In addition the call states +that the output is for a sRGB system and causes all PNG files without gAMA +chunks to be assumed to be encoded using sRGB. + + png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); + +In this case the output is assumed to be something like an sRGB conformant +display preceded by a power-law lookup table of power 1.45. This is how +early Mac systems behaved. + + png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR); + +This is the classic Jim Blinn approach and will work in academic +environments where everything is done by the book. It has the shortcoming +of assuming that input PNG data with no gamma information is linear - this +is unlikely to be correct unless the PNG files were generated locally. +Most of the time the output precision will be so low as to show +significant banding in dark areas of the image. + + png_set_expand_16(pp); + png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB); + +This is a somewhat more realistic Jim Blinn inspired approach. PNG files +are assumed to have the sRGB encoding if not marked with a gamma value and +the output is always 16 bits per component. This permits accurate scaling +and processing of the data. If you know that your input PNG files were +generated locally you might need to replace PNG_DEFAULT_sRGB with the +correct value for your system. + + png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB); + +If you just need to composite the PNG image onto an existing background +and if you control the code that does this you can use the optimization +setting. In this case you just copy completely opaque pixels to the +output. For pixels that are not completely transparent (you just skip +those) you do the composition math using png_composite or png_composite_16 +below then encode the resultant 8-bit or 16-bit values to match the output +encoding. + + Other cases + +If neither the PNG nor the standard linear encoding work for you because +of the software or hardware you use then you have a big problem. The PNG +case will probably result in halos around the image. The linear encoding +will probably result in a washed out, too bright, image (it's actually too +contrasty.) Try the ALPHA_OPTIMIZED mode above - this will probably +substantially reduce the halos. Alternatively try: + + png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB); + +This option will also reduce the halos, but there will be slight dark +halos round the opaque parts of the image where the background is light. +In the OPTIMIZED mode the halos will be light halos where the background +is dark. Take your pick - the halos are unavoidable unless you can get +your hardware/software fixed! (The OPTIMIZED approach is slightly +faster.) + +When the default gamma of PNG files doesn't match the output gamma. +If you have PNG files with no gamma information png_set_alpha_mode allows +you to provide a default gamma, but it also sets the output gamma to the +matching value. If you know your PNG files have a gamma that doesn't +match the output you can take advantage of the fact that +png_set_alpha_mode always sets the output gamma but only sets the PNG +default if it is not already set: + + png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); + png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); + +The first call sets both the default and the output gamma values, the +second call overrides the output gamma without changing the default. This +is easier than achieving the same effect with png_set_gamma. You must use +PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will +fire if more than one call to png_set_alpha_mode and png_set_background is +made in the same read operation, however multiple calls with PNG_ALPHA_PNG +are ignored. + +If you don't need, or can't handle, the alpha channel you can call +png_set_background() to remove it by compositing against a fixed color. Don't +call png_set_strip_alpha() to do this - it will leave spurious pixel values in +transparent parts of this image. + + png_set_background(png_ptr, &background_color, + PNG_BACKGROUND_GAMMA_SCREEN, 0, 1); + +The background_color is an RGB or grayscale value according to the data format +libpng will produce for you. Because you don't yet know the format of the PNG +file, if you call png_set_background at this point you must arrange for the +format produced by libpng to always have 8-bit or 16-bit components and then +store the color as an 8-bit or 16-bit color as appropriate. The color contains +separate gray and RGB component values, so you can let libpng produce gray or +RGB output according to the input format, but low bit depth grayscale images +must always be converted to at least 8-bit format. (Even though low bit depth +grayscale images can't have an alpha channel they can have a transparent +color!) + +You set the transforms you need later, either as flags to the high level +interface or libpng API calls for the low level interface. For reference the +settings and API calls required are: + +8-bit values: + PNG_TRANSFORM_SCALE_16 | PNG_EXPAND + png_set_expand(png_ptr); png_set_scale_16(png_ptr); + + If you must get exactly the same inaccurate results + produced by default in versions prior to libpng-1.5.4, + use PNG_TRANSFORM_STRIP_16 and png_set_strip_16(png_ptr) + instead. + +16-bit values: + PNG_TRANSFORM_EXPAND_16 + png_set_expand_16(png_ptr); + +In either case palette image data will be expanded to RGB. If you just want +color data you can add PNG_TRANSFORM_GRAY_TO_RGB or png_set_gray_to_rgb(png_ptr) +to the list. + +Calling png_set_background before the PNG file header is read will not work +prior to libpng-1.5.4. Because the failure may result in unexpected warnings or +errors it is therefore much safer to call png_set_background after the head has +been read. Unfortunately this means that prior to libpng-1.5.4 it cannot be +used with the high level interface. + +.SS The high-level read interface + +At this point there are two ways to proceed; through the high-level +read interface, or through a sequence of low-level read operations. +You can use the high-level interface if (a) you are willing to read +the entire image into memory, and (b) the input transformations +you want to do are limited to the following set: + + PNG_TRANSFORM_IDENTITY No transformation + PNG_TRANSFORM_SCALE_16 Strip 16-bit samples to + 8-bit accurately + PNG_TRANSFORM_STRIP_16 Chop 16-bit samples to + 8-bit less accurately + PNG_TRANSFORM_STRIP_ALPHA Discard the alpha channel + PNG_TRANSFORM_PACKING Expand 1, 2 and 4-bit + samples to bytes + PNG_TRANSFORM_PACKSWAP Change order of packed + pixels to LSB first + PNG_TRANSFORM_EXPAND Perform set_expand() + PNG_TRANSFORM_INVERT_MONO Invert monochrome images + PNG_TRANSFORM_SHIFT Normalize pixels to the + sBIT depth + PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA + to BGRA + PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA + to AG + PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity + to transparency + PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples + PNG_TRANSFORM_GRAY_TO_RGB Expand grayscale samples + to RGB (or GA to RGBA) + PNG_TRANSFORM_EXPAND_16 Expand samples to 16 bits + +(This excludes setting a background color, doing gamma transformation, +quantizing, and setting filler.) If this is the case, simply do this: + + png_read_png(png_ptr, info_ptr, png_transforms, NULL) + +where png_transforms is an integer containing the bitwise OR of some +set of transformation flags. This call is equivalent to png_read_info(), +followed the set of transformations indicated by the transform mask, +then png_read_image(), and finally png_read_end(). + +(The final parameter of this call is not yet used. Someday it might point +to transformation parameters required by some future input transform.) + +You must use png_transforms and not call any png_set_transform() functions +when you use png_read_png(). + +After you have called png_read_png(), you can retrieve the image data +with + + row_pointers = png_get_rows(png_ptr, info_ptr); + +where row_pointers is an array of pointers to the pixel data for each row: + + png_bytep row_pointers[height]; + +If you know your image size and pixel size ahead of time, you can allocate +row_pointers prior to calling png_read_png() with + + if (height > PNG_UINT_32_MAX / (sizeof (png_bytep))) + png_error(png_ptr, + "Image is too tall to process in memory"); + + if (width > PNG_UINT_32_MAX / pixel_size) + png_error(png_ptr, + "Image is too wide to process in memory"); + + row_pointers = png_malloc(png_ptr, + height*(sizeof (png_bytep))); + + for (int i = 0; i < height, i++) + row_pointers[i] = NULL; /* security precaution */ + + for (int i = 0; i < height, i++) + row_pointers[i] = png_malloc(png_ptr, + width*pixel_size); + + png_set_rows(png_ptr, info_ptr, &row_pointers); + +Alternatively you could allocate your image in one big block and define +row_pointers[i] to point into the proper places in your block, but first +be sure that your platform is able to allocate such a large buffer: + + /* Guard against integer overflow */ + if (height > PNG_SIZE_MAX/(width*pixel_size)) + png_error(png_ptr, "image_data buffer would be too large"); + + png_bytep buffer = png_malloc(png_ptr, + height*width*pixel_size); + + for (int i = 0; i < height, i++) + row_pointers[i] = buffer + i*width*pixel_size; + + png_set_rows(png_ptr, info_ptr, &row_pointers); + +If you use png_set_rows(), the application is responsible for freeing +row_pointers (and row_pointers[i], if they were separately allocated). + +If you don't allocate row_pointers ahead of time, png_read_png() will +do it, and it'll be free'ed by libpng when you call png_destroy_*(). + +.SS The low-level read interface + +If you are going the low-level route, you are now ready to read all +the file information up to the actual image data. You do this with a +call to png_read_info(). + + png_read_info(png_ptr, info_ptr); + +This will process all chunks up to but not including the image data. + +This also copies some of the data from the PNG file into the decode structure +for use in later transformations. Important information copied in is: + +1) The PNG file gamma from the gAMA chunk. This overwrites the default value +provided by an earlier call to png_set_gamma or png_set_alpha_mode. + +2) Prior to libpng-1.5.4 the background color from a bKGd chunk. This +damages the information provided by an earlier call to png_set_background +resulting in unexpected behavior. Libpng-1.5.4 no longer does this. + +3) The number of significant bits in each component value. Libpng uses this to +optimize gamma handling by reducing the internal lookup table sizes. + +4) The transparent color information from a tRNS chunk. This can be modified by +a later call to png_set_tRNS. + +.SS Querying the info structure + +Functions are used to get the information from the info_ptr once it +has been read. Note that these fields may not be completely filled +in until png_read_end() has read the chunk data following the image. + + png_get_IHDR(png_ptr, info_ptr, &width, &height, + &bit_depth, &color_type, &interlace_type, + &compression_type, &filter_method); + + width - holds the width of the image + in pixels (up to 2^31). + + height - holds the height of the image + in pixels (up to 2^31). + + bit_depth - holds the bit depth of one of the + image channels. (valid values are + 1, 2, 4, 8, 16 and depend also on + the color_type. See also + significant bits (sBIT) below). + + color_type - describes which color/alpha channels + are present. + PNG_COLOR_TYPE_GRAY + (bit depths 1, 2, 4, 8, 16) + PNG_COLOR_TYPE_GRAY_ALPHA + (bit depths 8, 16) + PNG_COLOR_TYPE_PALETTE + (bit depths 1, 2, 4, 8) + PNG_COLOR_TYPE_RGB + (bit_depths 8, 16) + PNG_COLOR_TYPE_RGB_ALPHA + (bit_depths 8, 16) + + PNG_COLOR_MASK_PALETTE + PNG_COLOR_MASK_COLOR + PNG_COLOR_MASK_ALPHA + + interlace_type - (PNG_INTERLACE_NONE or + PNG_INTERLACE_ADAM7) + + compression_type - (must be PNG_COMPRESSION_TYPE_BASE + for PNG 1.0) + + filter_method - (must be PNG_FILTER_TYPE_BASE + for PNG 1.0, and can also be + PNG_INTRAPIXEL_DIFFERENCING if + the PNG datastream is embedded in + a MNG-1.0 datastream) + + Any of width, height, color_type, bit_depth, + interlace_type, compression_type, or filter_method can + be NULL if you are not interested in their values. + + Note that png_get_IHDR() returns 32-bit data into + the application's width and height variables. + This is an unsafe situation if these are not png_uint_32 + variables. In such situations, the + png_get_image_width() and png_get_image_height() + functions described below are safer. + + width = png_get_image_width(png_ptr, + info_ptr); + + height = png_get_image_height(png_ptr, + info_ptr); + + bit_depth = png_get_bit_depth(png_ptr, + info_ptr); + + color_type = png_get_color_type(png_ptr, + info_ptr); + + interlace_type = png_get_interlace_type(png_ptr, + info_ptr); + + compression_type = png_get_compression_type(png_ptr, + info_ptr); + + filter_method = png_get_filter_type(png_ptr, + info_ptr); + + channels = png_get_channels(png_ptr, info_ptr); + + channels - number of channels of info for the + color type (valid values are 1 (GRAY, + PALETTE), 2 (GRAY_ALPHA), 3 (RGB), + 4 (RGB_ALPHA or RGB + filler byte)) + + rowbytes = png_get_rowbytes(png_ptr, info_ptr); + + rowbytes - number of bytes needed to hold a row + This value, the bit_depth, color_type, + and the number of channels can change + if you use transforms such as + png_set_expand(). See + png_read_update_info(), below. + + signature = png_get_signature(png_ptr, info_ptr); + + signature - holds the signature read from the + file (if any). The data is kept in + the same offset it would be if the + whole signature were read (i.e. if an + application had already read in 4 + bytes of signature before starting + libpng, the remaining 4 bytes would + be in signature[4] through signature[7] + (see png_set_sig_bytes())). + +These are also important, but their validity depends on whether the chunk +has been read. The png_get_valid(png_ptr, info_ptr, PNG_INFO_) and +png_get_(png_ptr, info_ptr, ...) functions return non-zero if the +data has been read, or zero if it is missing. The parameters to the +png_get_ are set directly if they are simple data types, or a +pointer into the info_ptr is returned for any complex types. + +The colorspace data from gAMA, cHRM, sRGB, iCCP, and sBIT chunks +is simply returned to give the application information about how the +image was encoded. Libpng itself only does transformations using the file +gamma when combining semitransparent pixels with the background color, and, +since libpng-1.6.0, when converting between 8-bit sRGB and 16-bit linear pixels +within the simplified API. Libpng also uses the file gamma when converting +RGB to gray, beginning with libpng-1.0.5, if the application calls +png_set_rgb_to_gray()). + + png_get_PLTE(png_ptr, info_ptr, &palette, + &num_palette); + + palette - the palette for the file + (array of png_color) + + num_palette - number of entries in the palette + + png_get_gAMA(png_ptr, info_ptr, &file_gamma); + png_get_gAMA_fixed(png_ptr, info_ptr, &int_file_gamma); + + file_gamma - the gamma at which the file is + written (PNG_INFO_gAMA) + + int_file_gamma - 100,000 times the gamma at which the + file is written + + png_get_cHRM(png_ptr, info_ptr, &white_x, &white_y, &red_x, + &red_y, &green_x, &green_y, &blue_x, &blue_y) + png_get_cHRM_XYZ(png_ptr, info_ptr, &red_X, &red_Y, &red_Z, + &green_X, &green_Y, &green_Z, &blue_X, &blue_Y, + &blue_Z) + png_get_cHRM_fixed(png_ptr, info_ptr, &int_white_x, + &int_white_y, &int_red_x, &int_red_y, + &int_green_x, &int_green_y, &int_blue_x, + &int_blue_y) + png_get_cHRM_XYZ_fixed(png_ptr, info_ptr, &int_red_X, &int_red_Y, + &int_red_Z, &int_green_X, &int_green_Y, + &int_green_Z, &int_blue_X, &int_blue_Y, + &int_blue_Z) + + {white,red,green,blue}_{x,y} + A color space encoding specified using the + chromaticities of the end points and the + white point. (PNG_INFO_cHRM) + + {red,green,blue}_{X,Y,Z} + A color space encoding specified using the + encoding end points - the CIE tristimulus + specification of the intended color of the red, + green and blue channels in the PNG RGB data. + The white point is simply the sum of the three + end points. (PNG_INFO_cHRM) + + png_get_sRGB(png_ptr, info_ptr, &srgb_intent); + + srgb_intent - the rendering intent (PNG_INFO_sRGB) + The presence of the sRGB chunk + means that the pixel data is in the + sRGB color space. This chunk also + implies specific values of gAMA and + cHRM. + + png_get_iCCP(png_ptr, info_ptr, &name, + &compression_type, &profile, &proflen); + + name - The profile name. + + compression_type - The compression type; always + PNG_COMPRESSION_TYPE_BASE for PNG 1.0. + You may give NULL to this argument to + ignore it. + + profile - International Color Consortium color + profile data. May contain NULs. + + proflen - length of profile data in bytes. + + png_get_sBIT(png_ptr, info_ptr, &sig_bit); + + sig_bit - the number of significant bits for + (PNG_INFO_sBIT) each of the gray, + red, green, and blue channels, + whichever are appropriate for the + given color type (png_color_16) + + png_get_tRNS(png_ptr, info_ptr, &trans_alpha, + &num_trans, &trans_color); + + trans_alpha - array of alpha (transparency) + entries for palette (PNG_INFO_tRNS) + + num_trans - number of transparent entries + (PNG_INFO_tRNS) + + trans_color - graylevel or color sample values of + the single transparent color for + non-paletted images (PNG_INFO_tRNS) + + png_get_eXIf_1(png_ptr, info_ptr, &num_exif, &exif); + + exif - Exif profile (array of png_byte) + (PNG_INFO_eXIf) + + png_get_hIST(png_ptr, info_ptr, &hist); + + hist - histogram of palette (array of + png_uint_16) (PNG_INFO_hIST) + + png_get_tIME(png_ptr, info_ptr, &mod_time); + + mod_time - time image was last modified + (PNG_INFO_tIME) + + png_get_bKGD(png_ptr, info_ptr, &background); + + background - background color (of type + png_color_16p) (PNG_INFO_bKGD) + valid 16-bit red, green and blue + values, regardless of color_type + + num_comments = png_get_text(png_ptr, info_ptr, + &text_ptr, &num_text); + + num_comments - number of comments + + text_ptr - array of png_text holding image + comments + + text_ptr[i].compression - type of compression used + on "text" PNG_TEXT_COMPRESSION_NONE + PNG_TEXT_COMPRESSION_zTXt + PNG_ITXT_COMPRESSION_NONE + PNG_ITXT_COMPRESSION_zTXt + + text_ptr[i].key - keyword for comment. Must contain + 1-79 characters. + + text_ptr[i].text - text comments for current + keyword. Can be empty. + + text_ptr[i].text_length - length of text string, + after decompression, 0 for iTXt + + text_ptr[i].itxt_length - length of itxt string, + after decompression, 0 for tEXt/zTXt + + text_ptr[i].lang - language of comment (empty + string for unknown). + + text_ptr[i].lang_key - keyword in UTF-8 + (empty string for unknown). + + Note that the itxt_length, lang, and lang_key + members of the text_ptr structure only exist when the + library is built with iTXt chunk support. Prior to + libpng-1.4.0 the library was built by default without + iTXt support. Also note that when iTXt is supported, + they contain NULL pointers when the "compression" + field contains PNG_TEXT_COMPRESSION_NONE or + PNG_TEXT_COMPRESSION_zTXt. + + num_text - number of comments (same as + num_comments; you can put NULL here + to avoid the duplication) + + Note while png_set_text() will accept text, language, + and translated keywords that can be NULL pointers, the + structure returned by png_get_text will always contain + regular zero-terminated C strings. They might be + empty strings but they will never be NULL pointers. + + num_spalettes = png_get_sPLT(png_ptr, info_ptr, + &palette_ptr); + + num_spalettes - number of sPLT chunks read. + + palette_ptr - array of palette structures holding + contents of one or more sPLT chunks + read. + + png_get_oFFs(png_ptr, info_ptr, &offset_x, &offset_y, + &unit_type); + + offset_x - positive offset from the left edge + of the screen (can be negative) + + offset_y - positive offset from the top edge + of the screen (can be negative) + + unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER + + png_get_pHYs(png_ptr, info_ptr, &res_x, &res_y, + &unit_type); + + res_x - pixels/unit physical resolution in + x direction + + res_y - pixels/unit physical resolution in + x direction + + unit_type - PNG_RESOLUTION_UNKNOWN, + PNG_RESOLUTION_METER + + png_get_sCAL(png_ptr, info_ptr, &unit, &width, + &height) + + unit - physical scale units (an integer) + + width - width of a pixel in physical scale units + + height - height of a pixel in physical scale units + (width and height are doubles) + + png_get_sCAL_s(png_ptr, info_ptr, &unit, &width, + &height) + + unit - physical scale units (an integer) + + width - width of a pixel in physical scale units + (expressed as a string) + + height - height of a pixel in physical scale units + (width and height are strings like "2.54") + + num_unknown_chunks = png_get_unknown_chunks(png_ptr, + info_ptr, &unknowns) + + unknowns - array of png_unknown_chunk + structures holding unknown chunks + + unknowns[i].name - name of unknown chunk + + unknowns[i].data - data of unknown chunk + + unknowns[i].size - size of unknown chunk's data + + unknowns[i].location - position of chunk in file + + The value of "i" corresponds to the order in which the + chunks were read from the PNG file or inserted with the + png_set_unknown_chunks() function. + + The value of "location" is a bitwise "or" of + + PNG_HAVE_IHDR (0x01) + PNG_HAVE_PLTE (0x02) + PNG_AFTER_IDAT (0x08) + +The data from the pHYs chunk can be retrieved in several convenient +forms: + + res_x = png_get_x_pixels_per_meter(png_ptr, + info_ptr) + + res_y = png_get_y_pixels_per_meter(png_ptr, + info_ptr) + + res_x_and_y = png_get_pixels_per_meter(png_ptr, + info_ptr) + + res_x = png_get_x_pixels_per_inch(png_ptr, + info_ptr) + + res_y = png_get_y_pixels_per_inch(png_ptr, + info_ptr) + + res_x_and_y = png_get_pixels_per_inch(png_ptr, + info_ptr) + + aspect_ratio = png_get_pixel_aspect_ratio(png_ptr, + info_ptr) + + Each of these returns 0 [signifying "unknown"] if + the data is not present or if res_x is 0; + res_x_and_y is 0 if res_x != res_y + + Note that because of the way the resolutions are + stored internally, the inch conversions won't + come out to exactly even number. For example, + 72 dpi is stored as 0.28346 pixels/meter, and + when this is retrieved it is 71.9988 dpi, so + be sure to round the returned value appropriately + if you want to display a reasonable-looking result. + +The data from the oFFs chunk can be retrieved in several convenient +forms: + + x_offset = png_get_x_offset_microns(png_ptr, info_ptr); + + y_offset = png_get_y_offset_microns(png_ptr, info_ptr); + + x_offset = png_get_x_offset_inches(png_ptr, info_ptr); + + y_offset = png_get_y_offset_inches(png_ptr, info_ptr); + + Each of these returns 0 [signifying "unknown" if both + x and y are 0] if the data is not present or if the + chunk is present but the unit is the pixel. The + remark about inexact inch conversions applies here + as well, because a value in inches can't always be + converted to microns and back without some loss + of precision. + +For more information, see the +PNG specification for chunk contents. Be careful with trusting +rowbytes, as some of the transformations could increase the space +needed to hold a row (expand, filler, gray_to_rgb, etc.). +See png_read_update_info(), below. + +A quick word about text_ptr and num_text. PNG stores comments in +keyword/text pairs, one pair per chunk, with no limit on the number +of text chunks, and a 2^31 byte limit on their size. While there are +suggested keywords, there is no requirement to restrict the use to these +strings. It is strongly suggested that keywords and text be sensible +to humans (that's the point), so don't use abbreviations. Non-printing +symbols are not allowed. See the PNG specification for more details. +There is also no requirement to have text after the keyword. + +Keywords should be limited to 79 Latin-1 characters without leading or +trailing spaces, but non-consecutive spaces are allowed within the +keyword. It is possible to have the same keyword any number of times. +The text_ptr is an array of png_text structures, each holding a +pointer to a language string, a pointer to a keyword and a pointer to +a text string. The text string, language code, and translated +keyword may be empty or NULL pointers. The keyword/text +pairs are put into the array in the order that they are received. +However, some or all of the text chunks may be after the image, so, to +make sure you have read all the text chunks, don't mess with these +until after you read the stuff after the image. This will be +mentioned again below in the discussion that goes with png_read_end(). + +.SS Input transformations + +After you've read the header information, you can set up the library +to handle any special transformations of the image data. The various +ways to transform the data will be described in the order that they +should occur. This is important, as some of these change the color +type and/or bit depth of the data, and some others only work on +certain color types and bit depths. + +Transformations you request are ignored if they don't have any meaning for a +particular input data format. However some transformations can have an effect +as a result of a previous transformation. If you specify a contradictory set of +transformations, for example both adding and removing the alpha channel, you +cannot predict the final result. + +The color used for the transparency values should be supplied in the same +format/depth as the current image data. It is stored in the same format/depth +as the image data in a tRNS chunk, so this is what libpng expects for this data. + +The color used for the background value depends on the need_expand argument as +described below. + +Data will be decoded into the supplied row buffers packed into bytes +unless the library has been told to transform it into another format. +For example, 4 bit/pixel paletted or grayscale data will be returned +2 pixels/byte with the leftmost pixel in the high-order bits of the byte, +unless png_set_packing() is called. 8-bit RGB data will be stored +in RGB RGB RGB format unless png_set_filler() or png_set_add_alpha() +is called to insert filler bytes, either before or after each RGB triplet. + +16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant +byte of the color value first, unless png_set_scale_16() is called to +transform it to regular RGB RGB triplets, or png_set_filler() or +png_set_add alpha() is called to insert two filler bytes, either before +or after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can +be modified with png_set_filler(), png_set_add_alpha(), png_set_strip_16(), +or png_set_scale_16(). + +The following code transforms grayscale images of less than 8 to 8 bits, +changes paletted images to RGB, and adds a full alpha channel if there is +transparency information in a tRNS chunk. This is most useful on +grayscale images with bit depths of 2 or 4 or if there is a multiple-image +viewing application that wishes to treat all images in the same way. + + if (color_type == PNG_COLOR_TYPE_PALETTE) + png_set_palette_to_rgb(png_ptr); + + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) + png_set_tRNS_to_alpha(png_ptr); + + if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) + png_set_expand_gray_1_2_4_to_8(png_ptr); + +The first two functions are actually aliases for png_set_expand(), added +in libpng version 1.0.4, with the function names expanded to improve code +readability. In some future version they may actually do different +things. + +As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was +added. It expands the sample depth without changing tRNS to alpha. + +As of libpng version 1.5.2, png_set_expand_16() was added. It behaves as +png_set_expand(); however, the resultant channels have 16 bits rather than 8. +Use this when the output color or gray channels are made linear to avoid fairly +severe accuracy loss. + + if (bit_depth < 16) + png_set_expand_16(png_ptr); + +PNG can have files with 16 bits per channel. If you only can handle +8 bits per channel, this will strip the pixels down to 8-bit. + + if (bit_depth == 16) + { +#if PNG_LIBPNG_VER >= 10504 + png_set_scale_16(png_ptr); +#else + png_set_strip_16(png_ptr); +#endif + } + +(The more accurate "png_set_scale_16()" API became available in libpng version +1.5.4). + +If you need to process the alpha channel on the image separately from the image +data (for example if you convert it to a bitmap mask) it is possible to have +libpng strip the channel leaving just RGB or gray data: + + if (color_type & PNG_COLOR_MASK_ALPHA) + png_set_strip_alpha(png_ptr); + +If you strip the alpha channel you need to find some other way of dealing with +the information. If, instead, you want to convert the image to an opaque +version with no alpha channel use png_set_background; see below. + +As of libpng version 1.5.2, almost all useful expansions are supported, the +major omissions are conversion of grayscale to indexed images (which can be +done trivially in the application) and conversion of indexed to grayscale (which +can be done by a trivial manipulation of the palette.) + +In the following table, the 01 means grayscale with depth<8, 31 means +indexed with depth<8, other numerals represent the color type, "T" means +the tRNS chunk is present, A means an alpha channel is present, and O +means tRNS or alpha is present but all pixels in the image are opaque. + + FROM 01 31 0 0T 0O 2 2T 2O 3 3T 3O 4A 4O 6A 6O + TO + 01 - [G] - - - - - - - - - - - - - + 31 [Q] Q [Q] [Q] [Q] Q Q Q Q Q Q [Q] [Q] Q Q + 0 1 G + . . G G G G G G B B GB GB + 0T lt Gt t + . Gt G G Gt G G Bt Bt GBt GBt + 0O lt Gt t . + Gt Gt G Gt Gt G Bt Bt GBt GBt + 2 C P C C C + . . C - - CB CB B B + 2T Ct - Ct C C t + t - - - CBt CBt Bt Bt + 2O Ct - Ct C C t t + - - - CBt CBt Bt Bt + 3 [Q] p [Q] [Q] [Q] Q Q Q + . . [Q] [Q] Q Q + 3T [Qt] p [Qt][Q] [Q] Qt Qt Qt t + t [Qt][Qt] Qt Qt + 3O [Qt] p [Qt][Q] [Q] Qt Qt Qt t t + [Qt][Qt] Qt Qt + 4A lA G A T T GA GT GT GA GT GT + BA G GBA + 4O lA GBA A T T GA GT GT GA GT GT BA + GBA G + 6A CA PA CA C C A T tT PA P P C CBA + BA + 6O CA PBA CA C C A tT T PA P P CBA C BA + + +Within the matrix, + "+" identifies entries where 'from' and 'to' are the same. + "-" means the transformation is not supported. + "." means nothing is necessary (a tRNS chunk can just be ignored). + "t" means the transformation is obtained by png_set_tRNS. + "A" means the transformation is obtained by png_set_add_alpha(). + "X" means the transformation is obtained by png_set_expand(). + "1" means the transformation is obtained by + png_set_expand_gray_1_2_4_to_8() (and by png_set_expand() + if there is no transparency in the original or the final + format). + "C" means the transformation is obtained by png_set_gray_to_rgb(). + "G" means the transformation is obtained by png_set_rgb_to_gray(). + "P" means the transformation is obtained by + png_set_expand_palette_to_rgb(). + "p" means the transformation is obtained by png_set_packing(). + "Q" means the transformation is obtained by png_set_quantize(). + "T" means the transformation is obtained by + png_set_tRNS_to_alpha(). + "B" means the transformation is obtained by + png_set_background(), or png_strip_alpha(). + +When an entry has multiple transforms listed all are required to cause the +right overall transformation. When two transforms are separated by a comma +either will do the job. When transforms are enclosed in [] the transform should +do the job but this is currently unimplemented - a different format will result +if the suggested transformations are used. + +In PNG files, the alpha channel in an image +is the level of opacity. If you need the alpha channel in an image to +be the level of transparency instead of opacity, you can invert the +alpha channel (or the tRNS chunk data) after it's read, so that 0 is +fully opaque and 255 (in 8-bit or paletted images) or 65535 (in 16-bit +images) is fully transparent, with + + png_set_invert_alpha(png_ptr); + +PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as +they can, resulting in, for example, 8 pixels per byte for 1 bit +files. This code expands to 1 pixel per byte without changing the +values of the pixels: + + if (bit_depth < 8) + png_set_packing(png_ptr); + +PNG files have possible bit depths of 1, 2, 4, 8, and 16. All pixels +stored in a PNG image have been "scaled" or "shifted" up to the next +higher possible bit depth (e.g. from 5 bits/sample in the range [0,31] +to 8 bits/sample in the range [0, 255]). However, it is also possible +to convert the PNG pixel data back to the original bit depth of the +image. This call reduces the pixels back down to the original bit depth: + + png_color_8p sig_bit; + + if (png_get_sBIT(png_ptr, info_ptr, &sig_bit)) + png_set_shift(png_ptr, sig_bit); + +PNG files store 3-color pixels in red, green, blue order. This code +changes the storage of the pixels to blue, green, red: + + if (color_type == PNG_COLOR_TYPE_RGB || + color_type == PNG_COLOR_TYPE_RGB_ALPHA) + png_set_bgr(png_ptr); + +PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them +into 4 or 8 bytes for windowing systems that need them in this format: + + if (color_type == PNG_COLOR_TYPE_RGB) + png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE); + +where "filler" is the 8-bit or 16-bit number to fill with, and the location +is either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether +you want the filler before the RGB or after. When filling an 8-bit pixel, +the least significant 8 bits of the number are used, if a 16-bit number is +supplied. This transformation does not affect images that already have full +alpha channels. To add an opaque alpha channel, use filler=0xffff and +PNG_FILLER_AFTER which will generate RGBA pixels. + +Note that png_set_filler() does not change the color type. If you want +to do that, you can add a true alpha channel with + + if (color_type == PNG_COLOR_TYPE_RGB || + color_type == PNG_COLOR_TYPE_GRAY) + png_set_add_alpha(png_ptr, filler, PNG_FILLER_AFTER); + +where "filler" contains the alpha value to assign to each pixel. +The png_set_add_alpha() function was added in libpng-1.2.7. + +If you are reading an image with an alpha channel, and you need the +data as ARGB instead of the normal PNG format RGBA: + + if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) + png_set_swap_alpha(png_ptr); + +For some uses, you may want a grayscale image to be represented as +RGB. This code will do that conversion: + + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb(png_ptr); + +Conversely, you can convert an RGB or RGBA image to grayscale or grayscale +with alpha. + + if (color_type == PNG_COLOR_TYPE_RGB || + color_type == PNG_COLOR_TYPE_RGB_ALPHA) + png_set_rgb_to_gray(png_ptr, error_action, + (double)red_weight, (double)green_weight); + + error_action = 1: silently do the conversion + + error_action = 2: issue a warning if the original + image has any pixel where + red != green or red != blue + + error_action = 3: issue an error and abort the + conversion if the original + image has any pixel where + red != green or red != blue + + red_weight: weight of red component + + green_weight: weight of green component + If either weight is negative, default + weights are used. + +In the corresponding fixed point API the red_weight and green_weight values are +simply scaled by 100,000: + + png_set_rgb_to_gray(png_ptr, error_action, + (png_fixed_point)red_weight, + (png_fixed_point)green_weight); + +If you have set error_action = 1 or 2, you can +later check whether the image really was gray, after processing +the image rows, with the png_get_rgb_to_gray_status(png_ptr) function. +It will return a png_byte that is zero if the image was gray or +1 if there were any non-gray pixels. Background and sBIT data +will be silently converted to grayscale, using the green channel +data for sBIT, regardless of the error_action setting. + +The default values come from the PNG file cHRM chunk if present; otherwise, the +defaults correspond to the ITU-R recommendation 709, and also the sRGB color +space, as recommended in the Charles Poynton's Colour FAQ, +Copyright (c) 2006-11-28 Charles Poynton, in section 9: + + + + Y = 0.2126 * R + 0.7152 * G + 0.0722 * B + +Previous versions of this document, 1998 through 2002, recommended a slightly +different formula: + + Y = 0.212671 * R + 0.715160 * G + 0.072169 * B + +Libpng uses an integer approximation: + + Y = (6968 * R + 23434 * G + 2366 * B)/32768 + +The calculation is done in a linear colorspace, if the image gamma +can be determined. + +The png_set_background() function has been described already; it tells libpng to +composite images with alpha or simple transparency against the supplied +background color. For compatibility with versions of libpng earlier than +libpng-1.5.4 it is recommended that you call the function after reading the file +header, even if you don't want to use the color in a bKGD chunk, if one exists. + +If the PNG file contains a bKGD chunk (PNG_INFO_bKGD valid), +you may use this color, or supply another color more suitable for +the current display (e.g., the background color from a web page). You +need to tell libpng how the color is represented, both the format of the +component values in the color (the number of bits) and the gamma encoding of the +color. The function takes two arguments, background_gamma_mode and need_expand +to convey this information; however, only two combinations are likely to be +useful: + + png_color_16 my_background; + png_color_16p image_background; + + if (png_get_bKGD(png_ptr, info_ptr, &image_background)) + png_set_background(png_ptr, image_background, + PNG_BACKGROUND_GAMMA_FILE, 1/*needs to be expanded*/, 1); + else + png_set_background(png_ptr, &my_background, + PNG_BACKGROUND_GAMMA_SCREEN, 0/*do not expand*/, 1); + +The second call was described above - my_background is in the format of the +final, display, output produced by libpng. Because you now know the format of +the PNG it is possible to avoid the need to choose either 8-bit or 16-bit +output and to retain palette images (the palette colors will be modified +appropriately and the tRNS chunk removed.) However, if you are doing this, +take great care not to ask for transformations without checking first that +they apply! + +In the first call the background color has the original bit depth and color type +of the PNG file. So, for palette images the color is supplied as a palette +index and for low bit greyscale images the color is a reduced bit value in +image_background->gray. + +If you didn't call png_set_gamma() before reading the file header, for example +if you need your code to remain compatible with older versions of libpng prior +to libpng-1.5.4, this is the place to call it. + +Do not call it if you called png_set_alpha_mode(); doing so will damage the +settings put in place by png_set_alpha_mode(). (If png_set_alpha_mode() is +supported then you can certainly do png_set_gamma() before reading the PNG +header.) + +This API unconditionally sets the screen and file gamma values, so it will +override the value in the PNG file unless it is called before the PNG file +reading starts. For this reason you must always call it with the PNG file +value when you call it in this position: + + if (png_get_gAMA(png_ptr, info_ptr, &file_gamma)) + png_set_gamma(png_ptr, screen_gamma, file_gamma); + + else + png_set_gamma(png_ptr, screen_gamma, 0.45455); + +If you need to reduce an RGB file to a paletted file, or if a paletted +file has more entries than will fit on your screen, png_set_quantize() +will do that. Note that this is a simple match quantization that merely +finds the closest color available. This should work fairly well with +optimized palettes, but fairly badly with linear color cubes. If you +pass a palette that is larger than maximum_colors, the file will +reduce the number of colors in the palette so it will fit into +maximum_colors. If there is a histogram, libpng will use it to make +more intelligent choices when reducing the palette. If there is no +histogram, it may not do as good a job. + + if (color_type & PNG_COLOR_MASK_COLOR) + { + if (png_get_valid(png_ptr, info_ptr, + PNG_INFO_PLTE)) + { + png_uint_16p histogram = NULL; + + png_get_hIST(png_ptr, info_ptr, + &histogram); + png_set_quantize(png_ptr, palette, num_palette, + max_screen_colors, histogram, 1); + } + + else + { + png_color std_color_cube[MAX_SCREEN_COLORS] = + { ... colors ... }; + + png_set_quantize(png_ptr, std_color_cube, + MAX_SCREEN_COLORS, MAX_SCREEN_COLORS, + NULL,0); + } + } + +PNG files describe monochrome as black being zero and white being one. +The following code will reverse this (make black be one and white be +zero): + + if (bit_depth == 1 && color_type == PNG_COLOR_TYPE_GRAY) + png_set_invert_mono(png_ptr); + +This function can also be used to invert grayscale and gray-alpha images: + + if (color_type == PNG_COLOR_TYPE_GRAY || + color_type == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_invert_mono(png_ptr); + +PNG files store 16-bit pixels in network byte order (big-endian, +ie. most significant bits first). This code changes the storage to the +other way (little-endian, i.e. least significant bits first, the +way PCs store them): + + if (bit_depth == 16) + png_set_swap(png_ptr); + +If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you +need to change the order the pixels are packed into bytes, you can use: + + if (bit_depth < 8) + png_set_packswap(png_ptr); + +Finally, you can write your own transformation function if none of +the existing ones meets your needs. This is done by setting a callback +with + + png_set_read_user_transform_fn(png_ptr, + read_transform_fn); + +You must supply the function + + void read_transform_fn(png_structp png_ptr, png_row_infop + row_info, png_bytep data) + +See pngtest.c for a working example. Your function will be called +after all of the other transformations have been processed. Take care with +interlaced images if you do the interlace yourself - the width of the row is the +width in 'row_info', not the overall image width. + +If supported, libpng provides two information routines that you can use to find +where you are in processing the image: + + png_get_current_pass_number(png_structp png_ptr); + png_get_current_row_number(png_structp png_ptr); + +Don't try using these outside a transform callback - firstly they are only +supported if user transforms are supported, secondly they may well return +unexpected results unless the row is actually being processed at the moment they +are called. + +With interlaced +images the value returned is the row in the input sub-image image. Use +PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to +find the output pixel (x,y) given an interlaced sub-image pixel (row,col,pass). + +The discussion of interlace handling above contains more information on how to +use these values. + +You can also set up a pointer to a user structure for use by your +callback function, and you can inform libpng that your transform +function will change the number of channels or bit depth with the +function + + png_set_user_transform_info(png_ptr, user_ptr, + user_depth, user_channels); + +The user's application, not libpng, is responsible for allocating and +freeing any memory required for the user structure. + +You can retrieve the pointer via the function +png_get_user_transform_ptr(). For example: + + voidp read_user_transform_ptr = + png_get_user_transform_ptr(png_ptr); + +The last thing to handle is interlacing; this is covered in detail below, +but you must call the function here if you want libpng to handle expansion +of the interlaced image. + + number_of_passes = png_set_interlace_handling(png_ptr); + +After setting the transformations, libpng can update your png_info +structure to reflect any transformations you've requested with this +call. + + png_read_update_info(png_ptr, info_ptr); + +This is most useful to update the info structure's rowbytes +field so you can use it to allocate your image memory. This function +will also update your palette with the correct screen_gamma and +background if these have been given with the calls above. You may +only call png_read_update_info() once with a particular info_ptr. + +After you call png_read_update_info(), you can allocate any +memory you need to hold the image. The row data is simply +raw byte data for all forms of images. As the actual allocation +varies among applications, no example will be given. If you +are allocating one large chunk, you will need to build an +array of pointers to each row, as it will be needed for some +of the functions below. + +Be sure that your platform can allocate the buffer that you'll need. +libpng internally checks for oversize width, but you'll need to +do your own check for number_of_rows*width*pixel_size if you are using +a multiple-row buffer: + + /* Guard against integer overflow */ + if (number_of_rows > PNG_SIZE_MAX/(width*pixel_size)) + png_error(png_ptr, "image_data buffer would be too large"); + +Remember: Before you call png_read_update_info(), the png_get_*() +functions return the values corresponding to the original PNG image. +After you call png_read_update_info the values refer to the image +that libpng will output. Consequently you must call all the png_set_ +functions before you call png_read_update_info(). This is particularly +important for png_set_interlace_handling() - if you are going to call +png_read_update_info() you must call png_set_interlace_handling() before +it unless you want to receive interlaced output. + +.SS Reading image data + +After you've allocated memory, you can read the image data. +The simplest way to do this is in one function call. If you are +allocating enough memory to hold the whole image, you can just +call png_read_image() and libpng will read in all the image data +and put it in the memory area supplied. You will need to pass in +an array of pointers to each row. + +This function automatically handles interlacing, so you don't +need to call png_set_interlace_handling() (unless you call +png_read_update_info()) or call this function multiple times, or any +of that other stuff necessary with png_read_rows(). + + png_read_image(png_ptr, row_pointers); + +where row_pointers is: + + png_bytep row_pointers[height]; + +You can point to void or char or whatever you use for pixels. + +If you don't want to read in the whole image at once, you can +use png_read_rows() instead. If there is no interlacing (check +interlace_type == PNG_INTERLACE_NONE), this is simple: + + png_read_rows(png_ptr, row_pointers, NULL, + number_of_rows); + +where row_pointers is the same as in the png_read_image() call. + +If you are doing this just one row at a time, you can do this with +a single row_pointer instead of an array of row_pointers: + + png_bytep row_pointer = row; + png_read_row(png_ptr, row_pointer, NULL); + +If the file is interlaced (interlace_type != 0 in the IHDR chunk), things +get somewhat harder. The only current (PNG Specification version 1.2) +interlacing type for PNG is (interlace_type == PNG_INTERLACE_ADAM7); +a somewhat complicated 2D interlace scheme, known as Adam7, that +breaks down an image into seven smaller images of varying size, based +on an 8x8 grid. This number is defined (from libpng 1.5) as +PNG_INTERLACE_ADAM7_PASSES in png.h + +libpng can fill out those images or it can give them to you "as is". +It is almost always better to have libpng handle the interlacing for you. +If you want the images filled out, there are two ways to do that. The one +mentioned in the PNG specification is to expand each pixel to cover +those pixels that have not been read yet (the "rectangle" method). +This results in a blocky image for the first pass, which gradually +smooths out as more pixels are read. The other method is the "sparkle" +method, where pixels are drawn only in their final locations, with the +rest of the image remaining whatever colors they were initialized to +before the start of the read. The first method usually looks better, +but tends to be slower, as there are more pixels to put in the rows. + +If, as is likely, you want libpng to expand the images, call this before +calling png_start_read_image() or png_read_update_info(): + + if (interlace_type == PNG_INTERLACE_ADAM7) + number_of_passes + = png_set_interlace_handling(png_ptr); + +This will return the number of passes needed. Currently, this is seven, +but may change if another interlace type is added. This function can be +called even if the file is not interlaced, where it will return one pass. +You then need to read the whole image 'number_of_passes' times. Each time +will distribute the pixels from the current pass to the correct place in +the output image, so you need to supply the same rows to png_read_rows in +each pass. + +If you are not going to display the image after each pass, but are +going to wait until the entire image is read in, use the sparkle +effect. This effect is faster and the end result of either method +is exactly the same. If you are planning on displaying the image +after each pass, the "rectangle" effect is generally considered the +better looking one. + +If you only want the "sparkle" effect, just call png_read_row() or +png_read_rows() as +normal, with the third parameter NULL. Make sure you make pass over +the image number_of_passes times, and you don't change the data in the +rows between calls. You can change the locations of the data, just +not the data. Each pass only writes the pixels appropriate for that +pass, and assumes the data from previous passes is still valid. + + png_read_rows(png_ptr, row_pointers, NULL, + number_of_rows); + or + png_read_row(png_ptr, row_pointers, NULL); + +If you only want the first effect (the rectangles), do the same as +before except pass the row buffer in the third parameter, and leave +the second parameter NULL. + + png_read_rows(png_ptr, NULL, row_pointers, + number_of_rows); + or + png_read_row(png_ptr, NULL, row_pointers); + +If you don't want libpng to handle the interlacing details, just call +png_read_rows() PNG_INTERLACE_ADAM7_PASSES times to read in all the images. +Each of the images is a valid image by itself; however, you will almost +certainly need to distribute the pixels from each sub-image to the +correct place. This is where everything gets very tricky. + +If you want to retrieve the separate images you must pass the correct +number of rows to each successive call of png_read_rows(). The calculation +gets pretty complicated for small images, where some sub-images may +not even exist because either their width or height ends up zero. +libpng provides two macros to help you in 1.5 and later versions: + + png_uint_32 width = PNG_PASS_COLS(image_width, pass_number); + png_uint_32 height = PNG_PASS_ROWS(image_height, pass_number); + +Respectively these tell you the width and height of the sub-image +corresponding to the numbered pass. 'pass' is in in the range 0 to 6 - +this can be confusing because the specification refers to the same passes +as 1 to 7! Be careful, you must check both the width and height before +calling png_read_rows() and not call it for that pass if either is zero. + +You can, of course, read each sub-image row by row. If you want to +produce optimal code to make a pixel-by-pixel transformation of an +interlaced image this is the best approach; read each row of each pass, +transform it, and write it out to a new interlaced image. + +If you want to de-interlace the image yourself libpng provides further +macros to help that tell you where to place the pixels in the output image. +Because the interlacing scheme is rectangular - sub-image pixels are always +arranged on a rectangular grid - all you need to know for each pass is the +starting column and row in the output image of the first pixel plus the +spacing between each pixel. As of libpng 1.5 there are four macros to +retrieve this information: + + png_uint_32 x = PNG_PASS_START_COL(pass); + png_uint_32 y = PNG_PASS_START_ROW(pass); + png_uint_32 xStep = 1U << PNG_PASS_COL_SHIFT(pass); + png_uint_32 yStep = 1U << PNG_PASS_ROW_SHIFT(pass); + +These allow you to write the obvious loop: + + png_uint_32 input_y = 0; + png_uint_32 output_y = PNG_PASS_START_ROW(pass); + + while (output_y < output_image_height) + { + png_uint_32 input_x = 0; + png_uint_32 output_x = PNG_PASS_START_COL(pass); + + while (output_x < output_image_width) + { + image[output_y][output_x] = + subimage[pass][input_y][input_x++]; + + output_x += xStep; + } + + ++input_y; + output_y += yStep; + } + +Notice that the steps between successive output rows and columns are +returned as shifts. This is possible because the pixels in the subimages +are always a power of 2 apart - 1, 2, 4 or 8 pixels - in the original +image. In practice you may need to directly calculate the output coordinate +given an input coordinate. libpng provides two further macros for this +purpose: + + png_uint_32 output_x = PNG_COL_FROM_PASS_COL(input_x, pass); + png_uint_32 output_y = PNG_ROW_FROM_PASS_ROW(input_y, pass); + +Finally a pair of macros are provided to tell you if a particular image +row or column appears in a given pass: + + int col_in_pass = PNG_COL_IN_INTERLACE_PASS(output_x, pass); + int row_in_pass = PNG_ROW_IN_INTERLACE_PASS(output_y, pass); + +Bear in mind that you will probably also need to check the width and height +of the pass in addition to the above to be sure the pass even exists! + +With any luck you are convinced by now that you don't want to do your own +interlace handling. In reality normally the only good reason for doing this +is if you are processing PNG files on a pixel-by-pixel basis and don't want +to load the whole file into memory when it is interlaced. + +libpng includes a test program, pngvalid, that illustrates reading and +writing of interlaced images. If you can't get interlacing to work in your +code and don't want to leave it to libpng (the recommended approach), see +how pngvalid.c does it. + +.SS Finishing a sequential read + +After you are finished reading the image through the +low-level interface, you can finish reading the file. + +If you want to use a different crc action for handling CRC errors in +chunks after the image data, you can call png_set_crc_action() +again at this point. + +If you are interested in comments or time, which may be stored either +before or after the image data, you should pass the separate png_info +struct if you want to keep the comments from before and after the image +separate. + + png_infop end_info = png_create_info_struct(png_ptr); + + if (!end_info) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return ERROR; + } + + png_read_end(png_ptr, end_info); + +If you are not interested, you should still call png_read_end() +but you can pass NULL, avoiding the need to create an end_info structure. +If you do this, libpng will not process any chunks after IDAT other than +skipping over them and perhaps (depending on whether you have called +png_set_crc_action) checking their CRCs while looking for the IEND chunk. + + png_read_end(png_ptr, NULL); + +If you don't call png_read_end(), then your file pointer will be +left pointing to the first chunk after the last IDAT, which is probably +not what you want if you expect to read something beyond the end of +the PNG datastream. + +When you are done, you can free all memory allocated by libpng like this: + + png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); + +or, if you didn't create an end_info structure, + + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + +It is also possible to individually free the info_ptr members that +point to libpng-allocated storage with the following function: + + png_free_data(png_ptr, info_ptr, mask, seq) + + mask - identifies data to be freed, a mask + containing the bitwise OR of one or + more of + PNG_FREE_PLTE, PNG_FREE_TRNS, + PNG_FREE_HIST, PNG_FREE_ICCP, + PNG_FREE_PCAL, PNG_FREE_ROWS, + PNG_FREE_SCAL, PNG_FREE_SPLT, + PNG_FREE_TEXT, PNG_FREE_UNKN, + or simply PNG_FREE_ALL + + seq - sequence number of item to be freed + (\-1 for all items) + +This function may be safely called when the relevant storage has +already been freed, or has not yet been allocated, or was allocated +by the user and not by libpng, and will in those cases do nothing. +The "seq" parameter is ignored if only one item of the selected data +type, such as PLTE, is allowed. If "seq" is not \-1, and multiple items +are allowed for the data type identified in the mask, such as text or +sPLT, only the n'th item in the structure is freed, where n is "seq". + +The default behavior is only to free data that was allocated internally +by libpng. This can be changed, so that libpng will not free the data, +or so that it will free data that was allocated by the user with png_malloc() +or png_calloc() and passed in via a png_set_*() function, with + + png_data_freer(png_ptr, info_ptr, freer, mask) + + freer - one of + PNG_DESTROY_WILL_FREE_DATA + PNG_SET_WILL_FREE_DATA + PNG_USER_WILL_FREE_DATA + + mask - which data elements are affected + same choices as in png_free_data() + +This function only affects data that has already been allocated. +You can call this function after reading the PNG data but before calling +any png_set_*() functions, to control whether the user or the png_set_*() +function is responsible for freeing any existing data that might be present, +and again after the png_set_*() functions to control whether the user +or png_destroy_*() is supposed to free the data. When the user assumes +responsibility for libpng-allocated data, the application must use +png_free() to free it, and when the user transfers responsibility to libpng +for data that the user has allocated, the user must have used png_malloc() +or png_calloc() to allocate it. + +If you allocated your row_pointers in a single block, as suggested above in +the description of the high level read interface, you must not transfer +responsibility for freeing it to the png_set_rows or png_read_destroy function, +because they would also try to free the individual row_pointers[i]. + +If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword +separately, do not transfer responsibility for freeing text_ptr to libpng, +because when libpng fills a png_text structure it combines these members with +the key member, and png_free_data() will free only text_ptr.key. Similarly, +if you transfer responsibility for free'ing text_ptr from libpng to your +application, your application must not separately free those members. + +The png_free_data() function will turn off the "valid" flag for anything +it frees. If you need to turn the flag off for a chunk that was freed by +your application instead of by libpng, you can use + + png_set_invalid(png_ptr, info_ptr, mask); + + mask - identifies the chunks to be made invalid, + containing the bitwise OR of one or + more of + PNG_INFO_gAMA, PNG_INFO_sBIT, + PNG_INFO_cHRM, PNG_INFO_PLTE, + PNG_INFO_tRNS, PNG_INFO_bKGD, + PNG_INFO_eXIf, + PNG_INFO_hIST, PNG_INFO_pHYs, + PNG_INFO_oFFs, PNG_INFO_tIME, + PNG_INFO_pCAL, PNG_INFO_sRGB, + PNG_INFO_iCCP, PNG_INFO_sPLT, + PNG_INFO_sCAL, PNG_INFO_IDAT + +For a more compact example of reading a PNG image, see the file example.c. + +.SS Reading PNG files progressively + +The progressive reader is slightly different from the non-progressive +reader. Instead of calling png_read_info(), png_read_rows(), and +png_read_end(), you make one call to png_process_data(), which calls +callbacks when it has the info, a row, or the end of the image. You +set up these callbacks with png_set_progressive_read_fn(). You don't +have to worry about the input/output functions of libpng, as you are +giving the library the data directly in png_process_data(). I will +assume that you have read the section on reading PNG files above, +so I will only highlight the differences (although I will show +all of the code). + +png_structp png_ptr; +png_infop info_ptr; + + /* An example code fragment of how you would + initialize the progressive reader in your + application. */ + int + initialize_png_reader() + { + png_ptr = png_create_read_struct + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn); + + if (!png_ptr) + return ERROR; + + info_ptr = png_create_info_struct(png_ptr); + + if (!info_ptr) + { + png_destroy_read_struct(&png_ptr, NULL, NULL); + return ERROR; + } + + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return ERROR; + } + + /* This one's new. You can provide functions + to be called when the header info is valid, + when each row is completed, and when the image + is finished. If you aren't using all functions, + you can specify NULL parameters. Even when all + three functions are NULL, you need to call + png_set_progressive_read_fn(). You can use + any struct as the user_ptr (cast to a void pointer + for the function call), and retrieve the pointer + from inside the callbacks using the function + + png_get_progressive_ptr(png_ptr); + + which will return a void pointer, which you have + to cast appropriately. + */ + png_set_progressive_read_fn(png_ptr, (void *)user_ptr, + info_callback, row_callback, end_callback); + + return 0; + } + + /* A code fragment that you call as you receive blocks + of data */ + int + process_data(png_bytep buffer, png_uint_32 length) + { + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + return ERROR; + } + + /* This one's new also. Simply give it a chunk + of data from the file stream (in order, of + course). On machines with segmented memory + models machines, don't give it any more than + 64K. The library seems to run fine with sizes + of 4K. Although you can give it much less if + necessary (I assume you can give it chunks of + 1 byte, I haven't tried less than 256 bytes + yet). When this function returns, you may + want to display any rows that were generated + in the row callback if you don't already do + so there. + */ + png_process_data(png_ptr, info_ptr, buffer, length); + + /* At this point you can call png_process_data_skip if + you want to handle data the library will skip yourself; + it simply returns the number of bytes to skip (and stops + libpng skipping that number of bytes on the next + png_process_data call). + return 0; + } + + /* This function is called (as set by + png_set_progressive_read_fn() above) when enough data + has been supplied so all of the header has been + read. + */ + void + info_callback(png_structp png_ptr, png_infop info) + { + /* Do any setup here, including setting any of + the transformations mentioned in the Reading + PNG files section. For now, you _must_ call + either png_start_read_image() or + png_read_update_info() after all the + transformations are set (even if you don't set + any). You may start getting rows before + png_process_data() returns, so this is your + last chance to prepare for that. + + This is where you turn on interlace handling, + assuming you don't want to do it yourself. + + If you need to you can stop the processing of + your original input data at this point by calling + png_process_data_pause. This returns the number + of unprocessed bytes from the last png_process_data + call - it is up to you to ensure that the next call + sees these bytes again. If you don't want to bother + with this you can get libpng to cache the unread + bytes by setting the 'save' parameter (see png.h) but + then libpng will have to copy the data internally. + */ + } + + /* This function is called when each row of image + data is complete */ + void + row_callback(png_structp png_ptr, png_bytep new_row, + png_uint_32 row_num, int pass) + { + /* If the image is interlaced, and you turned + on the interlace handler, this function will + be called for every row in every pass. Some + of these rows will not be changed from the + previous pass. When the row is not changed, + the new_row variable will be NULL. The rows + and passes are called in order, so you don't + really need the row_num and pass, but I'm + supplying them because it may make your life + easier. + + If you did not turn on interlace handling then + the callback is called for each row of each + sub-image when the image is interlaced. In this + case 'row_num' is the row in the sub-image, not + the row in the output image as it is in all other + cases. + + For the non-NULL rows of interlaced images when + you have switched on libpng interlace handling, + you must call png_progressive_combine_row() + passing in the row and the old row. You can + call this function for NULL rows (it will just + return) and for non-interlaced images (it just + does the memcpy for you) if it will make the + code easier. Thus, you can just do this for + all cases if you switch on interlace handling; + */ + + png_progressive_combine_row(png_ptr, old_row, + new_row); + + /* where old_row is what was displayed + previously for the row. Note that the first + pass (pass == 0, really) will completely cover + the old row, so the rows do not have to be + initialized. After the first pass (and only + for interlaced images), you will have to pass + the current row, and the function will combine + the old row and the new row. + + You can also call png_process_data_pause in this + callback - see above. + */ + } + + void + end_callback(png_structp png_ptr, png_infop info) + { + /* This function is called after the whole image + has been read, including any chunks after the + image (up to and including the IEND). You + will usually have the same info chunk as you + had in the header, although some data may have + been added to the comments and time fields. + + Most people won't do much here, perhaps setting + a flag that marks the image as finished. + */ + } + + + +.SH IV. Writing + +Much of this is very similar to reading. However, everything of +importance is repeated here, so you won't have to constantly look +back up in the reading section to understand writing. + +.SS Setup + +You will want to do the I/O initialization before you get into libpng, +so if it doesn't work, you don't have anything to undo. If you are not +using the standard I/O functions, you will need to replace them with +custom writing functions. See the discussion under Customizing libpng. + + FILE *fp = fopen(file_name, "wb"); + + if (!fp) + return ERROR; + +Next, png_struct and png_info need to be allocated and initialized. +As these can be both relatively large, you may not want to store these +on the stack, unless you have stack space to spare. Of course, you +will want to check if they return NULL. If you are also reading, +you won't want to name your read structure and your write structure +both "png_ptr"; you can call them anything you like, such as +"read_ptr" and "write_ptr". Look at pngtest.c, for example. + + png_structp png_ptr = png_create_write_struct + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn); + + if (!png_ptr) + return ERROR; + + png_infop info_ptr = png_create_info_struct(png_ptr); + if (!info_ptr) + { + png_destroy_write_struct(&png_ptr, NULL); + return ERROR; + } + +If you want to use your own memory allocation routines, +define PNG_USER_MEM_SUPPORTED and use +png_create_write_struct_2() instead of png_create_write_struct(): + + png_structp png_ptr = png_create_write_struct_2 + (PNG_LIBPNG_VER_STRING, (png_voidp)user_error_ptr, + user_error_fn, user_warning_fn, (png_voidp) + user_mem_ptr, user_malloc_fn, user_free_fn); + +After you have these structures, you will need to set up the +error handling. When libpng encounters an error, it expects to +longjmp() back to your routine. Therefore, you will need to call +setjmp() and pass the png_jmpbuf(png_ptr). If you +write the file from different routines, you will need to update +the png_jmpbuf(png_ptr) every time you enter a new routine that will +call a png_*() function. See your documentation of setjmp/longjmp +for your compiler for more information on setjmp/longjmp. See +the discussion on libpng error handling in the Customizing Libpng +section below for more information on the libpng error handling. + + if (setjmp(png_jmpbuf(png_ptr))) + { + png_destroy_write_struct(&png_ptr, &info_ptr); + fclose(fp); + return ERROR; + } + ... + return; + +If you would rather avoid the complexity of setjmp/longjmp issues, +you can compile libpng with PNG_NO_SETJMP, in which case +errors will result in a call to PNG_ABORT() which defaults to abort(). + +You can #define PNG_ABORT() to a function that does something +more useful than abort(), as long as your function does not +return. + +Checking for invalid palette index on write was added at libpng +1.5.10. If a pixel contains an invalid (out-of-range) index libpng issues +a benign error. This is enabled by default because this condition is an +error according to the PNG specification, Clause 11.3.2, but the error can +be ignored in each png_ptr with + + png_set_check_for_invalid_index(png_ptr, 0); + +If the error is ignored, or if png_benign_error() treats it as a warning, +any invalid pixels are written as-is by the encoder, resulting in an +invalid PNG datastream as output. In this case the application is +responsible for ensuring that the pixel indexes are in range when it writes +a PLTE chunk with fewer entries than the bit depth would allow. + +Now you need to set up the output code. The default for libpng is to +use the C function fwrite(). If you use this, you will need to pass a +valid FILE * in the function png_init_io(). Be sure that the file is +opened in binary mode. Again, if you wish to handle writing data in +another way, see the discussion on libpng I/O handling in the Customizing +Libpng section below. + + png_init_io(png_ptr, fp); + +If you are embedding your PNG into a datastream such as MNG, and don't +want libpng to write the 8-byte signature, or if you have already +written the signature in your application, use + + png_set_sig_bytes(png_ptr, 8); + +to inform libpng that it should not write a signature. + +.SS Write callbacks + +At this point, you can set up a callback function that will be +called after each row has been written, which you can use to control +a progress meter or the like. It's demonstrated in pngtest.c. +You must supply a function + + void write_row_callback(png_structp png_ptr, png_uint_32 row, + int pass) + { + /* put your code here */ + } + +(You can give it another name that you like instead of "write_row_callback") + +To inform libpng about your function, use + + png_set_write_status_fn(png_ptr, write_row_callback); + +When this function is called the row has already been completely processed and +it has also been written out. The 'row' and 'pass' refer to the next row to be +handled. For the +non-interlaced case the row that was just handled is simply one less than the +passed in row number, and pass will always be 0. For the interlaced case the +same applies unless the row value is 0, in which case the row just handled was +the last one from one of the preceding passes. Because interlacing may skip a +pass you cannot be sure that the preceding pass is just 'pass\-1', if you really +need to know what the last pass is record (row,pass) from the callback and use +the last recorded value each time. + +As with the user transform you can find the output row using the +PNG_ROW_FROM_PASS_ROW macro. + +You now have the option of modifying how the compression library will +run. The following functions are mainly for testing, but may be useful +in some cases, like if you need to write PNG files extremely fast and +are willing to give up some compression, or if you want to get the +maximum possible compression at the expense of slower writing. If you +have no special needs in this area, let the library do what it wants by +not calling this function at all, as it has been tuned to deliver a good +speed/compression ratio. The second parameter to png_set_filter() is +the filter method, for which the only valid values are 0 (as of the +July 1999 PNG specification, version 1.2) or 64 (if you are writing +a PNG datastream that is to be embedded in a MNG datastream). The third +parameter is a flag that indicates which filter type(s) are to be tested +for each scanline. See the PNG specification for details on the specific +filter types. + + + /* turn on or off filtering, and/or choose + specific filters. You can use either a single + PNG_FILTER_VALUE_NAME or the bitwise OR of one + or more PNG_FILTER_NAME masks. + */ + png_set_filter(png_ptr, 0, + PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE | + PNG_FILTER_SUB | PNG_FILTER_VALUE_SUB | + PNG_FILTER_UP | PNG_FILTER_VALUE_UP | + PNG_FILTER_AVG | PNG_FILTER_VALUE_AVG | + PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH| + PNG_ALL_FILTERS | PNG_FAST_FILTERS); + +If an application wants to start and stop using particular filters during +compression, it should start out with all of the filters (to ensure that +the previous row of pixels will be stored in case it's needed later), +and then add and remove them after the start of compression. + +If you are writing a PNG datastream that is to be embedded in a MNG +datastream, the second parameter can be either 0 or 64. + +The png_set_compression_*() functions interface to the zlib compression +library, and should mostly be ignored unless you really know what you are +doing. The only generally useful call is png_set_compression_level() +which changes how much time zlib spends on trying to compress the image +data. See the Compression Library (zlib.h and algorithm.txt, distributed +with zlib) for details on the compression levels. + + #include zlib.h + + /* Set the zlib compression level */ + png_set_compression_level(png_ptr, + Z_BEST_COMPRESSION); + + /* Set other zlib parameters for compressing IDAT */ + png_set_compression_mem_level(png_ptr, 8); + png_set_compression_strategy(png_ptr, + Z_DEFAULT_STRATEGY); + png_set_compression_window_bits(png_ptr, 15); + png_set_compression_method(png_ptr, 8); + png_set_compression_buffer_size(png_ptr, 8192) + + /* Set zlib parameters for text compression + * If you don't call these, the parameters + * fall back on those defined for IDAT chunks + */ + png_set_text_compression_mem_level(png_ptr, 8); + png_set_text_compression_strategy(png_ptr, + Z_DEFAULT_STRATEGY); + png_set_text_compression_window_bits(png_ptr, 15); + png_set_text_compression_method(png_ptr, 8); + +.SS Setting the contents of info for output + +You now need to fill in the png_info structure with all the data you +wish to write before the actual image. Note that the only thing you +are allowed to write after the image is the text chunks and the time +chunk (as of PNG Specification 1.2, anyway). See png_write_end() and +the latest PNG specification for more information on that. If you +wish to write them before the image, fill them in now, and flag that +data as being valid. If you want to wait until after the data, don't +fill them until png_write_end(). For all the fields in png_info and +their data types, see png.h. For explanations of what the fields +contain, see the PNG specification. + +Some of the more important parts of the png_info are: + + png_set_IHDR(png_ptr, info_ptr, width, height, + bit_depth, color_type, interlace_type, + compression_type, filter_method) + + width - holds the width of the image + in pixels (up to 2^31). + + height - holds the height of the image + in pixels (up to 2^31). + + bit_depth - holds the bit depth of one of the + image channels. + (valid values are 1, 2, 4, 8, 16 + and depend also on the + color_type. See also significant + bits (sBIT) below). + + color_type - describes which color/alpha + channels are present. + PNG_COLOR_TYPE_GRAY + (bit depths 1, 2, 4, 8, 16) + PNG_COLOR_TYPE_GRAY_ALPHA + (bit depths 8, 16) + PNG_COLOR_TYPE_PALETTE + (bit depths 1, 2, 4, 8) + PNG_COLOR_TYPE_RGB + (bit_depths 8, 16) + PNG_COLOR_TYPE_RGB_ALPHA + (bit_depths 8, 16) + + PNG_COLOR_MASK_PALETTE + PNG_COLOR_MASK_COLOR + PNG_COLOR_MASK_ALPHA + + interlace_type - PNG_INTERLACE_NONE or + PNG_INTERLACE_ADAM7 + + compression_type - (must be + PNG_COMPRESSION_TYPE_DEFAULT) + + filter_method - (must be PNG_FILTER_TYPE_DEFAULT + or, if you are writing a PNG to + be embedded in a MNG datastream, + can also be + PNG_INTRAPIXEL_DIFFERENCING) + +If you call png_set_IHDR(), the call must appear before any of the +other png_set_*() functions, because they might require access to some of +the IHDR settings. The remaining png_set_*() functions can be called +in any order. + +If you wish, you can reset the compression_type, interlace_type, or +filter_method later by calling png_set_IHDR() again; if you do this, the +width, height, bit_depth, and color_type must be the same in each call. + + png_set_PLTE(png_ptr, info_ptr, palette, + num_palette); + + palette - the palette for the file + (array of png_color) + num_palette - number of entries in the palette + + + png_set_gAMA(png_ptr, info_ptr, file_gamma); + png_set_gAMA_fixed(png_ptr, info_ptr, int_file_gamma); + + file_gamma - the gamma at which the image was + created (PNG_INFO_gAMA) + + int_file_gamma - 100,000 times the gamma at which + the image was created + + png_set_cHRM(png_ptr, info_ptr, white_x, white_y, red_x, red_y, + green_x, green_y, blue_x, blue_y) + png_set_cHRM_XYZ(png_ptr, info_ptr, red_X, red_Y, red_Z, green_X, + green_Y, green_Z, blue_X, blue_Y, blue_Z) + png_set_cHRM_fixed(png_ptr, info_ptr, int_white_x, int_white_y, + int_red_x, int_red_y, int_green_x, int_green_y, + int_blue_x, int_blue_y) + png_set_cHRM_XYZ_fixed(png_ptr, info_ptr, int_red_X, int_red_Y, + int_red_Z, int_green_X, int_green_Y, int_green_Z, + int_blue_X, int_blue_Y, int_blue_Z) + + {white,red,green,blue}_{x,y} + A color space encoding specified using the chromaticities + of the end points and the white point. + + {red,green,blue}_{X,Y,Z} + A color space encoding specified using the encoding end + points - the CIE tristimulus specification of the intended + color of the red, green and blue channels in the PNG RGB + data. The white point is simply the sum of the three end + points. + + png_set_sRGB(png_ptr, info_ptr, srgb_intent); + + srgb_intent - the rendering intent + (PNG_INFO_sRGB) The presence of + the sRGB chunk means that the pixel + data is in the sRGB color space. + This chunk also implies specific + values of gAMA and cHRM. Rendering + intent is the CSS-1 property that + has been defined by the International + Color Consortium + (http://www.color.org). + It can be one of + PNG_sRGB_INTENT_SATURATION, + PNG_sRGB_INTENT_PERCEPTUAL, + PNG_sRGB_INTENT_ABSOLUTE, or + PNG_sRGB_INTENT_RELATIVE. + + + png_set_sRGB_gAMA_and_cHRM(png_ptr, info_ptr, + srgb_intent); + + srgb_intent - the rendering intent + (PNG_INFO_sRGB) The presence of the + sRGB chunk means that the pixel + data is in the sRGB color space. + This function also causes gAMA and + cHRM chunks with the specific values + that are consistent with sRGB to be + written. + + png_set_iCCP(png_ptr, info_ptr, name, compression_type, + profile, proflen); + + name - The profile name. + + compression_type - The compression type; always + PNG_COMPRESSION_TYPE_BASE for PNG 1.0. + You may give NULL to this argument to + ignore it. + + profile - International Color Consortium color + profile data. May contain NULs. + + proflen - length of profile data in bytes. + + png_set_sBIT(png_ptr, info_ptr, sig_bit); + + sig_bit - the number of significant bits for + (PNG_INFO_sBIT) each of the gray, red, + green, and blue channels, whichever are + appropriate for the given color type + (png_color_16) + + png_set_tRNS(png_ptr, info_ptr, trans_alpha, + num_trans, trans_color); + + trans_alpha - array of alpha (transparency) + entries for palette (PNG_INFO_tRNS) + + num_trans - number of transparent entries + (PNG_INFO_tRNS) + + trans_color - graylevel or color sample values + (in order red, green, blue) of the + single transparent color for + non-paletted images (PNG_INFO_tRNS) + + png_set_eXIf_1(png_ptr, info_ptr, num_exif, exif); + + exif - Exif profile (array of png_byte) + (PNG_INFO_eXIf) + + png_set_hIST(png_ptr, info_ptr, hist); + + hist - histogram of palette (array of + png_uint_16) (PNG_INFO_hIST) + + png_set_tIME(png_ptr, info_ptr, mod_time); + + mod_time - time image was last modified + (PNG_INFO_tIME) + + png_set_bKGD(png_ptr, info_ptr, background); + + background - background color (of type + png_color_16p) (PNG_INFO_bKGD) + + png_set_text(png_ptr, info_ptr, text_ptr, num_text); + + text_ptr - array of png_text holding image + comments + + text_ptr[i].compression - type of compression used + on "text" PNG_TEXT_COMPRESSION_NONE + PNG_TEXT_COMPRESSION_zTXt + PNG_ITXT_COMPRESSION_NONE + PNG_ITXT_COMPRESSION_zTXt + text_ptr[i].key - keyword for comment. Must contain + 1-79 characters. + text_ptr[i].text - text comments for current + keyword. Can be NULL or empty. + text_ptr[i].text_length - length of text string, + after decompression, 0 for iTXt + text_ptr[i].itxt_length - length of itxt string, + after decompression, 0 for tEXt/zTXt + text_ptr[i].lang - language of comment (NULL or + empty for unknown). + text_ptr[i].translated_keyword - keyword in UTF-8 (NULL + or empty for unknown). + + Note that the itxt_length, lang, and lang_key + members of the text_ptr structure only exist when the + library is built with iTXt chunk support. Prior to + libpng-1.4.0 the library was built by default without + iTXt support. Also note that when iTXt is supported, + they contain NULL pointers when the "compression" + field contains PNG_TEXT_COMPRESSION_NONE or + PNG_TEXT_COMPRESSION_zTXt. + + num_text - number of comments + + png_set_sPLT(png_ptr, info_ptr, &palette_ptr, + num_spalettes); + + palette_ptr - array of png_sPLT_struct structures + to be added to the list of palettes + in the info structure. + num_spalettes - number of palette structures to be + added. + + png_set_oFFs(png_ptr, info_ptr, offset_x, offset_y, + unit_type); + + offset_x - positive offset from the left + edge of the screen + + offset_y - positive offset from the top + edge of the screen + + unit_type - PNG_OFFSET_PIXEL, PNG_OFFSET_MICROMETER + + png_set_pHYs(png_ptr, info_ptr, res_x, res_y, + unit_type); + + res_x - pixels/unit physical resolution + in x direction + + res_y - pixels/unit physical resolution + in y direction + + unit_type - PNG_RESOLUTION_UNKNOWN, + PNG_RESOLUTION_METER + + png_set_sCAL(png_ptr, info_ptr, unit, width, height) + + unit - physical scale units (an integer) + + width - width of a pixel in physical scale units + + height - height of a pixel in physical scale units + (width and height are doubles) + + png_set_sCAL_s(png_ptr, info_ptr, unit, width, height) + + unit - physical scale units (an integer) + + width - width of a pixel in physical scale units + expressed as a string + + height - height of a pixel in physical scale units + (width and height are strings like "2.54") + + png_set_unknown_chunks(png_ptr, info_ptr, &unknowns, + num_unknowns) + + unknowns - array of png_unknown_chunk + structures holding unknown chunks + unknowns[i].name - name of unknown chunk + unknowns[i].data - data of unknown chunk + unknowns[i].size - size of unknown chunk's data + unknowns[i].location - position to write chunk in file + 0: do not write chunk + PNG_HAVE_IHDR: before PLTE + PNG_HAVE_PLTE: before IDAT + PNG_AFTER_IDAT: after IDAT + +The "location" member is set automatically according to +what part of the output file has already been written. +You can change its value after calling png_set_unknown_chunks() +as demonstrated in pngtest.c. Within each of the "locations", +the chunks are sequenced according to their position in the +structure (that is, the value of "i", which is the order in which +the chunk was either read from the input file or defined with +png_set_unknown_chunks). + +A quick word about text and num_text. text is an array of png_text +structures. num_text is the number of valid structures in the array. +Each png_text structure holds a language code, a keyword, a text value, +and a compression type. + +The compression types have the same valid numbers as the compression +types of the image data. Currently, the only valid number is zero. +However, you can store text either compressed or uncompressed, unlike +images, which always have to be compressed. So if you don't want the +text compressed, set the compression type to PNG_TEXT_COMPRESSION_NONE. +Because tEXt and zTXt chunks don't have a language field, if you +specify PNG_TEXT_COMPRESSION_NONE or PNG_TEXT_COMPRESSION_zTXt +any language code or translated keyword will not be written out. + +Until text gets around a few hundred bytes, it is not worth compressing it. +After the text has been written out to the file, the compression type +is set to PNG_TEXT_COMPRESSION_NONE_WR or PNG_TEXT_COMPRESSION_zTXt_WR, +so that it isn't written out again at the end (in case you are calling +png_write_end() with the same struct). + +The keywords that are given in the PNG Specification are: + + Title Short (one line) title or + caption for image + + Author Name of image's creator + + Description Description of image (possibly long) + + Copyright Copyright notice + + Creation Time Time of original image creation + (usually RFC 1123 format, see below) + + Software Software used to create the image + + Disclaimer Legal disclaimer + + Warning Warning of nature of content + + Source Device used to create the image + + Comment Miscellaneous comment; conversion + from other image format + +The keyword-text pairs work like this. Keywords should be short +simple descriptions of what the comment is about. Some typical +keywords are found in the PNG specification, as is some recommendations +on keywords. You can repeat keywords in a file. You can even write +some text before the image and some after. For example, you may want +to put a description of the image before the image, but leave the +disclaimer until after, so viewers working over modem connections +don't have to wait for the disclaimer to go over the modem before +they start seeing the image. Finally, keywords should be full +words, not abbreviations. Keywords and text are in the ISO 8859-1 +(Latin-1) character set (a superset of regular ASCII) and can not +contain NUL characters, and should not contain control or other +unprintable characters. To make the comments widely readable, stick +with basic ASCII, and avoid machine specific character set extensions +like the IBM-PC character set. The keyword must be present, but +you can leave off the text string on non-compressed pairs. +Compressed pairs must have a text string, as only the text string +is compressed anyway, so the compression would be meaningless. + +PNG supports modification time via the png_time structure. Two +conversion routines are provided, png_convert_from_time_t() for +time_t and png_convert_from_struct_tm() for struct tm. The +time_t routine uses gmtime(). You don't have to use either of +these, but if you wish to fill in the png_time structure directly, +you should provide the time in universal time (GMT) if possible +instead of your local time. Note that the year number is the full +year (e.g. 1998, rather than 98 - PNG is year 2000 compliant!), and +that months start with 1. + +If you want to store the time of the original image creation, you should +use a plain tEXt chunk with the "Creation Time" keyword. This is +necessary because the "creation time" of a PNG image is somewhat vague, +depending on whether you mean the PNG file, the time the image was +created in a non-PNG format, a still photo from which the image was +scanned, or possibly the subject matter itself. In order to facilitate +machine-readable dates, it is recommended that the "Creation Time" +tEXt chunk use RFC 1123 format dates (e.g. "22 May 1997 18:07:10 GMT"), +although this isn't a requirement. Unlike the tIME chunk, the +"Creation Time" tEXt chunk is not expected to be automatically changed +by the software. To facilitate the use of RFC 1123 dates, a function +png_convert_to_rfc1123_buffer(buffer, png_timep) is provided to +convert from PNG time to an RFC 1123 format string. The caller must provide +a writeable buffer of at least 29 bytes. + +.SS Writing unknown chunks + +You can use the png_set_unknown_chunks function to queue up private chunks +for writing. You give it a chunk name, location, raw data, and a size. You +also must use png_set_keep_unknown_chunks() to ensure that libpng will +handle them. That's all there is to it. The chunks will be written by the +next following png_write_info_before_PLTE, png_write_info, or png_write_end +function, depending upon the specified location. Any chunks previously +read into the info structure's unknown-chunk list will also be written out +in a sequence that satisfies the PNG specification's ordering rules. + +Here is an example of writing two private chunks, prVt and miNE: + + #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED + /* Set unknown chunk data */ + png_unknown_chunk unk_chunk[2]; + strcpy((char *) unk_chunk[0].name, "prVt"; + unk_chunk[0].data = (unsigned char *) "PRIVATE DATA"; + unk_chunk[0].size = strlen(unk_chunk[0].data)+1; + unk_chunk[0].location = PNG_HAVE_IHDR; + strcpy((char *) unk_chunk[1].name, "miNE"; + unk_chunk[1].data = (unsigned char *) "MY CHUNK DATA"; + unk_chunk[1].size = strlen(unk_chunk[0].data)+1; + unk_chunk[1].location = PNG_AFTER_IDAT; + png_set_unknown_chunks(write_ptr, write_info_ptr, + unk_chunk, 2); + /* Needed because miNE is not safe-to-copy */ + png_set_keep_unknown_chunks(png, PNG_HANDLE_CHUNK_ALWAYS, + (png_bytep) "miNE", 1); + #endif + +.SS The high-level write interface + +At this point there are two ways to proceed; through the high-level +write interface, or through a sequence of low-level write operations. +You can use the high-level interface if your image data is present +in the info structure. All defined output +transformations are permitted, enabled by the following masks. + + PNG_TRANSFORM_IDENTITY No transformation + PNG_TRANSFORM_PACKING Pack 1, 2 and 4-bit samples + PNG_TRANSFORM_PACKSWAP Change order of packed + pixels to LSB first + PNG_TRANSFORM_INVERT_MONO Invert monochrome images + PNG_TRANSFORM_SHIFT Normalize pixels to the + sBIT depth + PNG_TRANSFORM_BGR Flip RGB to BGR, RGBA + to BGRA + PNG_TRANSFORM_SWAP_ALPHA Flip RGBA to ARGB or GA + to AG + PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity + to transparency + PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples + PNG_TRANSFORM_STRIP_FILLER Strip out filler + bytes (deprecated). + PNG_TRANSFORM_STRIP_FILLER_BEFORE Strip out leading + filler bytes + PNG_TRANSFORM_STRIP_FILLER_AFTER Strip out trailing + filler bytes + +If you have valid image data in the info structure (you can use +png_set_rows() to put image data in the info structure), simply do this: + + png_write_png(png_ptr, info_ptr, png_transforms, NULL) + +where png_transforms is an integer containing the bitwise OR of some set of +transformation flags. This call is equivalent to png_write_info(), +followed the set of transformations indicated by the transform mask, +then png_write_image(), and finally png_write_end(). + +(The final parameter of this call is not yet used. Someday it might point +to transformation parameters required by some future output transform.) + +You must use png_transforms and not call any png_set_transform() functions +when you use png_write_png(). + +.SS The low-level write interface + +If you are going the low-level route instead, you are now ready to +write all the file information up to the actual image data. You do +this with a call to png_write_info(). + + png_write_info(png_ptr, info_ptr); + +Note that there is one transformation you may need to do before +png_write_info(). In PNG files, the alpha channel in an image is the +level of opacity. If your data is supplied as a level of transparency, +you can invert the alpha channel before you write it, so that 0 is +fully transparent and 255 (in 8-bit or paletted images) or 65535 +(in 16-bit images) is fully opaque, with + + png_set_invert_alpha(png_ptr); + +This must appear before png_write_info() instead of later with the +other transformations because in the case of paletted images the tRNS +chunk data has to be inverted before the tRNS chunk is written. If +your image is not a paletted image, the tRNS data (which in such cases +represents a single color to be rendered as transparent) won't need to +be changed, and you can safely do this transformation after your +png_write_info() call. + +If you need to write a private chunk that you want to appear before +the PLTE chunk when PLTE is present, you can write the PNG info in +two steps, and insert code to write your own chunk between them: + + png_write_info_before_PLTE(png_ptr, info_ptr); + png_set_unknown_chunks(png_ptr, info_ptr, ...); + png_write_info(png_ptr, info_ptr); + +After you've written the file information, you can set up the library +to handle any special transformations of the image data. The various +ways to transform the data will be described in the order that they +should occur. This is important, as some of these change the color +type and/or bit depth of the data, and some others only work on +certain color types and bit depths. Even though each transformation +checks to see if it has data that it can do something with, you should +make sure to only enable a transformation if it will be valid for the +data. For example, don't swap red and blue on grayscale data. + +PNG files store RGB pixels packed into 3 or 6 bytes. This code tells +the library to strip input data that has 4 or 8 bytes per pixel down +to 3 or 6 bytes (or strip 2 or 4-byte grayscale+filler data to 1 or 2 +bytes per pixel). + + png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); + +where the 0 is unused, and the location is either PNG_FILLER_BEFORE or +PNG_FILLER_AFTER, depending upon whether the filler byte in the pixel +is stored XRGB or RGBX. + +PNG files pack pixels of bit depths 1, 2, and 4 into bytes as small as +they can, resulting in, for example, 8 pixels per byte for 1 bit files. +If the data is supplied at 1 pixel per byte, use this code, which will +correctly pack the pixels into a single byte: + + png_set_packing(png_ptr); + +PNG files reduce possible bit depths to 1, 2, 4, 8, and 16. If your +data is of another bit depth, you can write an sBIT chunk into the +file so that decoders can recover the original data if desired. + + /* Set the true bit depth of the image data */ + if (color_type & PNG_COLOR_MASK_COLOR) + { + sig_bit.red = true_bit_depth; + sig_bit.green = true_bit_depth; + sig_bit.blue = true_bit_depth; + } + + else + { + sig_bit.gray = true_bit_depth; + } + + if (color_type & PNG_COLOR_MASK_ALPHA) + { + sig_bit.alpha = true_bit_depth; + } + + png_set_sBIT(png_ptr, info_ptr, &sig_bit); + +If the data is stored in the row buffer in a bit depth other than +one supported by PNG (e.g. 3 bit data in the range 0-7 for a 4-bit PNG), +this will scale the values to appear to be the correct bit depth as +is required by PNG. + + png_set_shift(png_ptr, &sig_bit); + +PNG files store 16-bit pixels in network byte order (big-endian, +ie. most significant bits first). This code would be used if they are +supplied the other way (little-endian, i.e. least significant bits +first, the way PCs store them): + + if (bit_depth > 8) + png_set_swap(png_ptr); + +If you are using packed-pixel images (1, 2, or 4 bits/pixel), and you +need to change the order the pixels are packed into bytes, you can use: + + if (bit_depth < 8) + png_set_packswap(png_ptr); + +PNG files store 3 color pixels in red, green, blue order. This code +would be used if they are supplied as blue, green, red: + + png_set_bgr(png_ptr); + +PNG files describe monochrome as black being zero and white being +one. This code would be used if the pixels are supplied with this reversed +(black being one and white being zero): + + png_set_invert_mono(png_ptr); + +Finally, you can write your own transformation function if none of +the existing ones meets your needs. This is done by setting a callback +with + + png_set_write_user_transform_fn(png_ptr, + write_transform_fn); + +You must supply the function + + void write_transform_fn(png_structp png_ptr, png_row_infop + row_info, png_bytep data) + +See pngtest.c for a working example. Your function will be called +before any of the other transformations are processed. If supported +libpng also supplies an information routine that may be called from +your callback: + + png_get_current_row_number(png_ptr); + png_get_current_pass_number(png_ptr); + +This returns the current row passed to the transform. With interlaced +images the value returned is the row in the input sub-image image. Use +PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to +find the output pixel (x,y) given an interlaced sub-image pixel (row,col,pass). + +The discussion of interlace handling above contains more information on how to +use these values. + +You can also set up a pointer to a user structure for use by your +callback function. + + png_set_user_transform_info(png_ptr, user_ptr, 0, 0); + +The user_channels and user_depth parameters of this function are ignored +when writing; you can set them to zero as shown. + +You can retrieve the pointer via the function png_get_user_transform_ptr(). +For example: + + voidp write_user_transform_ptr = + png_get_user_transform_ptr(png_ptr); + +It is possible to have libpng flush any pending output, either manually, +or automatically after a certain number of lines have been written. To +flush the output stream a single time call: + + png_write_flush(png_ptr); + +and to have libpng flush the output stream periodically after a certain +number of scanlines have been written, call: + + png_set_flush(png_ptr, nrows); + +Note that the distance between rows is from the last time png_write_flush() +was called, or the first row of the image if it has never been called. +So if you write 50 lines, and then png_set_flush 25, it will flush the +output on the next scanline, and every 25 lines thereafter, unless +png_write_flush() is called before 25 more lines have been written. +If nrows is too small (less than about 10 lines for a 640 pixel wide +RGB image) the image compression may decrease noticeably (although this +may be acceptable for real-time applications). Infrequent flushing will +only degrade the compression performance by a few percent over images +that do not use flushing. + +.SS Writing the image data + +That's it for the transformations. Now you can write the image data. +The simplest way to do this is in one function call. If you have the +whole image in memory, you can just call png_write_image() and libpng +will write the image. You will need to pass in an array of pointers to +each row. This function automatically handles interlacing, so you don't +need to call png_set_interlace_handling() or call this function multiple +times, or any of that other stuff necessary with png_write_rows(). + + png_write_image(png_ptr, row_pointers); + +where row_pointers is: + + png_byte *row_pointers[height]; + +You can point to void or char or whatever you use for pixels. + +If you don't want to write the whole image at once, you can +use png_write_rows() instead. If the file is not interlaced, +this is simple: + + png_write_rows(png_ptr, row_pointers, + number_of_rows); + +row_pointers is the same as in the png_write_image() call. + +If you are just writing one row at a time, you can do this with +a single row_pointer instead of an array of row_pointers: + + png_bytep row_pointer = row; + + png_write_row(png_ptr, row_pointer); + +When the file is interlaced, things can get a good deal more complicated. +The only currently (as of the PNG Specification version 1.2, dated July +1999) defined interlacing scheme for PNG files is the "Adam7" interlace +scheme, that breaks down an image into seven smaller images of varying +size. libpng will build these images for you, or you can do them +yourself. If you want to build them yourself, see the PNG specification +for details of which pixels to write when. + +If you don't want libpng to handle the interlacing details, just +use png_set_interlace_handling() and call png_write_rows() the +correct number of times to write all the sub-images +(png_set_interlace_handling() returns the number of sub-images.) + +If you want libpng to build the sub-images, call this before you start +writing any rows: + + number_of_passes = png_set_interlace_handling(png_ptr); + +This will return the number of passes needed. Currently, this is seven, +but may change if another interlace type is added. + +Then write the complete image number_of_passes times. + + png_write_rows(png_ptr, row_pointers, number_of_rows); + +Think carefully before you write an interlaced image. Typically code that +reads such images reads all the image data into memory, uncompressed, before +doing any processing. Only code that can display an image on the fly can +take advantage of the interlacing and even then the image has to be exactly +the correct size for the output device, because scaling an image requires +adjacent pixels and these are not available until all the passes have been +read. + +If you do write an interlaced image you will hardly ever need to handle +the interlacing yourself. Call png_set_interlace_handling() and use the +approach described above. + +The only time it is conceivable that you will really need to write an +interlaced image pass-by-pass is when you have read one pass by pass and +made some pixel-by-pixel transformation to it, as described in the read +code above. In this case use the PNG_PASS_ROWS and PNG_PASS_COLS macros +to determine the size of each sub-image in turn and simply write the rows +you obtained from the read code. + +.SS Finishing a sequential write + +After you are finished writing the image, you should finish writing +the file. If you are interested in writing comments or time, you should +pass an appropriately filled png_info pointer. If you are not interested, +you can pass NULL. + + png_write_end(png_ptr, info_ptr); + +When you are done, you can free all memory used by libpng like this: + + png_destroy_write_struct(&png_ptr, &info_ptr); + +It is also possible to individually free the info_ptr members that +point to libpng-allocated storage with the following function: + + png_free_data(png_ptr, info_ptr, mask, seq) + + mask - identifies data to be freed, a mask + containing the bitwise OR of one or + more of + PNG_FREE_PLTE, PNG_FREE_TRNS, + PNG_FREE_HIST, PNG_FREE_ICCP, + PNG_FREE_PCAL, PNG_FREE_ROWS, + PNG_FREE_SCAL, PNG_FREE_SPLT, + PNG_FREE_TEXT, PNG_FREE_UNKN, + or simply PNG_FREE_ALL + + seq - sequence number of item to be freed + (\-1 for all items) + +This function may be safely called when the relevant storage has +already been freed, or has not yet been allocated, or was allocated +by the user and not by libpng, and will in those cases do nothing. +The "seq" parameter is ignored if only one item of the selected data +type, such as PLTE, is allowed. If "seq" is not \-1, and multiple items +are allowed for the data type identified in the mask, such as text or +sPLT, only the n'th item in the structure is freed, where n is "seq". + +If you allocated data such as a palette that you passed in to libpng +with png_set_*, you must not free it until just before the call to +png_destroy_write_struct(). + +The default behavior is only to free data that was allocated internally +by libpng. This can be changed, so that libpng will not free the data, +or so that it will free data that was allocated by the user with png_malloc() +or png_calloc() and passed in via a png_set_*() function, with + + png_data_freer(png_ptr, info_ptr, freer, mask) + + freer - one of + PNG_DESTROY_WILL_FREE_DATA + PNG_SET_WILL_FREE_DATA + PNG_USER_WILL_FREE_DATA + + mask - which data elements are affected + same choices as in png_free_data() + +For example, to transfer responsibility for some data from a read structure +to a write structure, you could use + + png_data_freer(read_ptr, read_info_ptr, + PNG_USER_WILL_FREE_DATA, + PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) + + png_data_freer(write_ptr, write_info_ptr, + PNG_DESTROY_WILL_FREE_DATA, + PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST) + +thereby briefly reassigning responsibility for freeing to the user but +immediately afterwards reassigning it once more to the write_destroy +function. Having done this, it would then be safe to destroy the read +structure and continue to use the PLTE, tRNS, and hIST data in the write +structure. + +This function only affects data that has already been allocated. +You can call this function before calling after the png_set_*() functions +to control whether the user or png_destroy_*() is supposed to free the data. +When the user assumes responsibility for libpng-allocated data, the +application must use +png_free() to free it, and when the user transfers responsibility to libpng +for data that the user has allocated, the user must have used png_malloc() +or png_calloc() to allocate it. + +If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword +separately, do not transfer responsibility for freeing text_ptr to libpng, +because when libpng fills a png_text structure it combines these members with +the key member, and png_free_data() will free only text_ptr.key. Similarly, +if you transfer responsibility for free'ing text_ptr from libpng to your +application, your application must not separately free those members. +For a more compact example of writing a PNG image, see the file example.c. + +.SH V. Simplified API + +The simplified API, which became available in libpng-1.6.0, hides the details +of both libpng and the PNG file format itself. +It allows PNG files to be read into a very limited number of +in-memory bitmap formats or to be written from the same formats. If these +formats do not accommodate your needs then you can, and should, use the more +sophisticated APIs above - these support a wide variety of in-memory formats +and a wide variety of sophisticated transformations to those formats as well +as a wide variety of APIs to manipulate ancillary information. + +To read a PNG file using the simplified API: + + 1) Declare a 'png_image' structure (see below) on the stack, set the + version field to PNG_IMAGE_VERSION and the 'opaque' pointer to NULL + (this is REQUIRED, your program may crash if you don't do it.) + + 2) Call the appropriate png_image_begin_read... function. + + 3) Set the png_image 'format' member to the required sample format. + + 4) Allocate a buffer for the image and, if required, the color-map. + + 5) Call png_image_finish_read to read the image and, if required, the + color-map into your buffers. + +There are no restrictions on the format of the PNG input itself; all valid +color types, bit depths, and interlace methods are acceptable, and the +input image is transformed as necessary to the requested in-memory format +during the png_image_finish_read() step. The only caveat is that if you +request a color-mapped image from a PNG that is full-color or makes +complex use of an alpha channel the transformation is extremely lossy and the +result may look terrible. + +To write a PNG file using the simplified API: + + 1) Declare a 'png_image' structure on the stack and memset() + it to all zero. + + 2) Initialize the members of the structure that describe the + image, setting the 'format' member to the format of the + image samples. + + 3) Call the appropriate png_image_write... function with a + pointer to the image and, if necessary, the color-map to write + the PNG data. + +png_image is a structure that describes the in-memory format of an image +when it is being read or defines the in-memory format of an image that you +need to write. The "png_image" structure contains the following members: + + png_controlp opaque Initialize to NULL, free with png_image_free + png_uint_32 version Set to PNG_IMAGE_VERSION + png_uint_32 width Image width in pixels (columns) + png_uint_32 height Image height in pixels (rows) + png_uint_32 format Image format as defined below + png_uint_32 flags A bit mask containing informational flags + png_uint_32 colormap_entries; Number of entries in the color-map + png_uint_32 warning_or_error; + char message[64]; + +In the event of an error or warning the "warning_or_error" +field will be set to a non-zero value and the 'message' field will contain +a '\0' terminated string with the libpng error or warning message. If both +warnings and an error were encountered, only the error is recorded. If there +are multiple warnings, only the first one is recorded. + +The upper 30 bits of the "warning_or_error" value are reserved; the low two +bits contain a two bit code such that a value more than 1 indicates a failure +in the API just called: + + 0 - no warning or error + 1 - warning + 2 - error + 3 - error preceded by warning + +The pixels (samples) of the image have one to four channels whose components +have original values in the range 0 to 1.0: + + 1: A single gray or luminance channel (G). + 2: A gray/luminance channel and an alpha channel (GA). + 3: Three red, green, blue color channels (RGB). + 4: Three color channels and an alpha channel (RGBA). + +The channels are encoded in one of two ways: + + a) As a small integer, value 0..255, contained in a single byte. For the +alpha channel the original value is simply value/255. For the color or +luminance channels the value is encoded according to the sRGB specification +and matches the 8-bit format expected by typical display devices. + +The color/gray channels are not scaled (pre-multiplied) by the alpha +channel and are suitable for passing to color management software. + + b) As a value in the range 0..65535, contained in a 2-byte integer, in +the native byte order of the platform on which the application is running. +All channels can be converted to the original value by dividing by 65535; all +channels are linear. Color channels use the RGB encoding (RGB end-points) of +the sRGB specification. This encoding is identified by the +PNG_FORMAT_FLAG_LINEAR flag below. + +When the simplified API needs to convert between sRGB and linear colorspaces, +the actual sRGB transfer curve defined in the sRGB specification (see the +article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 +approximation used elsewhere in libpng. + +When an alpha channel is present it is expected to denote pixel coverage +of the color or luminance channels and is returned as an associated alpha +channel: the color/gray channels are scaled (pre-multiplied) by the alpha +value. + +The samples are either contained directly in the image data, between 1 and 8 +bytes per pixel according to the encoding, or are held in a color-map indexed +by bytes in the image data. In the case of a color-map the color-map entries +are individual samples, encoded as above, and the image data has one byte per +pixel to select the relevant sample from the color-map. + +PNG_FORMAT_* + +The #defines to be used in png_image::format. Each #define identifies a +particular layout of channel data and, if present, alpha values. There are +separate defines for each of the two component encodings. + +A format is built up using single bit flag values. All combinations are +valid. Formats can be built up from the flag values or you can use one of +the predefined values below. When testing formats always use the FORMAT_FLAG +macros to test for individual features - future versions of the library may +add new flags. + +When reading or writing color-mapped images the format should be set to the +format of the entries in the color-map then png_image_{read,write}_colormap +called to read or write the color-map and set the format correctly for the +image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! + +NOTE: libpng can be built with particular features disabled. If you see +compiler errors because the definition of one of the following flags has been +compiled out it is because libpng does not have the required support. It is +possible, however, for the libpng configuration to enable the format on just +read or just write; in that case you may see an error at run time. +You can guard against this by checking for the definition of the +appropriate "_SUPPORTED" macro, one of: + + PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED + + PNG_FORMAT_FLAG_ALPHA format with an alpha channel + PNG_FORMAT_FLAG_COLOR color format: otherwise grayscale + PNG_FORMAT_FLAG_LINEAR 2-byte channels else 1-byte + PNG_FORMAT_FLAG_COLORMAP image data is color-mapped + PNG_FORMAT_FLAG_BGR BGR colors, else order is RGB + PNG_FORMAT_FLAG_AFIRST alpha channel comes first + +Supported formats are as follows. Future versions of libpng may support more +formats; for compatibility with older versions simply check if the format +macro is defined using #ifdef. These defines describe the in-memory layout +of the components of the pixels of the image. + +First the single byte (sRGB) formats: + + PNG_FORMAT_GRAY + PNG_FORMAT_GA + PNG_FORMAT_AG + PNG_FORMAT_RGB + PNG_FORMAT_BGR + PNG_FORMAT_RGBA + PNG_FORMAT_ARGB + PNG_FORMAT_BGRA + PNG_FORMAT_ABGR + +Then the linear 2-byte formats. When naming these "Y" is used to +indicate a luminance (gray) channel. The component order within the pixel +is always the same - there is no provision for swapping the order of the +components in the linear format. The components are 16-bit integers in +the native byte order for your platform, and there is no provision for +swapping the bytes to a different endian condition. + + PNG_FORMAT_LINEAR_Y + PNG_FORMAT_LINEAR_Y_ALPHA + PNG_FORMAT_LINEAR_RGB + PNG_FORMAT_LINEAR_RGB_ALPHA + +With color-mapped formats the image data is one byte for each pixel. The byte +is an index into the color-map which is formatted as above. To obtain a +color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP +to one of the above definitions, or you can use one of the definitions below. + + PNG_FORMAT_RGB_COLORMAP + PNG_FORMAT_BGR_COLORMAP + PNG_FORMAT_RGBA_COLORMAP + PNG_FORMAT_ARGB_COLORMAP + PNG_FORMAT_BGRA_COLORMAP + PNG_FORMAT_ABGR_COLORMAP + +PNG_IMAGE macros + +These are convenience macros to derive information from a png_image +structure. The PNG_IMAGE_SAMPLE_ macros return values appropriate to the +actual image sample values - either the entries in the color-map or the +pixels in the image. The PNG_IMAGE_PIXEL_ macros return corresponding values +for the pixels and will always return 1 for color-mapped formats. The +remaining macros return information about the rows in the image and the +complete image. + +NOTE: All the macros that take a png_image::format parameter are compile time +constants if the format parameter is, itself, a constant. Therefore these +macros can be used in array declarations and case labels where required. +Similarly the macros are also pre-processor constants (sizeof is not used) so +they can be used in #if tests. + + PNG_IMAGE_SAMPLE_CHANNELS(fmt) + Returns the total number of channels in a given format: 1..4 + + PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt) + Returns the size in bytes of a single component of a pixel or color-map + entry (as appropriate) in the image: 1 or 2. + + PNG_IMAGE_SAMPLE_SIZE(fmt) + This is the size of the sample data for one sample. If the image is + color-mapped it is the size of one color-map entry (and image pixels are + one byte in size), otherwise it is the size of one image pixel. + + PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt) + The maximum size of the color-map required by the format expressed in a + count of components. This can be used to compile-time allocate a + color-map: + + png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)]; + + png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)]; + + Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the + information from one of the png_image_begin_read_ APIs and dynamically + allocate the required memory. + + PNG_IMAGE_COLORMAP_SIZE(fmt) + The size of the color-map required by the format; this is the size of the + color-map buffer passed to the png_image_{read,write}_colormap APIs. It is + a fixed number determined by the format so can easily be allocated on the + stack if necessary. + +Corresponding information about the pixels + + PNG_IMAGE_PIXEL_CHANNELS(fmt) + The number of separate channels (components) in a pixel; 1 for a + color-mapped image. + + PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\ + The size, in bytes, of each component in a pixel; 1 for a color-mapped + image. + + PNG_IMAGE_PIXEL_SIZE(fmt) + The size, in bytes, of a complete pixel; 1 for a color-mapped image. + +Information about the whole row, or whole image + + PNG_IMAGE_ROW_STRIDE(image) + Returns the total number of components in a single row of the image; this + is the minimum 'row stride', the minimum count of components between each + row. For a color-mapped image this is the minimum number of bytes in a + row. + + If you need the stride measured in bytes, row_stride_bytes is + PNG_IMAGE_ROW_STRIDE(image) * PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt) + plus any padding bytes that your application might need, for example + to start the next row on a 4-byte boundary. + + PNG_IMAGE_BUFFER_SIZE(image, row_stride) + Return the size, in bytes, of an image buffer given a png_image and a row + stride - the number of components to leave space for in each row. + + PNG_IMAGE_SIZE(image) + Return the size, in bytes, of the image in memory given just a png_image; + the row stride is the minimum stride required for the image. + + PNG_IMAGE_COLORMAP_SIZE(image) + Return the size, in bytes, of the color-map of this image. If the image + format is not a color-map format this will return a size sufficient for + 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if + you don't want to allocate a color-map in this case. + +PNG_IMAGE_FLAG_* + +Flags containing additional information about the image are held in +the 'flags' field of png_image. + + PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB == 0x01 + This indicates that the RGB values of the in-memory bitmap do not + correspond to the red, green and blue end-points defined by sRGB. + + PNG_IMAGE_FLAG_FAST == 0x02 + On write emphasise speed over compression; the resultant PNG file will be + larger but will be produced significantly faster, particular for large + images. Do not use this option for images which will be distributed, only + used it when producing intermediate files that will be read back in + repeatedly. For a typical 24-bit image the option will double the read + speed at the cost of increasing the image size by 25%, however for many + more compressible images the PNG file can be 10 times larger with only a + slight speed gain. + + PNG_IMAGE_FLAG_16BIT_sRGB == 0x04 + On read if the image is a 16-bit per component image and there is no gAMA + or sRGB chunk assume that the components are sRGB encoded. Notice that + images output by the simplified API always have gamma information; setting + this flag only affects the interpretation of 16-bit images from an + external source. It is recommended that the application expose this flag + to the user; the user can normally easily recognize the difference between + linear and sRGB encoding. This flag has no effect on write - the data + passed to the write APIs must have the correct encoding (as defined + above.) + + If the flag is not set (the default) input 16-bit per component data is + assumed to be linear. + + NOTE: the flag can only be set after the png_image_begin_read_ call, + because that call initializes the 'flags' field. + +READ APIs + + The png_image passed to the read APIs must have been initialized by setting + the png_controlp field 'opaque' to NULL (or, better, memset the whole thing.) + + int png_image_begin_read_from_file( png_imagep image, + const char *file_name) + + The named file is opened for read and the image header + is filled in from the PNG header in the file. + + int png_image_begin_read_from_stdio (png_imagep image, + FILE *file) + + The PNG header is read from the stdio FILE object. + + int png_image_begin_read_from_memory(png_imagep image, + png_const_voidp memory, size_t size) + + The PNG header is read from the given memory buffer. + + int png_image_finish_read(png_imagep image, + png_colorp background, void *buffer, + png_int_32 row_stride, void *colormap)); + + Finish reading the image into the supplied buffer and + clean up the png_image structure. + + row_stride is the step, in png_byte or png_uint_16 units + as appropriate, between adjacent rows. A positive stride + indicates that the top-most row is first in the buffer - + the normal top-down arrangement. A negative stride + indicates that the bottom-most row is first in the buffer. + + background need only be supplied if an alpha channel must + be removed from a png_byte format and the removal is to be + done by compositing on a solid color; otherwise it may be + NULL and any composition will be done directly onto the + buffer. The value is an sRGB color to use for the + background, for grayscale output the green channel is used. + + For linear output removing the alpha channel is always done + by compositing on black. + + void png_image_free(png_imagep image) + + Free any data allocated by libpng in image->opaque, + setting the pointer to NULL. May be called at any time + after the structure is initialized. + +When the simplified API needs to convert between sRGB and linear colorspaces, +the actual sRGB transfer curve defined in the sRGB specification (see the +article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 +approximation used elsewhere in libpng. + +WRITE APIS + +For write you must initialize a png_image structure to describe the image to +be written: + + version: must be set to PNG_IMAGE_VERSION + opaque: must be initialized to NULL + width: image width in pixels + height: image height in rows + format: the format of the data you wish to write + flags: set to 0 unless one of the defined flags applies; set + PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images + where the RGB values do not correspond to the colors in sRGB. + colormap_entries: set to the number of entries in the color-map (0 to 256) + + int png_image_write_to_file, (png_imagep image, + const char *file, int convert_to_8bit, const void *buffer, + png_int_32 row_stride, const void *colormap)); + + Write the image to the named file. + + int png_image_write_to_memory (png_imagep image, void *memory, + png_alloc_size_t * PNG_RESTRICT memory_bytes, + int convert_to_8_bit, const void *buffer, ptrdiff_t row_stride, + const void *colormap)); + + Write the image to memory. + + int png_image_write_to_stdio(png_imagep image, FILE *file, + int convert_to_8_bit, const void *buffer, + png_int_32 row_stride, const void *colormap) + + Write the image to the given FILE object. + +With all write APIs if image is in one of the linear formats with +(png_uint_16) data then setting convert_to_8_bit will cause the output to be +a (png_byte) PNG gamma encoded according to the sRGB specification, otherwise +a 16-bit linear encoded PNG file is written. + +With all APIs row_stride is handled as in the read APIs - it is the spacing +from one row to the next in component sized units (float) and if negative +indicates a bottom-up row layout in the buffer. If you pass zero, libpng will +calculate the row_stride for you from the width and number of channels. + +Note that the write API does not support interlacing, sub-8-bit pixels, +indexed (paletted) images, or most ancillary chunks. + +.SH VI. Modifying/Customizing libpng + +There are two issues here. The first is changing how libpng does +standard things like memory allocation, input/output, and error handling. +The second deals with more complicated things like adding new chunks, +adding new transformations, and generally changing how libpng works. +Both of those are compile-time issues; that is, they are generally +determined at the time the code is written, and there is rarely a need +to provide the user with a means of changing them. + +Memory allocation, input/output, and error handling + +All of the memory allocation, input/output, and error handling in libpng +goes through callbacks that are user-settable. The default routines are +in pngmem.c, pngrio.c, pngwio.c, and pngerror.c, respectively. To change +these functions, call the appropriate png_set_*_fn() function. + +Memory allocation is done through the functions png_malloc(), png_calloc(), +and png_free(). The png_malloc() and png_free() functions currently just +call the standard C functions and png_calloc() calls png_malloc() and then +clears the newly allocated memory to zero; note that png_calloc(png_ptr, size) +is not the same as the calloc(number, size) function provided by stdlib.h. +There is limited support for certain systems with segmented memory +architectures and the types of pointers declared by png.h match this; you +will have to use appropriate pointers in your application. If you prefer +to use a different method of allocating and freeing data, you can use +png_create_read_struct_2() or png_create_write_struct_2() to register your +own functions as described above. These functions also provide a void +pointer that can be retrieved via + + mem_ptr = png_get_mem_ptr(png_ptr); + +Your replacement memory functions must have prototypes as follows: + + png_voidp malloc_fn(png_structp png_ptr, + png_alloc_size_t size); + + void free_fn(png_structp png_ptr, png_voidp ptr); + +Your malloc_fn() must return NULL in case of failure. The png_malloc() +function will normally call png_error() if it receives a NULL from the +system memory allocator or from your replacement malloc_fn(). + +Your free_fn() will never be called with a NULL ptr, since libpng's +png_free() checks for NULL before calling free_fn(). + +Input/Output in libpng is done through png_read() and png_write(), +which currently just call fread() and fwrite(). The FILE * is stored in +png_struct and is initialized via png_init_io(). If you wish to change +the method of I/O, the library supplies callbacks that you can set +through the function png_set_read_fn() and png_set_write_fn() at run +time, instead of calling the png_init_io() function. These functions +also provide a void pointer that can be retrieved via the function +png_get_io_ptr(). For example: + + png_set_read_fn(png_structp read_ptr, + voidp read_io_ptr, png_rw_ptr read_data_fn) + + png_set_write_fn(png_structp write_ptr, + voidp write_io_ptr, png_rw_ptr write_data_fn, + png_flush_ptr output_flush_fn); + + voidp read_io_ptr = png_get_io_ptr(read_ptr); + voidp write_io_ptr = png_get_io_ptr(write_ptr); + +The replacement I/O functions must have prototypes as follows: + + void user_read_data(png_structp png_ptr, + png_bytep data, size_t length); + + void user_write_data(png_structp png_ptr, + png_bytep data, size_t length); + + void user_flush_data(png_structp png_ptr); + +The user_read_data() function is responsible for detecting and +handling end-of-data errors. + +Supplying NULL for the read, write, or flush functions sets them back +to using the default C stream functions, which expect the io_ptr to +point to a standard *FILE structure. It is probably a mistake +to use NULL for one of write_data_fn and output_flush_fn but not both +of them, unless you have built libpng with PNG_NO_WRITE_FLUSH defined. +It is an error to read from a write stream, and vice versa. + +Error handling in libpng is done through png_error() and png_warning(). +Errors handled through png_error() are fatal, meaning that png_error() +should never return to its caller. Currently, this is handled via +setjmp() and longjmp() (unless you have compiled libpng with +PNG_NO_SETJMP, in which case it is handled via PNG_ABORT()), +but you could change this to do things like exit() if you should wish, +as long as your function does not return. + +On non-fatal errors, png_warning() is called +to print a warning message, and then control returns to the calling code. +By default png_error() and png_warning() print a message on stderr via +fprintf() unless the library is compiled with PNG_NO_CONSOLE_IO defined +(because you don't want the messages) or PNG_NO_STDIO defined (because +fprintf() isn't available). If you wish to change the behavior of the error +functions, you will need to set up your own message callbacks. These +functions are normally supplied at the time that the png_struct is created. +It is also possible to redirect errors and warnings to your own replacement +functions after png_create_*_struct() has been called by calling: + + png_set_error_fn(png_structp png_ptr, + png_voidp error_ptr, png_error_ptr error_fn, + png_error_ptr warning_fn); + +If NULL is supplied for either error_fn or warning_fn, then the libpng +default function will be used, calling fprintf() and/or longjmp() if a +problem is encountered. The replacement error functions should have +parameters as follows: + + void user_error_fn(png_structp png_ptr, + png_const_charp error_msg); + + void user_warning_fn(png_structp png_ptr, + png_const_charp warning_msg); + +Then, within your user_error_fn or user_warning_fn, you can retrieve +the error_ptr if you need it, by calling + + png_voidp error_ptr = png_get_error_ptr(png_ptr); + +The motivation behind using setjmp() and longjmp() is the C++ throw and +catch exception handling methods. This makes the code much easier to write, +as there is no need to check every return code of every function call. +However, there are some uncertainties about the status of local variables +after a longjmp, so the user may want to be careful about doing anything +after setjmp returns non-zero besides returning itself. Consult your +compiler documentation for more details. For an alternative approach, you +may wish to use the "cexcept" facility (see https://cexcept.sourceforge.io/), +which is illustrated in pngvalid.c and in contrib/visupng. + +Beginning in libpng-1.4.0, the png_set_benign_errors() API became available. +You can use this to handle certain errors (normally handled as errors) +as warnings. + + png_set_benign_errors (png_ptr, int allowed); + + allowed: 0: treat png_benign_error() as an error. + 1: treat png_benign_error() as a warning. + +As of libpng-1.6.0, the default condition is to treat benign errors as +warnings while reading and as errors while writing. + +.SS Custom chunks + +If you need to read or write custom chunks, you may need to get deeper +into the libpng code. The library now has mechanisms for storing +and writing chunks of unknown type; you can even declare callbacks +for custom chunks. However, this may not be good enough if the +library code itself needs to know about interactions between your +chunk and existing `intrinsic' chunks. + +If you need to write a new intrinsic chunk, first read the PNG +specification. Acquire a first level of understanding of how it works. +Pay particular attention to the sections that describe chunk names, +and look at how other chunks were designed, so you can do things +similarly. Second, check out the sections of libpng that read and +write chunks. Try to find a chunk that is similar to yours and use +it as a template. More details can be found in the comments inside +the code. It is best to handle private or unknown chunks in a generic method, +via callback functions, instead of by modifying libpng functions. This +is illustrated in pngtest.c, which uses a callback function to handle a +private "vpAg" chunk and the new "sTER" chunk, which are both unknown to +libpng. + +If you wish to write your own transformation for the data, look through +the part of the code that does the transformations, and check out some of +the simpler ones to get an idea of how they work. Try to find a similar +transformation to the one you want to add and copy off of it. More details +can be found in the comments inside the code itself. + +.SS Configuring for gui/windowing platforms: + +You will need to write new error and warning functions that use the GUI +interface, as described previously, and set them to be the error and +warning functions at the time that png_create_*_struct() is called, +in order to have them available during the structure initialization. +They can be changed later via png_set_error_fn(). On some compilers, +you may also have to change the memory allocators (png_malloc, etc.). + +.SS Configuring zlib: + +There are special functions to configure the compression. Perhaps the +most useful one changes the compression level, which currently uses +input compression values in the range 0 - 9. The library normally +uses the default compression level (Z_DEFAULT_COMPRESSION = 6). Tests +have shown that for a large majority of images, compression values in +the range 3-6 compress nearly as well as higher levels, and do so much +faster. For online applications it may be desirable to have maximum speed +(Z_BEST_SPEED = 1). With versions of zlib after v0.99, you can also +specify no compression (Z_NO_COMPRESSION = 0), but this would create +files larger than just storing the raw bitmap. You can specify the +compression level by calling: + + #include zlib.h + png_set_compression_level(png_ptr, level); + +Another useful one is to reduce the memory level used by the library. +The memory level defaults to 8, but it can be lowered if you are +short on memory (running DOS, for example, where you only have 640K). +Note that the memory level does have an effect on compression; among +other things, lower levels will result in sections of incompressible +data being emitted in smaller stored blocks, with a correspondingly +larger relative overhead of up to 15% in the worst case. + + #include zlib.h + png_set_compression_mem_level(png_ptr, level); + +The other functions are for configuring zlib. They are not recommended +for normal use and may result in writing an invalid PNG file. See +zlib.h for more information on what these mean. + + #include zlib.h + png_set_compression_strategy(png_ptr, + strategy); + + png_set_compression_window_bits(png_ptr, + window_bits); + + png_set_compression_method(png_ptr, method); + +This controls the size of the IDAT chunks (default 8192): + + png_set_compression_buffer_size(png_ptr, size); + +As of libpng version 1.5.4, additional APIs became +available to set these separately for non-IDAT +compressed chunks such as zTXt, iTXt, and iCCP: + + #include zlib.h + #if PNG_LIBPNG_VER >= 10504 + png_set_text_compression_level(png_ptr, level); + + png_set_text_compression_mem_level(png_ptr, level); + + png_set_text_compression_strategy(png_ptr, + strategy); + + png_set_text_compression_window_bits(png_ptr, + window_bits); + + png_set_text_compression_method(png_ptr, method); + #endif + +.SS Controlling row filtering + +If you want to control whether libpng uses filtering or not, which +filters are used, and how it goes about picking row filters, you +can call one of these functions. The selection and configuration +of row filters can have a significant impact on the size and +encoding speed and a somewhat lesser impact on the decoding speed +of an image. Filtering is enabled by default for RGB and grayscale +images (with and without alpha), but not for paletted images nor +for any images with bit depths less than 8 bits/pixel. + +The 'method' parameter sets the main filtering method, which is +currently only '0' in the PNG 1.2 specification. The 'filters' +parameter sets which filter(s), if any, should be used for each +scanline. Possible values are PNG_ALL_FILTERS, PNG_NO_FILTERS, +or PNG_FAST_FILTERS to turn filtering on and off, or to turn on +just the fast-decoding subset of filters, respectively. + +Individual filter types are PNG_FILTER_NONE, PNG_FILTER_SUB, +PNG_FILTER_UP, PNG_FILTER_AVG, PNG_FILTER_PAETH, which can be bitwise +ORed together with '|' to specify one or more filters to use. +These filters are described in more detail in the PNG specification. +If you intend to change the filter type during the course of writing +the image, you should start with flags set for all of the filters +you intend to use so that libpng can initialize its internal +structures appropriately for all of the filter types. (Note that this +means the first row must always be adaptively filtered, because libpng +currently does not allocate the filter buffers until png_write_row() +is called for the first time.) + + filters = PNG_NO_FILTERS; + filters = PNG_ALL_FILTERS; + filters = PNG_FAST_FILTERS; + + or + + filters = PNG_FILTER_NONE | PNG_FILTER_SUB | + PNG_FILTER_UP | PNG_FILTER_AVG | + PNG_FILTER_PAETH; + + png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, + filters); + + The second parameter can also be + PNG_INTRAPIXEL_DIFFERENCING if you are + writing a PNG to be embedded in a MNG + datastream. This parameter must be the + same as the value of filter_method used + in png_set_IHDR(). + +.SS Requesting debug printout + +The macro definition PNG_DEBUG can be used to request debugging +printout. Set it to an integer value in the range 0 to 3. Higher +numbers result in increasing amounts of debugging information. The +information is printed to the "stderr" file, unless another file +name is specified in the PNG_DEBUG_FILE macro definition. + +When PNG_DEBUG > 0, the following functions (macros) become available: + + png_debug(level, message) + png_debug1(level, message, p1) + png_debug2(level, message, p1, p2) + +in which "level" is compared to PNG_DEBUG to decide whether to print +the message, "message" is the formatted string to be printed, +and p1 and p2 are parameters that are to be embedded in the string +according to printf-style formatting directives. For example, + + png_debug1(2, "foo=%d", foo); + +is expanded to + + if (PNG_DEBUG > 2) + fprintf(PNG_DEBUG_FILE, "foo=%d\en", foo); + +When PNG_DEBUG is defined but is zero, the macros aren't defined, but you +can still use PNG_DEBUG to control your own debugging: + + #ifdef PNG_DEBUG + fprintf(stderr, ...); + #endif + +When PNG_DEBUG = 1, the macros are defined, but only png_debug statements +having level = 0 will be printed. There aren't any such statements in +this version of libpng, but if you insert some they will be printed. + +.SH VII. MNG support + +The MNG specification (available at http://www.libpng.org/pub/mng) allows +certain extensions to PNG for PNG images that are embedded in MNG datastreams. +Libpng can support some of these extensions. To enable them, use the +png_permit_mng_features() function: + + feature_set = png_permit_mng_features(png_ptr, mask) + + mask is a png_uint_32 containing the bitwise OR of the + features you want to enable. These include + PNG_FLAG_MNG_EMPTY_PLTE + PNG_FLAG_MNG_FILTER_64 + PNG_ALL_MNG_FEATURES + + feature_set is a png_uint_32 that is the bitwise AND of + your mask with the set of MNG features that is + supported by the version of libpng that you are using. + +It is an error to use this function when reading or writing a standalone +PNG file with the PNG 8-byte signature. The PNG datastream must be wrapped +in a MNG datastream. As a minimum, it must have the MNG 8-byte signature +and the MHDR and MEND chunks. Libpng does not provide support for these +or any other MNG chunks; your application must provide its own support for +them. You may wish to consider using libmng (available at +https://www.libmng.com/) instead. + +.SH VIII. Changes to Libpng from version 0.88 + +It should be noted that versions of libpng later than 0.96 are not +distributed by the original libpng author, Guy Schalnat, nor by +Andreas Dilger, who had taken over from Guy during 1996 and 1997, and +distributed versions 0.89 through 0.96, but rather by another member +of the original PNG Group, Glenn Randers-Pehrson. Guy and Andreas are +still alive and well, but they have moved on to other things. + +The old libpng functions png_read_init(), png_write_init(), +png_info_init(), png_read_destroy(), and png_write_destroy() have been +moved to PNG_INTERNAL in version 0.95 to discourage their use. These +functions will be removed from libpng version 1.4.0. + +The preferred method of creating and initializing the libpng structures is +via the png_create_read_struct(), png_create_write_struct(), and +png_create_info_struct() because they isolate the size of the structures +from the application, allow version error checking, and also allow the +use of custom error handling routines during the initialization, which +the old functions do not. The functions png_read_destroy() and +png_write_destroy() do not actually free the memory that libpng +allocated for these structs, but just reset the data structures, so they +can be used instead of png_destroy_read_struct() and +png_destroy_write_struct() if you feel there is too much system overhead +allocating and freeing the png_struct for each image read. + +Setting the error callbacks via png_set_message_fn() before +png_read_init() as was suggested in libpng-0.88 is no longer supported +because this caused applications that do not use custom error functions +to fail if the png_ptr was not initialized to zero. It is still possible +to set the error callbacks AFTER png_read_init(), or to change them with +png_set_error_fn(), which is essentially the same function, but with a new +name to force compilation errors with applications that try to use the old +method. + +Support for the sCAL, iCCP, iTXt, and sPLT chunks was added at libpng-1.0.6; +however, iTXt support was not enabled by default. + +Starting with version 1.0.7, you can find out which version of the library +you are using at run-time: + + png_uint_32 libpng_vn = png_access_version_number(); + +The number libpng_vn is constructed from the major version, minor +version with leading zero, and release number with leading zero, +(e.g., libpng_vn for version 1.0.7 is 10007). + +Note that this function does not take a png_ptr, so you can call it +before you've created one. + +You can also check which version of png.h you used when compiling your +application: + + png_uint_32 application_vn = PNG_LIBPNG_VER; + +.SH IX. Changes to Libpng from version 1.0.x to 1.2.x + +Support for user memory management was enabled by default. To +accomplish this, the functions png_create_read_struct_2(), +png_create_write_struct_2(), png_set_mem_fn(), png_get_mem_ptr(), +png_malloc_default(), and png_free_default() were added. + +Support for the iTXt chunk has been enabled by default as of +version 1.2.41. + +Support for certain MNG features was enabled. + +Support for numbered error messages was added. However, we never got +around to actually numbering the error messages. The function +png_set_strip_error_numbers() was added (Note: the prototype for this +function was inadvertently removed from png.h in PNG_NO_ASSEMBLER_CODE +builds of libpng-1.2.15. It was restored in libpng-1.2.36). + +The png_malloc_warn() function was added at libpng-1.2.3. This issues +a png_warning and returns NULL instead of aborting when it fails to +acquire the requested memory allocation. + +Support for setting user limits on image width and height was enabled +by default. The functions png_set_user_limits(), png_get_user_width_max(), +and png_get_user_height_max() were added at libpng-1.2.6. + +The png_set_add_alpha() function was added at libpng-1.2.7. + +The function png_set_expand_gray_1_2_4_to_8() was added at libpng-1.2.9. +Unlike png_set_gray_1_2_4_to_8(), the new function does not expand the +tRNS chunk to alpha. The png_set_gray_1_2_4_to_8() function is +deprecated. + +A number of macro definitions in support of runtime selection of +assembler code features (especially Intel MMX code support) were +added at libpng-1.2.0: + + PNG_ASM_FLAG_MMX_SUPPORT_COMPILED + PNG_ASM_FLAG_MMX_SUPPORT_IN_CPU + PNG_ASM_FLAG_MMX_READ_COMBINE_ROW + PNG_ASM_FLAG_MMX_READ_INTERLACE + PNG_ASM_FLAG_MMX_READ_FILTER_SUB + PNG_ASM_FLAG_MMX_READ_FILTER_UP + PNG_ASM_FLAG_MMX_READ_FILTER_AVG + PNG_ASM_FLAG_MMX_READ_FILTER_PAETH + PNG_ASM_FLAGS_INITIALIZED + PNG_MMX_READ_FLAGS + PNG_MMX_FLAGS + PNG_MMX_WRITE_FLAGS + PNG_MMX_FLAGS + +We added the following functions in support of runtime +selection of assembler code features: + + png_get_mmx_flagmask() + png_set_mmx_thresholds() + png_get_asm_flags() + png_get_mmx_bitdepth_threshold() + png_get_mmx_rowbytes_threshold() + png_set_asm_flags() + +We replaced all of these functions with simple stubs in libpng-1.2.20, +when the Intel assembler code was removed due to a licensing issue. + +These macros are deprecated: + + PNG_READ_TRANSFORMS_NOT_SUPPORTED + PNG_PROGRESSIVE_READ_NOT_SUPPORTED + PNG_NO_SEQUENTIAL_READ_SUPPORTED + PNG_WRITE_TRANSFORMS_NOT_SUPPORTED + PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED + PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED + +They have been replaced, respectively, by: + + PNG_NO_READ_TRANSFORMS + PNG_NO_PROGRESSIVE_READ + PNG_NO_SEQUENTIAL_READ + PNG_NO_WRITE_TRANSFORMS + PNG_NO_READ_ANCILLARY_CHUNKS + PNG_NO_WRITE_ANCILLARY_CHUNKS + +PNG_MAX_UINT was replaced with PNG_UINT_31_MAX. It has been +deprecated since libpng-1.0.16 and libpng-1.2.6. + +The function + png_check_sig(sig, num) +was replaced with + png_sig_cmp(sig, 0, num) == 0 +It has been deprecated since libpng-0.90. + +The function + png_set_gray_1_2_4_to_8() +which also expands tRNS to alpha was replaced with + png_set_expand_gray_1_2_4_to_8() +which does not. It has been deprecated since libpng-1.0.18 and 1.2.9. + +.SH X. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x + +Private libpng prototypes and macro definitions were moved from +png.h and pngconf.h into a new pngpriv.h header file. + +Functions png_set_benign_errors(), png_benign_error(), and +png_chunk_benign_error() were added. + +Support for setting the maximum amount of memory that the application +will allocate for reading chunks was added, as a security measure. +The functions png_set_chunk_cache_max() and png_get_chunk_cache_max() +were added to the library. + +We implemented support for I/O states by adding png_ptr member io_state +and functions png_get_io_chunk_name() and png_get_io_state() in pngget.c + +We added PNG_TRANSFORM_GRAY_TO_RGB to the available high-level +input transforms. + +Checking for and reporting of errors in the IHDR chunk is more thorough. + +Support for global arrays was removed, to improve thread safety. + +Some obsolete/deprecated macros and functions have been removed. + +Typecasted NULL definitions such as + #define png_voidp_NULL (png_voidp)NULL +were eliminated. If you used these in your application, just use +NULL instead. + +The png_struct and info_struct members "trans" and "trans_values" were +changed to "trans_alpha" and "trans_color", respectively. + +The obsolete, unused pnggccrd.c and pngvcrd.c files and related makefiles +were removed. + +The PNG_1_0_X and PNG_1_2_X macros were eliminated. + +The PNG_LEGACY_SUPPORTED macro was eliminated. + +Many WIN32_WCE #ifdefs were removed. + +The functions png_read_init(info_ptr), png_write_init(info_ptr), +png_info_init(info_ptr), png_read_destroy(), and png_write_destroy() +have been removed. They have been deprecated since libpng-0.95. + +The png_permit_empty_plte() was removed. It has been deprecated +since libpng-1.0.9. Use png_permit_mng_features() instead. + +We removed the obsolete stub functions png_get_mmx_flagmask(), +png_set_mmx_thresholds(), png_get_asm_flags(), +png_get_mmx_bitdepth_threshold(), png_get_mmx_rowbytes_threshold(), +png_set_asm_flags(), and png_mmx_supported() + +We removed the obsolete png_check_sig(), png_memcpy_check(), and +png_memset_check() functions. Instead use png_sig_cmp() == 0, +memcpy(), and memset(), respectively. + +The function png_set_gray_1_2_4_to_8() was removed. It has been +deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with +png_set_expand_gray_1_2_4_to_8() because the former function also +expanded any tRNS chunk to an alpha channel. + +Macros for png_get_uint_16, png_get_uint_32, and png_get_int_32 +were added and are used by default instead of the corresponding +functions. Unfortunately, +from libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the +function) incorrectly returned a value of type png_uint_32. + +We changed the prototype for png_malloc() from + png_malloc(png_structp png_ptr, png_uint_32 size) +to + png_malloc(png_structp png_ptr, png_alloc_size_t size) + +This also applies to the prototype for the user replacement malloc_fn(). + +The png_calloc() function was added and is used in place of +of "png_malloc(); memset();" except in the case in png_read_png() +where the array consists of pointers; in this case a "for" loop is used +after the png_malloc() to set the pointers to NULL, to give robust. +behavior in case the application runs out of memory part-way through +the process. + +We changed the prototypes of png_get_compression_buffer_size() and +png_set_compression_buffer_size() to work with size_t instead of +png_uint_32. + +Support for numbered error messages was removed by default, since we +never got around to actually numbering the error messages. The function +png_set_strip_error_numbers() was removed from the library by default. + +The png_zalloc() and png_zfree() functions are no longer exported. +The png_zalloc() function no longer zeroes out the memory that it +allocates. Applications that called png_zalloc(png_ptr, number, size) +can call png_calloc(png_ptr, number*size) instead, and can call +png_free() instead of png_zfree(). + +Support for dithering was disabled by default in libpng-1.4.0, because +it has not been well tested and doesn't actually "dither". +The code was not +removed, however, and could be enabled by building libpng with +PNG_READ_DITHER_SUPPORTED defined. In libpng-1.4.2, this support +was re-enabled, but the function was renamed png_set_quantize() to +reflect more accurately what it actually does. At the same time, +the PNG_DITHER_[RED,GREEN_BLUE]_BITS macros were also renamed to +PNG_QUANTIZE_[RED,GREEN,BLUE]_BITS, and PNG_READ_DITHER_SUPPORTED +was renamed to PNG_READ_QUANTIZE_SUPPORTED. + +We removed the trailing '.' from the warning and error messages. + +.SH XI. Changes to Libpng from version 1.4.x to 1.5.x + +From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the +function) incorrectly returned a value of type png_uint_32. +The incorrect macro was removed from libpng-1.4.5. + +Checking for invalid palette index on write was added at libpng +1.5.10. If a pixel contains an invalid (out-of-range) index libpng issues +a benign error. This is enabled by default because this condition is an +error according to the PNG specification, Clause 11.3.2, but the error can +be ignored in each png_ptr with + + png_set_check_for_invalid_index(png_ptr, allowed); + + allowed - one of + 0: disable benign error (accept the + invalid data without warning). + 1: enable benign error (treat the + invalid data as an error or a + warning). + +If the error is ignored, or if png_benign_error() treats it as a warning, +any invalid pixels are decoded as opaque black by the decoder and written +as-is by the encoder. + +Retrieving the maximum palette index found was added at libpng-1.5.15. +This statement must appear after png_read_png() or png_read_image() while +reading, and after png_write_png() or png_write_image() while writing. + + int max_palette = png_get_palette_max(png_ptr, info_ptr); + +This will return the maximum palette index found in the image, or "\-1" if +the palette was not checked, or "0" if no palette was found. Note that this +does not account for any palette index used by ancillary chunks such as the +bKGD chunk; you must check those separately to determine the maximum +palette index actually used. + +There are no substantial API changes between the non-deprecated parts of +the 1.4.5 API and the 1.5.0 API; however, the ability to directly access +members of the main libpng control structures, png_struct and png_info, +deprecated in earlier versions of libpng, has been completely removed from +libpng 1.5, and new private "pngstruct.h", "pnginfo.h", and "pngdebug.h" +header files were created. + +We no longer include zlib.h in png.h. The include statement has been moved +to pngstruct.h, where it is not accessible by applications. Applications that +need access to information in zlib.h will need to add the '#include "zlib.h"' +directive. It does not matter whether this is placed prior to or after +the '"#include png.h"' directive. + +The png_sprintf(), png_strcpy(), and png_strncpy() macros are no longer used +and were removed. + +We moved the png_strlen(), png_memcpy(), png_memset(), and png_memcmp() +macros into a private header file (pngpriv.h) that is not accessible to +applications. + +In png_get_iCCP, the type of "profile" was changed from png_charpp +to png_bytepp, and in png_set_iCCP, from png_charp to png_const_bytep. + +There are changes of form in png.h, including new and changed macros to +declare parts of the API. Some API functions with arguments that are +pointers to data not modified within the function have been corrected to +declare these arguments with const. + +Much of the internal use of C macros to control the library build has also +changed and some of this is visible in the exported header files, in +particular the use of macros to control data and API elements visible +during application compilation may require significant revision to +application code. (It is extremely rare for an application to do this.) + +Any program that compiled against libpng 1.4 and did not use deprecated +features or access internal library structures should compile and work +against libpng 1.5, except for the change in the prototype for +png_get_iCCP() and png_set_iCCP() API functions mentioned above. + +libpng 1.5.0 adds PNG_ PASS macros to help in the reading and writing of +interlaced images. The macros return the number of rows and columns in +each pass and information that can be used to de-interlace and (if +absolutely necessary) interlace an image. + +libpng 1.5.0 adds an API png_longjmp(png_ptr, value). This API calls +the application-provided png_longjmp_ptr on the internal, but application +initialized, longjmp buffer. It is provided as a convenience to avoid +the need to use the png_jmpbuf macro, which had the unnecessary side +effect of resetting the internal png_longjmp_ptr value. + +libpng 1.5.0 includes a complete fixed point API. By default this is +present along with the corresponding floating point API. In general the +fixed point API is faster and smaller than the floating point one because +the PNG file format used fixed point, not floating point. This applies +even if the library uses floating point in internal calculations. A new +macro, PNG_FLOATING_ARITHMETIC_SUPPORTED, reveals whether the library +uses floating point arithmetic (the default) or fixed point arithmetic +internally for performance critical calculations such as gamma correction. +In some cases, the gamma calculations may produce slightly different +results. This has changed the results in png_rgb_to_gray and in alpha +composition (png_set_background for example). This applies even if the +original image was already linear (gamma == 1.0) and, therefore, it is +not necessary to linearize the image. This is because libpng has *not* +been changed to optimize that case correctly, yet. + +Fixed point support for the sCAL chunk comes with an important caveat; +the sCAL specification uses a decimal encoding of floating point values +and the accuracy of PNG fixed point values is insufficient for +representation of these values. Consequently a "string" API +(png_get_sCAL_s and png_set_sCAL_s) is the only reliable way of reading +arbitrary sCAL chunks in the absence of either the floating point API or +internal floating point calculations. Starting with libpng-1.5.0, both +of these functions are present when PNG_sCAL_SUPPORTED is defined. Prior +to libpng-1.5.0, their presence also depended upon PNG_FIXED_POINT_SUPPORTED +being defined and PNG_FLOATING_POINT_SUPPORTED not being defined. + +Applications no longer need to include the optional distribution header +file pngusr.h or define the corresponding macros during application +build in order to see the correct variant of the libpng API. From 1.5.0 +application code can check for the corresponding _SUPPORTED macro: + +#ifdef PNG_INCH_CONVERSIONS_SUPPORTED + /* code that uses the inch conversion APIs. */ +#endif + +This macro will only be defined if the inch conversion functions have been +compiled into libpng. The full set of macros, and whether or not support +has been compiled in, are available in the header file pnglibconf.h. +This header file is specific to the libpng build. Notice that prior to +1.5.0 the _SUPPORTED macros would always have the default definition unless +reset by pngusr.h or by explicit settings on the compiler command line. +These settings may produce compiler warnings or errors in 1.5.0 because +of macro redefinition. + +Applications can now choose whether to use these macros or to call the +corresponding function by defining PNG_USE_READ_MACROS or +PNG_NO_USE_READ_MACROS before including png.h. Notice that this is +only supported from 1.5.0; defining PNG_NO_USE_READ_MACROS prior to 1.5.0 +will lead to a link failure. + +Prior to libpng-1.5.4, the zlib compressor used the same set of parameters +when compressing the IDAT data and textual data such as zTXt and iCCP. +In libpng-1.5.4 we reinitialized the zlib stream for each type of data. +We added five png_set_text_*() functions for setting the parameters to +use with textual data. + +Prior to libpng-1.5.4, the PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +option was off by default, and slightly inaccurate scaling occurred. +This option can no longer be turned off, and the choice of accurate +or inaccurate 16-to-8 scaling is by using the new png_set_scale_16_to_8() +API for accurate scaling or the old png_set_strip_16_to_8() API for simple +chopping. In libpng-1.5.4, the PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED +macro became PNG_READ_SCALE_16_TO_8_SUPPORTED, and the PNG_READ_16_TO_8 +macro became PNG_READ_STRIP_16_TO_8_SUPPORTED, to enable the two +png_set_*_16_to_8() functions separately. + +Prior to libpng-1.5.4, the png_set_user_limits() function could only be +used to reduce the width and height limits from the value of +PNG_USER_WIDTH_MAX and PNG_USER_HEIGHT_MAX, although this document said +that it could be used to override them. Now this function will reduce or +increase the limits. + +Starting in libpng-1.5.22, default user limits were established. These +can be overridden by application calls to png_set_user_limits(), +png_set_user_chunk_cache_max(), and/or png_set_user_malloc_max(). +The limits are now + max possible default + png_user_width_max 0x7fffffff 1,000,000 + png_user_height_max 0x7fffffff 1,000,000 + png_user_chunk_cache_max 0 (unlimited) 1000 + png_user_chunk_malloc_max 0 (unlimited) 8,000,000 + +The png_set_option() function (and the "options" member of the png struct) was +added to libpng-1.5.15, with option PNG_ARM_NEON. + +The library now supports a complete fixed point implementation and can +thus be used on systems that have no floating point support or very +limited or slow support. Previously gamma correction, an essential part +of complete PNG support, required reasonably fast floating point. + +As part of this the choice of internal implementation has been made +independent of the choice of fixed versus floating point APIs and all the +missing fixed point APIs have been implemented. + +The exact mechanism used to control attributes of API functions has +changed, as described in the INSTALL file. + +A new test program, pngvalid, is provided in addition to pngtest. +pngvalid validates the arithmetic accuracy of the gamma correction +calculations and includes a number of validations of the file format. +A subset of the full range of tests is run when "make check" is done +(in the 'configure' build.) pngvalid also allows total allocated memory +usage to be evaluated and performs additional memory overwrite validation. + +Many changes to individual feature macros have been made. The following +are the changes most likely to be noticed by library builders who +configure libpng: + +1) All feature macros now have consistent naming: + +#define PNG_NO_feature turns the feature off +#define PNG_feature_SUPPORTED turns the feature on + +pnglibconf.h contains one line for each feature macro which is either: + +#define PNG_feature_SUPPORTED + +if the feature is supported or: + +/*#undef PNG_feature_SUPPORTED*/ + +if it is not. Library code consistently checks for the 'SUPPORTED' macro. +It does not, and libpng applications should not, check for the 'NO' macro +which will not normally be defined even if the feature is not supported. +The 'NO' macros are only used internally for setting or not setting the +corresponding 'SUPPORTED' macros. + +Compatibility with the old names is provided as follows: + +PNG_INCH_CONVERSIONS turns on PNG_INCH_CONVERSIONS_SUPPORTED + +And the following definitions disable the corresponding feature: + +PNG_SETJMP_NOT_SUPPORTED disables SETJMP +PNG_READ_TRANSFORMS_NOT_SUPPORTED disables READ_TRANSFORMS +PNG_NO_READ_COMPOSITED_NODIV disables READ_COMPOSITE_NODIV +PNG_WRITE_TRANSFORMS_NOT_SUPPORTED disables WRITE_TRANSFORMS +PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED disables READ_ANCILLARY_CHUNKS +PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED disables WRITE_ANCILLARY_CHUNKS + +Library builders should remove use of the above, inconsistent, names. + +2) Warning and error message formatting was previously conditional on +the STDIO feature. The library has been changed to use the +CONSOLE_IO feature instead. This means that if CONSOLE_IO is disabled +the library no longer uses the printf(3) functions, even though the +default read/write implementations use (FILE) style stdio.h functions. + +3) Three feature macros now control the fixed/floating point decisions: + +PNG_FLOATING_POINT_SUPPORTED enables the floating point APIs + +PNG_FIXED_POINT_SUPPORTED enables the fixed point APIs; however, in +practice these are normally required internally anyway (because the PNG +file format is fixed point), therefore in most cases PNG_NO_FIXED_POINT +merely stops the function from being exported. + +PNG_FLOATING_ARITHMETIC_SUPPORTED chooses between the internal floating +point implementation or the fixed point one. Typically the fixed point +implementation is larger and slower than the floating point implementation +on a system that supports floating point; however, it may be faster on a +system which lacks floating point hardware and therefore uses a software +emulation. + +4) Added PNG_{READ,WRITE}_INT_FUNCTIONS_SUPPORTED. This allows the +functions to read and write ints to be disabled independently of +PNG_USE_READ_MACROS, which allows libpng to be built with the functions +even though the default is to use the macros - this allows applications +to choose at app buildtime whether or not to use macros (previously +impossible because the functions weren't in the default build.) + +.SH XII. Changes to Libpng from version 1.5.x to 1.6.x + +A "simplified API" has been added (see documentation in png.h and a simple +example in contrib/examples/pngtopng.c). The new publicly visible API +includes the following: + + macros: + PNG_FORMAT_* + PNG_IMAGE_* + structures: + png_control + png_image + read functions + png_image_begin_read_from_file() + png_image_begin_read_from_stdio() + png_image_begin_read_from_memory() + png_image_finish_read() + png_image_free() + write functions + png_image_write_to_file() + png_image_write_to_memory() + png_image_write_to_stdio() + +Starting with libpng-1.6.0, you can configure libpng to prefix all exported +symbols, using the PNG_PREFIX macro. + +We no longer include string.h in png.h. The include statement has been moved +to pngpriv.h, where it is not accessible by applications. Applications that +need access to information in string.h must add an '#include ' +directive. It does not matter whether this is placed prior to or after +the '#include "png.h"' directive. + +The following API are now DEPRECATED: + png_info_init_3() + png_convert_to_rfc1123() which has been replaced + with png_convert_to_rfc1123_buffer() + png_malloc_default() + png_free_default() + png_reset_zstream() + +The following have been removed: + png_get_io_chunk_name(), which has been replaced + with png_get_io_chunk_type(). The new + function returns a 32-bit integer instead of + a string. + The png_sizeof(), png_strlen(), png_memcpy(), png_memcmp(), and + png_memset() macros are no longer used in the libpng sources and + have been removed. These had already been made invisible to applications + (i.e., defined in the private pngpriv.h header file) since libpng-1.5.0. + +The signatures of many exported functions were changed, such that + png_structp became png_structrp or png_const_structrp + png_infop became png_inforp or png_const_inforp +where "rp" indicates a "restricted pointer". + +Dropped support for 16-bit platforms. The support for FAR/far types has +been eliminated and the definition of png_alloc_size_t is now controlled +by a flag so that 'small size_t' systems can select it if necessary. + +Error detection in some chunks has improved; in particular the iCCP chunk +reader now does pretty complete validation of the basic format. Some bad +profiles that were previously accepted are now accepted with a warning or +rejected, depending upon the png_set_benign_errors() setting, in particular +the very old broken Microsoft/HP 3144-byte sRGB profile. Starting with +libpng-1.6.11, recognizing and checking sRGB profiles can be avoided by +means of + + #if defined(PNG_SKIP_sRGB_CHECK_PROFILE) && \ + defined(PNG_SET_OPTION_SUPPORTED) + png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE, + PNG_OPTION_ON); + #endif + +It's not a good idea to do this if you are using the "simplified API", +which needs to be able to recognize sRGB profiles conveyed via the iCCP +chunk. + +The PNG spec requirement that only grayscale profiles may appear in images +with color type 0 or 4 and that even if the image only contains gray pixels, +only RGB profiles may appear in images with color type 2, 3, or 6, is now +enforced. The sRGB chunk is allowed to appear in images with any color type +and is interpreted by libpng to convey a one-tracer-curve gray profile or a +three-tracer-curve RGB profile as appropriate. + +Libpng 1.5.x erroneously used /MD for Debug DLL builds; if you used the debug +builds in your app and you changed your app to use /MD you will need to +change it back to /MDd for libpng 1.6.x. + +Prior to libpng-1.6.0 a warning would be issued if the iTXt chunk contained +an empty language field or an empty translated keyword. Both of these +are allowed by the PNG specification, so these warnings are no longer issued. + +The library now issues an error if the application attempts to set a +transform after it calls png_read_update_info() or if it attempts to call +both png_read_update_info() and png_start_read_image() or to call either +of them more than once. + +The default condition for benign_errors is now to treat benign errors as +warnings while reading and as errors while writing. + +The library now issues a warning if both background processing and RGB to +gray are used when gamma correction happens. As with previous versions of +the library the results are numerically very incorrect in this case. + +There are some minor arithmetic changes in some transforms such as +png_set_background(), that might be detected by certain regression tests. + +Unknown chunk handling has been improved internally, without any API change. +This adds more correct option control of the unknown handling, corrects +a pre-existing bug where the per-chunk 'keep' setting is ignored, and makes +it possible to skip IDAT chunks in the sequential reader. + +The machine-generated configure files are no longer included in branches +libpng17 and later of the GIT repository. They continue to be included +in the tarball releases, however. + +Libpng-1.6.0 through 1.6.2 used the CMF bytes at the beginning of the IDAT +stream to set the size of the sliding window for reading instead of using the +default 32-kbyte sliding window size. It was discovered that there are +hundreds of PNG files in the wild that have incorrect CMF bytes that caused +zlib to issue the "invalid distance too far back" error and reject the file. +Libpng-1.6.3 and later calculate their own safe CMF from the image dimensions, +provide a way to revert to the libpng-1.5.x behavior (ignoring the CMF bytes +and using a 32-kbyte sliding window), by using + + png_set_option(png_ptr, PNG_MAXIMUM_INFLATE_WINDOW, + PNG_OPTION_ON); + +and provide a tool (contrib/tools/pngfix) for rewriting a PNG file while +optimizing the CMF bytes in its IDAT chunk correctly. + +Libpng-1.6.0 and libpng-1.6.1 wrote uncompressed iTXt chunks with the wrong +length, which resulted in PNG files that cannot be read beyond the bad iTXt +chunk. This error was fixed in libpng-1.6.3, and a tool (called +contrib/tools/png-fix-itxt) has been added to the libpng distribution. + +Starting with libpng-1.6.17, the PNG_SAFE_LIMITS macro was eliminated +and safe limits are used by default (users who need larger limits +can still override them at compile time or run time, as described above). + +The new limits are + default spec limit + png_user_width_max 1,000,000 2,147,483,647 + png_user_height_max 1,000,000 2,147,483,647 + png_user_chunk_cache_max 128 unlimited + png_user_chunk_malloc_max 8,000,000 unlimited + +Starting with libpng-1.6.18, a PNG_RELEASE_BUILD macro was added, which allows +library builders to control compilation for an installed system (a release build). +It can be set for testing debug or beta builds to ensure that they will compile +when the build type is switched to RC or STABLE. In essence this overrides the +PNG_LIBPNG_BUILD_BASE_TYPE definition which is not directly user controllable. + +Starting with libpng-1.6.19, attempting to set an over-length PLTE chunk +is an error. Previously this requirement of the PNG specification was not +enforced, and the palette was always limited to 256 entries. An over-length +PLTE chunk found in an input PNG is silently truncated. + +Starting with libpng-1.6.31, the eXIf chunk is supported. Libpng does not +attempt to decode the Exif profile; it simply returns a byte array +containing the profile to the calling application which must do its own +decoding. + +.SH XIII. Detecting libpng + +The png_get_io_ptr() function has been present since libpng-0.88, has never +changed, and is unaffected by conditional compilation macros. It is the +best choice for use in configure scripts for detecting the presence of any +libpng version since 0.88. In an autoconf "configure.in" you could use + + AC_CHECK_LIB(png, png_get_io_ptr, ...) + +.SH XV. Source code repository + +Since about February 2009, version 1.2.34, libpng has been under "git" source +control. The git repository was built from old libpng-x.y.z.tar.gz files +going back to version 0.70. You can access the git repository (read only) +at + + https://github.com/pnggroup/libpng or + https://git.code.sf.net/p/libpng/code.git + +or you can browse it with a web browser at + + https://github.com/pnggroup/libpng or + https://sourceforge.net/p/libpng/code/ci/libpng16/tree/ + +Patches can be sent to png-mng-implement at lists.sourceforge.net or +uploaded to the libpng bug tracker at + + https://libpng.sourceforge.io/ + +or as a "pull request" to + + https://github.com/pnggroup/libpng/pulls + +We also accept patches built from the tar or zip distributions, and +simple verbal descriptions of bug fixes, reported either to the +SourceForge bug tracker, to the png-mng-implement at lists.sf.net +mailing list, as github issues. + +.SH XV. Coding style + +Our coding style is similar to the "Allman" style +(See https://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly +braces on separate lines: + + if (condition) + { + action; + } + + else if (another condition) + { + another action; + } + +The braces can be omitted from simple one-line actions: + + if (condition) + return 0; + +We use 3-space indentation, except for continued statements which +are usually indented the same as the first line of the statement +plus four more spaces. + +For macro definitions we use 2-space indentation, always leaving the "#" +in the first column. + + #ifndef PNG_NO_FEATURE + # ifndef PNG_FEATURE_SUPPORTED + # define PNG_FEATURE_SUPPORTED + # endif + #endif + +Comments appear with the leading "/*" at the same indentation as +the statement that follows the comment: + + /* Single-line comment */ + statement; + + /* This is a multiple-line + * comment. + */ + statement; + +Very short comments can be placed after the end of the statement +to which they pertain: + + statement; /* comment */ + +We don't use C++ style ("//") comments. We have, however, +used them in the past in some now-abandoned MMX assembler +code. + +Functions and their curly braces are not indented, and +exported functions are marked with PNGAPI: + + /* This is a public function that is visible to + * application programmers. It does thus-and-so. + */ + void PNGAPI + png_exported_function(png_ptr, png_info, foo) + { + body; + } + +The return type and decorations are placed on a separate line +ahead of the function name, as illustrated above. + +The prototypes for all exported functions appear in png.h, +above the comment that says + + /* Maintainer: Put new public prototypes here ... */ + +We mark all non-exported functions with "/* PRIVATE */"": + + void /* PRIVATE */ + png_non_exported_function(png_ptr, png_info, foo) + { + body; + } + +The prototypes for non-exported functions (except for those in +pngtest) appear in pngpriv.h above the comment that says + + /* Maintainer: Put new private prototypes here ^ */ + +To avoid polluting the global namespace, the names of all exported +functions and variables begin with "png_", and all publicly visible C +preprocessor macros begin with "PNG". We request that applications that +use libpng *not* begin any of their own symbols with either of these strings. + +We put a space after the "sizeof" operator and we omit the +optional parentheses around its argument when the argument +is an expression, not a type name, and we always enclose the +sizeof operator, with its argument, in parentheses: + + (sizeof (png_uint_32)) + (sizeof array) + +Prior to libpng-1.6.0 we used a "png_sizeof()" macro, formatted as +though it were a function. + +Control keywords if, for, while, and switch are always followed by a space +to distinguish them from function calls, which have no trailing space. + +We put a space after each comma and after each semicolon +in "for" statements, and we put spaces before and after each +C binary operator and after "for" or "while", and before +"?". We don't put a space between a typecast and the expression +being cast, nor do we put one between a function name and the +left parenthesis that follows it: + + for (i = 2; i > 0; \-\-i) + y[i] = a(x) + (int)b; + +We prefer #ifdef and #ifndef to #if defined() and #if !defined() +when there is only one macro being tested. We always use parentheses +with "defined". + +We express integer constants that are used as bit masks in hex format, +with an even number of lower-case hex digits, and to make them unsigned +(e.g., 0x00U, 0xffU, 0x0100U) and long if they are greater than 0x7fff +(e.g., 0xffffUL). + +We prefer to use underscores rather than camelCase in names, except +for a few type names that we inherit from zlib.h. + +We prefer "if (something != 0)" and "if (something == 0)" over +"if (something)" and if "(!something)", respectively, and for pointers +we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)". + +We do not use the TAB character for indentation in the C sources. + +Lines do not exceed 80 characters. + +Other rules can be inferred by inspecting the libpng source. + +.SH NOTE + +Note about libpng version numbers: + +Due to various miscommunications, unforeseen code incompatibilities +and occasional factors outside the authors' control, version numbering +on the library has not always been consistent and straightforward. +The following table summarizes matters since version 0.89c, which was +the first widely used release: + + source png.h png.h shared-lib + version string int version + ------- ------ ----- ---------- + 0.89c "1.0 beta 3" 0.89 89 1.0.89 + 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] + 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] + 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] + 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] + 0.97c 0.97 97 2.0.97 + 0.98 0.98 98 2.0.98 + 0.99 0.99 98 2.0.99 + 0.99a-m 0.99 99 2.0.99 + 1.00 1.00 100 2.1.0 [100 should be 10000] + 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] + 1.0.1 png.h string is 10001 2.1.0 + 1.0.1a-e identical to the 10002 from here on, the shared library + 1.0.2 source version) 10002 is 2.V where V is the source code + 1.0.2a-b 10003 version, except as noted. + 1.0.3 10003 + 1.0.3a-d 10004 + 1.0.4 10004 + 1.0.4a-f 10005 + 1.0.5 (+ 2 patches) 10005 + 1.0.5a-d 10006 + 1.0.5e-r 10100 (not source compatible) + 1.0.5s-v 10006 (not binary compatible) + 1.0.6 (+ 3 patches) 10006 (still binary incompatible) + 1.0.6d-f 10007 (still binary incompatible) + 1.0.6g 10007 + 1.0.6h 10007 10.6h (testing xy.z so-numbering) + 1.0.6i 10007 10.6i + 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) + 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) + 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) + 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) + 1.0.7 1 10007 (still compatible) + ... + 1.0.69 10 10069 10.so.0.69[.0] + ... + 1.2.59 13 10259 12.so.0.59[.0] + ... + 1.4.20 14 10420 14.so.0.20[.0] + ... + 1.5.30 15 10530 15.so.15.30[.0] + ... + 1.6.35 16 10635 16.so.16.35[.0] + +Henceforth the source version will match the shared-library minor and +patch numbers; the shared-library major version number will be used for +changes in backward compatibility, as it is intended. +The PNG_PNGLIB_VER macro, which is not used within libpng but is +available for applications, is an unsigned integer of the form XYYZZ +corresponding to the source version X.Y.Z (leading zeros in Y and Z). +Beta versions were given the previous public release number plus a +letter, until version 1.0.6j; from then on they were given the upcoming +public release number plus "betaNN" or "rcNN". + +.SH "SEE ALSO" +.BR "png"(5) +.IP +The PNG (Portable Network Graphics) format specification. +.LP +.B libpng +.IP +http://www.libpng.org/pub/png/libpng.html (canonical home page) +.br +https://github.com/pnggroup/libpng (canonical Git repository) +.br +https://libpng.sourceforge.io (downloadable archives) +.LP +.B zlib +.IP +https://zlib.net (canonical home page) +.br +https://github.com/madler/zlib (canonical Git repository) +.br +A copy of zlib may also be found at the same location as libpng. +.LP +In the case of any inconsistency between the PNG specification +and this library, the specification takes precedence. + +.SH AUTHORS +This man page: +Initially created by Glenn Randers-Pehrson. +Maintained by Cosmin Truta. + +The contributing authors would like to thank all those who helped +with testing, bug fixes, and patience. This wouldn't have been +possible without all of you. + +Thanks to Frank J. T. Wojcik for helping with the documentation. + +Libpng: +Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. +Maintained by Cosmin Truta. + +Supported by the PNG development group. +.br +png-mng-implement at lists.sourceforge.net. (Subscription is required; +visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe.) + +.\" end of man page diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/share/man/man3/libpngpf.3 b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/share/man/man3/libpngpf.3 new file mode 100644 index 0000000000000000000000000000000000000000..debff3fcde01e784a659c681282998ba6ef189e1 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/share/man/man3/libpngpf.3 @@ -0,0 +1,17 @@ +.TH LIBPNGPF 3 "February 9, 2026" +.SH NAME +libpng \- Portable Network Graphics (PNG) Reference Library 1.6.55 + +.SH SYNOPSIS +\fB#include "pngpriv.h"\fP + +.SH DESCRIPTION +As of libpng version 1.5.1, this manual is no longer maintained. The private +function prototypes, declared in private header files, should not be accessed +by applications. + +.SH "SEE ALSO" +.BR "libpng"(3) + +.SH AUTHORS +Cosmin Truta, Glenn Randers-Pehrson diff --git a/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/share/man/man5/png.5 b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/share/man/man5/png.5 new file mode 100644 index 0000000000000000000000000000000000000000..7e0fdc42a48fcdb3517ca9e7c71451292619d2c6 --- /dev/null +++ b/data/miniconda3/pkgs/libpng-1.6.55-h421ea60_0/share/man/man5/png.5 @@ -0,0 +1,81 @@ +.TH PNG 5 "February 9, 2026" +.SH NAME +png \- Portable Network Graphics (PNG) format + +.SH DESCRIPTION +PNG (Portable Network Graphics) is an extensible file format for the +lossless, portable, well-compressed storage of raster images. PNG +provides a patent-free replacement for GIF, and can also replace many +common uses of TIFF. Indexed-color, grayscale, and truecolor images +are supported, plus an optional alpha channel. Sample depths range +from 1 to 16 bits. +.P +PNG is designed to work well in online viewing applications, such +as the World Wide Web, so it is fully streamable with a progressive +display option. PNG is robust, providing both full file integrity +checking and fast, simple detection of common transmission errors. +Also, PNG can store color space data for improved color matching on +heterogeneous platforms. + +.SH "SEE ALSO" +.BR "libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5) +.LP +Portable Network Graphics (PNG) Specification (Third Edition): +.IP +.br +W3C Recommendation 24 June 2025 +.br +https://www.w3.org/TR/2025/REC-png-3-20250624/ +.LP +Portable Network Graphics (PNG) Specification (Second Edition): +.IP +.br +ISO/IEC 15948:2004(E) +.br +https://www.iso.org/standard/29581.html +.IP +.br +W3C Recommendation 10 November 2003 +.br +https://www.w3.org/TR/2003/REC-PNG-20031110/ +.LP +Portable Network Graphics (PNG) Specification Version 1.2: +.IP +.br +Published by the PNG Development Group on 14 July 1999 +.br +https://www.libpng.org/pub/png/spec/1.2/ +.LP +Portable Network Graphics (PNG) Specification Version 1.1: +.IP +.br +Published by the PNG Development Group on 15 February 1999 +.br +https://www.libpng.org/pub/png/spec/1.1/ +.LP +Portable Network Graphics (PNG) Specification Version 1.0: +.IP +.br +IETF RFC 2083, March 1997 +.br +https://www.ietf.org/rfc/rfc2083.txt +.IP +.br +W3C Recommendation 1 October 1996 +.br +https://www.w3.org/TR/REC-png-961001 + +.SH AUTHORS +This man page: Glenn Randers-Pehrson, Cosmin Truta, Chris Lilley. +.LP +PNG Specification (Third Edition): Chris Blume et al. +.LP +PNG Specification (Second Edition): David Duce et al. +.LP +PNG Specification Version 1.2: Glenn Randers-Pehrson et al. +.LP +PNG Specification Version 1.1: Glenn Randers-Pehrson et al. +.LP +PNG Specification Version 1.0: Thomas Boutell et al. + +.\" end of man page diff --git a/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/doc/opencascade/LICENSE_LGPL_21.txt b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/doc/opencascade/LICENSE_LGPL_21.txt new file mode 100644 index 0000000000000000000000000000000000000000..732811e4f1faf71870b7350f211b26e00d7bfbe9 --- /dev/null +++ b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/doc/opencascade/LICENSE_LGPL_21.txt @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/doc/opencascade/OCCT_LGPL_EXCEPTION.txt b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/doc/opencascade/OCCT_LGPL_EXCEPTION.txt new file mode 100644 index 0000000000000000000000000000000000000000..263d14ef75d9172e59213d880605729eed3041fc --- /dev/null +++ b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/doc/opencascade/OCCT_LGPL_EXCEPTION.txt @@ -0,0 +1,10 @@ +Open CASCADE exception (version 1.0) to GNU LGPL version 2.1. + +The object code (i.e. not a source) form of a "work that uses the Library" +can incorporate material from a header file that is part of the Library. +As a special exception to the GNU Lesser General Public License version 2.1, +you may distribute such object code incorporating material from header files +provided with the Open CASCADE Technology libraries (including code of CDL +generic classes) under terms of your choice, provided that you give +prominent notice in supporting documentation to this code that it makes use +of or is based on facilities provided by the Open CASCADE Technology software. diff --git a/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/SHMessage/SHMessage_SHAPE_us.pxx b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/SHMessage/SHMessage_SHAPE_us.pxx new file mode 100644 index 0000000000000000000000000000000000000000..d3deb0348a7edcaae976fde94b4a0570df8b64b5 --- /dev/null +++ b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/SHMessage/SHMessage_SHAPE_us.pxx @@ -0,0 +1,270 @@ +// This file has been automatically generated from resource file src/SHMessage/SHAPE.us + +static const char SHMessage_SHAPE_us[] = + "\n" + "! Message file for Shape Healing\n" + "\n" + "\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for shape names\n" + "!\n" + ".Name.Shape.MSG0\n" + "!\n" + ".Name.Vertex.MSG0\n" + "!\n" + ".Name.Edge.MSG0\n" + "!\n" + ".Name.Wire.MSG0\n" + "!\n" + ".Name.Face.MSG0\n" + "!\n" + ".Name.Shell.MSG0\n" + "!\n" + ".Name.Solid.MSG0\n" + "!\n" + ".Name.CompSolid.MSG0\n" + "!\n" + ".Name.Compound.MSG0\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for sequence of operators\n" + "! \n" + ".SP.Sequence.Info.Seq\n" + "Info: Shape Processing: Sequence of operators: %s\n" + "!\n" + ".SP.Sequence.Info.Operator\n" + "Info: Shape Processing: Operator %d/%d: %s\n" + "!\n" + ".SP.Sequence.Error.NoOp\n" + "Error: Shape Processing: Operator %s is not found\n" + "!\n" + ".SP.Sequence.Error.Except\n" + "Error: Shape Processing: Operator %s failed with exception %s\n" + "!\n" + ".SP.Sequence.Warn.NoSeq\n" + "Warning: Shape Processing: Sequence not defined for %s, nothing to do\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for printing results of shape processing\n" + "! \n" + ".PrResult.Print.MSG50\n" + " Shells:\n" + "!\n" + ".PrResult.Print.MSG55\n" + " Faces:\n" + "!\n" + ".PrResult.Print.MSG100\n" + "Mapping:\n" + "!\n" + ".PrResult.Print.MSG110\n" + " Result is Shell : %d\n" + "!\n" + ".PrResult.Print.MSG115\n" + " Result is Face : %d\n" + "!\n" + ".PrResult.Print.MSG150\n" + " No Result : %d\n" + "!\n" + ".PrResult.Print.MSG200\n" + "Preparation ratio:\n" + "!\n" + ".PrResult.Print.MSG205\n" + " Shells: %d per cent\n" + "!\n" + ".PrResult.Print.MSG210\n" + " Faces : %d per cent\n" + "!\n" + "! ==============================================================================\n" + "! Messages for Shape Healing\n" + "! \n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_Wire\n" + "! \n" + ".FixWire.FixDegenerated.MSG0\n" + "Degenerated edge(s) detected\n" + "!\n" + ".FixWire.FixDegenerated.MSG5\n" + "Degenerated edge %d detected\n" + "!\n" + ".FixWire.FixCurve3d.Removed\n" + "Incomplete edge (with no pcurves or 3d curve) removed\n" + "!\n" + ".FixAdvWire.FixSmall.MSG0\n" + "Small edge(s) removed\n" + "! \n" + ".FixAdvWire.FixSmall.MSG5\n" + "Edge %d was small, removed\n" + "! \n" + ".FixAdvWire.FixIntersection.MSG0\n" + "Self-intersection corrected\n" + "!\n" + ".FixAdvWire.FixIntersection.MSG5\n" + "Edge was self-intersecting, corrected\n" + "!\n" + ".FixAdvWire.FixIntersection.MSG10\n" + "Edges were intersecting, corrected\n" + "!\n" + ".FixAdvWire.FixLacking.MSG0\n" + "Lacking edge(s) inserted\n" + "!\n" + ".FixAdvWire.FixLacking.MSG5\n" + "Lacking edge %d inserted\n" + "!\n" + ".FixAdvWire..MSG0\n" + "!\n" + ".FixAdvWire..MSG5\n" + "!\n" + ".FixAdvWire..MSG10\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_Face\n" + "!\n" + ".FixAdvFace.FixMissingSeam.MSG0\n" + "Missing seam-edge added\n" + "!\n" + ".FixAdvFace.FixSmallAreaWire.MSG0\n" + "Null area wire detected, wire skipped\n" + "!\n" + ".FixAdvFace.FixOrientation.MSG0\n" + "Face created with natural bounds\n" + "!\n" + ".FixAdvFace.FixOrientation.MSG5\n" + "Wire on face was reversed\n" + "!\n" + ".FixAdvFace.FixOrientation.MSG11\n" + "Cannot orient wire\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_Wireframe\n" + "! \n" + ".FixWireframe.FixSmallEdges.MSG0\n" + "Small edge removed\n" + "!\n" + ".FixWireframe.FixSmallEdges.MSG1\n" + "Small wire removed\n" + "!\n" + ".FixWireframe.FixSmallEdges.MSG2\n" + "Small face removed\n" + "!\n" + ".FixWireframe.FixFixWireGaps.MSG0\n" + "Gaps in a wire fixed\n" + "!\n" + "!\n" + ".Fix.SplitCommonVertex.MSG0\n" + "Wires with common vertex fixed\n" + "!\n" + "!\n" + ".FixAdvShell.FixOrientation.MSG20\n" + "Impossible to orient faces in shell, several shells created\n" + "!\n" + ".FixAdvShell.FixOrientation.MSG30\n" + "Improperly connected shell split into parts\n" + "!\n" + ".FixAdvSolid.FixShell.MSG10\n" + "Solid cannot be created from an open shell\n" + "!\n" + ".FixAdvSolid.FixOrientation.MSG20\n" + "Orientation of shell(s) in solid was corrected\n" + "!\n" + ".FixAdvSolid.FixOrientation.MSG30\n" + "Improperly connected solid split into several parts\n" + "!\n" + ".FixAdvFace.FixLoopWire.MSG0\n" + "Wire was split on several wires\n" + "!\n" + ".FixAdvFace..MSG5\n" + "!\n" + ".FixAdvFace..MSG10\n" + "!\n" + ".FixEdge.SameParameter.MSG0\n" + "Not same parameter edge fixed\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_FixSmallFace\n" + "!\n" + ".FixAdvFace.FixSpotFace.MSG0\n" + "Spot face removed\n" + "!\n" + ".FixAdvFace.FixStripFace.MSG0\n" + "Strip face removed\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_FixSmallSolid\n" + "!\n" + ".ShapeFix.FixSmallSolid.MSG0\n" + "Small solid removed\n" + "!\n" + ".ShapeFix.FixSmallSolid.MSG1\n" + "Small solid merged with other\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeFix_Shell\n" + "!\n" + ".FixAdvShell.FixOrientation.MSG0\n" + "Faces were incorrectly oriented in the shell, corrected\n" + "!\n" + ".FixAdvShell.FixOrientation.MSG5\n" + "Faces were incorrectly oriented in the shell, not corrected\n" + "!\n" + ".FixAdvShell.FixClosedFlag.MSG0\n" + "Shell has incorrect flag isClosed\n" + "!\n" + ".FixAdvShell..MSG5\n" + "!\n" + ".FixAdvShell..MSG10\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeUpgrade\n" + "!\n" + ".ShapeDivide.FaceDivide.MSG0\n" + "Face divided\n" + "!\n" + ".ShapeDivide.WireDivide.MSG0\n" + "Wire divided\n" + "!\n" + ".ShapeDivide.EdgeDivide.MSG0\n" + "Edge divided\n" + "!\n" + ".ShapeDivide.FaceConvertToBezier.MSG0\n" + "Face converted to Bezier\n" + "!\n" + ".ShapeDivide.WireConvertToBezier.MSG0\n" + "Wire converted to Bezier\n" + "!\n" + ".ShapeDivide.EdgeConvertToBezier.MSG0\n" + "Edge converted to Bezier\n" + "!\n" + "! ------------------------------------------------------------------------------\n" + "! Messages for ShapeCustom\n" + "!\n" + ".BSplineRestriction.NewSurface.MSG0\n" + "Face converted to BSpline\n" + "!\n" + ".BSplineRestriction.NewSurface.MSG1\n" + "BSpline Face re-approximated\n" + "!\n" + ".BSplineRestriction.NewCurve.MSG0\n" + "Edge converted to BSpline\n" + "!\n" + ".BSplineRestriction.NewCurve.MSG1\n" + "BSpline Edge re-approximated\n" + "!\n" + "!\n" + ".ConvertToBSpline.NewSurface.MSG0\n" + "Face converted to BSpline\n" + "!\n" + ".ConvertToBSpline.NewCurve.MSG0\n" + "Edge converted to BSpline\n" + "!\n" + "!\n" + ".ConvertToRevolution.NewSurface.MSG0\n" + "Face converted to surface of revolution\n" + "!\n" + "!\n" + ".DirectModification.NewSurface.MSG0\n" + "Direction of Face of revolution corrected\n" + "!\n" + "!\n" + ".SweptToElementary.NewSurface.MSG0\n" + "Swept Face converted to elementary\n" + "!\n"; diff --git a/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/FILES b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/FILES new file mode 100644 index 0000000000000000000000000000000000000000..abde0859d1293437f6a19c5f22081d466f778d68 --- /dev/null +++ b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/FILES @@ -0,0 +1,6 @@ +appresource:::Standard +appresource:::StandardLite +appresource:::TObj +appresource:::XCAF +appresource:::MigrationSheet.txt +loginfile:::Plugin diff --git a/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/MigrationSheet.txt b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/MigrationSheet.txt new file mode 100644 index 0000000000000000000000000000000000000000..0a215a7421434d19193e1261c9f23c9e24d169a3 --- /dev/null +++ b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/MigrationSheet.txt @@ -0,0 +1,21 @@ +TDataStd_Shape TDataXtd_Shape +TDataStd_Constraint TDataXtd_Constraint +TDataStd_Geometry TDataXtd_Geometry +TDataStd_Axis TDataXtd_Axis +TDataStd_Point TDataXtd_Point +TDataStd_Plane TDataXtd_Plane +TDataStd_Position TDataXtd_Position +TDataStd_Placement TDataXtd_Placement +TDataStd_PatternStd TDataXtd_PatternStd +TPrsStd_AISPresentation TDataXtd_Presentation +PDataStd_Shape PDataXtd_Shape +PDataStd_Constraint PDataXtd_Constraint +PDataStd_Geometry PDataXtd_Geometry +PDataStd_Axis PDataXtd_Axis +PDataStd_Point PDataXtd_Point +PDataStd_Plane PDataXtd_Plane +PDataStd_Position PDataXtd_Position +PDataStd_Placement PDataXtd_Placement +PDataStd_PatternStd PDataXtd_PatternStd + + diff --git a/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/Plugin b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/Plugin new file mode 100644 index 0000000000000000000000000000000000000000..56ec8dac5b2e181f445e80a38396a05002cc8a58 --- /dev/null +++ b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/Plugin @@ -0,0 +1,52 @@ +! Description of available plugins +! ******************************** +! +! standard attribute drivers plugin +! +ad696001-5b34-11d1-b5ba-00a0c9064368.Location: TKStd +! +! standard attribute drivers plugin +! +bd696001-5b34-11d1-b5ba-00a0c9064368.Location: TKStdL +! +! XmlOcaf Document Plugin +! +03a56820-8269-11d5-aab2-0050044b1af1.Location: TKXml +03a56822-8269-11d5-aab2-0050044b1af1.Location: TKXml +03a56824-8269-11d5-aab2-0050044b1af1.Location: TKXml +! +! XmlLOcaf Document Plugin +! +13a56820-8269-11d5-aab2-0050044b1af1.Location: TKXmlL +13a56822-8269-11d5-aab2-0050044b1af1.Location: TKXmlL +13a56824-8269-11d5-aab2-0050044b1af1.Location: TKXmlL +! +! BinOcaf Document Plugin +! +03a56835-8269-11d5-aab2-0050044b1af1.Location: TKBin +03a56836-8269-11d5-aab2-0050044b1af1.Location: TKBin +! +! BinLOcaf Document Plugin +! +13a56835-8269-11d5-aab2-0050044b1af1.Location: TKBinL +13a56836-8269-11d5-aab2-0050044b1af1.Location: TKBinL +! +! XmlXCAF Document Plugin +! +f78ff496-a779-11d5-aab4-0050044b1af1.Location: TKXmlXCAF +f78ff497-a779-11d5-aab4-0050044b1af1.Location: TKXmlXCAF +! +! BinXCAF Document Plugin +! +a78ff496-a779-11d5-aab4-0050044b1af1.Location: TKBinXCAF +a78ff497-a779-11d5-aab4-0050044b1af1.Location: TKBinXCAF +! +! TObjXml Document Plugin +! +f78ff4a0-a779-11d5-aab4-0050044b1af1.Location: TKXmlTObj +f78ff4a1-a779-11d5-aab4-0050044b1af1.Location: TKXmlTObj +! +! TObjBin Document Plugin +! +f78ff4a2-a779-11d5-aab4-0050044b1af1.Location: TKBinTObj +f78ff4a3-a779-11d5-aab4-0050044b1af1.Location: TKBinTObj diff --git a/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/Standard b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/Standard new file mode 100644 index 0000000000000000000000000000000000000000..8c27410afa23b852bfa5854bbf8cd566729e1a92 --- /dev/null +++ b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/Standard @@ -0,0 +1,25 @@ +formatlist:MDTV-Standard|XmlOcaf|BinOcaf +! +! Default format +xml.FileFormat: XmlOcaf +cbf.FileFormat: BinOcaf +! +! standard attributes +! +MDTV-Standard.Description: Standard Document Version 1.0 +MDTV-Standard.FileExtension: std +MDTV-Standard.RetrievalPlugin: ad696001-5b34-11d1-b5ba-00a0c9064368 +! +! XmlOcaf format +! +XmlOcaf.Description: Xml Document Version 1.0 +XmlOcaf.FileExtension: xml +XmlOcaf.StoragePlugin: 03a56820-8269-11d5-aab2-0050044b1af1 +XmlOcaf.RetrievalPlugin: 03a56822-8269-11d5-aab2-0050044b1af1 +! +! BinOcaf format +! +BinOcaf.Description: Bin Ocaf Document Version 1.0 +BinOcaf.FileExtension: cbf +BinOcaf.StoragePlugin: 03a56835-8269-11d5-aab2-0050044b1af1 +BinOcaf.RetrievalPlugin: 03a56836-8269-11d5-aab2-0050044b1af1 diff --git a/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/StandardLite b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/StandardLite new file mode 100644 index 0000000000000000000000000000000000000000..b5c386548f9ba6644ad57cdc8d3afd92b2a35ccd --- /dev/null +++ b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/StandardLite @@ -0,0 +1,22 @@ +formatlist:OCC-StdLite|BinLOcaf|XmlLOcaf +! +! +! Lite attributes +! +OCC-StdLite.Description: Lite Document Version 1.0 +OCC-StdLite.FileExtension: stdl +OCC-StdLite.RetrievalPlugin: bd696001-5b34-11d1-b5ba-00a0c9064368 +! +! BinLOcaf format +! +BinLOcaf.Description: Lite Bin Ocaf Document Version 1.0 +BinLOcaf.FileExtension: cbfl +BinLOcaf.StoragePlugin: 13a56835-8269-11d5-aab2-0050044b1af1 +BinLOcaf.RetrievalPlugin: 13a56836-8269-11d5-aab2-0050044b1af1 +! +! XmlLOcaf format +! +XmlLOcaf.Description: Lite Xml Document Version 1.0 +XmlLOcaf.FileExtension: xmll +XmlLOcaf.StoragePlugin: 13a56820-8269-11d5-aab2-0050044b1af1 +XmlLOcaf.RetrievalPlugin: 13a56822-8269-11d5-aab2-0050044b1af1 diff --git a/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/TObj b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/TObj new file mode 100644 index 0000000000000000000000000000000000000000..601b50521f81122fec728bb266d121e32a5c20fb --- /dev/null +++ b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/TObj @@ -0,0 +1,17 @@ +formatlist: TObjXml|TObjBin +! +! Default format +xml.FileFormat: TObjXml +cbf.FileFormat: TObjBin +! +! TObjXml format +TObjXml.Description: TObj XML Document Version 1.0 +TObjXml.FileExtension: xml +TObjXml.StoragePlugin: f78ff4a0-a779-11d5-aab4-0050044b1af1 +TObjXml.RetrievalPlugin: f78ff4a1-a779-11d5-aab4-0050044b1af1 +! +! TObjBin format +TObjBin.Description: TObj BIN Document Version 1.0 +TObjBin.FileExtension: cbf +TObjBin.StoragePlugin: f78ff4a2-a779-11d5-aab4-0050044b1af1 +TObjBin.RetrievalPlugin: f78ff4a3-a779-11d5-aab4-0050044b1af1 diff --git a/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/XCAF b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/XCAF new file mode 100644 index 0000000000000000000000000000000000000000..4a67f6ec4db177b0c1e26c7b8c623e2213d3331d --- /dev/null +++ b/data/miniconda3/pkgs/occt-7.9.3-novtk_hac3f730_100/share/opencascade/resources/StdResource/XCAF @@ -0,0 +1,50 @@ +formatlist: MDTV-XCAF XmlXCAF BinXCAF MDTV-Standard XmlOcaf BinOcaf +! +! Default format +xml.FileFormat: XmlXCAF +! +! XCAF attributes +! +MDTV-XCAF.Description: XCAF Document Version 1.0 +MDTV-XCAF.FileExtension: dxc +MDTV-XCAF.StoragePlugin: ed8793f8-3142-11d4-b9b5-0060b0ee281b +MDTV-XCAF.RetrievalPlugin: ed8793f9-3142-11d4-b9b5-0060b0ee281b +MDTV-XCAFSchema: ed8793fa-3142-11d4-b9b5-0060b0ee281b +! +! XmlXCAF format +! +XmlXCAF.Description: XmlXCAF Document Version 1.0 +XmlXCAF.FileExtension: xml +XmlXCAF.StoragePlugin: f78ff496-a779-11d5-aab4-0050044b1af1 +XmlXCAF.RetrievalPlugin: f78ff497-a779-11d5-aab4-0050044b1af1 +! +! BinXCAF format +! +BinXCAF.Description: BinXCAF Document Version 1.0 +BinXCAF.FileExtension: xbf +BinXCAF.StoragePlugin: a78ff496-a779-11d5-aab4-0050044b1af1 +BinXCAF.RetrievalPlugin: a78ff497-a779-11d5-aab4-0050044b1af1 +! +! standard attributes +! +MDTV-Standard.Description: Standard Document Version 1.0 +MDTV-Standard.FileExtension: std +MDTV-Standard.StoragePlugin: ad696000-5b34-11d1-b5ba-00a0c9064368 +MDTV-Standard.RetrievalPlugin: ad696001-5b34-11d1-b5ba-00a0c9064368 +MDTV-StandardSchema: ad696002-5b34-11d1-b5ba-00a0c9064368 +MDTV-Standard.AttributeStoragePlugin: 47b0b826-d931-11d1-b5da-00a0c9064368 +MDTV-Standard.AttributeRetrievalPlugin: 47b0b827-d931-11d1-b5da-00a0c9064368 +! +! XmlOcaf format +! +XmlOcaf.Description: Xml Document Version 1.0 +XmlOcaf.FileExtension: xml +XmlOcaf.StoragePlugin: 03a56820-8269-11d5-aab2-0050044b1af1 +XmlOcaf.RetrievalPlugin: 03a56822-8269-11d5-aab2-0050044b1af1 +! +! BinOcaf format +! +BinOcaf.Description: Bin Ocaf Document Version 1.0 +BinOcaf.FileExtension: cbf +BinOcaf.StoragePlugin: 03a56835-8269-11d5-aab2-0050044b1af1 +BinOcaf.RetrievalPlugin: 03a56836-8269-11d5-aab2-0050044b1af1