 
 #if defined(__DEVICE_EMULATION__) && 0
         __syncthreads();
-        if (tid == 0 && example_num == 0) {
+        if (tid == 0 && block_num == 0) {
             fprintf(stderr, "completed fprop layer %d example %d; label %d\n",
-                    l, example_num, label);
+                    l, block_num, label);
             for (unsigned i = 0;  i < no;  ++i) {
                 fprintf(stderr, "output %d: value %f\n",
                         i, this_layer_outputs[i]);


        d_bias_updates.init(&bias_updates_vec[0], plan.num_layers);

        int grid_size = num_feature_vectors;

        // Get the scratch space
        d_layer_outputs.init(plan.total_neurons * grid_size);


    int num_feature_vectors;
    int feature_vector_width;
    int num_examples_per_invocation;

    Context(const Plan & plan,
            const float * feature_vectors,
