コード例 #1
0
ファイル: taskyield_ast_print.cpp プロジェクト: 4ntoine/clang
int main(int argc, char **argv) {
  static int a;
// CHECK: static int a;
#pragma omp taskyield
  // CHECK-NEXT: #pragma omp taskyield
  return tmain(argc) + tmain(argv[0][0]) + a;
}
コード例 #2
0
ファイル: barrier_ast_print.cpp プロジェクト: JaredCJR/clang
int main(int argc, char **argv) {
  static int a;
// CHECK: static int a;
#pragma omp barrier
  // CHECK-NEXT: #pragma omp barrier
  switch (argc) {
  case 0:
#pragma omp barrier
#pragma omp barrier
    break;
  default:
#pragma omp barrier
    break;
  }
// CHECK-NEXT: switch (argc) {
// CHECK-NEXT: case 0:
// CHECK-NEXT: #pragma omp barrier
// CHECK-NEXT: #pragma omp barrier
// CHECK-NEXT: break;
// CHECK-NEXT: default:
// CHECK-NEXT: #pragma omp barrier
// CHECK-NEXT: break;
// CHECK-NEXT: }
  return tmain(argc) + tmain(argv[0][0]) + a;
}
コード例 #3
0
ファイル: taskyield_codegen.cpp プロジェクト: JaredCJR/clang
// CHECK-LABEL: @main
int main(int argc, char **argv) {
  static int a;
#pragma omp taskyield
  // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T]]* @{{.+}})
  // CHECK: call i32 @__kmpc_omp_taskyield([[IDENT_T]]* @{{.+}}, i32 [[GTID]], i32 0)
  // CHECK: call {{.+}} [[TMAIN_INT:@.+]](i{{[0-9][0-9]}}
  // CHECK: call {{.+}} [[TMAIN_CHAR:@.+]](i{{[0-9]}}
  return tmain(argc) + tmain(argv[0][0]) + a;
}
コード例 #4
0
ファイル: barrier_codegen.cpp プロジェクト: JaredCJR/clang
// CHECK-LABEL: @main
int main(int argc, char **argv) {
  static int a;
#pragma omp barrier
  // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT_T]]* [[LOC]])
  // CHECK: call void @__kmpc_barrier([[IDENT_T]]* [[EXPLICIT_BARRIER_LOC]], i32 [[GTID]])
  // CHECK: call {{.+}} [[TMAIN_INT:@.+]](i{{[0-9][0-9]}}
  // CHECK: call {{.+}} [[TMAIN_CHAR:@.+]](i{{[0-9]}}
  return tmain(argc) + tmain(argv[0][0]) + a;
}
コード例 #5
0
int main (int argc, char **argv) {
  float x;
  int b = argc, c, d, e, f, g;
  static int a;
// CHECK: static int a;
#pragma omp parallel
// CHECK-NEXT: #pragma omp parallel
  a=2;
// CHECK-NEXT: a = 2;
#pragma omp parallel if(a) num_threads(a), default(none), private(argc,b),firstprivate(argv, c),shared(d,f),reduction(+:e) reduction(min : g) proc_bind(master)
// CHECK: #pragma omp parallel if(a) num_threads(a) default(none) private(argc,b) firstprivate(argv,c) shared(d,f) reduction(+: e) reduction(min: g) proc_bind(master)
  foo();
// CHECK-NEXT: foo();
  return tmain(b, &b) + tmain(x, &x);
}
コード例 #6
0
int main(int argc, char **argv) {
  int i;
  #pragma omp parallel for simd if // expected-error {{expected '(' after 'if'}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if () // expected-error {{expected expression}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp parallel for simd' are ignored}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if (argc > 0 ? argv[1] : argv[2])
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp parallel for simd' cannot contain more than one 'if' clause}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if (S1) // expected-error {{'S1' does not refer to a value}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp parallel for simd if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();

  return tmain(argc, argv);
}
コード例 #7
0
// CHECK-LABEL: define {{.*}}i{{[0-9]+}} @main()
int main() {
// CHECK: [[GTID:%.+]] = call {{.*}}i32 @__kmpc_global_thread_num(
// CHECK: call {{.*}}void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 0, void {{.+}}* [[CAP_FN4:@.+]] to void
#pragma omp parallel if (true)
  fn4();
// CHECK: call {{.*}}void @__kmpc_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
// CHECK: store i32 [[GTID]], i32* [[GTID_ADDR:%.+]],
// CHECK: call void [[CAP_FN5:@.+]](i32* [[GTID_ADDR]],
// CHECK: call {{.*}}void @__kmpc_end_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
#pragma omp parallel if (false)
  fn5();

// CHECK: br i1 %{{.+}}, label %[[OMP_THEN:.+]], label %[[OMP_ELSE:.+]]
// CHECK: [[OMP_THEN]]
// CHECK: call {{.*}}void {{.+}} @__kmpc_fork_call(%{{.+}}* @{{.+}}, i{{.+}} 0, void {{.+}}* [[CAP_FN6:@.+]] to void
// CHECK: br label %[[OMP_END:.+]]
// CHECK: [[OMP_ELSE]]
// CHECK: call {{.*}}void @__kmpc_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
// CHECK: store i32 [[GTID]], i32* [[GTID_ADDR:%.+]],
// CHECK: call void [[CAP_FN6]](i32* [[GTID_ADDR]],
// CHECK: call {{.*}}void @__kmpc_end_serialized_parallel(%{{.+}}* @{{.+}}, i32 [[GTID]])
// CHECK: br label %[[OMP_END]]
// CHECK: [[OMP_END]]
#pragma omp parallel if (Arg)
  fn6();
  // CHECK: = call {{.*}}i{{.+}} @{{.+}}tmain
  return tmain(Arg);
}
コード例 #8
0
int main() {
  TCHAR **argv, **enpv;
  int argc, si = 0;

  __wgetmainargs(&argc, &argv, &enpv, _CRT_glob, &si);
  return tmain(argc, argv);
}
コード例 #9
0
// CHECK-LABEL: @main
int main() {
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(
// CHECK: [[ORIG_TASK_PTR:%.+]] = call i8* @__kmpc_omp_task_alloc({{[^,]+}}, i32 [[GTID]], i32 1, i64 32, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[CAP_FN4:[^ ]+]] to i32 (i32, i8*)*))
// CHECK: call i32 @__kmpc_omp_task(%{{.+}}* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]])
#pragma omp task if (true)
  fn4();
// CHECK: [[ORIG_TASK_PTR:%.+]] = call i8* @__kmpc_omp_task_alloc(
// CHECK: [[TASK_PTR:%.+]] = bitcast i8* [[ORIG_TASK_PTR]] to
// CHECK: call void @__kmpc_omp_task_begin_if0(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]], i8* [[ORIG_TASK_PTR]])
// CHECK: call i32 [[CAP_FN5:@.+]](i32 [[GTID]], %{{.+}}* [[TASK_PTR]])
// CHECK: call void @__kmpc_omp_task_complete_if0(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]], i8* [[ORIG_TASK_PTR]])
#pragma omp task if (false)
  fn5();

// CHECK: [[ORIG_TASK_PTR:%.+]] = call i8* @__kmpc_omp_task_alloc({{[^,]+}}, i32 [[GTID]], i32 1, i64 32, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[CAP_FN6:[^ ]+]] to i32 (i32, i8*)*))
// CHECK: [[TASK_PTR:%.+]] = bitcast i8* [[ORIG_TASK_PTR]] to
// CHECK: br i1 %{{.+}}, label %[[OMP_THEN:.+]], label %[[OMP_ELSE:.+]]
// CHECK: [[OMP_THEN]]
// CHECK: call i32 @__kmpc_omp_task(%{{.+}}* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]])
// CHECK: br label %[[OMP_END:.+]]
// CHECK: [[OMP_ELSE]]
// CHECK: call void @__kmpc_omp_task_begin_if0(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]], i8* [[ORIG_TASK_PTR]])
// CHECK: call i32 [[CAP_FN6:@.+]](i32 [[GTID]], %{{.+}}* [[TASK_PTR]])
// CHECK: call void @__kmpc_omp_task_complete_if0(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]], i8* [[ORIG_TASK_PTR]])
// CHECK: br label %[[OMP_END]]
// CHECK: [[OMP_END]]
#pragma omp task if (Arg)
  fn6();
  // CHECK: = call {{.*}}i{{.+}} @{{.+}}tmain
  return tmain(Arg);
}
コード例 #10
0
ファイル: main.cpp プロジェクト: BackupTheBerlios/nirvana-svn
int main() {

	BApplication app("application/x.vnd-Procton.ABrowseTest1");
	
	tmain();	
	app.Run();
	return 0;
}
コード例 #11
0
int main (int argc, char **argv) {
#pragma omp target
#pragma omp teams
  {
  argc = 0;
  }
  return tmain(argv);
}
コード例 #12
0
ファイル: teams_codegen.cpp プロジェクト: mathben/clang
int main (int argc, char **argv) {
  int a = 20;
  int b = 5;
#pragma omp target
#pragma omp teams num_teams(a) thread_limit(b)
  {
  argc = 0;
  }
  return tmain(argv);
}
コード例 #13
0
ファイル: flush_codegen.cpp プロジェクト: AlexDenisov/clang
// CHECK-LABEL: @main
int main() {
  static int a;
#pragma omp flush
#pragma omp flush(a)
  // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
  // CHECK: call {{.*}}void @__kmpc_flush(%{{.+}}* {{(@|%).+}})
  return tmain(a);
  // CHECK: call {{.*}} [[TMAIN:@.+]](
  // CHECK: ret
}
コード例 #14
0
ファイル: yank.c プロジェクト: sdelafond/yank
int
main(int argc, const char *argv[])
{
	args(argc, argv);
	input();
	tsetup();
	tmain();
	tend();
	yank();
	return 0;
}
コード例 #15
0
int main(int argc, char **argv) {
#pragma omp taskyield
  ;
#pragma omp taskyield untied  // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}}
#pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}}
  if (argc)
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
    if (argc) {
#pragma omp taskyield
    }
  while (argc)
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
    while (argc) {
#pragma omp taskyield
    }
  do
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
    while (argc)
      ;
  do {
#pragma omp taskyield
  } while (argc);
  switch (argc)
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
    switch (argc)
    case 1:
#pragma omp taskyield
  switch (argc)
  case 1: {
#pragma omp taskyield
  }
  switch (argc) {
#pragma omp taskyield
  case 1:
#pragma omp taskyield
    break;
  default: {
#pragma omp taskyield
  } break;
  }
  for (;;)
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
    for (;;) {
#pragma omp taskyield
    }
label:
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
label1 : {
#pragma omp taskyield
}

  return tmain(argc);
}
コード例 #16
0
int main(int argc, char **argv) {
  int j;
#pragma omp target update to(j) device // expected-error {{expected '(' after 'device'}}
#pragma omp target update from(j) device ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update to(j) device () // expected-error {{expected expression}}
#pragma omp target update from(j) device (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp target update to(j) device (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
#pragma omp target update from(j) device (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
#pragma omp target update to(j) device (argc + argc)
#pragma omp target update from(j) device (argc), device (argc+1) // expected-error {{directive '#pragma omp target update' cannot contain more than one 'device' clause}}
#pragma omp target update to(j) device (S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp target update from(j) device (-2) // expected-error {{argument to 'device' clause must be a non-negative integer value}}
#pragma omp target update to(j) device (3.14) // expected-error {{expression must have integral or unscoped enumeration type, not 'double'}}

  return tmain(argc, argv); // expected-note {{in instantiation of function template specialization 'tmain<int, char>' requested here}}
}
コード例 #17
0
ファイル: task_final_messages.cpp プロジェクト: 4ntoine/clang
int main(int argc, char **argv) {
  #pragma omp task final // expected-error {{expected '(' after 'final'}}
  #pragma omp task final ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  #pragma omp task final () // expected-error {{expected expression}}
  #pragma omp task final (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  #pragma omp task final (argc)) // expected-warning {{extra tokens at the end of '#pragma omp task' are ignored}}
  #pragma omp task final (argc > 0 ? argv[1] : argv[2])
  #pragma omp task final (foobool(argc)), final (true) // expected-error {{directive '#pragma omp task' cannot contain more than one 'final' clause}}
  #pragma omp task final (S1) // expected-error {{'S1' does not refer to a value}}
  #pragma omp task final (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  #pragma omp task final (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  #pragma omp task final (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  #pragma omp task final(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  foo();

  return tmain(argc, argv);
}
コード例 #18
0
int main(int argc, char **argv) {
  #pragma omp taskloop num_tasks // expected-error {{expected '(' after 'num_tasks'}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks () // expected-error {{expected expression}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop' are ignored}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks (argc > 0 ? argv[1][0] : argv[2][argc])
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp taskloop' cannot contain more than one 'num_tasks' clause}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks (S1) // expected-error {{'S1' does not refer to a value}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks(0)  // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}}
  for (int i = 0; i < 10; ++i)
    foo();

  return tmain(argc, argv);
}
コード例 #19
0
ファイル: task_if_codegen.cpp プロジェクト: CSI-LLVM/clang
// CHECK-LABEL: @main
int main() {
// CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num(
// CHECK: [[ORIG_TASK_PTR:%.+]] = call i8* @__kmpc_omp_task_alloc({{[^,]+}}, i32 [[GTID]], i32 1, i64 40, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[CAP_FN7:[^ ]+]] to i32 (i32, i8*)*))
// CHECK: call i32 @__kmpc_omp_task(%{{.+}}* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]])
#pragma omp task if (true)
  fn7();
// CHECK: [[ORIG_TASK_PTR:%.+]] = call i8* @__kmpc_omp_task_alloc({{[^,]+}}, i32 [[GTID]], i32 1, i64 40, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[CAP_FN8:[^ ]+]] to i32 (i32, i8*)*))
// CHECK: [[TASK_PTR:%.+]] = bitcast i8* [[ORIG_TASK_PTR]] to
// CHECK: call void @__kmpc_omp_task_begin_if0(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]], i8* [[ORIG_TASK_PTR]])
// CHECK: call i32 [[CAP_FN8]](i32 [[GTID]], %{{.+}}* [[TASK_PTR]])
// CHECK: call void @__kmpc_omp_task_complete_if0(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]], i8* [[ORIG_TASK_PTR]])
#pragma omp task if (false)
  fn8();

// CHECK: [[ORIG_TASK_PTR:%.+]] = call i8* @__kmpc_omp_task_alloc({{[^,]+}}, i32 [[GTID]], i32 1, i64 40, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[CAP_FN9:[^ ]+]] to i32 (i32, i8*)*))
// CHECK: [[TASK_PTR:%.+]] = bitcast i8* [[ORIG_TASK_PTR]] to
// CHECK: br i1 %{{.+}}, label %[[OMP_THEN:.+]], label %[[OMP_ELSE:.+]]
// CHECK: [[OMP_THEN]]
// CHECK: call i32 @__kmpc_omp_task(%{{.+}}* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]])
// CHECK: br label %[[OMP_END:.+]]
// CHECK: [[OMP_ELSE]]
// CHECK: call void @__kmpc_omp_task_begin_if0(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]], i8* [[ORIG_TASK_PTR]])
// CHECK: call i32 [[CAP_FN9]](i32 [[GTID]], %{{.+}}* [[TASK_PTR]])
// CHECK: call void @__kmpc_omp_task_complete_if0(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]], i8* [[ORIG_TASK_PTR]])
// CHECK: br label %[[OMP_END]]
// CHECK: [[OMP_END]]
#pragma omp task if (Arg)
  fn9();
// CHECK: [[ORIG_TASK_PTR:%.+]] = call i8* @__kmpc_omp_task_alloc({{[^,]+}}, i32 [[GTID]], i32 1, i64 40, i64 1, i32 (i32, i8*)* bitcast (i32 (i32, %{{[^*]+}}*)* [[CAP_FN10:[^ ]+]] to i32 (i32, i8*)*))
// CHECK: [[TASK_PTR:%.+]] = bitcast i8* [[ORIG_TASK_PTR]] to
// CHECK: br i1 %{{.+}}, label %[[OMP_THEN:.+]], label %[[OMP_ELSE:.+]]
// CHECK: [[OMP_THEN]]
// CHECK: call i32 @__kmpc_omp_task_with_deps(%{{.+}}* @{{.+}}, i32 [[GTID]], i8* [[ORIG_TASK_PTR]], i32 1, i8* [[LIST:%[^,]+]], i32 0, i8* null)
// CHECK: br label %[[OMP_END:.+]]
// CHECK: [[OMP_ELSE]]
// CHECK: call void @__kmpc_omp_wait_deps(%{{.+}}* @{{.+}}, i32 [[GTID]], i32 1, i8* [[LIST]], i32 0, i8* null)
// CHECK: call void @__kmpc_omp_task_begin_if0(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]], i8* [[ORIG_TASK_PTR]])
// CHECK: call i32 [[CAP_FN10]](i32 [[GTID]], %{{.+}}* [[TASK_PTR]])
// CHECK: call void @__kmpc_omp_task_complete_if0(%{{.+}}* @{{.+}}, i{{.+}} [[GTID]], i8* [[ORIG_TASK_PTR]])
// CHECK: br label %[[OMP_END]]
// CHECK: [[OMP_END]]
#pragma omp task if (Arg) depend(inout : Arg)
  fn10();
  // CHECK: = call {{.*}}i{{.+}} @{{.+}}tmain
  return tmain(Arg);
}
コード例 #20
0
int main(int argc, char **argv) {
  int i;
  #pragma omp target parallel for simd if // expected-error {{expected '(' after 'if'}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if () // expected-error {{expected expression}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if (argc > 0 ? argv[1] : argv[2])
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'if' clause}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if (S1) // expected-error {{'S1' does not refer to a value}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if(target : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if(parallel : argc)
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if(target : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target parallel for simd'}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if(target : argc) if (target :argc) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'if' clause with 'target' name modifier}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if(parallel : argc) if (parallel :argc) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'if' clause with 'parallel' name modifier}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if(target : argc) if (argc) // expected-error {{expected  'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
  for (i = 0; i < argc; ++i) foo();
  #pragma omp target parallel for simd if(target : argc) if(parallel : argc) if (argc) // expected-error {{no more 'if' clause is allowed}} expected-note {{previous clause with directive name modifier specified here}} expected-note {{previous clause with directive name modifier specified here}}
  for (i = 0; i < argc; ++i) foo();

  return tmain(argc, argv);
}
コード例 #21
0
ファイル: makesrandom.cpp プロジェクト: jbresearch/simcommsys
int main(int argc, char *argv[])
   {
   libbase::cputimer tmain("Main timer");

   // Set up user parameters
   namespace po = boost::program_options;
   po::options_description desc("Allowed options");
   desc.add_options()("help", "print this help message");
   desc.add_options()("tau,t", po::value<int>(), "interleaver length");
   desc.add_options()("spread,s", po::value<int>(),
         "interleaver spread to start with");
   desc.add_options()("attempts,n", po::value<int>()->default_value(1000),
         "number of attempts before reducing spread");
   po::variables_map vm;
   po::store(po::parse_command_line(argc, argv, desc), vm);
   po::notify(vm);

   // Validate user parameters
   if (vm.count("help"))
      {
      std::cerr << desc << std::endl;
      return 1;
      }

   // Interpret arguments
   const int tau = vm["tau"].as<int> ();
   int spread = vm["spread"].as<int> ();
   const int max_attempts = vm["attempts"].as<int> ();
   // Main process
   libbase::int32u seed = 0;
   myvector<int> lut = create_srandom(tau, spread, seed, max_attempts);
   // Output
   const std::string fname = compose_filename(tau, spread, seed);
   std::ofstream file(fname.c_str());
   serialize_interleaver(file, lut, tau, spread, seed, tmain.elapsed());

   return 0;
   }
コード例 #22
0
ファイル: yank.c プロジェクト: mikesart/yank
int
main(int argc, char *argv[])
{
	const struct field	*field;
	char			*pat;
	int			c, i, rflags = REG_EXTENDED;

#ifdef __OpenBSD__
	if (pledge("stdio rpath proc exec tty", NULL) == -1)
		err(1, "pledge");
#endif

	setlocale(LC_CTYPE, "");

	pat = strtopat(" ");
	while ((c = getopt(argc, argv, "ilvxd:g:")) != -1)
		switch (c) {
		case 'd':
			free(pat);
			pat = strtopat(optarg);
			break;
		case 'g':
			free(pat);
			pat = optarg;
			rflags |= REG_NEWLINE;
			break;
		case 'i':
			rflags |= REG_ICASE;
			break;
		case 'l':
			free(pat);
			pat = strtopat("");
			break;
		case 'v':
			puts("yank " VERSION);
			exit(0);
		case 'x':
			tty.ca = 1;
			break;
		default:
			usage();
		}
	argc -= optind;
	argv += optind;

	if (regcomp(&reg, pat, rflags) != 0)
		errx(1, "invalid regular expression");

	/* Ensure space for yank command and null terminator. */
	if ((yankargv = calloc(argc + 3, sizeof(char *))) == NULL)
		err(1, NULL);
	if (argc)
	{
		for (i = 0; i < argc; i++)
			yankargv[i] = argv[i];
	}
	else
	{
		yankargv[0] = YANKCMD;
		yankargv[1] = YANKCMD2;
	}

	input();
	tsetup();
	field = tmain();
	tend();
	if (field == NULL)
		return 1;
	yank(in.v + field->so, field->eo - field->so + 1);

	return 0;
}
コード例 #23
0
int main(int argc, char **argv) {
  const int d = 5;       // expected-note 2 {{'d' defined here}}
  const int da[5] = {0}; // expected-note {{'da' defined here}}
  int qa[5] = {0};
  S4 e(4);
  S5 g(5);
  int i;
  int &j = i;                      // expected-note 2 {{'j' defined here}}
  S3 &p = k;                       // expected-note 2 {{'p' defined here}}
  const int &r = da[i];            // expected-note {{'r' defined here}}
  int &q = qa[i];                  // expected-note {{'q' defined here}}
  float fl;
#pragma omp target parallel for simd reduction // expected-error {{expected '(' after 'reduction'}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name, array element or array section}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(~ : argc) // expected-error {{expected unqualified-id}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(&& : argc)
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified list item cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified list item cannot be reduction}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(max : h.b) // expected-error {{expected variable name, array element or array section}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(+ : ba) // expected-error {{const-qualified list item cannot be reduction}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(* : ca) // expected-error {{const-qualified list item cannot be reduction}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(- : da) // expected-error {{const-qualified list item cannot be reduction}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(^ : fl) // expected-error {{invalid operands to binary expression ('float' and 'float')}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(&& : S2::S2s) // expected-error {{shared variable cannot be reduction}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(&& : S2::S2sc) // expected-error {{const-qualified list item cannot be reduction}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(& : e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{invalid operands to binary expression ('S4' and 'S4')}} expected-error {{calling a private constructor of class 'S5'}} expected-error {{invalid operands to binary expression ('S5' and 'S5')}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(+ : h, k, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be reduction}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(+ : o) // expected-error {{no viable overloaded '='}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp parallel private(k)
#pragma omp target parallel for simd reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp target parallel for simd reduction(+ : r) // expected-error {{const-qualified list item cannot be reduction}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp parallel shared(i)
#pragma omp parallel reduction(min : i)
#pragma omp target parallel for simd reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp parallel private(fl)
#pragma omp target parallel for simd reduction(+ : fl)
  for (int i = 0; i < 10; ++i)
    foo();
#pragma omp parallel reduction(* : fl)
#pragma omp target parallel for simd reduction(+ : fl)
  for (int i = 0; i < 10; ++i)
    foo();
  static int m;
#pragma omp target parallel for simd reduction(+ : m) // OK
  for (int i = 0; i < 10; ++i)
    m++;

  return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
}
コード例 #24
0
ファイル: makesrandom.cpp プロジェクト: jbresearch/simcommsys
myvector<int> create_srandom(const int tau, int& spread, libbase::int32u& seed,
      const int max_attempts)
   {
   // set up time-keepers
   libbase::pacifier p;
   // set up random-number generation
   libbase::truerand trng;
   libbase::randgen seeder;
   seeder.seed(trng.ival());
   libbase::randgen prng;
   // initialize space for results
   myvector<int> lut(tau);

   bool failed = true;
   while (failed)
      {
      std::cerr << "Searching for solution at spread " << spread << std::endl;
      // loop for a number of attempts at the given Spread, then
      // reduce and continue as necessary
      libbase::cputimer tmain("Attempt timer");
      int attempt;
      for (attempt = 0; attempt < max_attempts && failed; attempt++)
         {
         std::cerr << p.update(attempt, max_attempts);
         // re-seed random generator
         seed = seeder.ival();
         prng.seed(seed);
         // set up working variables
         mylist<int> unused(tau);
         unused.sequence();
         // loop to fill all entries in the interleaver - or until we fail
         failed = false;
         for (int i = 0; i < tau && !failed; i++)
            {
            // set up for the current entry
            mylist<pair<int> > untried = unused.pairup();
            // loop for the current entry
            // until we find a suitable value or totally fail trying
            while (!failed)
               {
               // choose a random number from what's left to try
               mylist<pair<int> >::iterator ndx = untried.getiteratorat(
                     prng.ival(untried.size()));
               const int n = ndx->value;
               // if it's no good remove it from the list of options
               if (!satisfiesspread(lut, n, i, spread))
                  {
                  untried.erase(ndx);
                  failed = untried.empty();
                  continue;
                  }
               // if it's a suitable value, insert & mark as used
               else
                  {
                  unused.erase(ndx->index);
                  lut(i) = n;
                  break;
                  }
               }
            }
         }
      // show user how fast we're working
      tmain.stop();
      std::cerr << "Attempts: " << attempt << " in " << tmain << std::endl;
      std::cerr << "Speed: " << double(attempt) / tmain.elapsed()
            << " attempts/sec" << std::endl;
      // if this failed, prepare for the next attempt
      if (failed)
         spread--;
      }

   // stop timers
   std::cerr << p.update(max_attempts, max_attempts);

   return lut;
   }
