Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. #PRAGMA

#PRAGMA

Scheduled Pinned Locked Moved C#
csharpvisual-studioquestion
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KUNWAR999
    wrote on last edited by
    #1

    how can we use #pragma omp directive in c# vs 2010??

    R L 2 Replies Last reply
    0
    • K KUNWAR999

      how can we use #pragma omp directive in c# vs 2010??

      R Offline
      R Offline
      RobCroll
      wrote on last edited by
      #2

      Here is the documentation #pragma warning (C# Reference)[^]

      "You get that on the big jobs."

      K 1 Reply Last reply
      0
      • R RobCroll

        Here is the documentation #pragma warning (C# Reference)[^]

        "You get that on the big jobs."

        K Offline
        K Offline
        KUNWAR999
        wrote on last edited by
        #3

        its taking more execution time than sequential code.. any sol?? :(

        L 1 Reply Last reply
        0
        • K KUNWAR999

          its taking more execution time than sequential code.. any sol?? :(

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          That is not possible; #pragma is a compiler directive and has nothing to do with execution speed.

          Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

          K 1 Reply Last reply
          0
          • L Lost User

            That is not possible; #pragma is a compiler directive and has nothing to do with execution speed.

            Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

            K Offline
            K Offline
            KUNWAR999
            wrote on last edited by
            #5

            but i want to reduce the execution time of a loop by making it parllel... for(int i=0;i<100;i++) { Console.WriteLine(i); } thatwhy i used pragma directive.. # prgma omp parllel for(int i=0;i<100;i++) { Console.WriteLine(i); } but its increse the time instead of reducing.. :( any sol for this??

            L P 2 Replies Last reply
            0
            • K KUNWAR999

              but i want to reduce the execution time of a loop by making it parllel... for(int i=0;i<100;i++) { Console.WriteLine(i); } thatwhy i used pragma directive.. # prgma omp parllel for(int i=0;i<100;i++) { Console.WriteLine(i); } but its increse the time instead of reducing.. :( any sol for this??

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              This has nothing to do with your original question, and I have already answered with a suggestion here[^].

              KUNWAR999 wrote:

              # prgma omp parllel

              What is this supposed to mean?

              Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

              L 1 Reply Last reply
              0
              • L Lost User

                This has nothing to do with your original question, and I have already answered with a suggestion here[^].

                KUNWAR999 wrote:

                # prgma omp parllel

                What is this supposed to mean?

                Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                Here[^] you go. Warning: it is a different world altogether. :)

                Luc Pattyn [My Articles] Nil Volentibus Arduum

                L 1 Reply Last reply
                0
                • K KUNWAR999

                  but i want to reduce the execution time of a loop by making it parllel... for(int i=0;i<100;i++) { Console.WriteLine(i); } thatwhy i used pragma directive.. # prgma omp parllel for(int i=0;i<100;i++) { Console.WriteLine(i); } but its increse the time instead of reducing.. :( any sol for this??

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  A few points. That pragma is for C/C++. If you want to have the sequence in order, you shouldn't try to turn it parallel as there is no guarantee of order of execution in parallel processing. If this isn't an issue, why not use the Task Parallel Library.

                  *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                  "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                  My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                  1 Reply Last reply
                  0
                  • K KUNWAR999

                    how can we use #pragma omp directive in c# vs 2010??

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    You can't, so there is no answer to "how". The standard C# compiler does not support OpenMP.

                    1 Reply Last reply
                    0
                    • L Luc Pattyn

                      Here[^] you go. Warning: it is a different world altogether. :)

                      Luc Pattyn [My Articles] Nil Volentibus Arduum

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Yes, I did discover that in the C++ compiler. My question was to get OP to explain what he/she thought it was, in terms of C#.

                      Unrequited desire is character building. OriginalGriff I'm sitting here giving you a standing ovation - Len Goodman

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups