https://foonathan.net/2015/10/allocatorawarecontainer-propagation-pitfalls/ 길고 이해하기 힘들다 filament에서 'propagate_on_container_move_assignment' 가 나와있어서 살펴봤는데, move assign 시 allocator도 move assign 하면서 container의 자료의 소유권을 이전해라 라는 것 같은데... https://stackoverflow.com/questions/27471053/example-usage-of-propagate-on-container-move-assignment 막상 filament의 구현은 allocator에서 사용하는 area memory 가 move/cop..
https://clang.llvm.org/docs/ThreadSafetyAnalysis.html clang TSA (thread safety analysis) for C (not just C++) https://github.com/jhi/clang-thread-safety-analysis-for-c/blob/master/tsa.h newpolaris@Donghyuns-MacBook-Pro test2 % clang++ -Wthread-safety main.cpp --std=c++14 -stdlib=libc++ main.cpp:7:17: warning: 'guarded_by' attribute requires arguments whose type is annotated with 'cap..
왠만한 예제로는 줄어드는게 안보이는데 동영상의 예제를 보자
google의 benchmark에서 모르는 부분이 너무 많다 benchmark는 cmake 폴더의 CXXFeatureCheck, AddCXXCompilerFlag를 이용해 컴파일러에 맞춰 설정을 진행한다 cmake_minimum_required (VERSION 3.5.1) set(CMAKE_C_COMPILER "gcc") set(CMAKE_CXX_COMPILER "g++") project (benchmark CXX) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(CXXFeatureCheck) cxx_feature_check(THREAD_SAFETY_ATTRIBUTES) add_executable(benchmark "m..
no optimize google benchmark의 해당 구문은 아래와 같이 구성된다 // The DoNotOptimize(...) function can be used to prevent a value or // expression from being optimized away by the compiler. This function is // intended to add little to no overhead. // See: https://youtu.be/nXaxk27zwlk?t=2441 #ifndef BENCHMARK_HAS_NO_INLINE_ASSEMBLY template inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) { a..
Tutorial 짧은것 에서 긴것 순 https://www.codeproject.com/Articles/15971/Using-Inline-Assembly-in-C-C https://wiki.kldp.org/KoreanDoc/html/EmbeddedKernel-KLDP/app3.basic.html http://jake.dothome.co.kr/inline-assembly/ https://www.cs.virginia.edu/~clc5q/gcc-inline-asm.pdf http://mentorembedded.github.io/advancedlinuxprogramming/alp-folder/alp-ch09-inline-asm.pdf https://www.ibiblio.org/gferg/ldp/GCC-Inlin..
glm 컴파일 단계에서 결정 https://github.com/g-truc/glm/blob/master/glm/simd/platform.h # if defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86) || defined(__i386__) # define GLM_ARCH (GLM_ARCH_X86) # elif defined(__arm__) || defined(_M_ARM) # define GLM_ARCH (GLM_ARCH_ARM) 강제하는 define도 존재 #elif defined(GLM_FORCE_NEON) # if __ARM_ARCH >= 8 # define GLM_ARCH (GLM_ARCH_ARMV8) # else # define GLM_ARCH..
static void BM_spinlock(benchmark::State& state) { static LockingPolicy::SpinLock l; for (auto _ : state) { l.lock(); l.unlock(); } } BENCHMARK(BM\_std\_mutex) ->Threads(1) ->Threads(2) ->Threads(8) ->ThreadPerCpu(); BENCHMARK(BM_utils_mutex) ->Threads(1) ->Threads(2) ->Threads(8) ->ThreadPerCpu(); BENCHMARK(BM_utils2_mutex) ->Threads(1) ->Threads(2) ->Threads(8) ->ThreadPerCpu();---------------..
https://youtu.be/y4WOsAaXLh0?t=3191
- Total
- Today
- Yesterday