목록 분류 전체보기 (299)
http://blog.naver.com/PostView.nhn?blogId=wkdghcjf1234&logNo=220210906503 형 변환 연산자: static_cast와 reinterpret_cast의 차이 이번에는 간단하게 static_cast와 reinterpret_cast의 차이점에 대하여 알아봅니다. 실제로 이 두가지는 비... blog.naver.com 다시 정리
stackexchange_ What's the difference between user registers and kernel registers? "Answer" It's simple - when each application program runs, it has access to its own set of registers. When you switch to other application, these register contents is saved to memory, and registers, saved from other application, loaded and this application continues its execution. Similarly, OS has its own register..
///"tensorflow/core/framework/op_kernel.cc" typedef std::unordered_multimap KernelRegistry; void* GlobalKernelRegistry() { static KernelRegistry* global_kernel_registry = new KernelRegistry; return global_kernel_registry; } static KernelRegistry* GlobalKernelRegistryTyped() { return reinterpret_cast(GlobalKernelRegistry()); } /// Conclusion KernelRegistry : Unordered multi_map , includes key, ke..
typedef OpKernel* (*Factory)(OpKernelConstruction*); - tensorflow source를 분석하다가 위의 typedef로 Factory가 정의되있는 것을 보고 공부하게 되었다. function pointer - 함수를 호출한다는 것은 함수가 정의된 메모리의 시작 주소로 pc를 이동시키는 것을 의미한다. 다른 상수 타입의 포인터와 마찬가지로 함수 포인터 단순히 이런 주소를 담는 변수이다. returnType (*fpName) (parmeters) - 위처럼 가리킬 함수의 리턴 타입, 파라미터와 함께 함수 포인터를 선언하고 같은 형태를 갖는 함수를 대입하여 주소를 저장하고, 이를 호출한다. void foo() { cout
///"tensorflow/core/framework/op_kernel.cc" // TODO(mrry): Convert to std::make_unique when available. OpKernel::OpKernel(OpKernelConstruction* context) : OpKernel(context, std::unique_ptr(new NodeDef(context->def()))) {} OpKernel::OpKernel(OpKernelConstruction* context, std::unique_ptr node_def) : def_(std::move(node_def)), input_types_(context->input_types().begin(), context->input_types().end..
///"tensorflow/core/framework/op_kernel.h" class OpKernelConstruction { public: OpKernelConstruction(DeviceType device_type, DeviceBase* device, Allocator* allocator, const NodeDef* node_def,const OpDef* op_def, FunctionLibraryRuntime* flib, const DataTypeSlice& input_types, const MemoryTypeSlice& input_memory_types, const DataTypeSlice& output_types, const MemoryTypeSlice& output_memory_types, ..
object factory- Design pattern to instance variety type's object.- 사용 이유 자료형에 대한 정보는 있지만, C++ 에서 표현 가능한 형태가 아닌 경우 - 파일을 읽고, 객체를 생성하는 경우 - 인터넷 패킷을 받고, 객체를 생성하는 경우 객체 생성시 의무적으로 해야할 일이 있을 경우simple examplehuman* human_factory(char sex){ human* h = 0; switch (sex) { case 'M': h = new Man(); break; case 2: h = new Woman(); brea..
"CODE" ///"tensorflow/core/platform/file_system.h" class FileSystemRegistry { public: typedef std::function Factory; virtual ~FileSystemRegistry(); virtual Status Register(const string& scheme, Factory factory) = 0; virtual FileSystem* Lookup(const string& scheme) = 0; virtual Status GetRegisteredFileSystemSchemes( std::vector* schemes) = 0; }; /// tensorflow/core/framework/op_kernel.h namespace..