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 <stdio.h> | |
#include <stdlib.h> | |
#include <CL/cl.h> | |
#define VECTOR_SIZE 1024 | |
// OpenCL kernel which is run for every work item created. | |
const char *saxpy_kernel = | |
"__kernel \n" | |
"void saxpy_kernel(float alpha, \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
/* | |
* You need pty setup: socat -d -d pty,raw,echo=0,link=/tmp/pty1 pty,raw,echo=0,link=/tmp/pty2 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <pthread.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
/* | |
* You need pty setup: socat -d -d pty,raw,echo=0,link=/tmp/pty1 pty,raw,echo=0,link=/tmp/pty2 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <pthread.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
cmake_minimum_required(VERSION 3.20) | |
project(python_module) | |
find_package(Python3 COMPONENTS Development.Module) | |
#Python_add_library(hello MODULE hello.c) | |
add_library(hello SHARED hello.c) | |
target_include_directories(hello PRIVATE ${Python_INCLUDE_DIRS}) | |
target_link_libraries(hello Python3::Module) | |
set_target_properties(hello PROPERTIES PREFIX "") |
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
# When you build ROS by yourself, do NOT have multiple version of | |
# Python development packages (libpython3.XX-dev). | |
# | |
# Because packages in ROS use either | |
# | |
# find_package(Python3 REQUIRED COMPONENTS Development) | |
# or | |
# find_package(Python3 REQUIRED COMPONENTS Interpreter) | |
# | |
# These two give you a different version if you have a different |
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 <iostream> | |
#include <vector> | |
#include <boost/accumulators/accumulators.hpp> | |
#include <boost/accumulators/statistics.hpp> | |
#include <boost/accumulators/statistics/rolling_mean.hpp> | |
#include <boost/accumulators/statistics/stats.hpp> | |
namespace ba = boost::accumulators; | |
int main() { |
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
static int _zbus_message_acc_data_chan = { 42 }; | |
static struct zbus_channel_data _zbus_chan_data_acc_data_chan = { | |
.observers_start_idx = -1, | |
.observers_end_idx = -1 | |
}; | |
static struct k_mutex _zbus_mutex_acc_data_chan = { | |
.wait_q = { { {(&(&_zbus_mutex_acc_data_chan.wait_q)->waitq)}, {(&(&_zbus_mutex_acc_data_chan.wait_q)->waitq)} } }, | |
.owner = NULL, |
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 <zephyr/kernel.h> | |
#include <zephyr/logging/log.h> | |
#include <zephyr/zbus/zbus.h> | |
LOG_MODULE_REGISTER(app); | |
ZBUS_CHAN_DEFINE(acc_data_chan, | |
int, | |
NULL, | |
NULL, /* User data */ | |
ZBUS_OBSERVERS(my_listener, my_subscriber), |
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
static int foo(void) | |
{ | |
return 42; | |
} | |
int main(void) | |
{ | |
int val = { | |
foo() | |
}; |
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
&spi4 { | |
pinctrl-0 = <&spi4_sck_pe2 &spi4_miso_pe5 &spi4_mosi_pe6>; | |
pinctrl-names = "default"; | |
cs-gpios = <&gpioe 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; | |
status = "okay"; | |
}; | |
&spi4_sck_pe2 { | |
bias-pull-up; | |
}; |
NewerOlder