473,480 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help with macro that works with OpenMP

1 New Member
How to rewrite the given macro so that it works with OpenMP:

#define SL_FOR_EACH(type, sl, code) \
#pragma omp parallel for \
for (type *i = sl.first(); i != NULL; i = i->next) { \
code \
} while(0)

The idea is to parallelize the loop inside this macro. Is this possible at all??? Cause now i get the famous error-message "'#' is not followed by a macro parameter"... Any help or even an idea???
Aug 23 '07 #1
1 1549
Banfa
9,065 Recognized Expert Moderator Expert
You can not put preprocessor commands (#) into macros so you will never be able to write a macro with a #pragma in it.
Aug 23 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3131
by: Vladimir_petter | last post by:
Hello guys, Looks like this technology is comming along with VS2005. Anybody has an expirience of using it along with C++? What are the patterns? Thanks, Vladimir.
8
1666
by: Gabest | last post by:
I really like the new openmp implementation of vc, but I ran into a something which may be a bug. Please see the following little example: void funct() { __declspec(align(16)) BYTE buff;...
4
2836
by: Web_PDE_Eric | last post by:
I don't know where to go, or what to buy, so plz re-direct me if I'm in the wrong place. I want to do high performance integration of partial differential eqns in n dimensions (n=0,1,2,3..etc) I...
1
8495
by: Carl J. Van Arsdall | last post by:
Hey everyone, I know I've posted several questions regarding python and python's parallel capabilities so bear with me as I've never attempted to incite discussion. However, today I'm...
0
1807
by: BallCOMET | last post by:
I have an application that I built with Visual Studio 2005 and for which I enabled OpenMP. If I open the compiled binary in Visual Studio, this is the manifest that is embedded in the executable...
2
3184
by: firenet | last post by:
gcc -g -fopenmp openmp.c -o openmp cc1: error: unrecognized command line option "-fopenmp" i wrote a simple openmp.c and wanted to compile it, but i got this error. What should i do ? Thanks
7
7968
by: s.z.s | last post by:
Hi! Is anybody using an openmp compiler under cygwin? I tried to install gcc 4.2.2 without success and now I'm looking for alternatives. Thanks, Steffen
6
2156
by: Renato Perini | last post by:
Hi all!!! I'm trying to find a *good* book about OpenMP and C, but I can't find anything specific. Can you advice me some good (and updated) books about OpenMP using the C interface? I'd like a...
0
1151
by: Alien | last post by:
Hi, I am having bit of confusion about !$OPENMP DO/!$OPENMP END DO and !$OPENMP PARALLEL DO/!$OPENMP END PARALLEL DO directives. Having looked at my notes, the only difference I can find is...
0
7039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6735
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6895
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4770
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.