コード例 #25
0
int main(int argc, char **argv) {
  const int d = 5;       // expected-note 2 {{'d' defined here}}
  const int da[5] = {0}; // expected-note {{'da' defined here}}
  int qa[5] = {0};
  S4 e(4); // expected-note {{'e' defined here}}
  S5 g(5); // expected-note {{'g' defined here}}
  int i;
  int &j = i;                           // expected-note 2 {{'j' defined here}}
  S3 &p = k;                            // expected-note 2 {{'p' defined here}}
  const int &r = da[i];                 // expected-note {{'r' defined here}}
  int &q = qa[i];                       // expected-note {{'q' defined here}}
  float fl;                             // expected-note {{'fl' defined here}}
#pragma omp parallel sections reduction // expected-error {{expected '(' after 'reduction'}}
  {
    foo();
  }
#pragma omp parallel sections reduction + // expected-error {{expected '(' after 'reduction'}} expected-warning {{extra tokens at the end of '#pragma omp parallel sections' are ignored}}
  {
    foo();
  }
#pragma omp parallel sections reduction( // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  {
    foo();
  }
#pragma omp parallel sections reduction(- // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  {
    foo();
  }
#pragma omp parallel sections reduction() // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
  {
    foo();
  }
#pragma omp parallel sections reduction(*) // expected-warning {{missing ':' after reduction identifier - ignoring}} expected-error {{expected expression}}
  {
    foo();
  }
