Skip to content

Instantly share code, notes, and snippets.

View 27Cobalter's full-sized avatar

27Cobalter / Takumi Kondo 27Cobalter

View GitHub Profile
cmake_minimum_required(VERSION 3.22)
project(opencv_builder)
set(OPENCV_VERSION "4.11.0")
string(TOLOWER ${CMAKE_SYSTEM_NAME} lower_system_name)
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} lower_system_processor)
set(CMAKE_TOOLCHAIN_FILE OFF)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install/opencv-${OPENCV_VERSION}-${lower_system_name}-${lower_system_processor}")
#include <chrono>
#include <condition_variable>
#include <cstdint>
#include <iostream>
#include <mutex>
#include <stop_token>
#include <thread>
auto main() -> int32_t {
std::mutex mut;
cobalt@teto⮀~⮀⮀
⮁⮁⮁ sudo perf bench mem memcpy -s 2GB -l 10
# Running 'mem/memcpy' benchmark:
# function 'default' (Default memcpy() provided by glibc)
# Copying 2GB bytes ...
26.870777 GB/sec
# function 'x86-64-unrolled' (unrolled memcpy() in arch/x86/lib/memcpy_64.S)
# Copying 2GB bytes ...
#ifndef SHARED_MUTEX_H
#define SHARED_MUTEX_H
#include <pthread.h>
#include <stdatomic.h>
// 共有メモリに配置する構造体
typedef struct {
pthread_mutex_t mutex; // プロセス間で共有される堅牢なミューテックス
atomic_uint ref_count; // 参照カウンタ
$ vcpkg install libusb pthread
$ # set PKG_CONFIG_PATH=%VCPKG_ROOT%\installed\%VCPKG_DEFAULT_HOST_TRIPLET%\lib\pkgconfig
$ cmake -S. -Bbuild -DPKG_CONFIG_EXECUTABLE=C:\Local\src\Vcpkg\downloads\tools\msys2\d33df895d441a36d\mingw64\bin\pkg-config.exe

https://en.eeworld.com.cn/mp/EmbeddedLee/a379948.jspx

diff --git a/cmake/FindLibUSB.cmake b/cmake/FindLibUSB.cmake
#include <cassert>
#include <numeric>
#include <print>
#include <cmath>
#include <filesystem>
#include <ranges>
#include <vector>
#include <opencv2/opencv.hpp>
#include <chrono>
#include <cstdint>
#include <functional>
#include <iostream>
#include <memory>
#include <ranges>
#include <string_view>
#include <syncstream>
#include <thread>
#include <bit>
#include <cmath>
#include <iostream>
#include <ranges>
#include <format>
#include <memory>
#include <numbers>
#include <chrono>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <format>
#include <concepts>
#include <span>
#include <valarray>
#include <stdfloat>
#include <chrono>
#include <memory>
#include <new>
#include <random>