From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id CEB263858C60 for ; Thu, 14 Mar 2024 22:24:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CEB263858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CEB263858C60 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::629 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710455048; cv=none; b=GKreUP4KEx5q8+WZU/gOatPT8/bdubrh7lgVqbWKzK9vzEB7joITse64w5fnN0oYbE8Ug1OFofNRy5Sw3gsq2ihMjdQ4gjTGeXKr6J+ECDEnPLQ3fVr4V9K/nua0zjfnTtBVTbOzAl/gDZtnKkMfvMD8Q0g55Pk/RMiXabYRG8s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710455048; c=relaxed/simple; bh=6w6IPecvFAzjgxz8Y1jfT2cGhl+P3ELVn7p+dipCaxI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=eLT7ZUTPqexjfEzeQvl8rt24lAKOceRAn8ZovUIs+hO5H6FezK8RyCWw7anAdSbsAo5QgVID8+7ycZFpQSofkAZa6FJzyKDr3jKstSbuhW0FXvlFUeB2M0yguYDOBpVMUHe2oSRF58Sx795QetmIjWbPU2dU6zSU3n+34kk63xk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a44665605f3so154055866b.2 for ; Thu, 14 Mar 2024 15:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1710455044; x=1711059844; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WZcRTlQHazpRAOlGF7BmdCVMNIBHGsLTmSTMju71qmY=; b=T/ToOogzkXztVgdc3N32tp8FhmYGEThYWFVVR84Z8PddHzFzTWx7mUlwT1EOGGTpAf UzG3A+0UUfGPErlUvRAfcUWiJOkOWO4d3ixi4iJlGdBZGaBGhLdZDSh5nKfmKJJpdNTq qqX5Uq18WQj2s+fd/ZKs7aG3P9PnHxf9XqzOBgbDzNZUZpf6Mfi2jyQ61Z5IKeU8tLp/ QxN2Mh+BVqOBe8xQ2UN1hDf1I/U0I9+A8Bl1oeJV3XPqZZEQT6e3MfvoqTI/g1CPVz4J oqqjpRMggzRbdvc6ANIGsDEm6L57uGOXYWlgioGUdYX7hJqx90ypfeKcJDgg4zmErYi6 xUug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710455044; x=1711059844; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WZcRTlQHazpRAOlGF7BmdCVMNIBHGsLTmSTMju71qmY=; b=Wg4GMEaSDQS06k6jQP/XQ0tqx+qrAVeRLtxXaf7NACr1KKMt2Kc21RIRVptAdJMMDT Tw40m0qSpKVoLmlTzFYl132RDHi7dlewwXHeoYSciFbllU0SfDqLl2heOCOi0X6Eeect vUXhyZA1a2wV2K6JNxdGjLTS972Xs5C0Bx6IL4jFB+XGH8bpCv/F5TyOFxZstk6L+JJI kQ+UXmKKSYlZMDJ6R8ml7Mw9Ryp5YtWiACQLqZGwND199hHkys7dyjcUXE9ltZcNWYcf QzVmP9CZIZIK2+5emUPbM6JrWMDagqSw4oiMXXgFfpsQsPl3NRi+rqpYHOQaqLQQR6hK /1Mg== X-Forwarded-Encrypted: i=1; AJvYcCWNNe076565ddt/e8uDBuZl7uK/A1R+y2GwsUT1Vw+7fAaBYrJo3ziBox7crRldNw/WsvJ5wnMy8wxe2iqAQBM= X-Gm-Message-State: AOJu0YzPYzAYhwOTGgPAWJryQ3sTOp8v3Fl4eRfGPhT+RjN0ZOeplEvB 0qgA9ggiz7uIjbI9XVC0JFgw668N6mMeOIvsH6dst0DHbBl7MdaIm2pzKl96VLE= X-Google-Smtp-Source: AGHT+IGatsMBpY0i7lOClK1+BV8IdbaHLGPaUcbjLSskuPyXaNfDY2g64Tqh7sR2CaejJIUUjBm8gA== X-Received: by 2002:a17:906:2c4f:b0:a46:5598:3430 with SMTP id f15-20020a1709062c4f00b00a4655983430mr655886ejh.9.1710455043932; Thu, 14 Mar 2024 15:24:03 -0700 (PDT) Received: from dem-tschwing-1.ger.mentorg.com (p200300c8b7033600b339189fe554cc9e.dip0.t-ipconnect.de. [2003:c8:b703:3600:b339:189f:e554:cc9e]) by smtp.gmail.com with ESMTPSA id l15-20020a1709065a8f00b00a3d2d81daafsm1103149ejq.172.2024.03.14.15.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 15:24:03 -0700 (PDT) From: Thomas Schwinge To: Abhinav Gupta Cc: Martin Jambor , gcc@gcc.gnu.org Subject: Re: GSoC In-Reply-To: References: User-Agent: Notmuch/0.30+90~g56b9265 (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Thu, 14 Mar 2024 23:24:00 +0100 Message-ID: <871q8cpi4f.fsf@dem-tschwing-1.schwinge.ddns.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,KAM_ASCII_DIVIDERS,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Abhinav! Thanks for your interest in contributing to GCC, and thanks to Martin for all the information you already provided. Just a bit more, to get you started on developing a proper project proposal: On 2024-03-13T14:54:52+0100, Martin Jambor wrote: > On Tue, Mar 12 2024, Abhinav Gupta wrote: >> I looked at all the links you provided in the reply and read the >> paper cited on the GCC page for GSoC. I also looked into the rust >> frontend project during this time, and the Offloading project >> interests me more, so I will focus solely on it in the remaining seven >> days before the deadline for GSoC application submission. > > AFAIU, in five days (from now) the application period *opens*, the > deadline is 2nd April. Still it is good idea not to lose any time. Indeed, no rush yet. :-) >> Are there other resources I can look at to better understand the whole >> process? At some point, no too late, you should spend some time on learning how to build GCC, and run the test suite. and have some pointers to get started. If you have specific questions, we're happy to help, of course. >> Reading the git commit on the website is proving to be very >> slow. Yes, that's not going to be necessary. >> I think the git commit about Intel MIC would be like a >> "template" in loose terms Right, that's in fact a very good description. The idea here is not to bring back the whole Intel MIC emulator, but something very much simpler. >> to implement the host-ISA mode at least, but >> for the libgomp plugin, I need a better understanding. Find existing libgomp plugins as 'libgomp/plugin/plugin-*.c'. The 'GOMP_OFFLOAD_[...]' functions implement the entry points, the offloading plugin API. Actually also the very simple 'libgomp/oacc-host.c' should be helpful. That's essentially the API you need to care about (for OpenACC; but OpenMP 'target' also won't require much more, for a start). Make some thoughts (or actual experiments) about how we could use/implement a separate host process for code offloading. And otherwise, as Martin said: > You need to understand how OpenMP programs are internally represented. > > Look at the following (hopefully correct, at least as long as you try it > on a system without any Offloading enabled) simple testcase for OpenMP > target construct: > > ---------------------------------------------------------------------- > #include > > volatile int v =3D 1; > > int main (int argc, char **argv) > { > int i =3D v; > > #pragma omp target map(to:i) > { > printf ("OpenMP target hello world, i is: %i\n", i); > } > > return 0; > } > ---------------------------------------------------------------------- > > and compile it with: > > gcc -fopenmp omptgt-hello.c -O2 -fdump-tree-optimized > > and then look at the generated optimized dump. This should give you an > idea how OpenMP regions are internally represented (as outlined > functions) and how calls into libgomp, the run-time library doing a lot > of the magic, look like. > > You can try to do more similar exercises with more OpenMP testcase which > you can find in sub-directory libgomp/testsuite/libgomp.c of in the GCC > repository. > > And then you should perhaps have a look into libgomp itself (you'll find > it in libgomp sub-directory) how GOMP_target_ext is implemented - though > don't worry if you don't understand many of the details, it is complex > stuff. At this point hopefully more of the contents of the Offloading > wiki page will make sense. > > Again, ask on the mailing list if you have any specific questions. Gr=C3=BC=C3=9Fe Thomas >> On Thu, 7 Mar 2024 at 20:37, Martin Jambor wrote: >>> >>> Hello, >>> >>> On Wed, Mar 06 2024, Abhinav Gupta via Gcc wrote: >>> > Dear GCC Community, >>> > I hope this email finds you well. My name is Abhinav Gupta. I am a >>> > 3rd-year student at IIT Tirupati pursuing a bachelor's degree in >>> > computer science and engineering. I am writing to express my interest >>> > in contributing to the GCC project under GSoC. >>> >>> We are very happy that you find contributing to GCC interesting. >>> >>> > I am interested in two projects - Offloading to a separate process on >>> > the same host, I am already working in parallel computing, >>> > specifically parallelising tensor algorithms using various techniques >>> > as part of my research project at IIT Tirupati. Although this is not >>> > directly related to compilers, I will be able to get going with the >>> > project quickly. >>> >>> I'd personally very much like to see this project implemented. There is >>> a lot of information on offloading at >>> https://gcc.gnu.org/wiki/Offloading >>> >>> To give you a bit more context where the idea comes from, it was first >>> thought of in email thread starting with >>> https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603984.html and >>> the patch that was "scrubbed" from the email archive eventually became >>> commit >>> https://gcc.gnu.org/cgit/gcc/commit/?id=3De4cba49413ca429dc82f6aa2e8812= 9ecb3fdd943 >>> >>> I hope these pointers will further help help you find out where to look >>> when planning the project. If you need more help, please feel free to >>> ask (I'm CCing Thomas who then is perhaps best placed to answer). >>> >>> > The second project is Rust Front-End - both the BIR location support >>> > and rustc testsuite adapter are of interest to me, >>> >>> Please note that Rust-GCC projects are a bit special in the sense that >>> they are often discussed primarily on Zulip of the gcc-rust team: >>> >>> https://gcc-rust.zulipchat.com/ >>> >>> So you may want to reach out to them there as well. >>> >>> > having worked on >>> > compiler front ends as part of my college's compiler design course >>> > combined with my experience in working with large libraries written in >>> > C++ (such as CTF) I believe that these two projects are something that >>> > I can do. >>> >>> You seem to be quite ready! >>> >>> > >>> > Proposed Timeline: >>> > I can start working as soon as my end-semester exams finish, i.e. 9th >>> > May 2024, and continue to work for however long it requires me to >>> > complete the project. >>> > Week 1-2 -> Knowing the existing code and understanding how it works. >>> >>> Right, but please try to do a bit of this, at least on the high level, >>> also now when preparing the proposal. There will be lots to learn in >>> the first weeks even so. Mainly because... >>> >>> > Week 3-8 -> Working on the implementation of whichever project we >>> > decide to move forward with >>> > Week 9-12 -> Testing and creating understandable documentation for th= e same. >>> > >>> > This is a very rough timeline, >>> >>> ...eventually the milestones in the application will have to be more >>> specific, mainly to demonstrate you have basic understanding of the >>> proposed project. >>> >>> > and I will refine it further as we >>> > discuss the project idea. This email is more of a call for guidance >>> > than an application, and I would appreciate any feedback you give me. >>> >>> This is a very good start. >>> >>> Good luck! >>> >>> Martin