Skip to content

Commit

Permalink
(#10727) Add recipe for cuda-api-wrappers/0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aborzunov committed May 11, 2022
1 parent 5f6c02e commit fd0b901
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recipes/cuda-api-wrappers/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"0.5.1":
url: "https://github.com/eyalroz/cuda-api-wrappers/archive/refs/tags/v0.5.1.tar.gz"
sha256: "3a6d49f3da411c3da825b3781115c09e3420b49d53e83a3982cf4e222e223e4e"
38 changes: 38 additions & 0 deletions recipes/cuda-api-wrappers/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from conans import ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import os

required_conan_version = ">=1.33.0"

class CudaKatConan(ConanFile):
name = "cuda-api-wrappers"
homepage = "https://github.com/eyalroz/cuda-api-wrappers"
description = "Thin C++-flavored wrappers for the CUDA APIs"
topics = ("gpgpu", "cuda", "cuda-api", "header-only")
url = "https://github.com/conan-io/conan-center-index"
no_copy_source = True
license = "BSD-3-Clause"

settings = "os", "arch", "compiler", "build_type"

@property
def _source_subfolder(self):
return "source_subfolder"

def package_id(self):
self.info.header_only()

def validate(self):
if self.settings.os == "Windows":
raise ConanInvalidConfiguration("cuda-api-wrappers library are not compatible on Windows")

def source(self):
tools.get(**self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True)

def package(self):
self.copy(pattern="LICENSE*", src=self._source_subfolder, dst="licenses")
self.copy("*", src=os.path.join(self._source_subfolder, "src"), dst="include")

def package_info(self):
self.cpp_info.names["cmake_find_package"] = "cuda-api-wrappers"
self.cpp_info.names["cmake_find_package_multi"] = "cuda-api-wrappers"
11 changes: 11 additions & 0 deletions recipes/cuda-api-wrappers/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.1)
project(test_package)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

find_package(cuda-api-wrappers REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} cuda-api-wrappers::cuda-api-wrappers)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11)
17 changes: 17 additions & 0 deletions recipes/cuda-api-wrappers/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from conans import ConanFile, CMake, tools
import os


class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake", "cmake_find_package_multi"

def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

def test(self):
if not tools.cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
9 changes: 9 additions & 0 deletions recipes/cuda-api-wrappers/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <iostream>
#include <cuda/undefine_specifiers.hpp>


int main() {

return 0;
}

3 changes: 3 additions & 0 deletions recipes/cuda-api-wrappers/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versions:
"0.5.1":
folder: all

0 comments on commit fd0b901

Please sign in to comment.