This file contains hidden or 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 <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; } |
This file contains hidden or 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 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") |
This file contains hidden or 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
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 ); |
This file contains hidden or 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 "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; |
This file contains hidden or 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 "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 |
This file contains hidden or 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
// test3.cpp : Defines the entry point for the console application. | |
// | |
#include <cassert> | |
#include <chrono> | |
#include <iostream> | |
#include <random> | |
#include <vector> | |
#include <cstdint> | |
#include <algorithm> |
This file contains hidden or 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 <functional> | |
#include <vector> | |
#include <future> | |
#include <iostream> | |
class MyType | |
{ | |
public: | |
int value = 0; | |
int compute() |
This file contains hidden or 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 <sstream> | |
#include <deque> | |
#include <fstream> | |
#include <algorithm> | |
#include <set> | |
#include <bits/unique_ptr.h> | |
#include <bits/stl_map.h> |
This file contains hidden or 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
---------------------------------------------------------- | |
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% |
This file contains hidden or 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
{ | |
"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 | |
} |