Dima
this is not really c++ topic
Anonymous
I have a struct like this struct a { float* array1, array2; } a myarray[512]; I malloc() array1 and array2 per element to 256 each making each element exactly 512 all cache aligned I made a second struct struct a { float array1[512]; float array2[512]; } a myarray[512]; they both perform at the same speed, I assumed using malloc() on array elements would have made a less efficient system but, seems not.
Anonymous
Infact I am finding it very hard to hit any cache penalty intentionally, I am compiling with clang
Anonymous
clang version 9.0.0-2 (tags/RELEASE_900/final) Target: x86_64-pc-linux-gnu Thread model: posix
Anonymous
I only ever iterate 0 to 512 sequentially, so I assumed having the memory in one big block array would be more efficient as I assume defining a block array of 512 x2 pointers (4 bytes per pointer so 8x512 bytes in the lookup array) and then malloc() is like having a lookup table array struct a[512] to what is then a big block array of 1024 floats (4 bytes x 1024) per struct 512 times in a big sequential array
Anonymous
either way I saw no change in time to iterate either solutions.
Anonymous
But I can iterate a memory mapped file a lot faster lol, as long as im just doing a memcmp on each element like 10 - 20 times faster than iterating a much smaller array of floats and doing some basic arithmetic
Anonymous
i guess there is some latency of the cpu accessing the fpu, as where in a standard byte comparison iteration it's all on the main cpu ?
Anonymous
hello who understans french ?
Natarajan
Google
🤣🤣🤣
Anonymous
anyway i have a project i dont know how to do it can someone help me (this is my first time in telegrame )
Talula
anyway i have a project i dont know how to do it can someone help me (this is my first time in telegrame )
What kind of project? If it's a very large one, we could try give you tips.
Anonymous
okey thank you, i went to google translate this is it :
Anonymous
We wanted to computerize the schooling of the computer science department, knowing that there are 6 semesters License and 4 semesters Master, such as: ─ Each semester contains challenging modules. ─ Each module contains: CC score, exam score and Average. ─ Providing a program in C allows you to manage an endless list of students. Each student is represented by: a number, Name, First name, Date of birth, date of registration, modules with their notes ... Also this program offers the following services (functions and procedures): ─ Register a student. ─ Enter a student's grades. ─ Calculate the average of a student. ─ Display the students whose mean> = 10 ─ Display% of students whose average> = 10 (admitted) ─ Display% of students with average <10 (postponed) ─ Displays the number of registered students Note: You must use pointers, structures and lists.
Anonymous
i am so new to chapter lists and i dont know how to use them in this project and i dont have much time please help me : give me tips or anything you can
Anonymous
yes it is a school project
Anonymous
okey i will thank you
Talula
i am so new to chapter lists and i dont know how to use them in this project and i dont have much time please help me : give me tips or anything you can
What tips? I mean you have to start somewhere and if you get stuck we could help you, what you wanna do? Want us to make the whole software for you?
Anonymous
no, not like that , well i searched in youtube and google .... i read about it i tried , can i send you what i wrote in c++ till now and gide me like give me notes if i am in the right way or i should change my methode ?
Anonymous
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct { char nom[30];//surname char prenom[30];//name char Date_naissance[30];//birthday char Date_inss[30];//day of inscription float moyenne; } etudiant ; typedef struct cellule cellule ; typedef cellule* liste ; struct cellule { etudiant data ; cellule * next ; }; cellule* newetudiant (etudiant e ) { cellule * b ; b=(cellule*)malloc(sizeof(cellule)); b->data=e; b->next=NULL; return b ; } void ajouteraudebut (liste* debut, etudiant e ) { cellule * b ; b=newetudiant(e); b->next=*debut; *debut=b; } void ajouteralafin(liste* debut, etudiant e) { cellule * b , *temp ; b=newetudiant (e); if(*debut == NULL) *debut=b; else { temp =*debut ; while(temp->next !=NULL) temp=temp->next ; temp->next=b; } } void ajouteretudiant(liste* debut ,etudiant e ) { if(e.moyenne<=10) ajouteraudebut(debut,e); else ajouteralafin(debut,e); } void afficher (liste debut ) { cellule * temp ; if(debut == NULL) printf("la liste est vide "); else { temp = debut ; while(temp!=NULL) { printf("%s \t %f -> ",temp->data.nom,temp->data.moyenne); temp =temp->next ; } } } int main () { liste l1=NULL; etudiant e; int chx; do { printf("nom : "); scanf("%s",&e.nom); printf("prenom : "); scanf("%s",&e.prenom); printf("Date naiss : "); scanf("%s",&e.Date_naiss); printf("Date inss : "); scanf("%s",&e.Date_inss); printf("moyenne : "); scanf("%f",&e.moyenne); ajouteretudiant(&l1,e); printf("un autre etudiant 0 si non : "); scanf("%d",&chx); }while(chx!=0); afficher(l1); return 0 ; }
Anonymous
i made this work using a programme that takes students who have more than 10 and put them in the end of list and take who has less then 10 and put them in the head
Anonymous
i know its is not what i have to do but should i continue or stop ? or ? (sorry for my bad english )
Talula
i know its is not what i have to do but should i continue or stop ? or ? (sorry for my bad english )
Yeah but I would love to know where you're stuck... I am not going to do your task for you.
Anonymous
i understand you are right , i will try harder and come back with better questions
Anonymous
and i just wanted oriontation to see if i am fine or i am totally wrong
Parikshit
Is there anything called access modifier in cpp?
Amir
it's basically defined in OOP object oriented programming
Parikshit
But what is that?
Amir
What is your query then?
Amir
Access modifier are used to give particular access and modify levels
Parikshit
I know access specifier but didn't know about modifier
Amir
like private public protected
Hadaward 'Solly'
he just wants to know the reserved words for C++ if there's any
Amir
obviously in both of them. there are rules for subclasses and classes
Parikshit
Okay, thanks
Anonymous
I found out my memory speed is 19.1 GB/s
Anonymous
Anonymous
This is my bottleneck as I am trying to push 36 GB in one pass, and a pass takes 4-5 seconds
Anonymous
two threads can still do 5-6 seconds
Anonymous
but after that the ram bus is truly exhausted
Anonymous
and the processes just start to take longer ofc
Dima
cool
Anonymous
what can I do, just deal with it ? I am trying to compute a neural network, I looked at the RTX cards and they have only 14 GB/s !!!!
Anonymous
Unles I get a EPYC with 8 ram channels and 16 slots
Anonymous
but even then that is only 2100 MHz under full load with the mobo's im looking at
Anonymous
I need more, and i need it faster, is this all modern technology is going to give me ?! 20 GB/s !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 25 GB/s at a push
Anonymous
PATHETIC
Ludovic 'Archivist'
Hadaward 'Solly'
## Rules #pinned * You are not entitled to an answer, getting angry about not answered questions will get you warned. * Not checking your problem in google (or any other search engine) first will get you a warn. * Asking to solve an assignment/test/whatever without trying it first yourself will get you a warn or will get you BANNED. We won’t write a code for you, but we can push you forward and suggest something. * Before posting a long code snippet think twice and read the Resources section below. * No “best book” or “best youtube channel” requests, use /get cbook and /get cppbookguide chat commands. * No “best ide” requests, use /get ide chat command to see the suggestions. * Asking for something that is in the pinned message right after joining WILL GET YOU BANNED. * C/C++ discussion preffered (assembly also allowed), asking about other languages (or groups for other languages) right after joining will get you BANNED. * Reverse enginnering, hacking and related topics are allowed, but asking to hack facebook, instagram, etc. is NOT allowed. Also if you ask "how to become a hacker" and obviously have zero knowledge on anything related to that you may get warned or banned. * Legitimate requests for help on code and programming questions are welcome. A request is considered legitimate if it describes your problem, what you've done so far and what went wrong. Requests such as "write my program" or "do my homework" are never considered legitimate. Asking not legitimate questions will result in a warn or ban. See https://stackoverflow.com/help/mcve on how to write good questions. * Asking for book recommendations is ok, but "pls give pdf book" is not allowed, find books by yourself. Posting illegally copied books (or links to those books) is also not allowed and will get you BANNED. * Only English language is allowed, if you speak shitty English or don't understand anything in English YOU WILL BE BANNED. * A little bit of programming related memes, jokes, shitposting are allowed. * NSFW content (porn, nudity, etc.) is not allowed. * Spamming/advertising (job posts are also ads, so ask an admin before posting) will grant you a warning or an immediate ban if you do it right after joining. * Religion, politics and ideological topics are forbidden. * Long code snippets must be posted via a snippet website(links below), posting pictures of code and posting long snippets in the group is not allowed. * If you encounter a problem, while using dev C++ or turbo C/C++, you will not be helped, use another more modern IDE. * Don't post compiled executables, that is obviously a security risk. * Personal messages without asking beforehand are not allowed. * If you want to post a link or some article in this chat you will need an admin approval first ## Resources C/C++ group India: http://t.me/c_cpp_india About asking good questions: * [English](http://www.catb.org/esr/faqs/smart-questions.html) * [Translations](http://www.catb.org/esr/faqs/smart-questions.html#translations) For posting long code snippets: * [GitHub Gist](https://gist.github.com) * [Ubuntu Paste](https://paste.ubuntu.com/) * [Pastebin](https://pastebin.com) ## Reports If you notice any forbidden content, please use the /report command while responding to the offending post to report it to the admins.
the rules dont appear as pinned to me. Anyone knows why?
Ludovic 'Archivist'
the rules dont appear as pinned to me. Anyone knows why?
Because you closed the pinned message at some point
Hadaward 'Solly'
heck
Anonymous
WOW WTF IT WAS A LINK TO THE RULES PIN
Dima
lol
Dima
darwin theory
Anonymous
LOL FFS
Anonymous
NOOOOOOOOooooooooooooooooooo
Hadaward 'Solly'
yeah i got banned in the python groups for a similar reason
Hadaward 'Solly'
i forwarded one of the admin messages bellow rules cuz it had the reference material someone asked haha
Hadaward 'Solly'
it had telegram ids... 😐
Anonymous
i forwarded one of the admin messages bellow rules cuz it had the reference material someone asked haha
lmfao could be a good troll tbh, tricking people to forward stuff you know will get them banned
Hadaward 'Solly'
i could've used the commands but i didnt learn them quick enough
Hadaward 'Solly'
nah, people ask for references all the time in language groups
Dima
#ot
Hadaward 'Solly'
i'm not even mad, just sad heh
Dima
/ban 1288595836
Hadaward 'Solly'
nice reference. Btw Dima, could you edit the rules message to include the offtopic group link in the bottom?
Anonymous
/ban 1288595836
lol can yu unban sudafed
Dima
/unban 1397820592
Anonymous
ty
Wendy
Hello am new hear
Dima
lol