repo_id
stringlengths
21
96
file_path
stringlengths
31
155
content
stringlengths
1
92.9M
__index_level_0__
int64
0
0
rapidsai_public_repos/cucim/python/cucim/src/cucim/skimage/measure
rapidsai_public_repos/cucim/python/cucim/src/cucim/skimage/measure/tests/test_polygon.py
import cupy as cp import pytest from cupy.testing import assert_array_equal from numpy.testing import assert_equal from cucim.skimage.measure import approximate_polygon, subdivide_polygon from cucim.skimage.measure._polygon import _SUBDIVISION_MASKS _square = cp.array( [ [0, 0], [0, 1], [0, 2], [0, 3], [1, 3], [2, 3], [3, 3], [3, 2], [3, 1], [3, 0], [2, 0], [1, 0], [0, 0], ] ) @pytest.mark.parametrize("dtype", [cp.float32, cp.float64]) def test_approximate_polygon(dtype): square = _square.astype(dtype, copy=False) out = approximate_polygon(square, 0.1) assert out.dtype == dtype assert_array_equal(out, square[cp.asarray((0, 3, 6, 9, 12)), :]) out = approximate_polygon(square, 2.2) assert_array_equal(out, square[cp.asarray((0, 6, 12)), :]) out = approximate_polygon( square[cp.asarray((0, 1, 3, 4, 5, 6, 7, 9, 11, 12)), :], 0.1 ) assert_array_equal(out, square[cp.asarray((0, 3, 6, 9, 12)), :]) out = approximate_polygon(square, -1) assert_array_equal(out, square) out = approximate_polygon(square, 0) assert_array_equal(out, square) @pytest.mark.parametrize("dtype", [cp.float32, cp.float64]) def test_subdivide_polygon(dtype): square = _square.astype(dtype, copy=False) new_square1 = square new_square2 = square[:-1] new_square3 = square[:-1] # test iterative subdvision for _ in range(10): square1, square2, square3 = new_square1, new_square2, new_square3 # test different B-Spline degrees for degree in range(1, 7): mask_len = len(_SUBDIVISION_MASKS[degree][0]) # test circular new_square1 = subdivide_polygon(square1, degree) assert new_square1.dtype == dtype assert_array_equal(new_square1[-1], new_square1[0]) assert_equal(new_square1.shape[0], 2 * square1.shape[0] - 1) # test non-circular new_square2 = subdivide_polygon(square2, degree) assert new_square3.dtype == dtype assert_equal( new_square2.shape[0], 2 * (square2.shape[0] - mask_len + 1) ) # test non-circular, preserve_ends new_square3 = subdivide_polygon(square3, degree, True) assert new_square3.dtype == dtype assert_array_equal(new_square3[0], square3[0]) assert_array_equal(new_square3[-1], square3[-1]) assert_equal( new_square3.shape[0], 2 * (square3.shape[0] - mask_len + 2) ) # not supported B-Spline degree with pytest.raises(ValueError): subdivide_polygon(square, 0) with pytest.raises(ValueError): subdivide_polygon(square, 8)
0
rapidsai_public_repos/cucim/python/cucim/src/cucim/skimage/measure
rapidsai_public_repos/cucim/python/cucim/src/cucim/skimage/measure/tests/test_entropy.py
import cupy as cp import numpy as np from numpy.testing import assert_almost_equal from cucim.skimage.measure import shannon_entropy def test_shannon_ones(): img = cp.ones((10, 10)) res = shannon_entropy(img, base=np.e) assert_almost_equal(float(res), 0.0) def test_shannon_all_unique(): img = cp.arange(64) res = shannon_entropy(img, base=2) assert_almost_equal(float(res), np.log(64) / np.log(2))
0
rapidsai_public_repos/cucim/python/cucim/src/cucim/skimage/measure
rapidsai_public_repos/cucim/python/cucim/src/cucim/skimage/measure/tests/test_block.py
import cupy as cp import pytest from cupy.testing import assert_array_equal from cucim.skimage.measure import block_reduce def test_block_reduce_sum(): image1 = cp.arange(4 * 6).reshape(4, 6) out1 = block_reduce(image1, (2, 3)) # fmt: off expected1 = cp.array([[24, 42], # noqa [96, 114]]) # fmt: on assert_array_equal(expected1, out1) image2 = cp.arange(5 * 8).reshape(5, 8) out2 = block_reduce(image2, (3, 3)) # fmt: off expected2 = cp.array([[ 81, 108, 87], # noqa [174, 192, 138]]) # fmt: on assert_array_equal(expected2, out2) def test_block_reduce_mean(): image1 = cp.arange(4 * 6).reshape(4, 6) out1 = block_reduce(image1, (2, 3), func=cp.mean) # fmt: off expected1 = cp.array([[ 4., 7.], # noqa [16., 19.]]) # fmt: on assert_array_equal(expected1, out1) image2 = cp.arange(5 * 8).reshape(5, 8) out2 = block_reduce(image2, (4, 5), func=cp.mean) # fmt: off expected2 = cp.array([[14. , 10.8], [ 8.5, 5.7]]) # noqa # fmt: on assert_array_equal(expected2, out2) def test_block_reduce_median(): image1 = cp.arange(4 * 6).reshape(4, 6) out1 = block_reduce(image1, (2, 3), func=cp.median) # fmt: off expected1 = cp.array([[ 4., 7.], # noqa [16., 19.]]) # fmt: on assert_array_equal(expected1, out1) image2 = cp.arange(5 * 8).reshape(5, 8) out2 = block_reduce(image2, (4, 5), func=cp.median) # fmt: off expected2 = cp.array([[14., 6.5], # noqa [ 0., 0. ]]) # noqa # fmt: on assert_array_equal(expected2, out2) image3 = cp.array([[1, 5, 5, 5], [5, 5, 5, 1000]]) out3 = block_reduce(image3, (2, 4), func=cp.median) assert_array_equal(5, out3) def test_block_reduce_min(): image1 = cp.arange(4 * 6).reshape(4, 6) out1 = block_reduce(image1, (2, 3), func=cp.min) # fmt: off expected1 = cp.array([[ 0, 3], # noqa [12, 15]]) # fmt: on assert_array_equal(expected1, out1) image2 = cp.arange(5 * 8).reshape(5, 8) out2 = block_reduce(image2, (4, 5), func=cp.min) # fmt: off expected2 = cp.array([[0, 0], [0, 0]]) # fmt: on assert_array_equal(expected2, out2) def test_block_reduce_max(): image1 = cp.arange(4 * 6).reshape(4, 6) out1 = block_reduce(image1, (2, 3), func=cp.max) # fmt: off expected1 = cp.array([[ 8, 11], # noqa [20, 23]]) # fmt: on assert_array_equal(expected1, out1) image2 = cp.arange(5 * 8).reshape(5, 8) out2 = block_reduce(image2, (4, 5), func=cp.max) # fmt: off expected2 = cp.array([[28, 31], [36, 39]]) # fmt: on assert_array_equal(expected2, out2) def test_invalid_block_size(): image = cp.arange(4 * 6).reshape(4, 6) with pytest.raises(ValueError): block_reduce(image, [1, 2, 3]) with pytest.raises(ValueError): block_reduce(image, [1, 0.5]) def test_default_block_size(): image = cp.arange(4 * 6).reshape(4, 6) out = block_reduce(image, func=cp.min) expected = cp.array([[0, 2, 4], [12, 14, 16]]) assert_array_equal(expected, out) def test_scalar_block_size(): image = cp.arange(6 * 6).reshape(6, 6) out = block_reduce(image, 3, func=cp.min) expected1 = cp.array([[0, 3], [18, 21]]) assert_array_equal(expected1, out) expected2 = block_reduce(image, (3, 3), func=cp.min) assert_array_equal(expected2, out) @pytest.mark.skip(reason="cupy.mean doesn't support setting dtype=cupy.uint8") def test_func_kwargs_same_dtype(): # fmt: off image = cp.array([[97, 123, 173, 227], [217, 241, 221, 214], [211, 11, 170, 53], # noqa [214, 205, 101, 57]], dtype=cp.uint8) # noqa # fmt: on out = block_reduce( image, (2, 2), func=cp.mean, func_kwargs={"dtype": cp.uint8} ) expected = cp.array([[41, 16], [32, 31]], dtype=cp.uint8) assert_array_equal(out, expected) assert out.dtype == expected.dtype def test_func_kwargs_different_dtype(): # fmt: off image = cp.array([[0.45745366, 0.67479345, 0.20949775, 0.3147348], [0.7209286, 0.88915504, 0.66153409, 0.07919526], [0.04640037, 0.54008495, 0.34664343, 0.56152301], [0.58085003, 0.80144708, 0.87844473, 0.29811511]], dtype=cp.float64) # fmt: on out = block_reduce( image, (2, 2), func=cp.mean, func_kwargs={"dtype": cp.float16} ) expected = cp.array([[0.6855, 0.3164], [0.4922, 0.521]], dtype=cp.float16) # Note: had to set decimal=3 for float16 to pass here when using CuPy cp.testing.assert_array_almost_equal(out, expected, decimal=3) assert out.dtype == expected.dtype
0
rapidsai_public_repos/cucim/python/cucim/src/cucim/skimage/measure
rapidsai_public_repos/cucim/python/cucim/src/cucim/skimage/measure/tests/test_moments.py
import itertools import cupy as cp import numpy as np import pytest from cupy.testing import ( assert_allclose, assert_array_almost_equal, assert_array_equal, ) from cupyx.scipy import ndimage as ndi from numpy.testing import assert_almost_equal from skimage import draw from cucim.skimage._shared.utils import _supported_float_type from cucim.skimage.measure import ( centroid, inertia_tensor, inertia_tensor_eigvals, moments, moments_central, moments_coords, moments_coords_central, moments_hu, moments_normalized, ) def compare_moments(m1, m2, thresh=1e-8): """Compare two moments arrays. Compares only values in the upper-left triangle of m1, m2 since values below the diagonal exceed the specified order and are not computed when the analytical computation is used. Also, there the first-order central moments will be exactly zero with the analytical calculation, but will not be zero due to limited floating point precision when using a numerical computation. Here we just specify the tolerance as a fraction of the maximum absolute value in the moments array. """ m1 = cp.asnumpy(m1) m2 = cp.asnumpy(m2) # make sure location of any NaN values match and then ignore the NaN values # in the subsequent comparisons nan_idx1 = np.where(np.isnan(m1.ravel()))[0] nan_idx2 = np.where(np.isnan(m2.ravel()))[0] assert len(nan_idx1) == len(nan_idx2) assert np.all(nan_idx1 == nan_idx2) m1[np.isnan(m1)] = 0 m2[np.isnan(m2)] = 0 max_val = np.abs(m1[m1 != 0]).max() for orders in itertools.product(*((range(m1.shape[0]),) * m1.ndim)): if sum(orders) > m1.shape[0] - 1: m1[orders] = 0 m2[orders] = 0 continue abs_diff = abs(m1[orders] - m2[orders]) rel_diff = abs_diff / max_val assert rel_diff < thresh @pytest.mark.parametrize("dtype", [cp.float32, cp.float64]) @pytest.mark.parametrize("anisotropic", [False, True, None]) def test_moments(anisotropic, dtype): image = cp.zeros((20, 20), dtype=dtype) image[14, 14] = 1 image[15, 15] = 1 image[14, 15] = 0.5 image[15, 14] = 0.5 if anisotropic: spacing = (1.4, 2) else: spacing = (1, 1) if anisotropic is None: m = moments(image) else: m = moments(image, spacing=spacing) assert m.dtype == dtype assert_array_equal(m[0, 0], 3) decimal = 5 if dtype == np.float32 else 12 assert_almost_equal(m[1, 0] / m[0, 0], 14.5 * spacing[0], decimal=decimal) assert_almost_equal(m[0, 1] / m[0, 0], 14.5 * spacing[1], decimal=decimal) @pytest.mark.parametrize("dtype", [cp.float32, cp.float64]) @pytest.mark.parametrize("anisotropic", [False, True, None]) def test_moments_central(anisotropic, dtype): image = cp.zeros((20, 20), dtype=dtype) image[14, 14] = 1 image[15, 15] = 1 image[14, 15] = 0.5 image[15, 14] = 0.5 if anisotropic: spacing = (2, 1) else: spacing = (1, 1) if anisotropic is None: mu = moments_central(image, (14.5, 14.5)) # check for proper centroid computation mu_calc_centroid = moments_central(image) else: mu = moments_central( image, (14.5 * spacing[0], 14.5 * spacing[1]), spacing=spacing ) # check for proper centroid computation mu_calc_centroid = moments_central(image, spacing=spacing) assert mu.dtype == dtype thresh = 1e-6 if dtype == np.float32 else 1e-14 compare_moments(mu, mu_calc_centroid, thresh=thresh) # shift image by dx=2, dy=2 image2 = cp.zeros((20, 20), dtype=dtype) image2[16, 16] = 1 image2[17, 17] = 1 image2[16, 17] = 0.5 image2[17, 16] = 0.5 if anisotropic is None: mu2 = moments_central(image2, (14.5 + 2, 14.5 + 2)) else: mu2 = moments_central( image2, ((14.5 + 2) * spacing[0], (14.5 + 2) * spacing[1]), spacing=spacing, ) assert mu2.dtype == dtype # central moments must be translation invariant compare_moments(mu, mu2, thresh=thresh) def test_moments_coords(): image = cp.zeros((20, 20), dtype=cp.float64) image[13:17, 13:17] = 1 mu_image = moments(image) coords = cp.array( [[r, c] for r in range(13, 17) for c in range(13, 17)], dtype=cp.float64 ) mu_coords = moments_coords(coords) assert_array_almost_equal(mu_coords, mu_image) @pytest.mark.parametrize("dtype", [cp.float16, cp.float32, cp.float64]) def test_moments_coords_dtype(dtype): image = cp.zeros((20, 20), dtype=dtype) image[13:17, 13:17] = 1 expected_dtype = _supported_float_type(dtype) mu_image = moments(image) assert mu_image.dtype == expected_dtype coords = cp.asarray( np.array( [[r, c] for r in range(13, 17) for c in range(13, 17)], dtype=dtype ) ) mu_coords = moments_coords(coords) assert mu_coords.dtype == expected_dtype assert_array_almost_equal(mu_coords, mu_image) def test_moments_central_coords(): image = cp.zeros((20, 20), dtype=float) image[13:17, 13:17] = 1 mu_image = moments_central(image, (14.5, 14.5)) coords = cp.asarray( np.array( [[r, c] for r in range(13, 17) for c in range(13, 17)], dtype=float, ) ) mu_coords = moments_coords_central(coords, (14.5, 14.5)) assert_array_almost_equal(mu_coords, mu_image) # ensure that center is being calculated normally mu_coords_calc_centroid = moments_coords_central(coords) assert_array_almost_equal(mu_coords_calc_centroid, mu_coords) # shift image by dx=3 dy=3 image = cp.zeros((20, 20), dtype=float) image[16:20, 16:20] = 1 mu_image = moments_central(image, (14.5, 14.5)) coords = cp.asarray( np.array( [[r, c] for r in range(16, 20) for c in range(16, 20)], dtype=float ) ) mu_coords = moments_coords_central(coords, (14.5, 14.5)) decimal = 6 assert_array_almost_equal(mu_coords, mu_image, decimal=decimal) def test_moments_normalized(): image = cp.zeros((20, 20), dtype=float) image[13:17, 13:17] = 1 mu = moments_central(image, (14.5, 14.5)) nu = moments_normalized(mu) # shift image by dx=-2, dy=-2 and scale non-zero extent by 0.5 image2 = cp.zeros((20, 20), dtype=float) # scale amplitude by 0.7 image2[11:13, 11:13] = 0.7 mu2 = moments_central(image2, (11.5, 11.5)) nu2 = moments_normalized(mu2) # central moments must be translation and scale invariant assert_array_almost_equal(nu, nu2, decimal=1) @pytest.mark.parametrize("anisotropic", [False, True]) def test_moments_normalized_spacing(anisotropic): image = cp.zeros((20, 20), dtype=np.double) image[13:17, 13:17] = 1 if not anisotropic: spacing1 = (1, 1) spacing2 = (3, 3) else: spacing1 = (1, 2) spacing2 = (2, 4) mu = moments_central(image, spacing=spacing1) nu = moments_normalized(mu, spacing=spacing1) mu2 = moments_central(image, spacing=spacing2) nu2 = moments_normalized(mu2, spacing=spacing2) # result should be invariant to absolute scale of spacing compare_moments(nu, nu2) def test_moments_normalized_3d(): image = cp.asarray(draw.ellipsoid(1, 1, 10)) mu_image = moments_central(image) nu = moments_normalized(mu_image) assert nu[0, 0, 2] > nu[0, 2, 0] assert_almost_equal(nu[0, 2, 0], nu[2, 0, 0]) coords = cp.where(image) mu_coords = moments_coords_central(coords) assert_array_almost_equal(mu_coords, mu_image) @pytest.mark.parametrize("dtype", [np.uint8, np.int32, np.float32, np.float64]) @pytest.mark.parametrize("order", [1, 2, 3, 4]) @pytest.mark.parametrize("ndim", [2, 3, 4]) def test_analytical_moments_calculation(dtype, order, ndim): if ndim == 2: shape = (256, 256) elif ndim == 3: shape = (64, 64, 64) else: shape = (16,) * ndim rng = np.random.default_rng(1234) if np.dtype(dtype).kind in "iu": x = rng.integers(0, 256, shape, dtype=dtype) else: x = rng.standard_normal(shape, dtype=dtype) x = cp.asarray(x) # setting center=None will use the analytical expressions m1 = moments_central(x, center=None, order=order) # providing explicit centroid will bypass the analytical code path m2 = moments_central(x, center=centroid(x), order=order) # ensure numeric and analytical central moments are close thresh = 5e-4 if _supported_float_type(x.dtype) == np.float32 else 1e-11 compare_moments(m1, m2, thresh=thresh) def test_moments_normalized_invalid(): with pytest.raises(ValueError): moments_normalized(cp.zeros((3, 3)), 3) with pytest.raises(ValueError): moments_normalized(cp.zeros((3, 3)), 4) def test_moments_hu(): image = cp.zeros((20, 20), dtype=float) image[13:15, 13:17] = 1 mu = moments_central(image, (13.5, 14.5)) nu = moments_normalized(mu) hu = moments_hu(nu) # shift image by dx=2, dy=3, scale by 0.5 and rotate by 90deg image2 = cp.zeros((20, 20), dtype=float) image2[11, 11:13] = 1 image2 = image2.T mu2 = moments_central(image2, (11.5, 11)) nu2 = moments_normalized(mu2) hu2 = moments_hu(nu2) # central moments must be translation and scale invariant assert_array_almost_equal(hu, hu2, decimal=1) @pytest.mark.parametrize("dtype", [cp.float16, cp.float32, cp.float64]) def test_moments_dtype(dtype): image = cp.zeros((20, 20), dtype=dtype) image[13:15, 13:17] = 1 expected_dtype = _supported_float_type(dtype) mu = moments_central(image, (13.5, 14.5)) assert mu.dtype == expected_dtype nu = moments_normalized(mu) assert nu.dtype == expected_dtype hu = moments_hu(nu) assert hu.dtype == expected_dtype @pytest.mark.parametrize("dtype", [cp.float16, cp.float32, cp.float64]) def test_centroid(dtype): image = cp.zeros((20, 20), dtype=dtype) image[14, 14:16] = 1 image[15, 14:16] = 1 / 3 image_centroid = centroid(image) if dtype == cp.float16: rtol = 1e-3 elif dtype == cp.float32: rtol = 1e-5 else: rtol = 1e-7 assert_allclose(image_centroid, (14.25, 14.5), rtol=rtol) @pytest.mark.parametrize("dtype", [cp.float16, cp.float32, cp.float64]) def test_inertia_tensor_2d(dtype): image = cp.zeros((40, 40), dtype=dtype) image[15:25, 5:35] = 1 # big horizontal rectangle (aligned with axis 1) expected_dtype = _supported_float_type(image.dtype) T = inertia_tensor(image) assert T.dtype == expected_dtype assert T[0, 0] > T[1, 1] cp.testing.assert_allclose(T[0, 1], 0) v0, v1 = inertia_tensor_eigvals(image, T=T) assert v0.dtype == expected_dtype assert v1.dtype == expected_dtype cp.testing.assert_allclose(cp.sqrt(v0 / v1), 3, rtol=0.01, atol=0.05) def test_inertia_tensor_3d(): image = cp.asarray(draw.ellipsoid(10, 5, 3)) T0 = inertia_tensor(image) eig0, V0 = np.linalg.eig(cp.asnumpy(T0)) # principal axis of ellipse = eigenvector of smallest eigenvalue v0 = cp.asarray(V0[:, np.argmin(eig0)]) assert cp.allclose(v0, [1, 0, 0]) or cp.allclose(-v0, [1, 0, 0]) imrot = ndi.rotate(image.astype(float), 30, axes=(0, 1), order=1) Tr = inertia_tensor(imrot) eigr, Vr = np.linalg.eig(cp.asnumpy(Tr)) vr = cp.asarray(Vr[:, np.argmin(eigr)]) # Check that axis has rotated by expected amount pi, cos, sin = np.pi, np.cos, np.sin # fmt: off R = cp.array([[cos(pi/6), -sin(pi/6), 0], # noqa [sin(pi/6), cos(pi/6), 0], # noqa [ 0, 0, 1]]) # noqa # fmt: on expected_vr = R @ v0 assert cp.allclose(vr, expected_vr, atol=1e-3, rtol=0.01) or cp.allclose( -vr, expected_vr, atol=1e-3, rtol=0.01 ) def test_inertia_tensor_eigvals(): # Floating point precision problems could make a positive # semidefinite matrix have an eigenvalue that is very slightly # negative. Check that we have caught and fixed this problem. # fmt: off image = cp.array([[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]) # fmt: on # mu = np.array([[3, 0, 98], [0, 14, 0], [2, 0, 98]]) eigvals = inertia_tensor_eigvals(image=image) assert min(eigvals) >= 0
0
rapidsai_public_repos/cucim/python
rapidsai_public_repos/cucim/python/pybind11/macros.h
/* * Copyright (c) 2020, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_MACRO_H #define PYCUCIM_MACRO_H #include <string> #include <fmt/format.h> constexpr const char* remove_leading_spaces(const char* str) { return *str == '\0' ? str : ((*str == ' ' || *str == '\n') ? remove_leading_spaces(str + 1) : str); } #define PYDOC(method, doc) static constexpr const char* doc_##method = remove_leading_spaces(doc); #endif // PYCUCIM_MACRO_H
0
rapidsai_public_repos/cucim/python
rapidsai_public_repos/cucim/python/pybind11/cucim_pydoc.h
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_CUCIM_PYDOC_H #define PYCUCIM_CUCIM_PYDOC_H #include <string> #include "macros.h" namespace cucim::doc { namespace DLDataType { // Constructor PYDOC(DLDataType, R"doc( Constructor for `DLDataType`. )doc") // uint8_t code; PYDOC(code, R"doc( Type code of base types. )doc") // uint8_t bits; PYDOC(bits, R"doc( Number of bits, common choices are 8, 16, 32. )doc") // uint16_t lanes; PYDOC(lanes, R"doc( Number of lanes in the type, used for vector types. )doc") } // namespace DLDataType namespace CuImage { // CuImage(const filesystem::Path& path); PYDOC(CuImage, R"doc( Constructor of CuImage. )doc") // CuImage(const filesystem::Path& path, const std::string& plugin_name); // CuImage(const CuImage& cuimg) = delete; // CuImage(CuImage&& cuimg); // // ~CuImage(); // std::shared_ptr<cache::ImageCache> CuImage::cache() PYDOC(cache, R"doc( Get cache object. )doc") // std::shared_ptr<profiler::Profiler> CuImage::profiler() PYDOC(profiler, R"doc( Get profiler object. )doc") // bool CuImage::is_trace_enabled() PYDOC(is_trace_enabled, R"doc( Return whether if the tracing is enabled or not. )doc") // filesystem::Path path() const; PYDOC(path, R"doc( Underlying file path for this object. )doc") // bool is_loaded() const; PYDOC(is_loaded, R"doc( True if image data is loaded & available. )doc") // io::Device device() const; PYDOC(device, R"doc( A device type. By default t is `cpu` (It will be changed since v0.19.0). )doc") // Metadata metadata() const; PYDOC(raw_metadata, R"doc( A raw metadata string. )doc") // Metadata metadata() const; PYDOC(metadata, R"doc( A metadata object as `dict`. It would be a dictionary(key-value pair) in general but can be a complex object (e.g., OME-TIFF metadata). )doc") // uint16_t ndim() const; PYDOC(ndim, R"doc( The number of dimensions. )doc") // std::string dims() const; PYDOC(dims, R"doc( A string containing a list of dimensions being requested. The default is to return the six standard dims ('STCZYX') unless it is a DP multi-resolution image. [sites, time, channel(or wavelength), z, y, x]. S - Sites or multiposition locations. NOTE: in OME-TIFF's metadata, dimension order would be specified as 'XYZCTS' (first one is fast-iterating dimension). )doc") // Shape shape() const; PYDOC(shape, R"doc( A tuple of dimension sizes (in the order of `dims`) )doc") // std::vector<int64_t> size(std::string dim_order) const; PYDOC(size, R"doc( Returns size as a tuple for the given dimension order. )doc") // DLDataType dtype() const; PYDOC(dtype, R"doc( The data type of the image. )doc") // DLDataType typestr() const; PYDOC(typestr, R"doc( The data type of the image in string format. The value can be converted to NumPy's dtype using `numpy.dtype()`. (e.g., `numpy.dtype(img.typestr)`). )doc") // std::vector<std::string> channel_names() const; PYDOC(channel_names, R"doc( A channel name list. )doc") // std::vector<float> spacing(std::string dim_order = std::string{}) const; PYDOC(spacing, R"doc( Returns physical size in tuple. If `dim_order` is specified, it returns physical size for the dimensions. If a dimension given by the `dim_order` doesn't exist, it returns 1.0 by default for the missing dimension. Args: dim_order: A dimension string (e.g., 'XYZ') Returns: A tuple with physical size for each dimension )doc") // std::vector<std::string> spacing_units(std::string dim_order = std::string{}) const; PYDOC(spacing_units, R"doc( Units for each spacing element (size is same with `ndim`). )doc") // std::array<float, 3> origin() const; PYDOC(origin, R"doc( Physical location of (0, 0, 0) (size is always 3). )doc") // std::array<std::array<float, 3>, 3> direction() const; PYDOC(direction, R"doc( Direction cosines (size is always 3x3). )doc") // std::string coord_sys() const; PYDOC(coord_sys, R"doc( Coordinate frame in which the direction cosines are measured. Available Coordinate frame names are not finalized yet. )doc") // (either `LPS`(ITK/DICOM) or `RAS`(NIfTI/3D Slicer)). (either `LPS`(ITK/DICOM) or `RAS`(NIfTI/3D Slicer)). // ResolutionInfo resolutions() const; PYDOC(resolutions, R"doc( Returns a dict that includes resolution information. - level_count: The number of levels - level_dimensions: A tuple of dimension tuples (width, height) - level_downsamples: A tuple of down-sample factors - level_tile_sizes: A tuple of tile size tuple (tile width, tile_height) )doc") // dlpack::DLTContainer container() const; // CuImage read_region(std::vector<int64_t> location, // std::vector<int64_t> size, // uint16_t level=0, // DimIndices region_dim_indices={}, // io::Device device="cpu", // DLTensor* buf=nullptr, // std::string shm_name=""); PYDOC(read_region, R"doc( Returns a subresolution image. - `location` and `size`'s dimension order is reverse of image's dimension order. - Need to specify (X,Y) and (Width, Height) instead of (Y,X) and (Height, Width). - If location is not specified, location would be (0, 0) if Z=0. Otherwise, location would be (0, 0, 0) - Like OpenSlide, location is level-0 based coordinates (using the level-0 reference frame) - If `size` is not specified, size would be (width, height) of the image at the specified `level`. - `<not supported yet>` Additional parameters (S,T,C,Z) are similar to <https://allencellmodeling.github.io/aicsimageio/aicsimageio.html#aicsimageio.aics_image.AICSImage.get_image_data> - Do not yet support indices/ranges for (S,T,C,Z). - Default value for level, S, T, Z are zero. - Default value for C is -1 (whole channels) - `<not supported yet>` `device` could be one of the following strings or Device object: e.g., `'cpu'`, `'cuda'`, `'cuda:0'` (use index 0), `cucim.clara.io.Device(cucim.clara.io.CUDA,0)`. - `<not supported yet>` If `buf` is specified (buf's type can be either numpy object that implements `__array_interface__`, or cupy-compatible object that implements `__cuda_array_interface__`), the read image would be saved into buf object without creating CPU/GPU memory. - `<not supported yet>` If `shm_name` is specified, shared memory would be created and data would be read in the shared memory. )doc") // std::set<std::string> associated_images() const; PYDOC(associated_images, R"doc( Returns a set of associated image names. Digital Pathology image usually has a label/thumbnail or a macro image(low-power snapshot of the entire glass slide). Names of those images (such as 'macro' and 'label') are in `associated_images`. )doc") // CuImage associated_image(const std::string& name) const; PYDOC(associated_image, R"doc( Returns an associated image for the given name, as a CuImage object. )doc") // void save(std::string file_path) const; PYDOC(save, R"doc( Saves image data to the file path. Currently it supports only .ppm file format that can be viewed by `eog` command in Ubuntu. )doc") // void close(); PYDOC(close, R"doc( Closes the file handle. Once the file handle is closed, the image object (if loaded before) still exists but cannot read additional images from the file. )doc") // void _set_array_interface(const CuImage& cuimg); PYDOC(_set_array_interface, R"doc( Add `__array_interface__` or `__cuda_array_interface__` depending on the memory type. Args: cuimg: CuImage object Returns: None )doc") }; // namespace CuImage namespace CuImageIterator { // CuImageIterator(std::shared_ptr<DataType> cuimg, bool ending = false); PYDOC(CuImageIterator, R"doc( Constructor of CuImageIterator. )doc") } // namespace CuImageIterator } // namespace cucim::doc #endif // PYCUCIM_CUCIM_PYDOC_H
0
rapidsai_public_repos/cucim/python
rapidsai_public_repos/cucim/python/pybind11/cucim_py.h
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_CUIMAGE_PY_H #define PYCUCIM_CUIMAGE_PY_H #include <vector> #include <nlohmann/json.hpp> #include <pybind11_json/pybind11_json.hpp> using json = nlohmann::json; namespace cucim { // Forward declarations class CuImage; template <typename DataType = CuImage> class CuImageIterator; namespace io { class Device; } namespace cache { class ImageCache; } namespace profiler { class Profiler; } std::string get_plugin_root(); void set_plugin_root(std::string path); /** * Converts an object with std::vector type to one with pybind11::tuple type. * * The code is derived from `make_tuple()` method in pybind11/cast.h which is under BSD-3-Clause License. * Please see LICENSE-3rdparty.md for the detail. * (https://github.com/pybind/pybind11/blob/993495c96c869c5d3f3266c3ed3b1b8439340fd2/include/pybind11/cast.h#L1817) * * @tparam PT Python type * @tparam T Vector type * @param vec A vector object to convert * @return An object of pybind11::tuple type to which `vec` is converted */ template<typename PT, typename T> pybind11::tuple vector2pytuple(const std::vector<T>& vec); std::shared_ptr<cucim::cache::ImageCache> py_cache(const py::object& ctype, const py::kwargs& kwargs); std::shared_ptr<cucim::profiler::Profiler> py_profiler(const py::kwargs& kwargs); bool py_is_trace_enabled(py::object /* self */); json py_metadata(const CuImage& cuimg); py::dict py_resolutions(const CuImage& cuimg); py::object py_read_region(const CuImage& cuimg, const py::iterable& location, std::vector<int64_t>&& size, int16_t level, uint32_t num_workers, uint32_t batch_size, bool drop_last, uint32_t prefetch_factor, bool shuffle, uint64_t seed, const io::Device& device, const py::object& buf, const std::string& shm_name, const py::kwargs& kwargs); py::object py_associated_image(const CuImage& cuimg, const std::string& name, const io::Device& device); py::object py_cuimage_iterator_next(CuImageIterator<CuImage>& it); void _set_array_interface(const py::object& cuimg_obj); } // namespace cucim #endif // PYCUCIM_CUIMAGE_PY_H
0
rapidsai_public_repos/cucim/python
rapidsai_public_repos/cucim/python/pybind11/cucim_py.cpp
/* * Copyright (c) 2020-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cucim_py.h" #include "cucim_pydoc.h" #include <fmt/format.h> #include <fmt/ranges.h> #include <pybind11/numpy.h> #include <pybind11/operators.h> #include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <cucim/cuimage.h> #include "cache/cache_py.h" #include "filesystem/filesystem_py.h" #include "io/io_py.h" #include "profiler/profiler_py.h" using namespace pybind11::literals; namespace py = pybind11; namespace cucim { static const std::unordered_map<uint8_t, const char*> g_dldata_typecode{ { kDLInt, "DLInt" }, { kDLUInt, "DLUInt" }, { kDLFloat, "DLFloat" }, { kDLBfloat, "DLBfloat" }, }; PYBIND11_MODULE(_cucim, m) { // clang-format off #ifdef CUCIM_VERSION # define XSTR(x) STR(x) # define STR(x) #x // Set version m.attr("__version__") = XSTR(CUCIM_VERSION); #endif // clang-format on // Get/set plugin root path m.def("_get_plugin_root", &get_plugin_root); m.def("_set_plugin_root", &set_plugin_root); // Submodule: io auto m_io = m.def_submodule("io"); io::init_io(m_io); // Submodule: filesystem auto m_fs = m.def_submodule("filesystem"); filesystem::init_filesystem(m_fs); // Submodule: cache auto m_cache = m.def_submodule("cache"); cache::init_cache(m_cache); // Submodule: profiler auto m_profiler = m.def_submodule("profiler"); profiler::init_profiler(m_profiler); // Data structures py::enum_<DLDataTypeCode>(m, "DLDataTypeCode") // .value("DLInt", kDLInt) // .value("DLUInt", kDLUInt) // .value("DLFloat", kDLFloat) // .value("DLBfloat", kDLBfloat); py::class_<DLDataType>(m, "DLDataType") // .def(py::init([](DLDataTypeCode code, uint8_t bits, uint16_t lanes) { auto ctr = std::make_unique<DLDataType>(); ctr->code = static_cast<uint8_t>(code); ctr->bits = bits; ctr->lanes = lanes; return ctr; }), doc::DLDataType::doc_DLDataType, py::call_guard<py::gil_scoped_release>()) .def_readonly("code", &DLDataType::code, doc::DLDataType::doc_code, py::call_guard<py::gil_scoped_release>()) // .def_readonly("bits", &DLDataType::bits, doc::DLDataType::doc_bits, py::call_guard<py::gil_scoped_release>()) // .def_readonly("lanes", &DLDataType::lanes, doc::DLDataType::doc_lanes, py::call_guard<py::gil_scoped_release>()) // .def(py::self == py::self) // .def(py::self != py::self) // .def( "__repr__", [](const DLDataType& dtype) { return fmt::format("<cucim.clara.DLDataType code:{}({}) bits:{} lanes:{}>", g_dldata_typecode.at(dtype.code), dtype.code, dtype.bits, dtype.lanes); }, py::call_guard<py::gil_scoped_release>()); py::class_<CuImage, std::shared_ptr<CuImage>>(m, "CuImage", py::dynamic_attr()) // .def(py::init<const std::string&>(), doc::CuImage::doc_CuImage, py::call_guard<py::gil_scoped_release>(), // py::arg("path")) // .def_static("cache", &py_cache, doc::CuImage::doc_cache, // py::arg("type") = py::none()) // .def_static("profiler", &py_profiler, doc::CuImage::doc_profiler, py::call_guard<py::gil_scoped_release>()) // .def_property_readonly_static("is_trace_enabled", &py_is_trace_enabled, doc::CuImage::doc_is_trace_enabled, py::call_guard<py::gil_scoped_release>()) //); // Do not release GIL .def_static("_set_array_interface", &_set_array_interface, doc::CuImage::doc__set_array_interface, // py::arg("cuimg") = py::none()) // .def_property("path", &CuImage::path, nullptr, doc::CuImage::doc_path, py::call_guard<py::gil_scoped_release>()) // .def_property("is_loaded", &CuImage::is_loaded, nullptr, doc::CuImage::doc_is_loaded, py::call_guard<py::gil_scoped_release>()) // .def_property( "device", &CuImage::device, nullptr, doc::CuImage::doc_device, py::call_guard<py::gil_scoped_release>()) // .def_property("raw_metadata", &CuImage::raw_metadata, nullptr, doc::CuImage::doc_raw_metadata, py::call_guard<py::gil_scoped_release>()) // .def_property( "metadata", &py_metadata, nullptr, doc::CuImage::doc_metadata, py::call_guard<py::gil_scoped_release>()) // .def_property("ndim", &CuImage::ndim, nullptr, doc::CuImage::doc_ndim, py::call_guard<py::gil_scoped_release>()) // .def_property("dims", &CuImage::dims, nullptr, doc::CuImage::doc_dims, py::call_guard<py::gil_scoped_release>()) // .def_property( "shape", &CuImage::shape, nullptr, doc::CuImage::doc_shape, py::call_guard<py::gil_scoped_release>()) // .def("size", &CuImage::size, doc::CuImage::doc_size, py::call_guard<py::gil_scoped_release>(), // py::arg("dim_order") = "" // ) // .def_property( "dtype", &CuImage::dtype, nullptr, doc::CuImage::doc_dtype, py::call_guard<py::gil_scoped_release>()) // .def_property("typestr", &CuImage::typestr, nullptr, doc::CuImage::doc_typestr, py::call_guard<py::gil_scoped_release>()) // .def_property("channel_names", &CuImage::channel_names, nullptr, doc::CuImage::doc_channel_names, py::call_guard<py::gil_scoped_release>()) // .def("spacing", &CuImage::spacing, doc::CuImage::doc_spacing, py::call_guard<py::gil_scoped_release>(), // py::arg("dim_order") = "" // ) // .def("spacing_units", &CuImage::spacing_units, doc::CuImage::doc_spacing_units, py::call_guard<py::gil_scoped_release>(), // py::arg("dim_order") = "" // ) // .def_property( "origin", &CuImage::origin, nullptr, doc::CuImage::doc_origin, py::call_guard<py::gil_scoped_release>()) // .def_property("direction", &CuImage::direction, nullptr, doc::CuImage::doc_direction, py::call_guard<py::gil_scoped_release>()) // .def_property("coord_sys", &CuImage::coord_sys, nullptr, doc::CuImage::doc_coord_sys, py::call_guard<py::gil_scoped_release>()) // .def_property("resolutions", &py_resolutions, nullptr, doc::CuImage::doc_resolutions, py::call_guard<py::gil_scoped_release>()) // .def("read_region", &py_read_region, doc::CuImage::doc_read_region, py::call_guard<py::gil_scoped_release>(), // py::arg("location") = py::tuple{}, // py::arg("size") = py::tuple{}, // py::arg("level") = 0, // py::arg("num_workers") = 0, // py::arg("batch_size") = 1, // py::arg("drop_last") = py::bool_(false), // py::arg("prefetch_factor") = 2, // py::arg("shuffle") = py::bool_(false), // py::arg("seed") = py::int_(0), // py::arg("device") = io::Device(), // py::arg("buf") = py::none(), // py::arg("shm_name") = "") // .def_property("associated_images", &CuImage::associated_images, nullptr, doc::CuImage::doc_associated_images, py::call_guard<py::gil_scoped_release>()) // .def("associated_image", &py_associated_image, doc::CuImage::doc_associated_image, py::call_guard<py::gil_scoped_release>(), // py::arg("name") = "", // py::arg("device") = io::Device()) // .def("save", &CuImage::save, doc::CuImage::doc_save, py::call_guard<py::gil_scoped_release>()) // .def("close", &CuImage::close, doc::CuImage::doc_close, py::call_guard<py::gil_scoped_release>()) // .def("__bool__", &CuImage::operator bool, py::call_guard<py::gil_scoped_release>()) // .def( "__iter__", // [](const std::shared_ptr<CuImage>& cuimg) { // return cuimg->begin(); // }, // py::call_guard<py::gil_scoped_release>()) .def( "__enter__", [](const std::shared_ptr<CuImage>& cuimg) { // return cuimg; // }, // py::call_guard<py::gil_scoped_release>()) .def( "__exit__", [](const std::shared_ptr<CuImage>& cuimg, const py::object& type, const py::object& value, const py::object& traceback) { // cuimg->close(); // }, // py::call_guard<py::gil_scoped_release>()) .def( "__repr__", // [](const CuImage& cuimg) { // return fmt::format("<cucim.CuImage path:{}>", cuimg.path()); }, py::call_guard<py::gil_scoped_release>()); py::class_<CuImageIterator<CuImage>, std::shared_ptr<CuImageIterator<CuImage>>>(m, "CuImageIterator") // .def(py::init<std::shared_ptr<CuImage>, bool>(), doc::CuImageIterator::doc_CuImageIterator, py::arg("cuimg"), // py::arg("ending") = false, py::call_guard<py::gil_scoped_release>()) .def( "__len__", [](const CuImageIterator<CuImage>& it) { // return it.size(); // }, // py::call_guard<py::gil_scoped_release>()) .def( "__iter__", // [](CuImageIterator<CuImage>* it) { // return it; // }, // py::call_guard<py::gil_scoped_release>()) .def("__next__", &py_cuimage_iterator_next, py::call_guard<py::gil_scoped_release>()) .def( "__repr__", // [](CuImageIterator<CuImage>& it) { // return fmt::format("<cucim.CuImageIterator index:{}>", it.index()); }, py::call_guard<py::gil_scoped_release>()); // We can use `"cpu"` instead of `Device("cpu")` py::implicitly_convertible<const char*, io::Device>(); } std::string get_plugin_root() { return CuImage::get_framework()->get_plugin_root(); } void set_plugin_root(std::string path) { CuImage::get_framework()->set_plugin_root(path.c_str()); } template <typename PT, typename T> pybind11::tuple vector2pytuple(const std::vector<T>& vec) { py::tuple result(vec.size()); std::vector<pybind11::object> args; args.reserve(vec.size()); for (auto& arg_value : vec) { args.emplace_back(pybind11::reinterpret_steal<pybind11::object>(pybind11::detail::make_caster<PT>::cast( std::forward<PT>(arg_value), pybind11::return_value_policy::automatic_reference, nullptr))); } int counter = 0; for (auto& arg_value : args) { PyTuple_SET_ITEM(result.ptr(), counter++, arg_value.release().ptr()); } return result; } std::shared_ptr<cucim::cache::ImageCache> py_cache(const py::object& type, const py::kwargs& kwargs) { if (py::isinstance<py::str>(type)) { std::string ctype = std::string(py::cast<py::str>(type)); cucim::cache::CacheType cache_type = cucim::cache::lookup_cache_type(ctype); // Copy default cache config to local cucim::cache::ImageCacheConfig config = cucim::CuImage::get_config()->cache(); config.type = cache_type; if (kwargs.contains("memory_capacity")) { config.memory_capacity = py::cast<uint32_t>(kwargs["memory_capacity"]); } if (kwargs.contains("capacity")) { config.capacity = py::cast<uint32_t>(kwargs["capacity"]); } else { // Update capacity depends on memory_capacity. config.capacity = cucim::cache::calc_default_cache_capacity(cucim::cache::kOneMiB * config.memory_capacity); } if (kwargs.contains("mutex_pool_capacity")) { config.mutex_pool_capacity = py::cast<uint32_t>(kwargs["mutex_pool_capacity"]); } if (kwargs.contains("list_padding")) { config.list_padding = py::cast<uint32_t>(kwargs["list_padding"]); } if (kwargs.contains("extra_shared_memory_size")) { config.extra_shared_memory_size = py::cast<uint32_t>(kwargs["extra_shared_memory_size"]); } if (kwargs.contains("record_stat")) { config.record_stat = py::cast<bool>(kwargs["record_stat"]); } return CuImage::cache(config); } else if (type.is_none()) { return CuImage::cache(); } throw std::invalid_argument( fmt::format("The first argument should be one of ['nocache', 'per_process', 'shared_memory'].")); } std::shared_ptr<cucim::profiler::Profiler> py_profiler(const py::kwargs& kwargs) { if (kwargs.empty()) { return CuImage::profiler(); } else { // Copy default profiler config to local cucim::profiler::ProfilerConfig config = cucim::CuImage::get_config()->profiler(); if (kwargs.contains("trace")) { config.trace = py::cast<bool>(kwargs["trace"]); } return CuImage::profiler(config); } } bool py_is_trace_enabled(py::object /* self */) { return CuImage::is_trace_enabled(); } json py_metadata(const CuImage& cuimg) { auto metadata = cuimg.metadata(); auto json_obj = json::parse(metadata.empty() ? "{}" : metadata); // Append basic metadata for the image auto item_iter = json_obj.emplace("cucim", json::object()); json& cucim_metadata = *(item_iter.first); cucim_metadata.emplace("path", cuimg.path()); cucim_metadata.emplace("ndim", cuimg.ndim()); cucim_metadata.emplace("dims", cuimg.dims()); cucim_metadata.emplace("shape", cuimg.shape()); { const auto& dtype = cuimg.dtype(); cucim_metadata.emplace( "dtype", json::object({ { "code", dtype.code }, { "bits", dtype.bits }, { "lanes", dtype.lanes } })); } cucim_metadata.emplace("typestr", cuimg.typestr()); cucim_metadata.emplace("channel_names", cuimg.channel_names()); cucim_metadata.emplace("spacing", cuimg.spacing()); cucim_metadata.emplace("spacing_units", cuimg.spacing_units()); cucim_metadata.emplace("origin", cuimg.origin()); cucim_metadata.emplace("direction", cuimg.direction()); cucim_metadata.emplace("coord_sys", cuimg.coord_sys()); { const auto& resolutions = cuimg.resolutions(); auto resolutions_iter = cucim_metadata.emplace("resolutions", json::object()); json& resolutions_metadata = *(resolutions_iter.first); auto level_count = resolutions.level_count(); resolutions_metadata.emplace("level_count", level_count); std::vector<std::vector<int64_t>> level_dimensions_vec; level_dimensions_vec.reserve(level_count); for (int level = 0; level < level_count; ++level) { level_dimensions_vec.emplace_back(resolutions.level_dimension(level)); } resolutions_metadata.emplace("level_dimensions", level_dimensions_vec); resolutions_metadata.emplace("level_downsamples", resolutions.level_downsamples()); std::vector<std::vector<uint32_t>> level_tile_sizes_vec; level_tile_sizes_vec.reserve(level_count); for (int level = 0; level < level_count; ++level) { level_tile_sizes_vec.emplace_back(resolutions.level_tile_size(level)); } resolutions_metadata.emplace("level_tile_sizes", level_tile_sizes_vec); } cucim_metadata.emplace("associated_images", cuimg.associated_images()); return json_obj; } py::dict py_resolutions(const CuImage& cuimg) { const auto& resolutions = cuimg.resolutions(); auto level_count = resolutions.level_count(); if (resolutions.level_count() == 0) { return py::dict{ "level_count"_a = pybind11::int_(0), // "level_dimensions"_a = pybind11::tuple(), // "level_downsamples"_a = pybind11::tuple(), // "level_tile_sizes"_a = pybind11::tuple() // }; } std::vector<py::tuple> level_dimensions_vec; level_dimensions_vec.reserve(level_count); std::vector<py::tuple> level_tile_sizes_vec; level_tile_sizes_vec.reserve(level_count); for (int level = 0; level < level_count; ++level) { level_dimensions_vec.emplace_back(vector2pytuple<pybind11::int_>(resolutions.level_dimension(level))); level_tile_sizes_vec.emplace_back(vector2pytuple<pybind11::int_>(resolutions.level_tile_size(level))); } py::tuple level_dimensions = vector2pytuple<const pybind11::tuple&>(level_dimensions_vec); py::tuple level_downsamples = vector2pytuple<pybind11::float_>(resolutions.level_downsamples()); py::tuple level_tile_sizes = vector2pytuple<const pybind11::tuple&>(level_tile_sizes_vec); return py::dict{ "level_count"_a = pybind11::int_(level_count), // "level_dimensions"_a = level_dimensions, // "level_downsamples"_a = level_downsamples, // "level_tile_sizes"_a = level_tile_sizes // }; } py::object py_read_region(const CuImage& cuimg, const py::iterable& location, std::vector<int64_t>&& size, int16_t level, uint32_t num_workers, uint32_t batch_size, bool drop_last, uint32_t prefetch_factor, bool shuffle, uint64_t seed, const io::Device& device, const py::object& buf, const std::string& shm_name, const py::kwargs& kwargs) { if (!size.empty() && size.size() != 2) { throw std::runtime_error("size (patch size) should be 2!"); } cucim::DimIndices indices; std::vector<int64_t> locations; { py::gil_scoped_acquire scope_guard; auto arr = pybind11::array_t<int64_t, py::array::c_style | py::array::forcecast>::ensure(location); if (arr) // fast copy { py::buffer_info buf = arr.request(); int64_t* data_array = static_cast<int64_t*>(buf.ptr); ssize_t data_size = buf.size; locations.reserve(data_size); locations.insert(locations.end(), &data_array[0], &data_array[data_size]); } else { auto iter = py::iter(location); while (iter != py::iterator::sentinel()) { if (py::isinstance<py::iterable>(*iter)) { auto iter2 = py::iter(*iter); while (iter2 != py::iterator::sentinel()) { locations.emplace_back(py::cast<int64_t>(*iter2)); ++iter2; } } else { locations.emplace_back(py::cast<int64_t>(*iter)); } ++iter; } } } if (kwargs) { std::vector<std::pair<char, int64_t>> indices_args; { py::gil_scoped_acquire scope_guard; for (auto item : kwargs) { auto key = std::string(py::str(item.first)); auto value = py::cast<int>(item.second); if (key.size() != 1) { throw std::invalid_argument( fmt::format("Argument name for Dimension should be a single character but '{}' is used.", key)); } char key_char = key[0] & ~32; if (key_char < 'A' || key_char > 'Z') { throw std::invalid_argument( fmt::format("Dimension character should be an alphabet but '{}' is used.", key)); } indices_args.emplace_back(std::make_pair(key_char, value)); } } indices = cucim::DimIndices(indices_args); } else { indices = cucim::DimIndices{}; } auto region_ptr = std::make_shared<cucim::CuImage>( std::move(cuimg.read_region(std::move(locations), std::move(size), level, num_workers, batch_size, drop_last, prefetch_factor, shuffle, seed, indices, device, nullptr, ""))); auto loader = region_ptr->loader(); if (batch_size > 1 || (loader && loader->size() > 1)) { auto iter_ptr = std::make_shared<CuImageIterator<CuImage>>(region_ptr->shared_from_this()); py::gil_scoped_acquire scope_guard; py::object iter = py::cast(iter_ptr, py::return_value_policy::take_ownership); return iter; } else { py::gil_scoped_acquire scope_guard; py::object region = py::cast(region_ptr); // Add `__array_interface__` or `__cuda_array_interface__` in runtime. _set_array_interface(region); return region; } } py::object py_associated_image(const CuImage& cuimg, const std::string& name, const io::Device& device) { auto image_ptr = std::make_shared<cucim::CuImage>(cuimg.associated_image(name, device)); { py::gil_scoped_acquire scope_guard; py::object image = py::cast(image_ptr); // Add `__array_interface__` or `__cuda_array_interface__` in runtime. _set_array_interface(image); return image; } } py::object py_cuimage_iterator_next(CuImageIterator<CuImage>& it) { bool stop_iteration = (it.index() == it.size()); if (stop_iteration) { throw py::stop_iteration(); } // Get the next batch of images. ++it; auto cuimg = *it; memory::DLTContainer container = cuimg->container(); DLTensor* tensor = static_cast<DLTensor*>(container); cucim::loader::ThreadBatchDataLoader* loader = cuimg->loader(); { py::gil_scoped_acquire scope_guard; py::object cuimg_obj = py::cast(cuimg); if (loader) { _set_array_interface(cuimg_obj); } return cuimg_obj; } } void _set_array_interface(const py::object& cuimg_obj) { const auto& cuimg = cuimg_obj.cast<const CuImage&>(); // TODO: using __array_struct__, access to array interface could be faster // (https://numpy.org/doc/stable/reference/arrays.interface.html#c-struct-access) // TODO: check the performance difference between python int vs python long later. loader::ThreadBatchDataLoader* loader = cuimg.loader(); memory::DLTContainer container = cuimg.container(); DLTensor* tensor = static_cast<DLTensor*>(container); if (!tensor) { return; } if (loader) { // Get the last available (batch) image. tensor->data = loader->data(); } if (tensor->data) { const char* type_str = container.numpy_dtype(); py::str typestr = py::str(type_str); py::tuple data = pybind11::make_tuple(py::int_(reinterpret_cast<uint64_t>(tensor->data)), py::bool_(false)); py::list descr; descr.append(py::make_tuple(""_s, typestr)); py::tuple shape = vector2pytuple<pybind11::int_>(cuimg.shape()); // Depending on container's memory type, expose either array_interface or cuda_array_interface switch (tensor->device.device_type) { case kDLCPU: { // Reference: https://numpy.org/doc/stable/reference/arrays.interface.html cuimg_obj.attr("__array_interface__") = py::dict{ "data"_a = data, "strides"_a = py::none(), "descr"_a = descr, "typestr"_a = typestr, "shape"_a = shape, "version"_a = py::int_(3) }; } break; case kDLCUDA: { // Reference: https://numba.readthedocs.io/en/stable/cuda/cuda_array_interface.html cuimg_obj.attr("__cuda_array_interface__") = py::dict{ "data"_a = data, "strides"_a = py::none(), "descr"_a = descr, "typestr"_a = typestr, "shape"_a = shape, "version"_a = py::int_(3), "mask"_a = py::none(), "stream"_a = 1 }; } break; default: break; } } else { switch (tensor->device.device_type) { case kDLCPU: { if (py::hasattr(cuimg_obj, "__array_interface__")) { py::delattr(cuimg_obj, "__array_interface__"); } } break; case kDLCUDA: { if (py::hasattr(cuimg_obj, "__cuda_array_interface__")) { py::delattr(cuimg_obj, "__cuda_array_interface__"); } } break; default: break; } } } } // namespace cucim
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/cache/cache_py.h
/* * Copyright (c) 2021, NVIDIA CORPORATcacheN. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_CACHE_INIT_H #define PYCUCIM_CACHE_INIT_H #include <optional> #include <vector> #include <pybind11/pybind11.h> namespace py = pybind11; namespace cucim::cache { // Forward declaration class ImageCache; void init_cache(py::module& m); bool py_record(ImageCache& cache, py::object value); py::dict py_config(ImageCache& cache); void py_image_cache_reserve(ImageCache& cache, uint32_t memory_capacity, py::kwargs kwargs); uint32_t py_preferred_memory_capacity(const py::object& img, const std::optional<const std::vector<uint64_t>>& image_size, const std::optional<const std::vector<uint32_t>>& tile_size, const std::optional<const std::vector<uint32_t>>& patch_size, uint32_t bytes_per_pixel); } // namespace cucim::cache #endif // PYCUCIM_CACHE_INIT_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/cache/image_cache_pydoc.h
/* * Copyright (c) 2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_CACHE_IMAGE_CACHE_PYDOC_H #define PYCUCIM_CACHE_IMAGE_CACHE_PYDOC_H #include "../macros.h" namespace cucim::cache::doc::ImageCache { // PYDOC(ImageCache, R"doc( // Constructor of ImageCache. // Args: // )doc") // virtual CacheType type() const; PYDOC(type, R"doc( A Cache type. )doc") PYDOC(config, R"doc( Returns the dictionary of configuration. )doc") // virtual uint32_t size() const = 0; PYDOC(size, R"doc( A size of list/hashmap. )doc") // virtual uint64_t memory_size() const = 0; PYDOC(memory_size, R"doc( A size of cache memory used. )doc") // virtual uint32_t capacity() const = 0; PYDOC(capacity, R"doc( A capacity of list/hashmap. )doc") // virtual uint64_t memory_capacity() const = 0; PYDOC(memory_capacity, R"doc( A capacity of cache memory. )doc") // virtual uint64_t free_memory() const = 0; PYDOC(free_memory, R"doc( A cache memory size available in the cache memory. )doc") // virtual void record(bool value) = 0; // virtual bool record() const = 0; PYDOC(record, R"doc( Records the cache statistics. )doc") // virtual uint64_t hit_count() const = 0; PYDOC(hit_count, R"doc( A cache hit count. )doc") // virtual uint64_t miss_count() const = 0; PYDOC(miss_count, R"doc( A cache miss count. )doc") // virtual void reserve(const ImageCacheConfig& config) = 0; PYDOC(reserve, R"doc( Reserves more memory if possible. )doc") } // namespace cucim::cache::doc::ImageCache #endif // PYCUCIM_CACHE_IMAGE_CACHE_PYDOC_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/cache/cache_py.cpp
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cache_py.h" #include "cache_pydoc.h" #include <pybind11/stl.h> #include <cucim/cache/image_cache.h> #include <cucim/cuimage.h> #include "image_cache_py.h" #include "image_cache_pydoc.h" using namespace pybind11::literals; namespace py = pybind11; namespace cucim::cache { void init_cache(py::module& cache) { py::enum_<CacheType>(cache, "CacheType") // .value("NoCache", CacheType::kNoCache) // .value("PerProcess", CacheType::kPerProcess) // .value("SharedMemory", CacheType::kSharedMemory); py::class_<ImageCache, std::shared_ptr<ImageCache>>(cache, "ImageCache") .def_property( "type", &ImageCache::type, nullptr, doc::ImageCache::doc_type, py::call_guard<py::gil_scoped_release>()) .def_property( "config", &py_config, nullptr, doc::ImageCache::doc_config, py::call_guard<py::gil_scoped_release>()) .def_property( "size", &ImageCache::size, nullptr, doc::ImageCache::doc_size, py::call_guard<py::gil_scoped_release>()) .def_property("memory_size", &ImageCache::memory_size, nullptr, doc::ImageCache::doc_memory_size, py::call_guard<py::gil_scoped_release>()) .def_property("capacity", &ImageCache::capacity, nullptr, doc::ImageCache::doc_capacity, py::call_guard<py::gil_scoped_release>()) .def_property("memory_capacity", &ImageCache::memory_capacity, nullptr, doc::ImageCache::doc_memory_capacity, py::call_guard<py::gil_scoped_release>()) .def_property("free_memory", &ImageCache::free_memory, nullptr, doc::ImageCache::doc_free_memory, py::call_guard<py::gil_scoped_release>()) .def("record", &py_record, doc::ImageCache::doc_record, // py::arg("value") = py::none()) .def_property("hit_count", &ImageCache::hit_count, nullptr, doc::ImageCache::doc_hit_count, py::call_guard<py::gil_scoped_release>()) .def_property("miss_count", &ImageCache::miss_count, nullptr, doc::ImageCache::doc_miss_count, py::call_guard<py::gil_scoped_release>()) .def("reserve", &py_image_cache_reserve, doc::ImageCache::doc_reserve, // py::arg("memory_capacity")); cache.def("preferred_memory_capacity", &py_preferred_memory_capacity, doc::doc_preferred_memory_capacity, // py::arg("img") = py::none(), // py::arg("image_size") = std::nullopt, // py::arg("tile_size") = std::nullopt, // py::arg("patch_size") = std::nullopt, // py::arg("bytes_per_pixel") = 3); } bool py_record(ImageCache& cache, py::object value) { if (value.is_none()) { return cache.record(); } else if (py::isinstance<py::bool_>(value)) { py::bool_ v = value.cast<py::bool_>(); cache.record(v); return v; } else { throw std::invalid_argument(fmt::format("Only 'NoneType' or 'bool' is available for the argument")); } } py::dict py_config(ImageCache& cache) { ImageCacheConfig& config = cache.config(); return py::dict{ "type"_a = pybind11::str(std::string(lookup_cache_type_str(config.type))), // "memory_capacity"_a = pybind11::int_(config.memory_capacity), // "capacity"_a = pybind11::int_(config.capacity), // "mutex_pool_capacity"_a = pybind11::int_(config.mutex_pool_capacity), // "list_padding"_a = pybind11::int_(config.list_padding), // "extra_shared_memory_size"_a = pybind11::int_(config.extra_shared_memory_size), // "record_stat"_a = pybind11::bool_(config.record_stat) // }; } void py_image_cache_reserve(ImageCache& cache, uint32_t memory_capacity, py::kwargs kwargs) { cucim::cache::ImageCacheConfig config = cucim::CuImage::get_config()->cache(); config.memory_capacity = memory_capacity; if (kwargs.contains("capacity")) { config.capacity = py::cast<uint32_t>(kwargs["capacity"]); } else { // Update capacity depends on memory_capacity. config.capacity = calc_default_cache_capacity(kOneMiB * memory_capacity); } cache.reserve(config); } uint32_t py_preferred_memory_capacity(const py::object& img, const std::optional<const std::vector<uint64_t>>& image_size, const std::optional<const std::vector<uint32_t>>& tile_size, const std::optional<const std::vector<uint32_t>>& patch_size, uint32_t bytes_per_pixel) { std::vector<uint64_t> param_image; std::vector<uint32_t> param_tile; std::vector<uint32_t> param_patch; if (!img.is_none()) { const CuImage& cuimg = *img.cast<cucim::CuImage*>(); std::vector<int64_t> image_size_vec = cuimg.size("XY"); param_image.insert(param_image.end(), image_size_vec.begin(), image_size_vec.end()); std::vector<uint32_t> tile_size_vec = cuimg.resolutions().level_tile_size(0); param_tile.insert(param_tile.end(), tile_size_vec.begin(), tile_size_vec.end()); // Calculate pixel size in bytes // (For example, if axes == "YXC" or "YXS", calculate [bytes per pixel] * [# items inside dims after 'X'] ) std::string dims = cuimg.dims(); std::size_t pivot = std::max(dims.rfind('X'), dims.rfind('Y')); if (pivot == std::string::npos) { bytes_per_pixel = 3; } else { if (pivot < dims.size()) { std::vector<int64_t> size_vec = cuimg.size(&dims.c_str()[pivot + 1]); int64_t item_count = 1; for (auto size : size_vec) { item_count *= size; } bytes_per_pixel = (cuimg.dtype().bits * item_count + 7) / 8; } } } else { if (!image_size || image_size->size() != 2) { throw std::invalid_argument( fmt::format("Please specify 'image_size' parameter (e.g., 'image_size=(100000, 100000)')!")); } if (!tile_size || tile_size->size() != 2) { param_tile = { kDefaultTileSize, kDefaultTileSize }; } } if (!patch_size || patch_size->size() != 2) { param_patch = { kDefaultPatchSize, kDefaultPatchSize }; } return preferred_memory_capacity(!param_image.empty() ? param_image : image_size.value(), // !param_tile.empty() ? param_tile : tile_size.value(), // !param_patch.empty() ? param_patch : patch_size.value(), // bytes_per_pixel); } } // namespace cucim::cache
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/cache/cache_pydoc.h
/* * Copyright (c) 2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_CACHE_PYDOC_H #define PYCUCIM_CACHE_PYDOC_H #include "../macros.h" namespace cucim::cache::doc { // py::int_ py_preferred_memory_capacity(const py::object& img, // const std::optional<const std::vector<uint64_t>>& image_size, // const std::optional<const std::vector<uint32_t>>& tile_size, // const std::optional<const std::vector<uint32_t>>& patch_size, // uint32_t bytes_per_pixel); PYDOC(preferred_memory_capacity, R"doc( Returns a good cache memory capacity value in MiB for the given conditions. Please see how the value is calculated: https://godbolt.org/z/8vxnPfKM5 Args: img: A `CuImage` object that can provide `image_size`, `tile_size`, `bytes_per_pixel` information. If this argument is provided, only `patch_size` from the arguments is used for the calculation. image_size: A list of values that presents the image size (width, height). tile_size: A list of values that presents the tile size (width, height). The default value is (256, 256). patch_size: A list of values that presents the patch size (width, height). The default value is (256, 256). bytes_per_pixel: The number of bytes that each pixel in the 2D image takes place. The default value is 3. Returns: int: The suggested memory capacity in MiB. )doc") } // namespace cucim::cache::doc #endif // PYCUCIM_CACHE_PYDOC_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/cache/image_cache_py.cpp
/* * Copyright (c) 2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "image_cache_py.h" #include "image_cache_pydoc.h" #include <pybind11/pybind11.h> namespace py = pybind11; namespace cucim::cache { } // namespace cucim::cache
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/cache/image_cache_py.h
/* * Copyright (c) 2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_CACHE_IMAGE_CACHE_PY_H #define PYCUCIM_CACHE_IMAGE_CACHE_PY_H #include <cucim/cache/image_cache.h> #include <pybind11/pytypes.h> namespace py = pybind11; namespace cucim::cache { } // namespace cucim::cache #endif // PYCUCIM_CACHE_IMAGE_CACHE_PY_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/profiler/profiler_py.cpp
/* * Copyright (c) 2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "profiler_py.h" #include "profiler_pydoc.h" #include <cucim/profiler/profiler.h> #include <cucim/cuimage.h> using namespace pybind11::literals; namespace py = pybind11; namespace cucim::profiler { void init_profiler(py::module& profiler) { py::class_<Profiler, std::shared_ptr<Profiler>>(profiler, "Profiler") .def_property("config", &py_config, nullptr, doc::Profiler::doc_config, py::call_guard<py::gil_scoped_release>()) .def("trace", &py_trace, doc::Profiler::doc_trace, py::call_guard<py::gil_scoped_release>(), // py::arg("value") = py::none() // ); } bool py_trace(Profiler& profiler, py::object value) { if (value.is_none()) { return profiler.trace(); } else if (py::isinstance<py::bool_>(value)) { py::bool_ v = value.cast<py::bool_>(); profiler.trace(v); return v; } else { throw std::invalid_argument(fmt::format("Only 'NoneType' or 'bool' is available for the argument")); } } py::dict py_config(Profiler& profiler) { ProfilerConfig& config = profiler.config(); return py::dict{ "trace"_a = pybind11::bool_(config.trace) // }; } } // namespace cucim::profiler
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/profiler/profiler_pydoc.h
/* * Copyright (c) 2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_PROFILER_PROFILER_PYDOC_H #define PYCUCIM_PROFILER_PROFILER_PYDOC_H #include "../macros.h" namespace cucim::profiler::doc::Profiler { PYDOC(config, R"doc( Returns the dictionary of configuration. )doc") // void trace(bool value) = 0; // bool trace() const = 0; PYDOC(trace, R"doc( Traces method executions with NVTX. )doc") } // namespace cucim::profiler::doc::Profiler #endif // PYCUCIM_PROFILER_PROFILER_PYDOC_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/profiler/profiler_py.h
/* * Copyright (c) 2021, NVIDIA CORPORATcacheN. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_PROFILER_INIT_H #define PYCUCIM_PROFILER_INIT_H #include <pybind11/pybind11.h> namespace py = pybind11; namespace cucim::profiler { // Forward declaration class Profiler; void init_profiler(py::module& m); bool py_trace(Profiler& profiler, py::object value); py::dict py_config(Profiler& profiler); } // namespace cucim::profiler #endif // PYCUCIM_PROFILER_INIT_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/filesystem/filesystem_pydoc.h
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_FILESYSTEM_PYDOC_H #define PYCUCIM_FILESYSTEM_PYDOC_H #include "../macros.h" namespace cucim::filesystem::doc { // bool is_gds_available(); PYDOC(is_gds_available, R"doc( Check if the GDS is available in the system. Returns: True if libcufile.so is loaded and cuFileDriverOpen() API call succeeds. )doc") // std::shared_ptr<CuFileDriver> open(const char* file_path, const char* flags = "r", mode_t mode = 0644); PYDOC(open, R"doc( Open file with specific flags and mode. 'flags' can be one of the following flag string: - "r": os.O_RDONLY - "r+": os.O_RDWR - "w": os.O_RDWR | os.O_CREAT | os.O_TRUNC - "a": os.O_RDWR | os.O_CREAT In addition to above flags, the method append os.O_CLOEXEC and os.O_DIRECT by default. The following is optional flags that can be added to above string: - 'p': Use POSIX APIs only (first try to open with O_DIRECT). It does not use GDS. - 'n': Do not add O_DIRECT flag. - 'm': Use memory-mapped file. This flag is supported only for the read-only file descriptor. When 'm' is used, `PROT_READ` and `MAP_SHARED` are used for the parameter of mmap() function. Args: file_path: A file path to open. flags: File flags in string. Default value is "r". mode: A file mode. Default value is '0o644'. Returns: An object of CuFileDriver. )doc") // bool close(const std::shared_ptr<CuFileDriver>& fd); PYDOC(close, R"doc( Closes the given file driver. Args: fd: An CuFileDriver object. Returns: True if succeed, False otherwise. )doc") // ssize_t pread(void* buf, size_t count, off_t file_offset, off_t buf_offset = 0); PYDOC(pread, R"doc( Reads up to `count` bytes from file driver `fd` at offset `offset` (from the start of the file) into the buffer `buf` starting at offset `buf_offset`. The file offset is not changed. Args: fd: An object of CuFileDriver. buf: A buffer where read bytes are stored. Buffer can be either in CPU memory or (CUDA) GPU memory. count: The number of bytes to read. file_offset: An offset from the start of the file. buf_offset: An offset from the start of the buffer. Default value is 0. Returns: The number of bytes read if succeed, -1 otherwise. )doc") // ssize_t pread(const std::shared_ptr<CuFileDriver>& fd, const void* buf, size_t count, off_t file_offset, off_t buf_offset = 0); PYDOC(pwrite, R"doc( Write up to `count` bytes from the buffer `buf` starting at offset `buf_offset` to the file driver `fd` at offset `offset` (from the start of the file). The file offset is not changed. Args: fd: An object of CuFileDriver. buf: A buffer where write bytes come from. Buffer can be either in CPU memory or (CUDA) GPU memory. count: The number of bytes to write. file_offset: An offset from the start of the file. buf_offset: An offset from the start of the buffer. Default value is 0. Returns: The number of bytes written if succeed, -1 otherwise. )doc") // bool discard_page_cache(const char* file_path); PYDOC(discard_page_cache, R"doc( Discards a system (page) cache for the given file path. Args: file_path: A file path to drop system cache. Returns: True if succeed, False otherwise. )doc") } // namespace cucim::filesystem::doc #endif // PYCUCIM_FILESYSTEM_PYDOC_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/filesystem/filesystem_py.cpp
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "filesystem_py.h" #include "filesystem_pydoc.h" #include <pybind11/pybind11.h> #include <cucim/filesystem/cufile_driver.h> #include "cufile_py.h" #include "cufile_pydoc.h" namespace py = pybind11; namespace cucim::filesystem { void init_filesystem(py::module& fs) { py::enum_<FileHandleType>(fs, "FileHandleType") // .value("Unknown", FileHandleType::kUnknown) // .value("Posix", FileHandleType::kPosix) // .value("PosixODirect", FileHandleType::kPosixODirect) // .value("MemoryMapped", FileHandleType::kMemoryMapped) // .value("GPUDirect", FileHandleType::kGPUDirect); py::class_<CuFileDriver, std::shared_ptr<CuFileDriver>>(fs, "CuFileDriver") .def(py::init<int, bool, bool, const char*>(), doc::CuFileDriver::doc_CuFileDriver, // py::arg("fd"), // py::arg("no_gds") = false, // py::arg("use_mmap") = false, // py::arg("file_path") = py::str(""), // py::call_guard<py::gil_scoped_release>()) .def("pread", &fd_pread, doc::CuFileDriver::doc_pread, // Do not release GIL as it would access properties of // python object py::arg("buf"), // py::arg("count"), // py::arg("file_offset"), // py::arg("buf_offset") = 0) // .def("pwrite", &fd_pwrite, doc::CuFileDriver::doc_pwrite, // Do not release GIL as it would access properties of // python object py::arg("buf"), // py::arg("count"), // py::arg("file_offset"), // py::arg("buf_offset") = 0) // .def("close", &CuFileDriver::close, doc::CuFileDriver::doc_close, py::call_guard<py::gil_scoped_release>()) // .def( "__enter__", [](const std::shared_ptr<CuFileDriver>& fd) { // return fd; // }, // py::call_guard<py::gil_scoped_release>()) .def( "__exit__", [](const std::shared_ptr<CuFileDriver>& fd, const py::object& type, const py::object& value, const py::object& traceback) { // fd->close(); // }, // py::call_guard<py::gil_scoped_release>()) .def("__repr__", [](const CuFileDriver& fd) { return fmt::format("<cucim.clara.filesystem.CuFileDriver path:{}>", fd.path()); }); fs.def("is_gds_available", &is_gds_available, doc::doc_is_gds_available, py::call_guard<py::gil_scoped_release>()) .def("open", &py_open, doc::doc_open, py::arg("file_path"), // py::arg("flags"), // py::arg("mode") = 0644, // py::call_guard<py::gil_scoped_release>()) .def("pread", &py_pread, doc::doc_pread, // Do not release GIL as it would access properties of python object py::arg("fd"), // py::arg("buf"), // py::arg("count"), // py::arg("file_offset"), // py::arg("buf_offset") = 0) // .def("pwrite", &py_pwrite, doc::doc_pwrite, // Do not release GIL as it would access properties of python object py::arg("fd"), // py::arg("buf"), // py::arg("count"), // py::arg("file_offset"), // py::arg("buf_offset") = 0) // .def("close", &close, doc::doc_close, py::call_guard<py::gil_scoped_release>()) .def("discard_page_cache", &discard_page_cache, doc::doc_discard_page_cache, py::arg("file_path"), // py::call_guard<py::gil_scoped_release>()); } std::shared_ptr<CuFileDriver> py_open(const char* file_path, const char* flags, mode_t mode) { return open(file_path, flags, mode); } ssize_t py_pread(const std::shared_ptr<CuFileDriver>& fd, py::object buf, size_t count, off_t file_offset, off_t buf_offset) { if (fd != nullptr) { return fd_pread(*fd, buf, count, file_offset, buf_offset); } else { fmt::print(stderr, "fd (CuFileDriver) is None!"); return -1; } } ssize_t py_pwrite(const std::shared_ptr<CuFileDriver>& fd, py::object buf, size_t count, off_t file_offset, off_t buf_offset) { if (fd != nullptr) { return fd_pwrite(*fd, buf, count, file_offset, buf_offset); } else { fmt::print(stderr, "fd (CuFileDriver) is None!"); return -1; } } } // namespace cucim::filesystem
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/filesystem/filesystem_py.h
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_FILESYSTEM_INIT_H #define PYCUCIM_FILESYSTEM_INIT_H #include <memory> #include <pybind11/pybind11.h> namespace py = pybind11; namespace cucim::filesystem { // Forward declaration class CuFileDriver; void init_filesystem(py::module& m); std::shared_ptr<CuFileDriver> py_open(const char* file_path, const char* flags, mode_t mode); ssize_t py_pread(const std::shared_ptr<CuFileDriver>& fd, py::object buf, size_t count, off_t file_offset, off_t buf_offset = 0); ssize_t py_pwrite(const std::shared_ptr<CuFileDriver>& fd, py::object buf, size_t count, off_t file_offset, off_t buf_offset = 0); // bool py_close(const std::shared_ptr<CuFileDriver>& fd); // bool py_discard_page_cache(const char* file_path); } #endif // PYCUCIM_FILESYSTEM_INIT_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/filesystem/cufile_pydoc.h
/* * Copyright (c) 2020, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_CUFILE_PYDOC_H #define PYCUCIM_CUFILE_PYDOC_H #include "../macros.h" namespace cucim::filesystem::doc::CuFileDriver { // CuFileDriver(int fd, bool no_gds = false, bool use_mmap = false, const char* file_path = ""); PYDOC(CuFileDriver, R"doc( Constructor of CuFileDriver. Args: fd: A file descriptor (in `int` type) which is available through `os.open()` method. no_gds: If True, use POSIX APIs only even when GDS can be supported for the file. use_mmap: If True, use memory-mapped IO. This flag is supported only for the read-only file descriptor. Default value is `False`. file_path: A file path for the file descriptor. It would retrieve the absolute file path of the file descriptor if not specified. )doc") // ssize_t pread(void* buf, size_t count, off_t file_offset, off_t buf_offset = 0); PYDOC(pread, R"doc( Reads up to `count` bytes from the file driver at offset `file_offset` (from the start of the file) into the buffer `buf` starting at offset `buf_offset`. The file offset is not changed. Args: buf: A buffer where read bytes are stored. Buffer can be either in CPU memory or (CUDA) GPU memory. count: The number of bytes to read. file_offset: An offset from the start of the file. buf_offset: An offset from the start of the buffer. Default value is 0. Returns: The number of bytes read if succeed, -1 otherwise. )doc") // ssize_t pwrite(const void* buf, size_t count, off_t file_offset, off_t buf_offset = 0); PYDOC(pwrite, R"doc( Reads up to `count` bytes from the file driver at offset `file_offset` (from the start of the file) into the buffer `buf` starting at offset `buf_offset`. The file offset is not changed. Args: buf: A buffer where write bytes come from. Buffer can be either in CPU memory or (CUDA) GPU memory. count: The number of bytes to write. file_offset: An offset from the start of the file. buf_offset: An offset from the start of the buffer. Default value is 0. Returns: The number of bytes written if succeed, -1 otherwise. )doc") // bool close(); PYDOC(close, R"doc( Closes opened file if not closed. )doc") } // namespace cucim::filesystem::doc::CuFileDriver #endif // PYCUCIM_CUFILE_PYDOC_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/filesystem/cufile_py.h
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_CUFILE_PY_H #define PYCUCIM_CUFILE_PY_H #include "cucim/filesystem/cufile_driver.h" #include <cstdio> #include <pybind11/pytypes.h> namespace py = pybind11; namespace cucim::filesystem { // Note: there would be name conflict with pread/pwrite in cufile_driver.h so prefixed 'fd_'. ssize_t fd_pread(const CuFileDriver& fd, const py::object& buf, size_t count, off_t file_offset, off_t buf_offset = 0); ssize_t fd_pwrite(CuFileDriver& fd, const py::object& buf, size_t count, off_t file_offset, off_t buf_offset = 0); } // namespace cucim::filesystem #endif // PYCUCIM_CUFILE_PY_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/filesystem/cufile_py.cpp
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cufile_py.h" #include "cufile_pydoc.h" #include <pybind11/pybind11.h> #include <cucim/filesystem/cufile_driver.h> #include "../memory/memory_py.h" namespace py = pybind11; namespace cucim::filesystem { ssize_t fd_pread(const CuFileDriver& fd, const py::object& obj, size_t count, off_t file_offset, off_t buf_offset) { void* buf = nullptr; size_t memory_size = 0; bool readonly = false; cucim::memory::get_memory_info(obj, &buf, nullptr, &memory_size, &readonly); if (buf == nullptr) { throw std::runtime_error("Cannot Recognize the array object!"); } if (readonly) { throw std::runtime_error("The buffer is readonly so cannot be used for pread!"); } if (memory_size && count > memory_size) { throw std::runtime_error(fmt::format("[Error] 'count' ({}) is larger than the size of the array object ({})!", count, memory_size)); } py::call_guard<py::gil_scoped_release>(); return fd.pread(buf, count, file_offset, buf_offset); } ssize_t fd_pwrite(CuFileDriver& fd, const py::object& obj, size_t count, off_t file_offset, off_t buf_offset) { void* buf = nullptr; size_t memory_size = 0; cucim::memory::get_memory_info(obj, &buf, nullptr, &memory_size, nullptr); if (buf == nullptr) { throw std::runtime_error("Cannot Recognize the array object!"); } if (memory_size && count > memory_size) { throw std::runtime_error(fmt::format("[Error] 'count' ({}) is larger than the size of the array object ({})!", count, memory_size)); } py::call_guard<py::gil_scoped_release>(); return fd.pwrite(buf, count, file_offset, buf_offset); } } // namespace cucim::filesystem
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/memory/memory_py.cpp
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "memory_py.h" #include "memory_pydoc.h" #include <pybind11/pybind11.h> #include <cucim/memory/memory_manager.h> namespace py = pybind11; namespace cucim::memory { void init_memory(py::module& memory) { } static size_t calculate_memory_size(const std::vector<size_t>& shape, const char* dtype_str) { // TODO: implement method to calculate size // https://github.com/pytorch/pytorch/blob/master/torch/tensor.py#L733 (we can take digit part) return 0; } void get_memory_info(const py::object& buf_obj, void** out_buf, cucim::io::Device* out_device, size_t* out_memory_size, bool* out_readonly) { if (out_buf == nullptr) { throw std::runtime_error("[Error] out_buf shouldn't be nullptr!"); } void* buf = nullptr; size_t memory_size = 0; if (py::hasattr(buf_obj, "__array_interface__")) { auto attr = py::getattr(buf_obj, "__array_interface__"); if (py::isinstance<py::dict>(attr)) { auto dict = py::cast<py::dict>(attr); if (dict.contains("data")) { auto data = dict["data"]; if (py::isinstance<py::tuple>(data)) { auto data_tuple = data.cast<py::tuple>(); if (data_tuple.size() == 2) { if (out_readonly) { *out_readonly = data_tuple[1].cast<bool>(); } buf = reinterpret_cast<void*>(data_tuple[0].cast<uint64_t>()); if (py::hasattr(buf_obj, "nbytes")) { memory_size = py::getattr(buf_obj, "nbytes").cast<size_t>(); } else { // TODO: implement method to calculate size } } } } } } else if (py::hasattr(buf_obj, "__cuda_array_interface__")) { auto attr = py::getattr(buf_obj, "__cuda_array_interface__"); if (py::isinstance<py::dict>(attr)) { auto dict = py::cast<py::dict>(attr); if (dict.contains("data")) { auto data = dict["data"]; if (py::isinstance<py::tuple>(data)) { auto data_tuple = data.cast<py::tuple>(); if (data_tuple.size() == 2) { if (out_readonly) { *out_readonly = data_tuple[1].cast<bool>(); } buf = reinterpret_cast<void*>(data_tuple[0].cast<uint64_t>()); if (py::hasattr(buf_obj, "nbytes")) { memory_size = py::getattr(buf_obj, "nbytes").cast<size_t>(); } else { // TODO: implement method to calculate size } } } } } } else if (py::isinstance<py::int_>(buf_obj)) { buf = reinterpret_cast<void*>(buf_obj.cast<uint64_t>()); } *out_buf = buf; if (out_memory_size) { *out_memory_size = memory_size; } if (buf == nullptr) { return; } if (out_device) { cucim::memory::PointerAttributes attributes; cucim::memory::get_pointer_attributes(attributes, buf); *out_device = attributes.device; } } } // namespace cucim::memory
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/memory/memory_py.h
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_MEMORY_INIT_H #define PYCUCIM_MEMORY_INIT_H #include <pybind11/pybind11.h> #include <cucim/io/device.h> namespace py = pybind11; namespace cucim::memory { void init_memory(py::module& m); void get_memory_info(const py::object& buf_obj, void** out_buf, cucim::io::Device* out_device = nullptr, size_t* out_memory_size = 0, bool* out_readonly = nullptr); } // namespace cucim::memory #endif // PYCUCIM_MEMORY_INIT_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/memory/memory_pydoc.h
/* * Copyright (c) 2020, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_MEMORY_PYDOC_H #define PYCUCIM_MEMORY_PYDOC_H #include "../macros.h" namespace cucim::memory::doc { } // namespace cucim::memory::doc #endif // PYCUCIM_MEMORY_PYDOC_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/io/device_pydoc.h
/* * Copyright (c) 2020, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_DEVICE_PYDOC_H #define PYCUCIM_DEVICE_PYDOC_H #include "../macros.h" namespace cucim::io::doc::Device { // explicit Device(); // explicit Device(const std::string& device_name); PYDOC(Device, R"doc( Constructor for `Device`. )doc") // Device(const char* device_name); // Device(DeviceType type, DeviceIndex index); // Device(DeviceType type, DeviceIndex index, const std::string& param); // static DeviceType parse_type(const std::string& device_name); PYDOC(parse_type, R"doc( Create `DeviceType` object from the device name string. )doc") // explicit operator std::string() const; // DeviceType type() const; PYDOC(type, R"doc( Device type. )doc") // DeviceIndex index() const; PYDOC(index, R"doc( Device index. )doc") } // namespace cucim::io::doc::Device #endif // PYCUCIM_DEVICE_PYDOC_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/io/io_py.h
/* * Copyright (c) 2020, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_IO_INIT_H #define PYCUCIM_IO_INIT_H #include <pybind11/pybind11.h> namespace py = pybind11; namespace cucim::io { void init_io(py::module& m); } #endif // PYCUCIM_IO_INIT_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/io/device_py.cpp
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "device_pydoc.h" #include <pybind11/pybind11.h> #include <cucim/io/device.h> namespace py = pybind11; namespace cucim::io { } // namespace cucim::io
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/io/io_pydoc.h
/* * Copyright (c) 2020, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PYCUCIM_IO_PYDOC_H #define PYCUCIM_IO_PYDOC_H #include "../macros.h" namespace cucim::io::doc { } #endif // PYCUCIM_IO_PYDOC_H
0
rapidsai_public_repos/cucim/python/pybind11
rapidsai_public_repos/cucim/python/pybind11/io/io_py.cpp
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "io_pydoc.h" #include "device_pydoc.h" #include <pybind11/pybind11.h> #include <cucim/io/device.h> namespace py = pybind11; namespace cucim::io { void init_io(py::module& io) { py::enum_<DeviceType>(io, "DeviceType") // .value("CPU", DeviceType::kCPU) // .value("CUDA", DeviceType::kCUDA) // .value("CUDAHost", DeviceType::kCUDAHost) // .value("CUDAManaged", DeviceType::kCUDAManaged) // .value("CPUShared", DeviceType::kCPUShared) // .value("CUDAShared", DeviceType::kCUDAShared); py::class_<Device>(io, "Device") // .def(py::init<const std::string&>(), doc::Device::doc_Device) // .def_static("parse_type", &Device::parse_type, doc::Device::doc_parse_type) // .def_property("type", &Device::type, nullptr, doc::Device::doc_type) // .def_property("index", &Device::index, nullptr, doc::Device::doc_index) .def("__repr__", [](const Device& device) { return std::string(device); }); } } // namespace cucim::io
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/test_data/gen_images.sh
#!/bin/bash SCRIPT_DIR=$(dirname "$(readlink -f "$0")") TOP="$(git rev-parse --show-toplevel 2> /dev/null || echo "${SCRIPT_DIR}")" [ -z "${TOP}" ] && >&2 echo "Repository root is not available!" && exit 1 DEST_FOLDER=${TOP}/test_data/generated mkdir -p ${DEST_FOLDER} generate_image() { local recipe="${1:-tiff}" local check_file="${2:-}" [ -n "${check_file}" ] && [ -f "${DEST_FOLDER}/${check_file}" ] && return python3 ${TOP}/python/cucim/tests/util/gen_image.py ${recipe} --dest ${DEST_FOLDER} } generate_image tiff::stripe:32x32:16 tiff_stripe_32x32_16.tif generate_image tiff::stripe:4096x4096:256:deflate tiff_stripe_4096x4096_256.tif
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/test_data/README.md
# Test Data Folder (`test_data` folder) Symbolic links for for this folder is available under the following subfolders: - `cpp/plugins/cucim.kit.cuslide` - `python/cucim` ## Generated Test Data (`test_data/generated` folder) Generated by executing `gen_images.sh`. - tiff_stripe_32x32_16.tif - tiff_stripe_4096x4096_256.tif ## Private Test Data (`test_data/private` folder) - `generic_tiff_000.tif` : 256x256 multi-resolution/tiled TIF conversion of `TUPAC-TR-467.svs` from the dataset of [Tumor Proliferation Assessment Challenge 2016](http://tupac.tue-image.nl/node/3) (TUPAC16 | MICCAI Grand Challenge) which are publicly available through [The Cancer Genome Atlas (TCGA)](https://www.cancer.gov/about-nci/organization/ccg/research/structural-genomics/tcga) under [CC BY 3.0 License](https://creativecommons.org/licenses/by/3.0/) - `philips_tiff_000.tif` : `normal_042.tif` from the [Camelyon16 challenge data](ftp://parrot.genomics.cn/gigadb/pub/10.5524/100001_101000/100439/CAMELYON16/training/normal/normal_042.tif) (another [link](https://camelyon17.grand-challenge.org/Data/)) which is under [CC0 License](https://choosealicense.com/licenses/cc0-1.0/)
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/test_data/push_testdata.sh
#!/bin/bash SCRIPT_DIR=$(dirname "$(readlink -f "$0")") docker build -t gigony/svs-testdata:little-big ${SCRIPT_DIR} docker push gigony/svs-testdata:little-big
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/test_data/Dockerfile
FROM scratch WORKDIR /input COPY ./input /input CMD ["dummy"]
0
rapidsai_public_repos/cucim/test_data
rapidsai_public_repos/cucim/test_data/input/README.md
# Test Dataset TUPAC-TR-488.svs and TUPAC-TR-467.svs are breast cancer cases (TCGA-BRCA) from the dataset of Tumor Proliferation Assessment Challenge 2016 (TUPAC16 | MICCAI Grand Challenge) which are publicly available through [The Cancer Genome Atlas (TCGA)](https://www.cancer.gov/about-nci/organization/ccg/research/structural-genomics/tcga) under [CC BY 3.0 License](https://creativecommons.org/licenses/by/3.0/) - Website: http://tupac.tue-image.nl/node/3 - Data link: https://drive.google.com/drive/u/0/folders/0B--ztKW0d17XYlBqOXppQmw0M2M - TUPAC-TR-467.svs : https://portal.gdc.cancer.gov/files/575c0465-c4bc-4ea7-ab63-ba48aa5e374b - TUPAC-TR-488.svs : https://portal.gdc.cancer.gov/files/e27c87c9-e163-4d55-8f27-4cc7dfca08d8 - License: CC BY 3.0 (https://wiki.cancerimagingarchive.net/display/Public/TCGA-BRCA#3539225f58e64731d8e47d588cedd99d300d5d6) - See LICENSE-3rdparty file ## Converted files - image.tif : 256x256 multi-resolution/tiled TIF conversion of TUPAC-TR-467.svs - image2.tif : 256x256 multi-resolution/tiled TIF conversion of TUPAC-TR-488.svs
0
rapidsai_public_repos/cucim/test_data
rapidsai_public_repos/cucim/test_data/input/LICENSE-3rdparty
Creative Commons Legal Code Attribution 3.0 Unported CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. License THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. 1. Definitions a. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. b. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. c. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. d. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. e. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. f. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. g. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. h. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. i. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. 2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: a. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; b. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; c. to Distribute and Publicly Perform the Work including as incorporated in Collections; and, d. to Distribute and Publicly Perform Adaptations. e. For the avoidance of doubt: i. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; ii. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, iii. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License. The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved. 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: a. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested. b. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. c. Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. 5. Representations, Warranties and Disclaimer UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 7. Termination a. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. b. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. 8. Miscellaneous a. Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. b. Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. c. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. d. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. e. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. f. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. Creative Commons Notice Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License. Creative Commons may be contacted at https://creativecommons.org/.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/gds/CMakeLists.txt
# # Copyright (c) 2020-2021, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # cucim_set_build_shared_libs(OFF) # Disable visibility to not expose unnecessary symbols set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN YES) # Set RPATH if (NOT APPLE) set(CMAKE_INSTALL_RPATH $ORIGIN) endif () ################################################################################ # Add library: cufile_stub ################################################################################ add_library(cufile_stub include/cufile_stub.h src/cufile_stub.cpp ) # Compile options set_target_properties(cufile_stub PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS NO # To prevent the error message: /usr/bin/ld: ../lib/libcufile_stub.a(cufile_stub.cpp.o): relocation R_X86_64_PC32 against symbol `__fatbinwrap_46_tmpxft_00005869_00000000_6_cufile_stub_cpp1_ii_1e2ddd49' can not be used when making a shared object; recompile with -fPIC POSITION_INDEPENDENT_CODE ON ) # Note: Looks like the following line causes error on CMake 3.18.4 (it is working on 3.18.2). Keeping it for now. set(CUCIM_REQUIRED_FEATURES cxx_std_17) target_compile_features(cufile_stub PRIVATE ${CUCIM_REQUIRED_FEATURES}) # Use generator expression to avoid `nvcc fatal : Value '-std=c++17' is not defined for option 'Werror'` target_compile_options(cufile_stub PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Werror -Wall -Wextra> ) ## Link libraries target_link_libraries(cufile_stub PUBLIC ${CMAKE_DL_LIBS} PRIVATE CUDA::cudart ) # Set GDS include path (cufile.h) if (DEFINED ENV{CONDA_BUILD} AND EXISTS $ENV{PREFIX}/include/cufile.h) set(GDS_INCLUDE_PATH "$ENV{PREFIX}/include") elseif (DEFINED ENV{CONDA_PREFIX} AND EXISTS $ENV{CONDA_PREFIX}/include/cufile.h) set(GDS_INCLUDE_PATH "$ENV{CONDA_PREFIX}/include") elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/include/cufile.h) set(GDS_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/include) else () set(GDS_INCLUDE_PATH /usr/local/cuda/include) endif () message("Set GDS_INCLUDE_PATH to '${GDS_INCLUDE_PATH}'.") # Enabling CUCIM_STATIC_GDS assumes that lib/libcufile_static.a and include/cufile.h is available # under ../temp/cuda folder. if (CUCIM_STATIC_GDS) add_library(deps::gds_static STATIC IMPORTED GLOBAL) if (DEFINED ENV{CONDA_BUILD}) set(GDS_STATIC_LIB_PATH "$ENV{PREFIX}/lib/libcufile_static.a") elseif (DEFINED ENV{CONDA_PREFIX}) set(GDS_STATIC_LIB_PATH "$ENV{CONDA_PREFIX}/lib/libcufile_static.a") elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/lib64/libcufile_static.a) set(GDS_STATIC_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/lib64/libcufile_static.a) else () set(GDS_STATIC_LIB_PATH /usr/local/cuda/lib64/libcufile_static.a) endif () message("Set GDS_STATIC_LIB_PATH to '${GDS_STATIC_LIB_PATH}'.") set_target_properties(deps::gds_static PROPERTIES IMPORTED_LOCATION "${GDS_STATIC_LIB_PATH}" INTERFACE_INCLUDE_DIRECTORIES "${GDS_INCLUDE_PATH}" ) target_link_libraries(cufile_stub PUBLIC ${CMAKE_DL_LIBS} PRIVATE deps::gds_static ) endif() target_compile_definitions(cufile_stub PUBLIC CUCIM_SUPPORT_GDS=$<BOOL:${CUCIM_SUPPORT_GDS}> CUCIM_STATIC_GDS=$<BOOL:${CUCIM_STATIC_GDS}> ) target_include_directories(cufile_stub PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${GDS_INCLUDE_PATH}> PRIVATE # Add path to cufile.h explicitly. ${TOP}/temp/cuda would be available by `./run copy_gds_files_` ${CMAKE_CURRENT_SOURCE_DIR}/../cpp/include # for including helper.h in cucim/dynlib ) add_library(deps::gds ALIAS cufile_stub) # Do not generate SONAME as this would be used as a stub library for building on CentOS until cufile has a static library. # Need to use IMPORTED_NO_SONAME when using this .so file. # : https://stackoverflow.com/questions/27261288/cmake-linking-shared-c-object-from-externalproject-produces-binaries-with-rel #set_target_properties(cufile_stub PROPERTIES NO_SONAME 1) #target_link_options(cufile_stub PRIVATE "LINKER:-soname=cufile.so") ## Build a fake libcufile.so #set_target_properties(cufile_stub PROPERTIES OUTPUT_NAME "cufile") # ################################################################################# ## Add tests ################################################################################# #add_subdirectory(tests) cucim_restore_build_shared_libs()
0
rapidsai_public_repos/cucim/gds
rapidsai_public_repos/cucim/gds/include/cufile_stub.h
/* * Copyright (c) 2020, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef CUCIM_CUFILE_STUB_H #define CUCIM_CUFILE_STUB_H #include "cufile.h" #include "cucim/dynlib/helper.h" class CuFileStub { public: void load(); void unload(); ~CuFileStub(); private: cucim::dynlib::LibraryHandle handle_ = nullptr; }; #endif // CUCIM_CUFILE_STUB_H
0
rapidsai_public_repos/cucim/gds
rapidsai_public_repos/cucim/gds/src/cufile_stub.cpp
/* * Copyright (c) 2020, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cufile_stub.h" #include "cucim/dynlib/helper.h" #include "cucim/util/platform.h" #define IMPORT_FUNCTION(handle, name) impl_##name = cucim::dynlib::get_library_symbol<t_##name>(handle, #name); typedef CUfileError_t (*t_cuFileHandleRegister)(CUfileHandle_t* fh, CUfileDescr_t* descr); typedef void (*t_cuFileHandleDeregister)(CUfileHandle_t fh); typedef CUfileError_t (*t_cuFileBufRegister)(const void* devPtr_base, size_t length, int flags); typedef CUfileError_t (*t_cuFileBufDeregister)(const void* devPtr_base); typedef ssize_t (*t_cuFileRead)(CUfileHandle_t fh, void* devPtr_base, size_t size, off_t file_offset, off_t devPtr_offset); typedef ssize_t (*t_cuFileWrite)( CUfileHandle_t fh, const void* devPtr_base, size_t size, off_t file_offset, off_t devPtr_offset); typedef CUfileError_t (*t_cuFileDriverOpen)(void); typedef CUfileError_t (*t_cuFileDriverClose)(void); typedef CUfileError_t (*t_cuFileDriverGetProperties)(CUfileDrvProps_t* props); typedef CUfileError_t (*t_cuFileDriverSetPollMode)(bool poll, size_t poll_threshold_size); typedef CUfileError_t (*t_cuFileDriverSetMaxDirectIOSize)(size_t max_direct_io_size); typedef CUfileError_t (*t_cuFileDriverSetMaxCacheSize)(size_t max_cache_size); typedef CUfileError_t (*t_cuFileDriverSetMaxPinnedMemSize)(size_t max_pinned_size); static t_cuFileHandleRegister impl_cuFileHandleRegister = nullptr; static t_cuFileHandleDeregister impl_cuFileHandleDeregister = nullptr; static t_cuFileBufRegister impl_cuFileBufRegister = nullptr; static t_cuFileBufDeregister impl_cuFileBufDeregister = nullptr; static t_cuFileRead impl_cuFileRead = nullptr; static t_cuFileWrite impl_cuFileWrite = nullptr; static t_cuFileDriverOpen impl_cuFileDriverOpen = nullptr; static t_cuFileDriverClose impl_cuFileDriverClose = nullptr; static t_cuFileDriverGetProperties impl_cuFileDriverGetProperties = nullptr; static t_cuFileDriverSetPollMode impl_cuFileDriverSetPollMode = nullptr; static t_cuFileDriverSetMaxDirectIOSize impl_cuFileDriverSetMaxDirectIOSize = nullptr; static t_cuFileDriverSetMaxCacheSize impl_cuFileDriverSetMaxCacheSize = nullptr; static t_cuFileDriverSetMaxPinnedMemSize impl_cuFileDriverSetMaxPinnedMemSize = nullptr; void CuFileStub::load() { #if !CUCIM_SUPPORT_GDS return; #endif #if !CUCIM_STATIC_GDS if (handle_ == nullptr) { // Note: Load the dynamic library with RTLD_NODELETE flag because libcufile.so uses thread_local which can // cause a segmentation fault if the library is dynamically loaded/unloaded. (See #158) // CUDA versions before CUDA 11.7.1 did not ship libcufile.so.0, so this is // a workaround that adds support for all prior versions of libcufile. handle_ = cucim::dynlib::load_library( { "libcufile.so.0", "libcufile.so.1.3.0" /* 11.7.0 */, "libcufile.so.1.2.1" /* 11.6.2, 11.6.1 */, "libcufile.so.1.2.0" /* 11.6.0 */, "libcufile.so.1.1.1" /* 11.5.1 */, "libcufile.so.1.1.0" /* 11.5.0 */, "libcufile.so.1.0.2" /* 11.4.4, 11.4.3, 11.4.2 */, "libcufile.so.1.0.1" /* 11.4.1 */, "libcufile.so.1.0.0" /* 11.4.0 */ }, RTLD_LAZY | RTLD_LOCAL | RTLD_NODELETE); if (handle_ == nullptr) { return; } IMPORT_FUNCTION(handle_, cuFileDriverOpen); IMPORT_FUNCTION(handle_, cuFileHandleRegister); IMPORT_FUNCTION(handle_, cuFileHandleDeregister); IMPORT_FUNCTION(handle_, cuFileBufRegister); IMPORT_FUNCTION(handle_, cuFileBufDeregister); IMPORT_FUNCTION(handle_, cuFileRead); IMPORT_FUNCTION(handle_, cuFileWrite); IMPORT_FUNCTION(handle_, cuFileDriverOpen); IMPORT_FUNCTION(handle_, cuFileDriverClose); IMPORT_FUNCTION(handle_, cuFileDriverGetProperties); IMPORT_FUNCTION(handle_, cuFileDriverSetPollMode); IMPORT_FUNCTION(handle_, cuFileDriverSetMaxDirectIOSize); IMPORT_FUNCTION(handle_, cuFileDriverSetMaxCacheSize); IMPORT_FUNCTION(handle_, cuFileDriverSetMaxPinnedMemSize); } #endif } void CuFileStub::unload() { #if !CUCIM_SUPPORT_GDS return; #endif #if !CUCIM_STATIC_GDS if (handle_) { cucim::dynlib::unload_library(handle_); handle_ = nullptr; impl_cuFileDriverOpen = nullptr; impl_cuFileHandleRegister = nullptr; impl_cuFileHandleDeregister = nullptr; impl_cuFileBufRegister = nullptr; impl_cuFileBufDeregister = nullptr; impl_cuFileRead = nullptr; impl_cuFileWrite = nullptr; impl_cuFileDriverOpen = nullptr; impl_cuFileDriverClose = nullptr; impl_cuFileDriverGetProperties = nullptr; impl_cuFileDriverSetPollMode = nullptr; impl_cuFileDriverSetMaxDirectIOSize = nullptr; impl_cuFileDriverSetMaxCacheSize = nullptr; impl_cuFileDriverSetMaxPinnedMemSize = nullptr; } #endif } CuFileStub::~CuFileStub() { // Note: unload() would be called explicitly by CuFileDriverInitializer to unload the shared library after // calling cuFileDriverClose() in CuFileDriverInitializer::~CuFileDriverInitializer() // unload(); } #if __cplusplus extern "C" { #endif #if !CUCIM_STATIC_GDS CUfileError_t cuFileHandleRegister(CUfileHandle_t* fh, CUfileDescr_t* descr) { if (impl_cuFileHandleRegister) { return impl_cuFileHandleRegister(fh, descr); } return CUfileError_t{ CU_FILE_DRIVER_NOT_INITIALIZED, CUDA_SUCCESS }; } void cuFileHandleDeregister(CUfileHandle_t fh) { if (impl_cuFileHandleDeregister) { impl_cuFileHandleDeregister(fh); } } CUfileError_t cuFileBufRegister(const void* devPtr_base, size_t length, int flags) { if (impl_cuFileBufRegister) { return impl_cuFileBufRegister(devPtr_base, length, flags); } return CUfileError_t{ CU_FILE_DRIVER_NOT_INITIALIZED, CUDA_SUCCESS }; } CUfileError_t cuFileBufDeregister(const void* devPtr_base) { if (impl_cuFileBufDeregister) { return impl_cuFileBufDeregister(devPtr_base); } return CUfileError_t{ CU_FILE_DRIVER_NOT_INITIALIZED, CUDA_SUCCESS }; } ssize_t cuFileRead(CUfileHandle_t fh, void* devPtr_base, size_t size, off_t file_offset, off_t devPtr_offset) { if (impl_cuFileRead) { return impl_cuFileRead(fh, devPtr_base, size, file_offset, devPtr_offset); } return -1; } ssize_t cuFileWrite(CUfileHandle_t fh, const void* devPtr_base, size_t size, off_t file_offset, off_t devPtr_offset) { if (impl_cuFileWrite) { return impl_cuFileWrite(fh, devPtr_base, size, file_offset, devPtr_offset); } return -1; } CUfileError_t cuFileDriverOpen(void) { // GDS v1.0.0 does not support WSL and executing this can cause the following error: // Assertion failure, file index :cufio-udev line :143 // So we do not call impl_cuFileDriverOpen() here if the current platform is WSL. if (impl_cuFileDriverOpen) { // If not in WSL, call impl_cuFileDriverOpen() if (!cucim::util::is_in_wsl()) { return impl_cuFileDriverOpen(); } } return CUfileError_t{ CU_FILE_DRIVER_NOT_INITIALIZED, CUDA_SUCCESS }; } CUfileError_t cuFileDriverClose(void) { if (impl_cuFileDriverClose) { return impl_cuFileDriverClose(); } return CUfileError_t{ CU_FILE_DRIVER_NOT_INITIALIZED, CUDA_SUCCESS }; } CUfileError_t cuFileDriverGetProperties(CUfileDrvProps_t* props) { if (impl_cuFileDriverGetProperties) { return impl_cuFileDriverGetProperties(props); } return CUfileError_t{ CU_FILE_DRIVER_NOT_INITIALIZED, CUDA_SUCCESS }; } CUfileError_t cuFileDriverSetPollMode(bool poll, size_t poll_threshold_size) { if (impl_cuFileDriverSetPollMode) { return impl_cuFileDriverSetPollMode(poll, poll_threshold_size); } return CUfileError_t{ CU_FILE_DRIVER_NOT_INITIALIZED, CUDA_SUCCESS }; } CUfileError_t cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) { if (impl_cuFileDriverSetMaxDirectIOSize) { return impl_cuFileDriverSetMaxDirectIOSize(max_direct_io_size); } return CUfileError_t{ CU_FILE_DRIVER_NOT_INITIALIZED, CUDA_SUCCESS }; } CUfileError_t cuFileDriverSetMaxCacheSize(size_t max_cache_size) { if (impl_cuFileDriverSetMaxCacheSize) { return impl_cuFileDriverSetMaxCacheSize(max_cache_size); } return CUfileError_t{ CU_FILE_DRIVER_NOT_INITIALIZED, CUDA_SUCCESS }; } CUfileError_t cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) { if (impl_cuFileDriverSetMaxPinnedMemSize) { return impl_cuFileDriverSetMaxPinnedMemSize(max_pinned_size); } return CUfileError_t{ CU_FILE_DRIVER_NOT_INITIALIZED, CUDA_SUCCESS }; } #endif #if __cplusplus } #endif
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.abseil-cpp
Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.googletest
Copyright 2008, Google Inc. 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 Google Inc. 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.fmt
Copyright (c) 2012 - present, Victor Zverovich 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. --- Optional exception to the license --- As an exception, if, as a result of your compiling your source code, portions of this Software are embedded into a machine-executable object form of such source code, you may redistribute such embedded portions in such object form without including the above copyright and permission notices.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.StainTools
MIT License Copyright (c) 2018 Peter Byfield 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.pytorch
From PyTorch: Copyright (c) 2016- Facebook, Inc (Adam Paszke) Copyright (c) 2014- Facebook, Inc (Soumith Chintala) Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) Copyright (c) 2011-2013 NYU (Clement Farabet) Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston) Copyright (c) 2006 Idiap Research Institute (Samy Bengio) Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz) From Caffe2: Copyright (c) 2016-present, Facebook Inc. All rights reserved. All contributions by Facebook: Copyright (c) 2016 Facebook Inc. All contributions by Google: Copyright (c) 2015 Google Inc. All rights reserved. All contributions by Yangqing Jia: Copyright (c) 2015 Yangqing Jia All rights reserved. All contributions by Kakao Brain: Copyright 2019-2020 Kakao Brain All contributions from Caffe: Copyright(c) 2013, 2014, 2015, the respective contributors All rights reserved. All other contributions: Copyright(c) 2015, 2016 the respective contributors All rights reserved. Caffe2 uses a copyright model similar to Caffe: each contributor holds copyright over their contributions to Caffe2. The project versioning records all such contribution and copyright details. If a contributor wants to further mark their specific copyright on a particular contribution, they should indicate their copyright solely in the commit message of the change when it is committed. 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 names of Facebook, Deepmind Technologies, NYU, NEC Laboratories America and IDIAP Research Institute 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.dockcross
Copyright (c) 2015, 2016, 2017, 2018, 2021 Steeve Morin, Rob Burns, Matthew McCormick, Jean-Christophe-Fillion-Robin, Bensuperpc 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.pugixml
MIT License Copyright (c) 2006-2020 Arseny Kapoulkine 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.libcuckoo
Copyright (C) 2013, Carnegie Mellon University and Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --------------------------- The third-party libraries have their own licenses, as detailed in their source files.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.dask
BSD 3-Clause License Copyright (c) 2014-2018, Anaconda, Inc. and 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: * 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 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 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.tifffile
BSD 3-Clause License Copyright (c) 2008-2020, Christoph Gohlke 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 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.libtiff
Copyright (c) 1988-1997 Sam Leffler Copyright (c) 1991-1997 Silicon Graphics, Inc. Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that (i) the above copyright notices and this permission notice appear in all copies of the software and related documentation, and (ii) the names of Sam Leffler and Silicon Graphics may not be used in any advertising or publicity relating to the software without the specific, prior written permission of Sam Leffler and Silicon Graphics. THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.pytest
The MIT License (MIT) Copyright (c) 2004-2020 Holger Krekel and others 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.aicsimageio
Copyright 2020 Allen Institute for Cell Science 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 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.openslide
OpenSlide Carnegie Mellon University and others https://openslide.org/ ==================== Unless otherwise specified, this code is copyright Carnegie Mellon University. This code is licensed under the GNU LGPL version 2.1, not any later version. See the file lgpl-2.1.txt for the text of the license. OpenSlide 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.click
Copyright 2014 Pallets 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 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.benchmark
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.spdlog
The MIT License (MIT) Copyright (c) 2016 Gabi Melman. 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. -- NOTE: Third party dependency used by this software -- This software depends on the fmt lib (MIT License), and users must comply to its license: https://github.com/fmtlib/fmt/blob/master/LICENSE.rst
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.pybind11
Copyright (c) 2016 Wenzel Jakob <[email protected]>, 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 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. Please also refer to the file .github/CONTRIBUTING.md, which clarifies licensing of external contributions to this project including patches, pull requests, etc.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.gputil
MIT License Copyright (c) 2017 anderskm 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.taskflow
TASKFLOW MIT LICENSE Copyright (c) 2018-2021 Dr. Tsung-Wei Huang 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.psutil
BSD 3-Clause License Copyright (c) 2009, Jay Loden, Dave Daeschler, Giampaolo Rodola' 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 psutil authors 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.libdeflate
Copyright 2016 Eric Biggers 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.Catch2
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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.pybind11_json
BSD 3-Clause License Copyright (c) 2019, 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 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 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.NVTX
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- LLVM Exceptions to the Apache 2.0 License ---- As an exception, if, as a result of your compiling your source code, portions of this Software are embedded into an Object form of such source code, you may redistribute such embedded portions in such Object form without complying with the conditions of Sections 4(a), 4(b) and 4(d) of the License. In addition, if you combine or link compiled forms of this Software with software that is licensed under the GPLv2 ("Combined Software") and if a court of competent jurisdiction determines that the patent provision (Section 3), the indemnity provision (Section 9) or other Section of the License conflicts with the conditions of the GPLv2, you may retroactively and prospectively choose to deem waived or otherwise exclude such Section(s) of the License, but only in their entirety and only with respect to the Combined Software.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.cuda
End User 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: Mar 24, 2021. 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 software. 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 This package includes over 100+ CUDA examples that demonstrate various CUDA programming principles, and efficient CUDA implementation of algorithms in specific application domains. Default Install Location of CUDA Samples Windows platform: %ProgramData%\NVIDIA Corporation\CUDA Samples\v#.# Linux platform: /usr/local/cuda-#.#/samples and $HOME/NVIDIA_CUDA-#.#_Samples Mac platform: /Developer/NVIDIA/CUDA-#.#/samples 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. Third Party Licenses The SDK may come bundled with, or otherwise include or be distributed with, third party software licensed by a NVIDIA supplier and/or open source software provided under an open source license. Use of third party software is subject to the third-party license terms, or in the absence of third party terms, the terms of this Agreement. Copyright to third party software is held by the copyright holders indicated in the third-party software or license. 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. Unless you have an agreement with NVIDIA for this purpose, you may not use the SDK with any system or application where the use or failure of the system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss. Examples include use in avionics, navigation, military, medical, life support or other life critical applications. NVIDIA does not design, test or manufacture the SDK for these critical uses and 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. 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 your use of the SDK outside of the scope of this Agreement, or not in compliance with its terms. 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 SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR 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 as those laws are applied to contracts entered into and performed entirely within Delaware by Delaware residents, 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 a resident or citizen of any country currently embargoed by the U.S. and that you are not otherwise prohibited from receiving the SDK. 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 [email protected]. 2.6. Attachment A The following CUDA Toolkit files may be distributed with Licensee 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 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 Component NVIDIA Optimizing Compiler Library Windows nvvm.dll Mac OSX libnvvm.dylib Linux libnvvm.so 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 Component NVIDIA CUDA File IO Libraries and Header All cufile.h Linux libcufile.so, libcufile_rdma.so, libcufile_static.a, libcufile_rdma_static.a The NVIDIA CUDA Driver Libraries are only distributable in applications that meet this criteria: 1. The application was developed starting from a NVIDIA CUDA container obtained from Docker Hub or the NVIDIA GPU Cloud, and 2. The resulting application is packaged as a Docker container and distributed to users on Docker Hub or the NVIDIA GPU Cloud only. 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 [email protected]. 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 (e.g. nvprof) 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 ([email protected]) David Keyes ([email protected]) Hatem Ltaief ([email protected]) 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 . -----------------
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.dask-cuda
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2019 NVIDIA Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.scifio
Copyright (c) 2011 - 2020, SCIFIO developers. 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.CLI11
CLI11 1.8 Copyright (c) 2017-2019 University of Cincinnati, developed by Henry Schreiner under NSF AWARD 1414736. All rights reserved. Redistribution and use in source and binary forms of CLI11, 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 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.opencv-contrib-python
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.libjpeg-turbo
libjpeg-turbo Licenses ====================== libjpeg-turbo is covered by three compatible BSD-style open source licenses: - The IJG (Independent JPEG Group) License, which is listed in [README.ijg](README.ijg) This license applies to the libjpeg API library and associated programs (any code inherited from libjpeg, and any modifications to that code.) - The Modified (3-clause) BSD License, which is listed below This license covers the TurboJPEG API library and associated programs, as well as the build system. - The [zlib License](https://opensource.org/licenses/Zlib) This license is a subset of the other two, and it covers the libjpeg-turbo SIMD extensions. Complying with the libjpeg-turbo Licenses ========================================= This section provides a roll-up of the libjpeg-turbo licensing terms, to the best of our understanding. 1. If you are distributing a modified version of the libjpeg-turbo source, then: 1. You cannot alter or remove any existing copyright or license notices from the source. **Origin** - Clause 1 of the IJG License - Clause 1 of the Modified BSD License - Clauses 1 and 3 of the zlib License 2. You must add your own copyright notice to the header of each source file you modified, so others can tell that you modified that file (if there is not an existing copyright header in that file, then you can simply add a notice stating that you modified the file.) **Origin** - Clause 1 of the IJG License - Clause 2 of the zlib License 3. You must include the IJG README file, and you must not alter any of the copyright or license text in that file. **Origin** - Clause 1 of the IJG License 2. If you are distributing only libjpeg-turbo binaries without the source, or if you are distributing an application that statically links with libjpeg-turbo, then: 1. Your product documentation must include a message stating: This software is based in part on the work of the Independent JPEG Group. **Origin** - Clause 2 of the IJG license 2. If your binary distribution includes or uses the TurboJPEG API, then your product documentation must include the text of the Modified BSD License (see below.) **Origin** - Clause 2 of the Modified BSD License 3. You cannot use the name of the IJG or The libjpeg-turbo Project or the contributors thereof in advertising, publicity, etc. **Origin** - IJG License - Clause 3 of the Modified BSD License 4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be free of defects, nor do we accept any liability for undesirable consequences resulting from your use of the software. **Origin** - IJG License - Modified BSD License - zlib License The Modified (3-clause) BSD License =================================== Copyright (C)2009-2020 D. R. Commander. All Rights Reserved. Copyright (C)2015 Viktor Szathmáry. 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 libjpeg-turbo Project 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. Why Three Licenses? =================== The zlib License could have been used instead of the Modified (3-clause) BSD License, and since the IJG License effectively subsumes the distribution conditions of the zlib License, this would have effectively placed libjpeg-turbo binary distributions under the IJG License. However, the IJG License specifically refers to the Independent JPEG Group and does not extend attribution and endorsement protections to other entities. Thus, it was desirable to choose a license that granted us the same protections for new code that were granted to the IJG for code derived from their software.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.zarr-python
The MIT License (MIT) Copyright (c) 2015-2018 Zarr Developers <https://github.com/zarr-developers> 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.pytest-lazy-fixture
The MIT License (MIT) Copyright (c) 2016 Marsel Zaripov 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.folly
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Files in folly/external/farmhash licensed as follows Copyright (c) 2014 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.pba+
MIT License Copyright (c) 2019 School of Computing, National University of Singapore 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.rmm
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.numpy
Copyright (c) 2005-2020, NumPy Developers. 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 NumPy Developers nor the names of any 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.cupy
Copyright (c) 2015 Preferred Infrastructure, Inc. Copyright (c) 2015 Preferred Networks, 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.scikit-image
Copyright (C) 2019, the scikit-image team 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 skimage 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. skimage/_shared/version_requirements.py:_check_version Copyright (c) 2013 The IPython Development Team 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 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 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. skimage/_shared/version_requirements.py:is_installed: Original Copyright (C) 2009-2011 Pierre Raybaut 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.boost
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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.json
MIT License Copyright (c) 2013-2020 Niels Lohmann 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.
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/3rdparty/LICENSE.nvjpeg2000
Software License Agreement -------------------------- LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS 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. License. 1.1 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: (i) Install and use the SDK, (ii) Modify and create derivative works of sample source code delivered in the SDK, and (iii) 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.2 Distribution Requirements These are the distribution requirements for you to exercise the distribution grant: (i) Your application must have material additional functionality, beyond the included portions of the SDK. (ii) The distributable portions of the SDK shall only be accessed by your application. (iii) 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.” (iv) Unless a developer tool is identified in this Agreement as distributable, it is delivered for your internal use only. (v) 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. (vi) 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.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.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.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.6 Third Party Licenses The SDK may come bundled with, or otherwise include or be distributed with, third party software licensed by a NVIDIA supplier and/or open source software provided under an open source license. Use of third party software is subject to the third-party license terms, or in the absence of third party terms, the terms of this Agreement. Copyright to third party software is held by the copyright holders indicated in the third-party software or license. 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. 2. Limitations. The following license limitations apply to your use of the SDK: 2.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.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. 2.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. 2.4 You may not bypass, disable, or circumvent any encryption, security, digital rights management or authentication mechanism in the SDK. 2.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 (i) disclosed or distributed in source code form; (ii) licensed for the purpose of making derivative works; or (iii) redistributable at no charge. 2.6 Unless you have an agreement with NVIDIA for this purpose, you may not use the SDK with any system or application where the use or failure of the system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss. Examples include use in avionics, navigation, military, medical, life support or other life critical applications. NVIDIA does not design, test or manufacture the SDK for these critical uses and 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. 2.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 your use of the SDK outside of the scope of this Agreement, or not in compliance with its terms. 3. Ownership. 3.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 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. 3.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 3.1. 3.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. 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. 5. Limitations of Liability. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR 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. 6. Termination. 6.1 This Agreement will continue to apply until terminated by either you or NVIDIA as described below. 6.2 If you want to terminate this Agreement, you may do so by stopping to use the SDK. 6.3 NVIDIA may, at any time, terminate this Agreement if: (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); (ii) you commence or participate in any legal proceeding against NVIDIA with respect to the SDK; or (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. 6.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 licenses granted to you. 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 as those laws are applied to contracts entered into and performed entirely within Delaware by Delaware residents, 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 (b)(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 a resident or citizen of any country currently embargoed by the U.S. and that you are not otherwise prohibited from receiving the SDK. 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. (v. January 28, 2020) nvJPEG2K SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS The terms in this supplement govern your use of the NVIDIA nvJPEG2K 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. 4.1 License Scope. The SDK is licensed for you to develop applications only for use in systems with NVIDIA GPUs. 2. Distribution. The following portions of the SDK are distributable under the Agreement: the runtime files .so and .h, and libnvjpeg2k_static.a. 3. 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 [email protected]. (v. August 27, 2020)
0
rapidsai_public_repos/cucim/conda
rapidsai_public_repos/cucim/conda/environments/all_cuda-120_arch-x86_64.yaml
# This file is generated by `rapids-dependency-file-generator`. # To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. channels: - rapidsai - rapidsai-nightly - conda-forge - nvidia dependencies: - GPUtil>=1.4.0 - c-compiler - click - cmake>=3.23.1,!=3.25.0 - cuda-cudart-dev - cuda-nvcc - cuda-version=12.0 - cupy>=12.0.0 - cxx-compiler - gcc_linux-64=11.* - imagecodecs>=2021.6.8 - ipython - jbig - lazy_loader>=0.1 - libcufile-dev - libnvjpeg-dev - libnvjpeg-static - libwebp-base - matplotlib-base - nbsphinx - ninja - numpy>=1.21.3 - numpydoc - openslide-python>=1.1.2 - pip - pooch>=1.6.0 - pre-commit - psutil>=5.8.0 - pydata-sphinx-theme - pytest-cov>=2.12.1 - pytest-lazy-fixture>=0.6.3 - pytest-xdist - pytest>=6.2.4 - python>=3.8,<3.11 - recommonmark - scikit-image>=0.19.0,<0.22.0a0 - scipy - sphinx<6 - sysroot_linux-64==2.17 - tifffile>=2022.7.28 - xz - yasm - zlib - zstd - pip: - opencv-python-headless>=4.6 name: all_cuda-120_arch-x86_64
0
rapidsai_public_repos/cucim/conda
rapidsai_public_repos/cucim/conda/environments/all_cuda-118_arch-x86_64.yaml
# This file is generated by `rapids-dependency-file-generator`. # To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. channels: - rapidsai - rapidsai-nightly - conda-forge - nvidia dependencies: - GPUtil>=1.4.0 - c-compiler - click - cmake>=3.23.1,!=3.25.0 - cuda-version=11.8 - cudatoolkit - cupy>=12.0.0 - cxx-compiler - gcc_linux-64=11.* - imagecodecs>=2021.6.8 - ipython - jbig - lazy_loader>=0.1 - libcufile-dev=1.4.0.31 - libcufile=1.4.0.31 - libnvjpeg-dev=11.6.0.55 - libnvjpeg=11.6.0.55 - libwebp-base - matplotlib-base - nbsphinx - ninja - numpy>=1.21.3 - numpydoc - nvcc_linux-64=11.8 - openslide-python>=1.1.2 - pip - pooch>=1.6.0 - pre-commit - psutil>=5.8.0 - pydata-sphinx-theme - pytest-cov>=2.12.1 - pytest-lazy-fixture>=0.6.3 - pytest-xdist - pytest>=6.2.4 - python>=3.8,<3.11 - recommonmark - scikit-image>=0.19.0,<0.22.0a0 - scipy - sphinx<6 - sysroot_linux-64==2.17 - tifffile>=2022.7.28 - xz - yasm - zlib - zstd - pip: - opencv-python-headless>=4.6 name: all_cuda-118_arch-x86_64
0
rapidsai_public_repos/cucim/conda/recipes
rapidsai_public_repos/cucim/conda/recipes/libcucim/conda_build_config.yaml
c_compiler_version: - 11 cxx_compiler_version: - 11 cuda_compiler: - cuda-nvcc cuda11_compiler: - nvcc sysroot_version: - "2.17" # The CTK libraries below are missing from the conda-forge::cudatoolkit package # for CUDA 11. The "*_host_*" version specifiers correspond to `11.8` packages # and the "*_run_*" version specifiers correspond to `11.x` packages. cuda11_libcufile_host_version: - "1.4.0.31" cuda11_libcufile_run_version: - ">=1.0.0.82,<=1.4.0.31" cuda11_libnvjpeg_host_version: - "11.6.0.55"
0
rapidsai_public_repos/cucim/conda/recipes
rapidsai_public_repos/cucim/conda/recipes/libcucim/build.sh
# Copyright (c) 2021, NVIDIA CORPORATION. CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} echo "CC : ${CC}" echo "CXX : ${CXX}" # CUDA needs to include $PREFIX/include as system include path export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" # It is assumed that this script is executed from the root of the repo directory by conda-build # (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) # Build libcucim core ./run build_local libcucim ${CUCIM_BUILD_TYPE} ${PREFIX} mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/include cp -P -r install/bin/* $PREFIX/bin/ || true cp -P -r install/lib/* $PREFIX/lib/ || true cp -P -r install/include/* $PREFIX/include/ || true # Build plugins for plugin_name in cuslide cumed; do echo "Building cucim.kit.${plugin_name} ..." ./run build_local ${plugin_name} ${CUCIM_BUILD_TYPE} ${PREFIX} mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/include cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/bin/* $PREFIX/bin/ || true cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/lib/* $PREFIX/lib/ || true done
0
rapidsai_public_repos/cucim/conda/recipes
rapidsai_public_repos/cucim/conda/recipes/libcucim/meta.yaml
# Copyright (c) 2021-2023, NVIDIA CORPORATION. {% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} {% set date_string = environ['RAPIDS_DATE_STRING'] %} package: name: libcucim version: {{ version }} source: path: ../../.. build: number: {{ GIT_DESCRIBE_NUMBER }} string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} ignore_run_exports: - libwebp-base ignore_run_exports_from: {% if cuda_major == "11" %} - {{ compiler('cuda11') }} {% endif %} script_env: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY - AWS_SESSION_TOKEN - CMAKE_C_COMPILER_LAUNCHER - CMAKE_CUDA_COMPILER_LAUNCHER - CMAKE_CXX_COMPILER_LAUNCHER - CMAKE_GENERATOR - PARALLEL_LEVEL - SCCACHE_BUCKET - SCCACHE_IDLE_TIMEOUT - SCCACHE_REGION - SCCACHE_S3_KEY_PREFIX=libcucim-aarch64 # [aarch64] - SCCACHE_S3_KEY_PREFIX=libcucim-linux64 # [linux64] - SCCACHE_S3_USE_SSL - SCCACHE_S3_NO_CREDENTIALS requirements: build: - {{ compiler("c") }} - {{ compiler("cxx") }} {% if cuda_major == "11" %} - {{ compiler('cuda11') }} ={{ cuda_version }} {% else %} - {{ compiler('cuda') }} {% endif %} - cuda-version ={{ cuda_version }} - binutils - cmake >=3.23.1,!=3.25.0 - make - ninja - sysroot_{{ target_platform }} {{ sysroot_version }} - yasm # [x86_64] host: - cuda-version ={{ cuda_version }} {% if cuda_major == "11" %} - libcufile {{ cuda11_libcufile_host_version }} # [linux64] - libcufile-dev {{ cuda11_libcufile_host_version }} # [linux64] - libnvjpeg {{ cuda11_libnvjpeg_host_version }} - libnvjpeg-dev {{ cuda11_libnvjpeg_host_version }} {% else %} - libcufile-dev # [linux64] - libnvjpeg-dev - libnvjpeg-static {% endif %} - jbig - libwebp-base - nvtx-c >=3.1.0 - openslide - xz - zlib - zstd run: - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} {% if cuda_major == "11" %} - cudatoolkit - libcufile {{ cuda11_libcufile_run_version }} # [linux64] {% endif %} - {{ pin_compatible('libwebp-base', max_pin='x.x') }} - jbig # - openslide # skipping here but benchmark binary would need openslide library - xz - zlib - zstd about: home: https://developer.nvidia.com/multidimensional-image-processing summary: libcucim C++ library license: Apache-2.0 license_family: Apache license_file: LICENSE doc_url: https://docs.rapids.ai/api/cucim/stable/ dev_url: https://github.com/rapidsai/cucim
0
rapidsai_public_repos/cucim/conda/recipes
rapidsai_public_repos/cucim/conda/recipes/cucim/conda_build_config.yaml
c_compiler_version: - 11 cxx_compiler_version: - 11 cuda_compiler: - cuda-nvcc cuda11_compiler: - nvcc sysroot_version: - "2.17"
0
rapidsai_public_repos/cucim/conda/recipes
rapidsai_public_repos/cucim/conda/recipes/cucim/build.sh
# Copyright (c) 2021, NVIDIA CORPORATION. CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} echo "CC : ${CC}" echo "CXX : ${CXX}" # CUDA needs to include $PREFIX/include as system include path export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" # It is assumed that this script is executed from the root of the repo directory by conda-build # (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) ./run build_local cucim ${CUCIM_BUILD_TYPE} cp -P python/install/lib/* python/cucim/src/cucim/clara/ pushd python/cucim echo "PYTHON: ${PYTHON}" $PYTHON -m pip install . -vv popd
0
rapidsai_public_repos/cucim/conda/recipes
rapidsai_public_repos/cucim/conda/recipes/cucim/meta.yaml
# Copyright (c) 2021-2023, NVIDIA CORPORATION. {% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} {% set py_version = environ['CONDA_PY'] %} {% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} {% set cuda_major = cuda_version.split('.')[0] %} {% set date_string = environ['RAPIDS_DATE_STRING'] %} package: name: cucim version: {{ version }} source: path: ../../.. build: number: {{ GIT_DESCRIBE_NUMBER }} string: cuda{{ cuda_major }}_py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} ignore_run_exports_from: {% if cuda_major == "11" %} - {{ compiler('cuda11') }} {% endif %} script_env: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY - AWS_SESSION_TOKEN - CMAKE_C_COMPILER_LAUNCHER - CMAKE_CUDA_COMPILER_LAUNCHER - CMAKE_CXX_COMPILER_LAUNCHER - CMAKE_GENERATOR - PARALLEL_LEVEL - SCCACHE_BUCKET - SCCACHE_IDLE_TIMEOUT - SCCACHE_REGION - SCCACHE_S3_KEY_PREFIX=cucim-aarch64 # [aarch64] - SCCACHE_S3_KEY_PREFIX=cucim-linux64 # [linux64] - SCCACHE_S3_USE_SSL - SCCACHE_S3_NO_CREDENTIALS requirements: build: - {{ compiler("c") }} - {{ compiler("cxx") }} {% if cuda_major == "11" %} - {{ compiler('cuda11') }} ={{ cuda_version }} {% else %} - {{ compiler('cuda') }} {% endif %} - cuda-version ={{ cuda_version }} - cmake >=3.23.1,!=3.25.0 - make - ninja - sysroot_{{ target_platform }} {{ sysroot_version }} host: - click - cuda-version ={{ cuda_version }} - cupy >=12.0.0 - libcucim ={{ version }} - numpy 1.21 - python - scikit-image >=0.19.0,<0.22.0a0 - scipy run: - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} - {{ pin_compatible('numpy') }} - click - cupy >=12.0.0 - lazy_loader >=0.1 - libcucim ={{ version }} # - openslide # skipping here but benchmark binary would need openslide library - python - scikit-image >=0.19.0,<0.22.0a0 - scipy tests: requirements: - cuda-version ={{ cuda_version }} imports: - cucim about: home: https://developer.nvidia.com/multidimensional-image-processing summary: cucim Python package license: Apache-2.0 license_family: Apache license_file: LICENSE doc_url: https://docs.rapids.ai/api/cucim/stable/ dev_url: https://github.com/rapidsai/cucim
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/scripts/run-dist
#!/bin/bash # # Copyright (c) 2020, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # init_globals() { if [ "$0" != "/bin/bash" ]; then SCRIPT_DIR=$(dirname "$(readlink -f "$0")") export RUN_SCRIPT_FILE="$(readlink -f "$0")" else export RUN_SCRIPT_FILE="$(readlink -f "${BASH_SOURCE[0]}")" fi export TOP=$(dirname "${RUN_SCRIPT_FILE}") } ################################################################################ # Utility functions ################################################################################ ####################################### # Get list of available commands from a given input file. # # Available commands and command summary are extracted by checking a pattern # "_desc() { echo '". # Section title is extracted by checking a pattern "# Section: ". # This command is used for listing available commands in CLI. # # e.g.) # "# Section: String/IO functions" # => "# String/IO functions" # "to_lower_desc() { echo 'Convert to lower case" # => "to_lower ----------------- Convert to lower case" # # Arguments: # $1 - input file that defines commands # Returns: # Print list of available commands from $1 ####################################### get_list_of_available_commands() { local file_name="$1" if [ ! -e "$1" ]; then echo "$1 doesn't exist!" fi local line_str='--------------------------------' local IFS= cmd_lines="$(IFS= cat "$1" | grep -E -e "^(([[:alpha:]_[:digit:]]+)_desc\(\)|# Section: )" | sed "s/_desc() *{ *echo '/ : /")" local line while IFS= read -r line; do local cmd=$(echo "$line" | cut -d":" -f1) local desc=$(echo "$line" | cut -d":" -f2-) if [ "$cmd" = "# Section" ]; then c_echo B "${desc}" else # there is no substring operation in 'sh' so use 'cut' local dash_line="$(echo "${line_str}" | cut -c ${#cmd}-)" # = "${line_str:${#cmd}}" c_echo Y " ${cmd}" w " ${dash_line} ${desc}" fi # use <<EOF, not '<<<"$cmd_lines"' to be executable in sh done <<EOF $cmd_lines EOF } my_cat_prefix() { local IFS local prefix="$1" local line while IFS= read -r line; do echo "${prefix}${line}" # -e option doesn't work in 'sh' so disallow escaped characters done <&0 } c_str() { local old_color=39 local old_attr=0 local color=39 local attr=0 local text="" #local no_change=0 for i in "$@"; do case "$i" in r|R) color=31 ;; g|G) color=32 ;; y|Y) color=33 ;; b|B) color=34 ;; p|P) color=35 ;; c|C) color=36 ;; w|W) color=37 ;; z|Z) color=0 ;; esac case "$i" in l|L|R|G|Y|B|P|C|W) attr=1 ;; n|N|r|g|y|b|p|c|w) attr=0 ;; z|Z) attr=0 ;; *) text="${text}$i" esac if [ ${old_color} -ne ${color} ] || [ ${old_attr} -ne ${attr} ]; then text="${text}\033[${attr};${color}m" old_color=$color old_attr=$attr fi done /bin/echo -en "$text" } c_echo() { local old_opt="$(shopt -op xtrace)" # save old xtrace option set +x # unset xtrace local text="$(c_str "$@")" /bin/echo -e "$text\033[0m" eval "${old_opt}" # restore old xtrace option } echo_err() { >&2 echo "$@" } c_echo_err() { >&2 c_echo "$@" } printf_err() { >&2 printf "$@" } get_item_ranges() { local indexes="$1" local list="$2" echo -n "$(echo "${list}" | xargs | cut -d " " -f "${indexes}")" return $? } get_unused_ports() { local num_of_ports=${1:-1} local start=${2:-49152} local end=${3:-61000} comm -23 \ <(seq ${start} ${end} | sort) \ <(ss -tan | awk '{print $4}' | while read line; do echo ${line##*\:}; done | grep '[0-9]\{1,5\}' | sort -u) \ | shuf | tail -n ${num_of_ports} # use tail instead head to avoid broken pipe in VSCode terminal } newline() { echo } info() { c_echo W "$(date -u '+%Y-%m-%d %H:%M:%S') [INFO] " Z "$@" } error() { echo R "$(date -u '+%Y-%m-%d %H:%M:%S') [ERROR] " Z "$@" } fatal() { echo R "$(date -u '+%Y-%m-%d %H:%M:%S') [FATAL] " Z "$@" echo if [ -n "${SCRIPT_DIR}" ]; then exit 1 fi } run_command() { local status=0 local cmd="$*" c_echo B "$(date -u '+%Y-%m-%d %H:%M:%S') " W "\$ " G "${cmd}" [ "$(echo -n "$@")" = "" ] && return 1 # return 1 if there is no command available "$@" status=$? unset IFS return $status } retry() { local retries=$1 shift local count=0 until run_command "$@"; do exit=$? wait=$((2 ** count)) count=$((count + 1)) if [ $count -lt $retries ]; then info "Retry $count/$retries. Exit code=$exit, Retrying in $wait seconds..." sleep $wait else fatal "Retry $count/$retries. Exit code=$exit, no more retries left." return 1 fi done return 0 } #================================================================================== # Section: Example #================================================================================== download_testdata_desc() { echo 'Download test data from Docker Hub ' } download_testdata() { c_echo W "Downloading test data..." run_command mkdir -p ${TOP}/notebooks/input if [ ! -e ${TOP}/notebooks/input/README.md ]; then run_command rm -rf ${TOP}/notebooks/input id=$(docker create gigony/svs-testdata:little-big) run_command docker cp $id:/input ${TOP}/notebooks run_command docker rm -v $id c_echo G "Test data is downloaded to ${TOP}/notebooks/input!" else c_echo G "Test data already exists at ${TOP}/notebooks/input!" fi } copy_gds_files_() { [ ! -d /usr/local/cuda/gds ] && c_echo_err R "GDS is not available at /usr/local/cuda/gds !" && return 1 rm -rf ${TOP}/temp/gds mkdir -p ${TOP}/temp/gds/lib64 cp -P -r /usr/local/cuda/gds/* ${TOP}/temp/gds/ cp -P /usr/local/cuda/lib64/cufile.h /usr/local/cuda/lib64/libcufile* ${TOP}/temp/gds/lib64/ } launch_notebooks_desc() { echo 'Launch jupyter notebooks Arguments: -p <port> - port number -h <host> - hostname to serve documentation on (default: 0.0.0.0) -g - launch GDS-enabled container ' } launch_notebooks() { local OPTIND local port=$(get_unused_ports 1 10000 10030) local host='0.0.0.0' local gds_postfix='' local gds_nvme_path='' while getopts 'p:h:g:' option; do case "${option}" in p) port="$OPTARG" ;; h) host="$OPTARG" ;; g) gds_postfix='-gds' echo "# OPTARG:$OPTARG" [ -z "$OPTARG" ] && c_echo_err R "Please specify NVMe path!" && return 1 gds_nvme_path=$(readlink -f "$OPTARG") [ ! -d "$gds_nvme_path" ] && c_echo_err R "Folder $gds_nvme_path doesn't exist!" && return 1 # Copy cufile SDK from host system to temp/gds copy_gds_files_ ;; *) return 1 esac done download_testdata run_command cp ${TOP}/*.whl ${TOP}/notebooks run_command docker build --runtime nvidia -t cucim-jupyter${gds_postfix} -f ${TOP}/docker/Dockerfile-jupyter${gds_postfix} ${TOP} [ $? -ne 0 ] && return 1 c_echo W "Port " G "$port" W " would be used...(" B "http://$(hostname -I | cut -d' ' -f 1):${port}" W ")" if [ -z "${gds_postfix}" ]; then run_command docker run --runtime nvidia --gpus all -it --rm \ -v ${TOP}/notebooks:/notebooks \ -p ${port}:${port} \ cucim-jupyter \ -c "echo -n 'Enter New Password: '; jupyter lab --ServerApp.password=\"\$(python3 -u -c \"from jupyter_server.auth import passwd;pw=input();print(passwd(pw));\" | egrep 'sha|argon')\" --ServerApp.root_dir=/notebooks --allow-root --port=${port} --ip=${host} --no-browser" else local MNT_PATH=/nvme local GDS_IMAGE=cucim-jupyter${gds_postfix} local BUILD_VER=`uname -r` local NV_DRIVER=`nvidia-smi -q -i 0 | sed -n 's/Driver Version.*: *\(.*\) *$/\1/p'` echo "using nvidia driver version $NV_DRIVER on kernel $BUILD_VER" local ofed_version=$(ofed_info -s | grep MLNX) if [ $? -eq 0 ]; then local rdma_core=$(dpkg -s libibverbs-dev | grep "Source: rdma-core") if [ $? -eq 0 ]; then local CONFIG_MOFED_VERSION=$(echo $ofed_version | cut -d '-' -f 2) echo "Found MOFED version $CONFIG_MOFED_VERSION" fi local MLNX_SRCS="--volume /usr/src/mlnx-ofed-kernel-${CONFIG_MOFED_VERSION}:/usr/src/mlnx-ofed-kernel-${CONFIG_MOFED_VERSION}:ro" local MOFED_DEVS="--net=host --volume /sys/class/infiniband_verbs:/sys/class/infiniband_verbs/ " fi docker run \ --ipc host \ -it \ --rm \ --gpus all \ -v ${TOP}/notebooks:/notebooks \ -p ${port}:${port} \ --volume /run/udev:/run/udev:ro \ --volume /sys/kernel/config:/sys/kernel/config/ \ --volume /usr/src/nvidia-$NV_DRIVER:/usr/src/nvidia-$NV_DRIVER:ro ${MLNX_SRCS}\ --volume /dev:/dev:ro \ --privileged \ --env NV_DRIVER=${NV_DRIVER} \ --volume /lib/modules/$BUILD_VER/:/lib/modules/$BUILD_VER \ --volume "${MNT_PATH}:/notebooks/nvme:rw" \ ${MOFED_DEVS} \ ${GDS_IMAGE} \ -c "echo -n 'Enter New Password: '; jupyter lab --ServerApp.password=\"\$(python3 -u -c \"from jupyter_server.auth import passwd;pw=input();print(passwd(pw));\" | egrep 'sha|argon')\" --ServerApp.root_dir=/notebooks --allow-root --port=${port} --ip=${host} --no-browser" fi } #================================================================================== # Section: Build #================================================================================== build_train() { local image_name=${1:-cucim-train} run_command docker build -t ${image_name} -f ${TOP}/docker/Dockerfile-claratrain ${TOP}/docker } build_train_desc() { echo 'Build Clara Train Docker image with cuCIM (& OpenSlide) Build image from docker/Dockerfile-claratrain Arguments: $1 - docker image name (default:cucim-train) ' } build_train() { local image_name=${1:-cucim-train} run_command docker build -t ${image_name} -f ${TOP}/docker/Dockerfile-claratrain ${TOP} } build_examples_desc() { echo 'Build cuCIM C++ examples ' } build_examples() { local image_name=cucim-cmake run_command docker build -t ${image_name} -f ${TOP}/docker/Dockerfile-cmake ${TOP}/docker run_command docker run -it --rm \ -v ${TOP}:/workspace \ ${image_name} \ -c " mkdir -p /workspace/examples/cpp/build; rm -rf /workspace/examples/cpp/build/*; cd /workspace/examples/cpp/build; cmake .. && make" c_echo W "Copying binary files to ${TOP}/bin folder..." run_command mkdir -p ${TOP}/bin run_command cp ${TOP}/examples/cpp/build/bin/* ${TOP}/bin download_testdata c_echo W "Execute the binary with the following commands:" c_echo " # Set library path" c_echo B " export LD_LIBRARY_PATH=${TOP}/install/lib:\$LD_LIBRARY_PATH" c_echo " # Execute" c_echo B " ./bin/tiff_image notebooks/input/image.tif ." } parse_args() { local OPTIND while getopts 'yh' option; do case "${option}" in y) ALWAYS_YES=true; ;; h) print_usage exit 1 ;; *) ;; esac done shift $((OPTIND-1)) CMD="$1" shift ARGS=("$@") } print_usage() { set +x echo_err echo_err "USAGE: $0 [command] [arguments]..." echo_err "" c_echo_err W "Global Arguments" echo_err c_echo_err W "Command List" c_echo_err Y " help " w "---------------------------- Print detailed description for a given argument (command name)" echo_err "$(get_list_of_available_commands "${RUN_SCRIPT_FILE}" | my_cat_prefix " ")" echo_err } print_cmd_help_messages() { local cmd="$1" if [ -n "${cmd}" ]; then if type ${cmd}_desc > /dev/null 2>&1; then ${cmd}_desc exit 0 else c_echo_err R "Command '${cmd}' doesn't exist!" exit 1 fi fi print_usage return 0 } main() { local ret=0 parse_args "$@" case "$CMD" in help) print_cmd_help_messages "${ARGS[@]}" exit 0 ;; build) build_examples "${ARGS[@]}" ;; notebooks) launch_notebooks "${ARGS[@]}" ;; ''|main) print_usage ;; *) if type ${CMD} > /dev/null 2>&1; then "$CMD" "${ARGS[@]}" else print_usage exit 1 fi ;; esac ret=$? if [ -n "${SCRIPT_DIR}" ]; then exit $ret fi } init_globals if [ -n "${SCRIPT_DIR}" ]; then main "$@" fi
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/scripts/auditwheel_repair.py
# Apache License, Version 2.0 # Copyright 2020 NVIDIA Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import functools import re from unittest.mock import patch import auditwheel.elfutils from auditwheel.main import main from auditwheel.wheeltools import InWheelCtx # How auditwheel repair works? # # From https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/wheel_abi.py#L38 # 1) Find a Python extension libraries(.so) # if so ==> A, else ==> B # 2) `needed_libs` <== external libraries needed by A and B # 3) From b in B, # if b is not in `needed_libs`, b is added to A # 4) Only external libraries in A are patched to use locally copied .so files # - external libraries that exists under wheel path are discarded # - https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/policy/external_references.py#L61 # - https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/repair.py#L62 # # With current implementation, # - `cucim/_cucim.cpython-XX-x86_64-linux-gnu.so` files are in A by 1) # - `cucim/libcucim.so.??` is in B by 1) # - `cucim/libcucim.so.??` and `libcudart.so.11.0` are in `needed_libs` by 2) # - `cucim/cucim.kit.cuslide@??.??.??.so` is in A by 3) # # And only libz and libcudart are considered as external libraries. # To work with cuCIM, we need to # 1) make `cucim/libcucim.so.??` as Python extension library # - Patch elf_is_python_extension : https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/elfutils.py#L81 # 2) control how to copy external libraries # - Patch copylib: https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/repair.py#L108 # - Need for libnvjpeg library # 3) preprocess wheel metadata # - patch InWheelCtx.__enter__ : https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/wheeltools.py#L158 # - `Root-Is-Purelib: true` -> `Root-Is-Purelib: false` from WHEEL file # Parameters PYTHON_EXTENSION_LIBRARIES = [r"cucim/libcucim\.so\.\d{1,2}"] # 1) auditwheel.elfutils.elf_is_python_extension replacement orig_elf_is_python_extension = auditwheel.elfutils.elf_is_python_extension @functools.wraps(orig_elf_is_python_extension) def elf_is_python_extension(fn, elf): if any(map(lambda x: re.fullmatch(x, fn), PYTHON_EXTENSION_LIBRARIES)): print("[cuCIM] Consider {} as a python extension.".format(fn)) return True, 3 return orig_elf_is_python_extension(fn, elf) # 3) auditwheel.wheeltools.InWheelCtx.__enter__ replacement orig_inwheelctx_enter = InWheelCtx.__enter__ @functools.wraps(orig_inwheelctx_enter) def inwheelctx_enter(self): rtn = orig_inwheelctx_enter(self) # `self.path` is a path that extracted files from the wheel file exists # base_dir = glob.glob(join(self.path, '*.dist-info')) # wheel_path = join(base_dir[0], 'WHEEL') # with open(wheel_path, 'r') as f: # wheel_text = f.read() # wheel_text = wheel_text.replace('Root-Is-Purelib: true', 'Root-Is-Purelib: false') # noqa: E501 # with open(wheel_path, 'w') as f: # f.write(wheel_text) return rtn # # sys.argv replacement # testargs = ["auditwheel_repair.py", "repair", "--plat", "manylinux2014_x86_64", "-w", "wherehouse", "cuclara_image-0.1.1-py3-none-manylinux2014_x86_64.whl"] # noqa: E501 # with patch.object(sys, 'argv', testargs): if __name__ == "__main__": # Patch with patch.object( auditwheel.elfutils, "elf_is_python_extension", elf_is_python_extension ): with patch.object(InWheelCtx, "__enter__", inwheelctx_enter): main()
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/scripts/debug_python
#!/bin/bash # # Copyright (c) 2021, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # SCRIPT_DIR=$(dirname "$(readlink -f "$0")") if [ -e ${SCRIPT_DIR}/debug_env.sh ]; then # User can place debug_env.sh in the same directory as this script (scripts/debug_env.sh would be ignored in git repo) . ${SCRIPT_DIR}/debug_env.sh elif [ -e ${SCRIPT_DIR}/../.python-version ]; then # Need to init in script: https://github.com/pyenv/pyenv-virtualenv/issues/204 eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" # Above will do `pyenv activate $(cat ${SCRIPT_DIR}/../.python-version)`. else echo "Environment file not found. Exiting." exit 1 fi echo "Python: $(python3 -c "import sys;print(sys.executable)")" exec env python3 "$@"
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/benchmarks/config.h
/* * Apache License, Version 2.0 * Copyright 2020-2021 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef CUCIM_CONFIG_H #define CUCIM_CONFIG_H #include <string> struct AppConfig { std::string test_folder; std::string test_file; bool discard_cache = false; int random_seed = 0; bool random_start_location = false; int64_t image_width = 0; int64_t image_height = 0; // Pseudo configurations for google benchmark bool benchmark_list_tests = false; std::string benchmark_filter; // <regex> int benchmark_min_time = 0; // <min_time> int benchmark_repetitions = 0; // <num_repetitions> bool benchmark_report_aggregates_only = false; bool benchmark_display_aggregates_only = false; std::string benchmark_format; // <console|json|csv> std::string benchmark_out; // <filename> std::string benchmark_out_format; // <json|console|csv> std::string benchmark_color; // {auto|true|false} std::string benchmark_counters_tabular; std::string v; // <verbosity> std::string get_input_path(const std::string default_value = "generated/tiff_stripe_4096x4096_256.tif") const { // If `test_file` is absolute path if (!test_folder.empty() && test_file.substr(0, 1) == "/") { return test_file; } else { std::string test_data_folder = test_folder; if (test_data_folder.empty()) { if (const char* env_p = std::getenv("CUCIM_TESTDATA_FOLDER")) { test_data_folder = env_p; } else { test_data_folder = "test_data"; } } if (test_file.empty()) { return test_data_folder + "/" + default_value; } else { return test_data_folder + "/" + test_file; } } } }; #endif // CUCIM_CONFIG_H
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/benchmarks/CMakeLists.txt
# # Copyright (c) 2020, NVIDIA CORPORATION. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ################################################################################ # Add executable: cucim_benchmarks ################################################################################ add_executable(cucim_benchmarks main.cpp config.h) set_target_properties(cucim_benchmarks PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS NO ) target_compile_features(cucim_benchmarks PRIVATE ${CUCIM_REQUIRED_FEATURES}) # Use generator expression to avoid `nvcc fatal : Value '-std=c++17' is not defined for option 'Werror'` target_compile_options(cucim_benchmarks PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Werror -Wall -Wextra>) target_compile_definitions(cucim_benchmarks PUBLIC CUCIM_VERSION=${PROJECT_VERSION} CUCIM_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} CUCIM_VERSION_MINOR=${PROJECT_VERSION_MINOR} CUCIM_VERSION_PATCH=${PROJECT_VERSION_PATCH} CUCIM_VERSION_BUILD=${PROJECT_VERSION_BUILD} ) target_link_libraries(cucim_benchmarks PRIVATE ${CUCIM_PACKAGE_NAME} deps::googlebenchmark deps::openslide deps::cli11 ) ################################################################################ # Add executable: cucim_primitives_benchmarks ################################################################################ add_executable(cucim_primitives_benchmarks primitives.cpp) #set_source_files_properties(main.cpp PROPERTIES LANGUAGE CUDA) # failed with CLI11 library set_target_properties(cucim_primitives_benchmarks PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED YES CXX_EXTENSIONS NO ) target_compile_features(cucim_primitives_benchmarks PRIVATE ${CUCIM_REQUIRED_FEATURES}) # Use generator expression to avoid `nvcc fatal : Value '-std=c++17' is not defined for option 'Werror'` target_compile_options(cucim_primitives_benchmarks PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Werror -Wall -Wextra>) target_link_libraries(cucim_primitives_benchmarks PRIVATE ${CUCIM_PACKAGE_NAME} deps::googlebenchmark )
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/benchmarks/main.cpp
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "config.h" #include <fcntl.h> #include <unistd.h> #include <cstdlib> #include <cstring> #include <fmt/format.h> #include <benchmark/benchmark.h> #include <openslide/openslide.h> #include <CLI/CLI.hpp> #include "cucim/cuimage.h" static AppConfig g_config; static void test_cucim(benchmark::State& state) { std::string input_path = g_config.get_input_path(); int arg = -1; for (auto state_item : state) { state.PauseTiming(); { // Use a different start random seed for the different argument if (arg != state.range()) { arg = state.range(); srand(g_config.random_seed + arg); } if (g_config.discard_cache) { int fd = open(input_path.c_str(), O_RDONLY); fdatasync(fd); posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED); close(fd); } } state.ResumeTiming(); int64_t request_location[2] = { 0, 0 }; if (g_config.random_start_location) { request_location[0] = rand() % (g_config.image_width - state.range(0)); request_location[1] = rand() % (g_config.image_height - state.range(0)); } cucim::CuImage image = cucim::CuImage(input_path.c_str()); cucim::CuImage region = image.read_region({ request_location[0], request_location[1] }, { state.range(0), state.range(0) }, 0); } } static void test_openslide(benchmark::State& state) { std::string input_path = g_config.get_input_path(); int arg = -1; for (auto _ : state) { state.PauseTiming(); { // Use a different start random seed for the different argument if (arg != state.range()) { arg = state.range(); srand(g_config.random_seed + arg); } if (g_config.discard_cache) { int fd = open(input_path.c_str(), O_RDONLY); fdatasync(fd); posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED); close(fd); } } state.ResumeTiming(); openslide_t* slide = openslide_open(input_path.c_str()); uint32_t* buf = static_cast<uint32_t*>(cucim_malloc(state.range(0) * state.range(0) * 4)); int64_t request_location[2] = { 0, 0 }; if (g_config.random_start_location) { request_location[0] = rand() % (g_config.image_width - state.range(0)); request_location[1] = rand() % (g_config.image_height - state.range(0)); } openslide_read_region(slide, buf, request_location[0], request_location[1], 0, state.range(0), state.range(0)); cucim_free(buf); openslide_close(slide); } } BENCHMARK(test_cucim)->Unit(benchmark::kMicrosecond)->RangeMultiplier(2)->Range(1, 4096); BENCHMARK(test_openslide)->Unit(benchmark::kMicrosecond)->RangeMultiplier(2)->Range(1, 4096); static bool remove_help_option(int* argc, char** argv) { for (int i = 1; argc && i < *argc; ++i) { if (strncmp(argv[i], "-h", 3) == 0 || strncmp(argv[i], "--help", 7) == 0) { for (int j = i + 1; argc && j < *argc; ++j) { argv[j - 1] = argv[j]; } --(*argc); argv[*argc] = nullptr; return true; } } return false; } static bool setup_configuration() { std::string input_path = g_config.get_input_path(); openslide_t* slide = openslide_open(input_path.c_str()); if (slide == nullptr) { fmt::print("[Error] Cannot load {}!\n", input_path); return false; } int64_t w, h; openslide_get_level0_dimensions(slide, &w, &h); g_config.image_width = w; g_config.image_height = h; openslide_close(slide); return true; } // BENCHMARK_MAIN(); int main(int argc, char** argv) { // Skip processing help option bool has_help_option = remove_help_option(&argc, argv); ::benchmark::Initialize(&argc, argv); // if (::benchmark::ReportUnrecognizedArguments(argc, argv)) // return 1; CLI::App app{ "cuCIM Benchmark" }; app.add_option("--test_folder", g_config.test_folder, "An input test folder path"); app.add_option("--test_file", g_config.test_file, "An input test image file path"); app.add_option("--discard_cache", g_config.discard_cache, "Discard page cache for the input file for each iteration"); app.add_option("--random_seed", g_config.random_seed, "A random seed number"); app.add_option( "--random_start_location", g_config.random_start_location, "Randomize start location of read_region()"); // Pseudo benchmark options app.add_option("--benchmark_list_tests", g_config.benchmark_list_tests, "{true|false}"); app.add_option("--benchmark_filter", g_config.benchmark_filter, "<regex>"); app.add_option("--benchmark_min_time", g_config.benchmark_min_time, "<min_time>"); app.add_option("--benchmark_repetitions", g_config.benchmark_repetitions, "<num_repetitions>"); app.add_option("--benchmark_report_aggregates_only", g_config.benchmark_report_aggregates_only, "{true|false}"); app.add_option("--benchmark_display_aggregates_only", g_config.benchmark_display_aggregates_only, "{true|false}"); app.add_option("--benchmark_format", g_config.benchmark_format, "<console|json|csv>"); app.add_option("--benchmark_out", g_config.benchmark_out, "<filename>"); app.add_option("--benchmark_out_format", g_config.benchmark_out_format, "<json|console|csv>"); app.add_option("--benchmark_color", g_config.benchmark_color, "{auto|true|false}"); app.add_option("--benchmark_counters_tabular", g_config.benchmark_counters_tabular, "{true|false}"); app.add_option("--v", g_config.v, "<verbosity>"); // Append help option if exists if (has_help_option) { argv[argc] = const_cast<char*>("--help"); ++argc; } CLI11_PARSE(app, argc, argv); if (!setup_configuration()) { return 1; } ::benchmark::RunSpecifiedBenchmarks(); }
0
rapidsai_public_repos/cucim
rapidsai_public_repos/cucim/benchmarks/primitives.cpp
/* * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cucim/memory/memory_manager.h" #include <vector> #include <string> #include <cstring> #include <memory_resource> #include <benchmark/benchmark.h> static void vector_copy_push_back(benchmark::State& state) { const int data_count = 50000; uint64_t data[data_count]; // Code inside this loop is measured repeatedly for (auto _ : state) { std::vector<uint64_t> data_vec; for (int i = 0; i < data_count; ++i) { data_vec.push_back(data[i]); } // Make sure the variable is not optimized away by compiler benchmark::DoNotOptimize(data_vec); } } // Register the function as a benchmark BENCHMARK(vector_copy_push_back); static void vector_copy_insert(benchmark::State& state) { const int data_count = 50000; uint64_t data[data_count]; // Code before the loop is not measured for (auto _ : state) { std::vector<uint64_t> data_vec; data_vec.insert(data_vec.end(), &data[0], &data[data_count]); // Make sure the variable is not optimized away by compiler benchmark::DoNotOptimize(data_vec); } } BENCHMARK(vector_copy_insert); static void vector_copy_vector_vector(benchmark::State& state) { const int data_count = 50000; uint64_t data[data_count]; // Code before the loop is not measured for (auto _ : state) { std::vector<uint64_t> data_vec; data_vec.insert(data_vec.end(), &data[0], &data[data_count]); std::vector<uint64_t> data_vec2(&data[0], &data[data_count]); data_vec.insert(data_vec.end(), data_vec2.begin(), data_vec2.end()); // Make sure the variable is not optimized away by compiler benchmark::DoNotOptimize(data_vec); } } BENCHMARK(vector_copy_vector_vector); static void string_memcpy(benchmark::State& state) { // Code before the loop is not measured for (auto _ : state) { std::string data = "#########################################################################################################################################################################################"; const int size = data.size(); char * c_str = (char*) malloc(size + 1); memcpy(c_str, data.data(), size); c_str[size] = '\0'; free(c_str); // Make sure the variable is not optimized away by compiler benchmark::DoNotOptimize(c_str); benchmark::DoNotOptimize(size); } } BENCHMARK(string_memcpy); static void string_strcpy(benchmark::State& state) { // Code before the loop is not measured for (auto _ : state) { std::string data = "#########################################################################################################################################################################################"; char * c_str = (char*) malloc(data.size() + 1); strcpy(c_str, data.data()); free(c_str); // Make sure the variable is not optimized away by compiler benchmark::DoNotOptimize(c_str); } } BENCHMARK(string_strcpy); static void string_strdup(benchmark::State& state) { // Code before the loop is not measured for (auto _ : state) { std::string data = "#########################################################################################################################################################################################"; char * c_str = strdup(data.data()); free(c_str); // Make sure the variable is not optimized away by compiler benchmark::DoNotOptimize(c_str); } } BENCHMARK(string_strdup); static void alloc_malloc(benchmark::State& state) { // Code before the loop is not measured for (auto _ : state) { char* arr[30000]; for (int i = 0; i < 30000; i++) { arr[i] = (char*)malloc(10); arr[i][0] = i; } for (int i = 0; i < 30000; i++) { free(arr[i]); } // Make sure the variable is not optimized away by compiler benchmark::DoNotOptimize(arr); } } BENCHMARK(alloc_malloc);//->Iterations(100); static void alloc_pmr(benchmark::State& state) { // Code before the loop is not measured for (auto _ : state) { char* arr[30000]; for (int i = 0; i < 30000; i++) { arr[i] = static_cast<char*>(cucim_malloc(10)); arr[i][0] = i; } for (int i = 0; i < 30000; i++) { cucim_free(arr[i]); } // Make sure the variable is not optimized away by compiler benchmark::DoNotOptimize(arr); } } BENCHMARK(alloc_pmr);//->Iterations(100); BENCHMARK_MAIN(); // Debug // ``` // -------------------------------------------------------------------- // Benchmark Time CPU Iterations // -------------------------------------------------------------------- // vector_copy_push_back 591517 ns 591510 ns 1267 // vector_copy_insert 8488 ns 8488 ns 85160 // vector_copy_vector_vector 225441 ns 225439 ns 3069 // string_memcpy 169 ns 169 ns 3854598 // string_strcpy 202 ns 202 ns 4114834 // string_strdup 184 ns 184 ns 3666944 // ``` // Release // ``` // -------------------------------------------------------------------- // Benchmark Time CPU Iterations // -------------------------------------------------------------------- // vector_copy_push_back 118518 ns 118518 ns 5745 // vector_copy_insert 7779 ns 7779 ns 92190 // vector_copy_vector_vector 198800 ns 198793 ns 3347 // string_memcpy 20.3 ns 20.3 ns 32102053 // string_strcpy 24.8 ns 24.8 ns 27352024 // string_strdup 32.4 ns 32.4 ns 21458177 // ```
0
rapidsai_public_repos/cucim/benchmarks
rapidsai_public_repos/cucim/benchmarks/skimage/cucim_exposure_bench.py
import argparse import os import pickle import cupy import cupy as cp import numpy as np import pandas as pd import skimage import skimage.exposure from _image_bench import ImageBench import cucim.skimage import cucim.skimage.exposure class ExposureBench(ImageBench): def set_args(self, dtype): if np.dtype(dtype).kind in "iu": scale = 256 else: scale = 1.0 imaged = cupy.testing.shaped_random( self.shape, xp=cp, dtype=dtype, scale=scale ) image = cp.asnumpy(imaged) self.args_cpu = (image,) self.args_gpu = (imaged,) class MatchHistogramBench(ImageBench): def set_args(self, dtype): if np.dtype(dtype).kind in "iu": scale = 256 else: scale = 1.0 imaged = cupy.testing.shaped_random( self.shape, xp=cp, dtype=dtype, scale=scale ) imaged2 = cupy.testing.shaped_random( self.shape, xp=cp, dtype=dtype, scale=scale ) image = cp.asnumpy(imaged) image2 = cp.asnumpy(imaged2) self.args_cpu = (image, image2) self.args_gpu = (imaged, imaged2) def main(args): pfile = "cucim_exposure_results.pickle" if os.path.exists(pfile): with open(pfile, "rb") as f: all_results = pickle.load(f) else: all_results = pd.DataFrame() dtypes = [np.dtype(args.dtype)] # image sizes/shapes shape = tuple(list(map(int, (args.img_size.split(","))))) run_cpu = not args.no_cpu for function_name, fixed_kwargs, var_kwargs, allow_color in [ ("equalize_adapthist", dict(clip_limit=0.01, nbins=256), dict(), True), ( "histogram", dict(source_range="image"), dict(nbins=[16, 256], normalize=[True, False]), False, ), ("cumulative_distribution", dict(), dict(nbins=[16, 256]), False), ("equalize_hist", dict(mask=None), dict(nbins=[16, 256]), False), ( "rescale_intensity", dict(in_range="image", out_range="dtype"), dict(), False, ), ("adjust_gamma", dict(), dict(), False), ("adjust_log", dict(), dict(), False), ("adjust_sigmoid", dict(), dict(inv=[False, True]), False), ("is_low_contrast", dict(), dict(), False), ]: if function_name != args.func_name: continue if function_name == "match_histograms": channel_axis = -1 if shape[-1] in [3, 4] else None B = MatchHistogramBench( function_name="match_histograms", shape=shape, dtypes=dtypes, fixed_kwargs=dict(channel_axis=channel_axis), var_kwargs=dict(), module_cpu=skimage.exposure, module_gpu=cucim.skimage.exposure, run_cpu=run_cpu, ) results = B.run_benchmark(duration=args.duration) all_results = pd.concat([all_results, results["full"]]) else: if shape[-1] == 3 and not allow_color: continue if function_name == "equalize_adapthist": # TODO: fix equalize_adapthist for size (3840, 2160) # and kernel_size = [16, 16] size_factors = [4, 8, 16] kernel_sizes = [] for size_factor in size_factors: kernel_sizes.append( [max(s // size_factor, 1) for s in shape if s != 3] ) var_kwargs.update(dict(kernel_size=kernel_sizes)) B = ExposureBench( function_name=function_name, shape=shape, dtypes=dtypes, fixed_kwargs=fixed_kwargs, var_kwargs=var_kwargs, module_cpu=skimage.exposure, module_gpu=cucim.skimage.exposure, run_cpu=run_cpu, ) results = B.run_benchmark(duration=args.duration) all_results = pd.concat([all_results, results["full"]]) fbase = os.path.splitext(pfile)[0] all_results.to_csv(fbase + ".csv") all_results.to_pickle(pfile) with open(fbase + ".md", "wt") as f: f.write(all_results.to_markdown()) if __name__ == "__main__": parser = argparse.ArgumentParser( description="Benchmarking cuCIM exposure functions" ) func_name_choices = [ "equalize_adapthist", "cumulative_distribution", "equalize_hist", "rescale_intensity", "adjust_gamma", "adjust_log", "adjust_sigmoid", "is_low_contrast", "match_histograms", ] dtype_choices = [ "float16", "float32", "float64", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", ] parser.add_argument( "-i", "--img_size", type=str, help="Size of input image", required=True ) parser.add_argument( "-d", "--dtype", type=str, help="Dtype of input image", choices=dtype_choices, required=True, ) parser.add_argument( "-f", "--func_name", type=str, help="function to benchmark", choices=func_name_choices, required=True, ) parser.add_argument( "-t", "--duration", type=int, help="time to run benchmark", required=True, ) parser.add_argument( "--no_cpu", action="store_true", help="disable cpu measurements", default=False, ) args = parser.parse_args() main(args)
0
rapidsai_public_repos/cucim/benchmarks
rapidsai_public_repos/cucim/benchmarks/skimage/run-nv-bench-exposure.sh
#!/bin/bash param_shape=(512,512 3840,2160 3840,2160,3 192,192,192) param_filt=(equalize_adapthist cumulative_distribution equalize_hist rescale_intensity adjust_gamma adjust_log adjust_sigmoid is_low_contrast match_histograms) param_dt=(float32 uint8) for shape in "${param_shape[@]}"; do for filt in "${param_filt[@]}"; do for dt in "${param_dt[@]}"; do python cucim_exposure_bench.py -f $filt -i $shape -d $dt -t 10 done done done
0
rapidsai_public_repos/cucim/benchmarks
rapidsai_public_repos/cucim/benchmarks/skimage/cupyx_scipy_ndimage_filter_bench.py
import os import pickle import cupy import cupy as cp import cupyx.scipy.ndimage import numpy as np import pandas as pd import scipy from _image_bench import ImageBench class ConvolveBench(ImageBench): def __init__( self, function_name, shape, weights_shape, dtypes=[np.float32], fixed_kwargs={}, var_kwargs={}, module_cpu=scipy.ndimage, module_gpu=cupyx.scipy.ndimage, ): self.weights_shape = weights_shape super().__init__( function_name=function_name, shape=shape, dtypes=dtypes, fixed_kwargs=fixed_kwargs, var_kwargs=var_kwargs, module_cpu=module_cpu, module_gpu=module_gpu, ) def set_args(self, dtype): imaged = cupy.testing.shaped_random(self.shape, xp=cp, dtype=dtype) image = cp.asnumpy(imaged) wd = cupy.testing.shaped_random(self.weights_shape, xp=cp, dtype=dtype) w = cp.asnumpy(wd) self.args_cpu = (image, w) self.args_gpu = (imaged, wd) class FilterBench(ImageBench): def set_args(self, dtype): imaged = cupy.testing.shaped_random(self.shape, xp=cp, dtype=dtype) image = cp.asnumpy(imaged) self.args_cpu = (image,) self.args_gpu = (imaged,) pfile = "filter_results.pickle" if os.path.exists(pfile): with open(pfile, "rb") as f: all_results = pickle.load(f) else: all_results = pd.DataFrame() modes = ["constant", "mirror"] prefilter = True dtypes = [np.float32] for shape in [(512, 512), (3840, 2160), (192, 192, 192)]: ndim = len(shape) weights_shape = (3,) * ndim weights_shape1d = weights_shape[:1] # TODO: add cases for generic_filter and generic_filter1d? for fname, var_kwargs in [ ("uniform_filter", dict(mode=["nearest"], size=[3, 5, 7, 9])), ("uniform_filter1d", dict(mode=["nearest"], size=[3, 7], axis=[0, -1])), ("gaussian_filter", dict(mode=["nearest"], sigma=[0.33, 1, 3, 4, 9])), ( "gaussian_filter1d", dict( mode=["nearest"], sigma=[0.33, 3, 9], axis=[0, -1], order=[0, 1] ), ), ("maximum_filter", dict(mode=["nearest"], size=[3, 5, 7])), ("maximum_filter1d", dict(mode=["nearest"], size=[3, 7], axis=[0, -1])), ("minimum_filter", dict(mode=["nearest"], size=[3, 5, 7])), ("minimum_filter1d", dict(mode=["nearest"], size=[3, 7], axis=[0, -1])), ("median_filter", dict(mode=["nearest"], size=[3, 5, 7])), ( "percentile_filter", dict(mode=["nearest"], size=[3, 5, 7], percentile=[30]), ), ("rank_filter", dict(mode=["nearest"], size=[3, 5, 7], rank=[-2])), ("prewitt", dict(mode=["nearest"], axis=[0, -1])), ("sobel", dict(mode=["nearest"], axis=[0, -1])), ("laplace", dict(mode=["nearest"])), ("gaussian_laplace", dict(mode=["nearest"], sigma=[0.33, 3, 9])), ( "gaussian_gradient_magnitude", dict(mode=["nearest"], sigma=[0.33, 3, 9]), ), ]: B = FilterBench( function_name=fname, shape=shape, dtypes=dtypes, fixed_kwargs=dict(output=None), var_kwargs=var_kwargs, ) results = B.run_benchmark(duration=1) all_results = pd.concat([all_results, results["full"]]) for fname, wshape, var_kwargs in [ ("convolve", weights_shape, dict(mode=modes)), ("correlate", weights_shape, dict(mode=modes)), ("convolve1d", weights_shape1d, dict(mode=modes, axis=[0, -1])), ("correlate1d", weights_shape1d, dict(mode=modes, axis=[0, -1])), ]: B = ConvolveBench( function_name=fname, shape=shape, weights_shape=wshape, dtypes=dtypes, fixed_kwargs=dict(output=None, origin=0), var_kwargs=var_kwargs, ) results = B.run_benchmark(duration=1) all_results = pd.concat([all_results, results["full"]]) fbase = os.path.splitext(pfile)[0] all_results.to_csv(fbase + ".csv") all_results.to_pickle(pfile) with open(fbase + ".md", "wt") as f: f.write(all_results.to_markdown())
0