Skip to content

Instantly share code, notes, and snippets.

View utilForever's full-sized avatar

Chris Ohk utilForever

View GitHub Profile
@utilForever
utilForever / CallMemberFunction.cpp
Created February 3, 2017 01:04
Call member function pointed by instantiated object (using variadic template and std::bind)
#include <iostream>
#include <functional>
class AAA
{
public:
bool A(int a, int b, int c)
{
return a + b + c > 10;
}
@utilForever
utilForever / move_semantics.cpp
Created August 22, 2017 12:26
Examples for move semantics (C++11)
#include <string>
#include <iostream>
#include <iomanip>
#include <utility>
struct A
{
std::string s;
A() : s("test") { }
A(const A& o) : s(o.s) { std::cout << "move failed!\n"; }
@utilForever
utilForever / StructuredBindings.cpp
Created October 19, 2017 04:56
Examples for C++17 structured bindings
#include <iostream>
#include <tuple>
int main()
{
auto tuple = std::make_tuple(1, 'a', 2.3);
// unpack the tuple into individual variables declared at the call site
auto[i, c, d] = tuple;
@utilForever
utilForever / move_semantics.cpp
Created October 22, 2017 15:53
Rvalue reference, move semantics, std::move example
#include <iostream>
#include <algorithm>
class A
{
public:
// Simple constructor that initializes the resource.
explicit A(size_t length)
: mLength(length), mData(new int[length])
@utilForever
utilForever / TimePerfTests-OpenMP.txt
Last active April 21, 2018 16:13
CubbyFlow Time Performance Test Result - OpenMP
Run on (12 X 3298 MHz CPU s)
CPU Caches:
L1 Data 32K (x6)
L1 Instruction 32K (x6)
L2 Unified 262K (x6)
L3 Unified 15728K (x1)
--------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------------------------------------------------------
BVH3/Nearest 138131 ns 138108 ns 7467
@utilForever
utilForever / MemPerfTests-OpenMP.txt
Last active April 21, 2018 16:13
CubbyFlow Memory Performance Tests - OpenMP
[==========] Running 7 tests from 4 test cases.
[----------] Global test environment set-up.
[----------] 1 test from FDMICCGSolver3
[ RUN ] FDMICCGSolver3.Memory
[ STAT ] Mem usage: 2.414410 GB.
[ OK ] FDMICCGSolver3.Memory (7952 ms)
[----------] 1 test from FDMICCGSolver3 (7953 ms total)
[----------] 1 test from FLIPSolver3
[ RUN ] FLIPSolver3.Memory
@utilForever
utilForever / TimePerfTests-IntelTBB.txt
Created April 21, 2018 16:27
CubbyFlow Time Performance Test Result - Intel TBB
Run on (12 X 3298 MHz CPU s)
CPU Caches:
L1 Data 32K (x6)
L1 Instruction 32K (x6)
L2 Unified 262K (x6)
L3 Unified 15728K (x1)
--------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------------------------------------------------------
BVH3/Nearest 130629 ns 129395 ns 6400
@utilForever
utilForever / UnitTests-OpenMP.txt
Created April 24, 2018 09:24
CubbyFlow Unit Tests - OpenMP
[==========] Running 761 tests from 160 test cases.
[----------] Global test environment set-up.
[----------] 1 test from APICSolver2
[ RUN ] APICSolver2.UpdateEmpty
[ OK ] APICSolver2.UpdateEmpty (19 ms)
[----------] 1 test from APICSolver2 (21 ms total)
[----------] 1 test from APICSolver3
[ RUN ] APICSolver3.UpdateEmpty
[ OK ] APICSolver3.UpdateEmpty (24 ms)
@utilForever
utilForever / UnitTests-IntelTBB.txt
Created April 24, 2018 09:25
CubbyFlow Unit Tests - Intel TBB
[==========] Running 761 tests from 160 test cases.
[----------] Global test environment set-up.
[----------] 1 test from APICSolver2
[ RUN ] APICSolver2.UpdateEmpty
[ OK ] APICSolver2.UpdateEmpty (5 ms)
[----------] 1 test from APICSolver2 (5 ms total)
[----------] 1 test from APICSolver3
[ RUN ] APICSolver3.UpdateEmpty
[ OK ] APICSolver3.UpdateEmpty (11 ms)
@utilForever
utilForever / getopt-example.cpp
Created May 3, 2018 03:47
getopt vs Clara (getopt)
/*************************************************************************
> File Name: main.cpp
> Project Name: CubbyFlow
> Author: Chan-Ho Chris Ohk
> Purpose: SPH Simulator
> Created Time: 2017/06/18
> Copyright (c) 2018, Chan-Ho Chris Ohk
*************************************************************************/
#include <Core/Array/ArrayUtils.h>