#pragma omp parallel sections reduction(\) // expected-error {{expected unqualified-id}} expected-warning {{missing ':' after reduction identifier - ignoring}}
  {
    foo();
  }
#pragma omp parallel sections reduction(foo : argc // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max'}}
  {
    foo();
  }
#pragma omp parallel sections reduction(| : argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  {
    foo();
  }
#pragma omp parallel sections reduction(|| : argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
  {
    foo();
  }
#pragma omp parallel sections reduction(~ : argc) // expected-error {{expected unqualified-id}}
  {
    foo();
  }
#pragma omp parallel sections reduction(&& : argc)
  {
    foo();
  }
#pragma omp parallel sections reduction(^ : S1) // expected-error {{'S1' does not refer to a value}}
  {
    foo();
  }
#pragma omp parallel sections reduction(+ : a, b, c, d, f) // expected-error {{reduction variable with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}}
  {
    foo();
  }
#pragma omp parallel sections reduction(min : a, b, c, d, f) // expected-error {{reduction variable with incomplete type 'S1'}} expected-error 2 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 2 {{const-qualified variable cannot be reduction}}
  {
    foo();
  }
#pragma omp parallel sections reduction(max : argv[1]) // expected-error {{expected variable name}}
  {
    foo();
  }
#pragma omp parallel sections reduction(+ : ba) // expected-error {{a reduction variable with array type 'const S2 [5]'}}
  {
    foo();
  }
