Skip to content

Instantly share code, notes, and snippets.

View OlivierLi's full-sized avatar
🚀
Making things lean and fast!

Olivier Li OlivierLi

🚀
Making things lean and fast!
View GitHub Profile
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <algorithm>
#include <map>
#include <cassert>
bool comp( const std::pair<size_t, size_t>& lhs, const std::pair<size_t, size_t>& rhs ) {return lhs.first < rhs.first; }
cmake_minimum_required(VERSION 2.8)
project(skip_map)
SET(CMAKE_CXX_COMPILER clang++)
SET(CLANG_COMPILE_FLAGS "-Wall -Wextra -Wfatal-errors --std=c++14 -g")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLANG_COMPILE_FLAGS}" )
#Find all cpp files recursively
file(GLOB_RECURSE SRC "src" "*.cpp")
void test_sse( int *output, const int *input )
{
//SSE -> AVX transition
//_mm256_zeroall();
//Load the integers into an xmm register
__m256i loaded_ints = _mm256_loadu_si256( ( const __m256i* )input );
//Convert the integers to float values
__m256 values_reg = _mm256_cvtepi32_ps( loaded_ints );
#include "stdafx.h"
#include <iostream>
#include <chrono>
#include <immintrin.h>
#include <memory>
static inline bool isAligned( const void *pointer, size_t byte_count )
{
return (uintptr_t) pointer % byte_count == 0;
#include "stdafx.h"
#include <iostream>
#include <chrono>
#include <xmmintrin.h>
#include <cstring>
void test_sse( unsigned char *output, int *input )
{
//Create alligned arrays on the stack and the pointers needed to access them
// test3.cpp : Defines the entry point for the console application.
//
#include <cassert>
#include <chrono>
#include <iostream>
#include <random>
#include <vector>
#include <cstdint>
#include <algorithm>
#include <functional>
#include <vector>
#include <future>
#include <iostream>
class MyType
{
public:
int value = 0;
int compute()
@OlivierLi
OlivierLi / main.cpp
Created June 8, 2015 01:39
Code Jam treasure chest
#include <iostream>
#include <vector>
#include <sstream>
#include <deque>
#include <fstream>
#include <algorithm>
#include <set>
#include <bits/unique_ptr.h>
#include <bits/stl_map.h>
@OlivierLi
OlivierLi / result.txt
Last active August 29, 2015 14:10
Résultats préléminaires
----------------------------------------------------------
Training predictor neural_network_predictor
Result: success
Validating predictor neural_network_predictor
Mean Squared Error: 0.803143 Mean Percent Error: 12.9514%
----------------------------------------------------------
Training predictor knn_predictor
Result: success
Validating predictor knn_predictor
Mean Squared Error: 0.485454 Mean Percent Error: 9.83764%
@OlivierLi
OlivierLi / default.json
Created April 14, 2014 22:10
default.json
{
"particles_count" : 64000,
"particle_mass" : 0.0025,
"simulation_time" : 1,
"target_fps" : 60,
"simulation_scale" : 0.01,
"write_all_frames" : false,
"constant_acceleration" : {
"x" : 0, "y" : -9.8, "z" : 0
}