r/cpp11 • u/cloudgazer3d • Aug 11 '14
r/cpp11 • u/YouFeedTheFish • Aug 29 '13
Tuple Forwarding [xpost: r/cpp, credit to /u/meetingcpp]
r/cpp11 • u/blowaraspb • Jan 27 '17
How to handle big datasets in c++?
I am writing some machine learning algorithms like neural nets and svm in C++ as a learning exercise. I need to handle a big dataset on my handwritten algorithm. How should I access and manage the data? I have heard about hdf5 and their c api. Is that something that can be used or should I use something else? My focus is something that is easy to use but that can be traded off for some technique that is super-scalable and an all-around much better idea to use. Please don't tell me about machine learning libraries, I know they are awesome, this is just a learning exercise. Thanks.
The dataset is around 20-30gb. I have 8gb ram available along with an nvidia 940mx gpu. I will use cuda for training. The dataset is text based and I need to do a classification task on it by training and testing and then predicting using the trained model. Please tell me what more details are needed.
r/cpp11 • u/YouFeedTheFish • Jan 18 '16
Thread Affinity and Hyperthreading
r/cpp11 • u/GitHubCpp • Jun 27 '17
You don't need a stateful deleter in your unique_ptr (usually)
r/cpp11 • u/Neargye • Mar 24 '19
Nameof operator for modern C++, simple name of a variable, type, member, function, macros, and enum.
r/cpp11 • u/Neargye • Apr 09 '19
[magic_enum]: Static reflection on enums for modern C++, work with any enum type without any macro or boilerplate code. Enum-to-string/String-to-enum and other useful functions.
r/cpp11 • u/Wolverine_6011 • May 01 '23
FUNCTIONS IN CPP | LEARNING CPP ONLINE
r/cpp11 • u/ovidiucucu • Jan 29 '15
Using Lambdas in MFC Applications - Part 1 [x-post from /r/codexpert/]
r/cpp11 • u/YouFeedTheFish • Feb 05 '13
constexpr question
I was tinkering around with constexpr to solve another redditor's question in a novel way and I noticed that the compiler was generating less-than-optimal code, depending on how I was applying the statement. This code adds all of the even numbers up to 100.
In the first instance, the compiler did what I expected:
#include <iostream>
template<int NUM> class Adder{
public:
constexpr static int RUNNING_TOTAL = Adder<NUM-2>::RUNNING_TOTAL + NUM;
};
template<> class Adder<0>{
public:
constexpr static int RUNNING_TOTAL = 0;
};
int main(int argc, const char * argv[])
{
std::cout << Adder<100>::RUNNING_TOTAL<<std::endl;
return 0;
}And the compiler generated this (snippet):
movl $2550, %ecx Here, it rolled up all of the loops and output the sum. Great. Unfortunately, when I removed the classes and used functional template specialization, like so:
#include <iostream>
template<int NUM> constexpr int getTotal(){return getTotal<NUM-2>() + NUM;}
template<> constexpr int getTotal<0>(){return 0;}
int main(int argc, const char * argv[])
{
std::cout << getTotal<100>() <<std::endl;
return 0;
}I end up getting this (snippet):
callq __Z8getTotalILi100EEiv
movq __ZNSt3__14coutE@GOTPCREL(%rip), %rdi...
__Z8getTotalILi100EEiv:
callq __Z8getTotalILi98EEiv
addl $100, %eaxAnd this continues, one function calling another until the solution is reached at runtime.
Why isn't constexpr rolling up the loops in this case? Did I violate constexpr-ness somehow?
Weirdly, sometimes it does roll it up:
template<int NUM> constexpr int getTotal(){return getTotal<NUM-2>() + NUM;}
template<> constexpr int getTotal<0>(){return 0;}
template<int N>
class Foo{
public:
static constexpr int getNumber(){return N;}
};
int main(int argc, const char * argv[])
{
//std::cout << Adder<100>::RUNNING_TOTAL <<std::endl;
std::cout <<Foo<getTotal<14>()>::getNumber()<<std::endl;
return 0;
}Which gives me the following assembly:
__ZN3FooILi56EE9getNumberEv:
movl $56, %eax //<-- 56 is the right answer.
popq %rbp
ret[edit: Should note that I am using the Apple LLVM compiler 4.2.]
[edit 2: Incidentally, just typing getTotal<getTotal<3>()>() crashes my ide (xcode 4.6) consistently.]
r/cpp11 • u/rigtorp • Mar 31 '16
Awesome Modern C++ (list of only high quality resources, help me make it even better)
r/cpp11 • u/YouFeedTheFish • May 30 '13
C++ auto and decltype Explained [x-post: /r/cpp; credit to /u/mttd]
thbecker.netr/cpp11 • u/YouFeedTheFish • Mar 05 '13
The importance of std::function [xpost from cpp]
r/cpp11 • u/YouFeedTheFish • Apr 14 '14
Runtime differences between C++03 and C++11
r/cpp11 • u/YouFeedTheFish • Mar 05 '13
C++11 concurrency: condition variables [xpost from /r/cpp]
codexpert.ror/cpp11 • u/YouFeedTheFish • Apr 02 '13
Ten C++11 Features Every C++ Developer Should Use [x-post: /r/cpp, credit to /u/meetingcpp]
r/cpp11 • u/YouFeedTheFish • Apr 14 '14
Converting between numbers and strings in C++11
codexpert.ror/cpp11 • u/YouFeedTheFish • Feb 16 '14
Exploiting the delete specifier. [X-post: /r/cpp]
r/cpp11 • u/[deleted] • Aug 28 '17
Property Binding Library C++
Hello I'm a student writing my masters degree and i got a thesis about researching and writing a property binding library for C++.
My question to you guys is:
What extra functionality would you like to have in such a library?
Do you have some tips for me and sources i should have a look into?
Special standards you think i should use? (at the moment it's only -std=c++11 and newer)