#pragma omp parallel sections reduction(* : ca) // expected-error {{a reduction variable with array type 'const S3 [5]'}}
  {
    foo();
  }
#pragma omp parallel sections reduction(- : da) // expected-error {{a reduction variable with array type 'const int [5]'}}
  {
    foo();
  }
#pragma omp parallel sections reduction(^ : fl) // expected-error {{variable of type 'float' is not valid for specified reduction operation}}
  {
    foo();
  }
#pragma omp parallel sections reduction(&& : S2::S2s)
  {
    foo();
  }
#pragma omp parallel sections reduction(&& : S2::S2sc) // expected-error {{const-qualified variable cannot be reduction}}
  {
    foo();
  }
#pragma omp parallel sections reduction(& : e, g) // expected-error {{reduction variable must have an accessible, unambiguous default constructor}} expected-error {{variable of type 'S5' is not valid for specified reduction operation}}
  {
    foo();
  }
#pragma omp parallel sections reduction(+ : h, k) // expected-error {{threadprivate or thread local variable cannot be reduction}}
  {
    foo();
  }
#pragma omp parallel sections reduction(+ : o) // expected-error {{variable of type 'class S6' is not valid for specified reduction operation}}
  {
    foo();
  }
#pragma omp parallel sections private(i), reduction(+ : j), reduction(+ : q) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
  {
    foo();
  }
