forked from conan-io/conan-center-index
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(conan-io#16688) ruy: update to support Conan 2.0
* ruy: update to support Conan 2.0 * ruy: fixes * ruy: remove cmake generated files * ruy: remove old version * ruy: fix test_package when cppstd is not defined in the profile (conan 1.x) * ruy: fix order of cmake_minimum_required invocation * ruy: export all symbols on windows to support shared * Update recipes/ruy/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Update recipes/ruy/all/test_package/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Update recipes/ruy/all/test_package/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Update recipes/ruy/all/test_package/CMakeLists.txt Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> * Update recipes/ruy/all/test_package/CMakeLists.txt Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --------- Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
- Loading branch information
1 parent
5eb5c0d
commit ca0d539
Showing
9 changed files
with
128 additions
and
81 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
sources: | ||
"cci.20210622": | ||
url: "https://github.com/google/ruy/archive/9c56af3fce210a8a103eda19bd6f47c08a9e3d90.tar.gz" | ||
sha256: "8895874cfbf7263b028a6ec55b4b1737af0ea2b7bfedac90fd14d0b0a654f2dc" | ||
"cci.20220628": | ||
url: "https://github.com/google/ruy/archive/841ea4172ba904fe3536789497f9565f2ef64129.tar.gz" | ||
sha256: "fbd20e6c8cd5cf8ef159f69600ea0c7ef0f1401a4c16a9cd04e5a12ffa9c6e14" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package CXX) | ||
cmake_minimum_required(VERSION 3.15) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
project(test_package LANGUAGES CXX) | ||
|
||
find_package(ruy REQUIRED) | ||
find_package(ruy REQUIRED CONFIG) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} ruy::ruy) | ||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) | ||
|
||
target_link_libraries(${PROJECT_NAME} PRIVATE ruy::ruy) | ||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
from conan import ConanFile | ||
from conan.tools.build import can_run | ||
from conan.tools.cmake import cmake_layout, CMake, CMakeToolchain | ||
import os | ||
from conans import ConanFile, CMake, tools | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake", "cmake_find_package" | ||
settings = "os", "arch", "compiler", "build_type" | ||
generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" | ||
test_type = "explicit" | ||
|
||
def requirements(self): | ||
self.requires(self.tested_reference_str) | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
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) | ||
if can_run(self): | ||
bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") | ||
self.run(bin_path, env="conanrun") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project(test_package CXX) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup(TARGETS) | ||
|
||
find_package(ruy REQUIRED) | ||
|
||
add_executable(${PROJECT_NAME} test_package.cpp) | ||
target_link_libraries(${PROJECT_NAME} ruy::ruy) | ||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
from conans import ConanFile, CMake, tools | ||
|
||
|
||
class TestPackageConan(ConanFile): | ||
settings = "os", "compiler", "build_type", "arch" | ||
generators = "cmake", "cmake_find_package" | ||
|
||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <cstdint> | ||
#include <iostream> | ||
|
||
#include "ruy/ruy.h" | ||
|
||
int main() { | ||
|
||
ruy::Context context; | ||
const float lhs_data[] = {1, 2, 3, 4}; | ||
const float rhs_data[] = {1, 2, 3, 4}; | ||
float dst_data[4]; | ||
|
||
ruy::Matrix<float> lhs; | ||
ruy::MakeSimpleLayout(2, 2, ruy::Order::kRowMajor, lhs.mutable_layout()); | ||
lhs.set_data(lhs_data); | ||
ruy::Matrix<float> rhs; | ||
ruy::MakeSimpleLayout(2, 2, ruy::Order::kColMajor, rhs.mutable_layout()); | ||
rhs.set_data(rhs_data); | ||
ruy::Matrix<float> dst; | ||
ruy::MakeSimpleLayout(2, 2, ruy::Order::kColMajor, dst.mutable_layout()); | ||
dst.set_data(dst_data); | ||
|
||
ruy::MulParams<float, float> mul_params; | ||
ruy::Mul(lhs, rhs, mul_params, &context, &dst); | ||
|
||
std::cout << "ruy's test_package ran successfully \n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
versions: | ||
"cci.20210622": | ||
folder: all | ||
"cci.20220628": | ||
folder: all |