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
cmake_minimum_required(VERSION 3.0) | |
project(plugins) | |
######## | |
add_library(mylib | |
mylib.cpp | |
) | |
target_compile_options(mylib PRIVATE -fPIC) | |
######## |
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
cmake_minimum_required(VERSION 3.10) | |
project(predictor) | |
set(CMAKE_CXX_STANDARD 17) | |
# Append Torch path | |
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/libtorch") | |
# Find Torch | |
find_package(Torch REQUIRED) | |
message(STATUS "Torch found: ${Torch_FOUND}") |
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
#include <atomic> | |
#include <cassert> | |
#include <condition_variable> | |
#include <ctime> | |
#include <iostream> | |
#include <mutex> | |
#include <random> | |
#include <thread> | |
template <typename T, uint32_t BatchSize> |
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
#include <atomic> | |
#include <cassert> | |
#include <cstring> | |
#include <ctime> | |
#include <fcntl.h> | |
#include <functional> | |
#include <iostream> | |
#include <netinet/in.h> | |
#include <poll.h> | |
#include <sstream> |
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
#include <atomic> | |
#include <iostream> | |
#define MEMORY_ORDER std::memory_order_relaxed | |
// #define MEMORY_ORDER std::memory_order_seq_cst | |
static constexpr int numberCount = 50; | |
static constexpr uint64_t targetValue = 1'000'000'000; | |
static uint64_t getUsec() |
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
#include <cassert> | |
#include <cstring> | |
#include <ctime> | |
#include <iostream> | |
#include <thread> | |
#include <netinet/in.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <unistd.h> |
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
#include <cstring> | |
#include <ctime> | |
#include <iostream> | |
#include <list> | |
#define USE_INTRUSIVE 1 | |
#define USE_POINTER 1 | |
#define MAKE_NOISE_FOR_STD_PTR 1 | |
#if USE_POINTER |
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
#include <atomic> | |
#include <ctime> | |
#include <iostream> | |
#include <thread> | |
static constexpr int workerCount = 1; | |
static constexpr uint64_t target = 400'000'000; | |
// Vary this value between 0 and 128 to see the difference. | |
static constexpr int paddingSize = 128; |
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
#!/bin/bash | |
# [Required] | |
# -s - subject; | |
# -c - first commit to send. | |
# [Optional] | |
# -b - branch name; | |
# -i - issue number; | |
# -h - print help; |