Skip to content

Instantly share code, notes, and snippets.

@chipmunk-sm
chipmunk-sm / test.cpp
Created January 13, 2019 21:49
benchmark: fill std::vector with value use memset, std::fill, assign, iterator. ( int64_t, int32_t, int16_t, int8_t )
#include <iostream>
#include <iomanip>
#include <vector>
#include <chrono>
template <typename T>
double Test_memset(T val , std::vector<T> &v, size_t iterations)
{
auto start = std::chrono::high_resolution_clock::now();
@chipmunk-sm
chipmunk-sm / wordCounterSample.cpp
Created September 23, 2018 15:40
c/c++ Word Counter Sample
// Example program
#include <iostream>
#include <cassert>
int wordCounter( const char* pszStringBuffer)
{
auto wordCount = 0;
while( *pszStringBuffer ) {
// whitespace
@chipmunk-sm
chipmunk-sm / MacroAssemblerARM.cpp
Created September 13, 2018 13:33
Qt, Android, armeabi-v7a, test fix for NDK 17.x Qt/5.11.1/Src/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/assembler/MacroAssemblerARM.cpp
/*
* Copyright (C) 2009 University of Szeged
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
#include <iostream>
// console output:
//***
//0 A()
//1 B()
//2 C()
//3 ~C()
//4 ~B()
//5 ~A()
#include <iostream>
// console output:
//0 A()
//1 B()
//2 C()
//3 ~C()
//4 ~B()
//5 ~A()
@chipmunk-sm
chipmunk-sm / environment
Created July 17, 2018 17:00
environment for kubuntu
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
XDG_CURRENT_DESKTOP="KDE"
AMDAPPSDKROOT="/home/f/AMDAPPSDK-3.0"
OPENCL_VENDOR_PATH="/home/f/AMDAPPSDK-3.0/etc/OpenCL/vendors/"
OpenCL_INCLUDE_DIR="/home/f/AMDAPPSDK-3.0/include/"
OpenCL_LIBRARY="/home/f/AMDAPPSDK-3.0/"