Skip to content

Commit

Permalink
thrust: add v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Jan 9, 2024
1 parent 75ee447 commit adfead0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
12 changes: 6 additions & 6 deletions recipes/thrust/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
sources:
"1.16.0":
url: "https://github.com/thrust/thrust/archive/1.16.0.tar.gz"
sha256: "93b9553e3ee544e05395022bea67e6d600f8f3eb680950ec7cf73c0f55162487"
"1.17.0":
url: "https://github.com/thrust/thrust/archive/1.17.0.tar.gz"
sha256: "b02aca5d2325e9128ed9d46785b8e72366f758b873b95001f905f22afcf31bbf"
"2.2.0":
url: "https://github.com/NVIDIA/cccl/archive/refs/tags/v2.2.0.tar.gz"
sha256: "e27678a9d583f9994e591367e864425e722050a9ee1d721b2bd736b442b768d4"
"1.17.2":
url: "https://github.com/thrust/thrust/archive/1.17.2.tar.gz"
sha256: "d021e37f5aac30fd1b9737865399feb57db8e601ae2fc0af3cd41784435e9523"
"1.16.0":
url: "https://github.com/thrust/thrust/archive/1.16.0.tar.gz"
sha256: "93b9553e3ee544e05395022bea67e6d600f8f3eb680950ec7cf73c0f55162487"
32 changes: 17 additions & 15 deletions recipes/thrust/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from conan import ConanFile
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout
from conan.tools.scm import Version

required_conan_version = ">=1.52.0"

Expand All @@ -15,8 +16,9 @@ class ThrustConan(ConanFile):
"the C++ Standard Template Library (STL)."
)
topics = ("parallel", "stl", "header-only", "cuda", "gpgpu")
homepage = "https://thrust.github.io/"
homepage = "https://nvidia.github.io/thrust/"
url = "https://github.com/conan-io/conan-center-index"

package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True
Expand All @@ -31,8 +33,11 @@ def layout(self):
basic_layout(self, src_folder="src")

def requirements(self):
# Otherwise CUB from system CUDA is used, which is not guaranteed to be compatible
self.requires("cub/1.17.2")
if Version(self.version) >= "2.0":
self.requires(f"cub/{self.version}")
self.requires(f"libcudacxx/{self.version}")
else:
self.requires("cub/1.17.2")

if self.options.device_system == "tbb":
self.requires("onetbb/2021.10.0")
Expand All @@ -51,19 +56,16 @@ def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def package(self):
copy(
self,
pattern="LICENSE",
dst=os.path.join(self.package_folder, "licenses"),
src=self.source_folder,
)
source_folder = self.source_folder
if Version(self.version) >= "2.2.0":
source_folder = os.path.join(self.source_folder, "thrust")
copy(self, "LICENSE",
src=source_folder,
dst=os.path.join(self.package_folder, "licenses"))
for pattern in ["*.h", "*.inl"]:
copy(
self,
pattern=pattern,
src=os.path.join(self.source_folder, "thrust"),
dst=os.path.join(self.package_folder, "include", "thrust"),
)
copy(self, pattern,
src=os.path.join(source_folder, "thrust"),
dst=os.path.join(self.package_folder, "include", "thrust"))

def package_info(self):
self.cpp_info.bindirs = []
Expand Down
6 changes: 3 additions & 3 deletions recipes/thrust/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
versions:
"1.16.0":
folder: all
"1.17.0":
"2.2.0":
folder: all
"1.17.2":
folder: all
"1.16.0":
folder: all

0 comments on commit adfead0

Please sign in to comment.