#pragma omp parallel private(k)
#pragma omp parallel sections reduction(+ : p), reduction(+ : p) // expected-error 2 {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
  {
    foo();
  }
#pragma omp parallel sections reduction(+ : p), reduction(+ : p) // expected-error {{variable can appear only once in OpenMP 'reduction' clause}} expected-note {{previously referenced here}}
  {
    foo();
  }
#pragma omp parallel sections reduction(+ : r) // expected-error {{const-qualified variable cannot be reduction}}
  {
    foo();
  }
#pragma omp parallel shared(i)
#pragma omp parallel reduction(min : i)
#pragma omp parallel sections reduction(max : j) // expected-error {{argument of OpenMP clause 'reduction' must reference the same object in all threads}}
  {
    foo();
  }
#pragma omp parallel private(fl)
#pragma omp parallel sections reduction(+ : fl)
  {
    foo();
  }
#pragma omp parallel reduction(* : fl)
#pragma omp parallel sections reduction(+ : fl)
  {
    foo();
  }

  return tmain(argc) + tmain(fl); // expected-note {{in instantiation of function template specialization 'tmain<int>' requested here}} expected-note {{in instantiation of function template specialization 'tmain<float>' requested here}}
}
コード例 #26
0
ファイル: parallel_codegen.cpp プロジェクト: jamboree/clang
int main (int argc, char **argv) {
#pragma omp parallel
  foo(argc);
  return tmain(argv);
}
コード例 #27
0
int main(int argc, char *argv[])
{
    libbase::cputimer tmain("Main timer");

    // Set up user parameters
    po::options_description desc("Allowed options");
    desc.add_options()("help", "print this help message");
    desc.add_options()("system-file,i", po::value<std::string>(),
                       "input file containing system description");
    desc.add_options()("parameter,r", po::value<double>(),
                       "simulation parameter");
    desc.add_options()("seed,s", po::value<libbase::int32u>(),
                       "system initialization seed (random if not stated)");
    desc.add_options()("show-all,a", po::bool_switch(),
                       "show all simulated frames (not just first error event)");
    po::variables_map vm;
    po::store(po::parse_command_line(argc, argv, desc), vm);
    po::notify(vm);

    // Validate user parameters
    if (vm.count("help") || vm.count("system-file") == 0
            || vm.count("parameter") == 0)
    {
        cout << desc << std::endl;
        return 0;
    }

    // Interpret user parameters
    const bool showall = vm["show-all"].as<bool> ();
    // Simulation system & parameters
    libcomm::experiment *system = createsystem(
                                      vm["system-file"].as<std::string> ());
    system->set_parameter(vm["parameter"].as<double> ());
    // Initialise running values
    system->reset();
    if (vm.count("seed"))
        seed_experiment(system, vm["seed"].as<libbase::int32u>());
    else
        seed_experiment(system);
    cerr << "Simulating system at parameter = " << system->get_parameter()
         << std::endl;
    // Simulate, waiting for an error event
    libbase::vector<double> result;
    do
    {
        cerr << "Simulating sample " << system->get_samplecount() << std::endl;
        system->sample(result);
        system->accumulate(result);
        if (showall)
        {
            cerr << "Event for sample " << system->get_samplecount() << ":"
                 << std::endl;
            display_event(system);
        }
    } while (result.min() == 0);
    cerr << "Event found after " << system->get_samplecount() << " samples"
         << std::endl;
    // Display results if necessary
    if (!showall)
        display_event(system);

    // Destroy what was created on the heap
    delete system;
    return 0;
}
コード例 #28
0
ファイル: parallel_codegen.cpp プロジェクト: Leedehai/clang
int main (int argc, char **argv) {
  int a[argc];
#pragma omp parallel
  foo(a[1]);
  return tmain(argv);
}
コード例 #29
0
JNIEXPORT void JNICALL
Java_com_example_testthreadpoolexecutor_MainActivity_jni(JNIEnv *e, jobject o)
{
	extern int tmain();
	tmain();
}
コード例 #30
0
ファイル: flush_messages.cpp プロジェクト: Blizzard/clang
int main(int argc, char **argv) {
#pragma omp flush
  ;
#pragma omp flush untied  // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp flush'}}
#pragma omp flush unknown // expected-warning {{extra tokens at the end of '#pragma omp flush' are ignored}}
  if (argc)
#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
    if (argc) {
#pragma omp flush
    }
  while (argc)
#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
    while (argc) {
#pragma omp flush
    }
  do
#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
    while (argc)
      ;
  do {
#pragma omp flush
  } while (argc);
  switch (argc)
#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
    switch (argc)
    case 1:
#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
  switch (argc)
  case 1: {
#pragma omp flush
  }
  switch (argc) {
#pragma omp flush
  case 1:
#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
    break;
  default: {
#pragma omp flush
  } break;
  }
  for (;;)
#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
    for (;;) {
#pragma omp flush
    }
label:
#pragma omp flush // expected-error {{'#pragma omp flush' cannot be an immediate substatement}}
label1 : {
#pragma omp flush
}

#pragma omp flush
#pragma omp flush(                              // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp flush()                             // expected-error {{expected expression}}
#pragma omp flush(argc                          // expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp flush(argc,                         // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
#pragma omp flush(argc)
#pragma omp flush(S1) // expected-error {{'S1' does not refer to a value}}
#pragma omp flush(argc) flush(argc) // expected-warning {{extra tokens at the end of '#pragma omp flush' are ignored}}
#pragma omp parallel flush(argc) // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}}
  ;
  return tmain(argc);
}